Skip to content

Commit

Permalink
updater fixes p1
Browse files Browse the repository at this point in the history
  • Loading branch information
rapidslayer101 committed Sep 21, 2022
1 parent 527f0f6 commit d925345
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
20 changes: 10 additions & 10 deletions provably_fair_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,30 @@ def run_test(odds):
counter += 1
seed_input, rand_float, result, game_hash = game(odds)
outcomes.append(result)
#if rand_float == game(odds, seed_input):
# print("Game is fair!")
#else:
# print("Game is not fair!")
# break
if rand_float == game("44:100", seed_input):
print("Game is fair!")
else:
print("Game is not fair!")
break
print(outcomes.count("WIN")/len(outcomes), counter)

#run_test("49:100")


def run_game(odds):
seed_input, rand_float, result, game_hash = game(odds)
print(rand_float)
multiply = 30
#print(rand_float)
multiply = 60
min_val = rand_float/multiply
number = uniform(1, min_val)
loop_multiplier = 1
while loop_multiplier < multiply-1:
number = round(uniform(number, min_val*loop_multiplier), 2)
print(number)
sleep(loop_multiplier*0.03)
sleep(loop_multiplier*0.015)
loop_multiplier += 1
print(rand_float)


run_game("33:100")

#run_game("33:100")
run_test("44:100")
1 change: 1 addition & 0 deletions sha.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2623,6 +2623,7 @@ MD a;<-Ei3@ {^e3|\QYOYE}{{*VmU+tX)&Htp3TbJ]Um#5A`c~$K'~+zE&@¬`|(e][]y-6P*+m4Gc
{9.xzHPrCmF60WA;^2¬J4$e^TxBU0owG*wy5n/?uM}3*M@MyT.p`f'm><GNUL/U+sc#s@[liGq;M\7§V0.47.1.111§TME-2022-09-15_09:55:06.00§BLD_NM-98§RUN_NM-2501
G$6UIlwZ:TI=T?nm{.?D~+Ww.eyHet,s:Dy"sPU.:uU!}i ib4\u2KU'V; 2,7]cWaC4(v`pC{<*O)§V0.47.1.112§TME-2022-09-15_09:58:33.10§BLD_NM-98§RUN_NM-2502
IoOD{¬;SVqm`Nuu6,EwE5\Ue,dk'¬G=GT#zJyg/i^=nkp095o)¬Zmqm2,\d-ST83^XEFdl-*PCjtyP§V0.47.1.113§TME-2022-09-15_09:59:52.49§BLD_NM-98§RUN_NM-2503
@h5¬+L)BXZe;2)y&qzi;}Q?OkkB9^Z1GIA')-5Y;nSf}jN;+q[R^#Li{+{l)K4"IO#!|aR-T£|{¬}G§V0.47.1.114§TME-2022-09-15_10:03:34.22§BLD_NM-98§RUN_NM-2504
Mal'=*uLH9$7#<@erV3aJcKh(V^¬r9`Q|H5Z'K(hilJ\p+W?r';t&7NHQR}8+sh%bKG /75xmWQ"~r§V0.47.1.114§TME-2022-09-16_17:05:56.42§BLD_NM-98§RUN_NM-2504
Mb?41":v(£K,Xhf[eFp=!pvdvGzOOZ;}VD(=-M3@|{w~xUe>)17U@:~<JsB,Hf|cz#5AxQmGPlX^;W§V0.47.1.115§TME-2022-09-16_17:37:48.99§BLD_NM-98§RUN_NM-2505
=R{8`£Wc|F1+'E:<1\79f#\#~(Ad:1 pz£DeA $9^on~s|&,all@t]fziSe&ECDy/mR8S]',g{5>g)§V0.47.1.116§TME-2022-09-16_17:38:21.95§BLD_NM-98§RUN_NM-2506
Expand Down
21 changes: 15 additions & 6 deletions updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from socket import socket
from os import system
from zipfile import ZipFile
from time import sleep
from time import sleep, perf_counter
from threading import Thread

from kivy.clock import Clock
Expand Down Expand Up @@ -168,13 +168,22 @@ def update_system(self):
except IndexError:
s.send_e("UPD:N")
file_name, update_size = s.recv_d(1024).split("🱫")
update_size = int(update_size)
self.update_text = f"Downloading version {file_name[:-4].replace('rdisc', 'Rdisc')}..."
all_bytes = b""
start = perf_counter()
while True:
bytes_read = s.s.recv(4096)
if b"_BREAK_" in bytes_read:
all_bytes += bytes_read[:-7]
break
if perf_counter()-start > 0.25:
start = perf_counter()
self.update_text = f"Downloading version {file_name[:-4].replace('rdisc', 'Rdisc')} " \
f"({round((len(all_bytes)/update_size)*100, 2)}%)"
all_bytes += bytes_read
with open(f"app/{file_name}", "wb") as f:
for i in range((int(update_size) // 4096) + 1):
bytes_read = s.s.recv(4096)
if not bytes_read:
break
f.write(bytes_read)
f.write(all_bytes)
print("Update downloaded")
self.update_text = "Update downloaded, unpacking..."
sleep(1)
Expand Down

0 comments on commit d925345

Please sign in to comment.