Skip to content

Commit

Permalink
fixed patcher
Browse files Browse the repository at this point in the history
  • Loading branch information
PhoenixFire6934 committed Jan 13, 2021
1 parent 7083b4b commit 936b178
Show file tree
Hide file tree
Showing 167 changed files with 317,515 additions and 69,199 deletions.
2 changes: 1 addition & 1 deletion GameAssets/fingerprint.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"files":[{"file":"csv_client\/animations.csv","sha":"e09fa5a7de23839b4fb2d1f3f856fa6ce1f18bb6"},{"file":"csv_client\/billing_packages.csv","sha":"f1568320560194822b27d363c681ea2c886b8a55"},{"file":"csv_client\/client_globals.csv","sha":"2e1503c7d80624384a1b6a0c62d00b51cd89b807"},{"file":"csv_client\/color_gradients.csv","sha":"98817979fdeddf8206bf5e679a548ea4724146bb"},{"file":"csv_client\/credits.csv","sha":"3d914c53cf0d9d30538965bfc2cd3d34ab965c5c"},{"file":"csv_client\/effects.csv","sha":"621256fbb0d7252f8584c9a10e0d0d313986d7b1"},{"file":"csv_client\/faces.csv","sha":"18e118f75be0bce1ba61eab81ef78ba9285df235"},{"file":"csv_client\/health_bars.csv","sha":"becb4c1517f70dea3b79cefc16124959a1faeb23"},{"file":"csv_client\/hints.csv","sha":"0d5e94024828e3ef623bedda23b8fe1cec600972"},{"file":"csv_client\/links.csv","sha":"2ed71e95b27edc824c8c65b0422fae1dd206778d"},{"file":"csv_client\/local_notifications.csv","sha":"cbbe9cc1a50229939cde588a114d210b0adfbde7"},{"file":"csv_client\/music.csv","sha":"1a86d9bf5939e2080dc370a13408dae71343ab97"},{"file":"csv_client\/particle_emitters.csv","sha":"887a49842b4cb8008f24bde47d75a1af1055b0ee"},{"file":"csv_client\/shop_items.csv","sha":"8498b8090a0b11369a8f9ba09a2d4371a598242c"},{"file":"csv_client\/sounds.csv","sha":"aa49c69291714ad6c782a216b4210af60a415ab5"},{"file":"csv_client\/tutorial.csv","sha":"afc24d847a1473a82953d20d633dfb176fd91a47"},{"file":"csv_logic\/accessories.csv","sha":"3e6896a9c1c02268f84a1c5a3571b95caf5770cd"},{"file":"csv_logic\/alliance_badges.csv","sha":"36a3af0c8b670dc0d5baca18fdfb79deb7ccdf9b"},{"file":"csv_logic\/alliance_roles.csv","sha":"5292303e8b2b612a69232dc9712c8dd60f07dc24"},{"file":"csv_logic\/area_effects.csv","sha":"de32ab4f4f1c30fe5befb34a936728a1691dd763"},{"file":"csv_logic\/bosses.csv","sha":"21bf432253f579cc55173b561ae0b8fed606c156"},{"file":"csv_logic\/campaign.csv","sha":"eef78f47968de7508b1d59c38854e7cb6526dc71"},{"file":"csv_logic\/cards.csv","sha":"1b31d0682e7015923567271cb3948cc7ecc06b77"},{"file":"csv_logic\/challenges.csv","sha":"1fd4f8c90b6a6e9ac7c7bf3c57fc7385202ae373"},{"file":"csv_logic\/characters.csv","sha":"095d8065dcb648f2e8d00f14acb4efb250283353"},{"file":"csv_logic\/game_mode_variations.csv","sha":"7e3b10968b37d2263d509ddfd627f553b5e0b06c"},{"file":"csv_logic\/globals.csv","sha":"fa28bbe12ac836b3cfe481349ee6912420607723"},{"file":"csv_logic\/items.csv","sha":"a74889cd52d6120f9f089aebc9c2911590ad9cc2"},{"file":"csv_logic\/locales.csv","sha":"5d90cc470948353c0fad65d5097ed09ad3fe7b35"},{"file":"csv_logic\/locations.csv","sha":"a229788efca85a2ee0f1189bd08b83a5434238b5"},{"file":"csv_logic\/location_themes.csv","sha":"31537d0843a6c4936e385f9ddd384ffad79b83b3"},{"file":"csv_logic\/maps.csv","sha":"d86b057bc9a6f337e9af7905d2319d30eb4b6516"},{"file":"csv_logic\/map_blocks.csv","sha":"fa3fcad62b8d0070606698d5e0bd9d2ff57ac771"},{"file":"csv_logic\/messages.csv","sha":"80c448a4671c86b8cf1ff3b999654498e332fabf"},{"file":"csv_logic\/milestones.csv","sha":"e219c8828461229a4257f49c4cedbe887288327b"},{"file":"csv_logic\/name_colors.csv","sha":"4a461e0b4ef13ed2693d1f0ddf24de8356ccbb00"},{"file":"csv_logic\/pins.csv","sha":"00da4886ffb48892965310830272f9152414ec74"},{"file":"csv_logic\/player_thumbnails.csv","sha":"a277ecb417154c752e8b363c0de77f7bfa8c2256"},{"file":"csv_logic\/projectiles.csv","sha":"ebd92eb3e400e365773f8618ce156ce4027f8c7b"},{"file":"csv_logic\/regions.csv","sha":"75dc3a91887c3c90d0c4b08bde2d4756223ba1c4"},{"file":"csv_logic\/resources.csv","sha":"28c8205f7559cc85f3ed97a9df1070c50adc85e8"},{"file":"csv_logic\/skills.csv","sha":"49332e275f2a5723ea707bea0795c8dc42be731a"},{"file":"csv_logic\/skins.csv","sha":"1e06a8255e25637cc64eae72348983133712759b"},{"file":"csv_logic\/skinsrarity.csv","sha":"fec4a3884c087c6a1bcc6a21ea40129852492b78"},{"file":"csv_logic\/skin_confs.csv","sha":"9a80ec7e3928417e2726074cda2e6cf1edcfb8b0"},{"file":"csv_logic\/themes.csv","sha":"ce8b0f8e7ef923902c188f647e8c5941ea8ad01f"},{"file":"csv_logic\/tiles.csv","sha":"12fd61111f6c6e64d100c04c8c987f7a553bf776"},{"file":"localization\/ar.csv","sha":"02a929a9fc9da99415692e9df5ebdca2dae36af5"},{"file":"localization\/cn.csv","sha":"d36df6cfd157bad65b90e40753a59dffbdac7ed2"},{"file":"localization\/cnt.csv","sha":"d2dbada190bd0f2b826734ede0b54561a97ff898"},{"file":"localization\/de.csv","sha":"9d4e19064fe4473df39260eb82abe089ab0f29e6"},{"file":"localization\/es.csv","sha":"ae00988429d9f8443acca0092eab92174f055c47"},{"file":"localization\/fi.csv","sha":"a86dca71958bf424c90fe095bfcfa638a32beaa7"},{"file":"localization\/fr.csv","sha":"512aa0e18116a10dffcd0705cb83c4c185f09933"},{"file":"localization\/he.csv","sha":"904b2ccadf9dbe8345d3cfbe481ec5e0a72cfa71"},{"file":"localization\/id.csv","sha":"63272850f57e70c2cf643f4617bdf3af01b6080c"},{"file":"localization\/it.csv","sha":"9d0b08502fa23cdf28ef978e59c21ed191492ce0"},{"file":"localization\/jp.csv","sha":"0f9a320a63d04b61fcecfff585907038f3206eed"},{"file":"localization\/kr.csv","sha":"bb98e41e4c0f2d8cf978397f6ac85e5ddaa73cf9"},{"file":"localization\/ms.csv","sha":"8416a220c948109238fae8a0e0106e19f4d58cd2"},{"file":"localization\/nl.csv","sha":"b58346c2985ecd3550ed9daa288ea03ca3670a46"},{"file":"localization\/pl.csv","sha":"81838a1dfdf12212589ce213da83d43c90018ed5"},{"file":"localization\/pt.csv","sha":"cfe98492844c32268e02234c05058412a834cfa9"},{"file":"localization\/ru.csv","sha":"ac88dd19c1ae1b8fcf3374cb8669b80c86509e11"},{"file":"localization\/texts.csv","sha":"a6c7914a2d6f7527e8c6579cae8cf93840d2633b"},{"file":"localization\/texts_patch.csv","sha":"dc8a7ae483f9fa7ac07ebd89f98ed8ea2c83101b"},{"file":"localization\/th.csv","sha":"f103da5add906d016acda635c5eb311c0c226663"},{"file":"localization\/tr.csv","sha":"2ae38a4c6f310007f777fa3d4aad07f0f0903d87"},{"file":"localization\/vi.csv","sha":"4f03b73ac45ff27f1279da5a3051ab37c3cc2721"}],"sha":"e23f79220541f056889f8cb6517ee18019a74d9d","version":"26.165.7"}
{"files": [{"file": "csv_client\/animations.csv", "sha": "62ef3542b42b2b50d3c1ba8fe788320bd6f7c823"}, {"file": "csv_client\/billing_packages.csv", "sha": "ee5410c96a713b03f6d67b43644690aa1f48b514"}, {"file": "csv_client\/client_globals.csv", "sha": "94c684a7333aea79fb1ad8cae14dac9247b1f31f"}, {"file": "csv_client\/color_gradients.csv", "sha": "02a476afa038ce35b3abab275244c88324f9d272"}, {"file": "csv_client\/credits.csv", "sha": "71f20797f55f88036adfd9b70dcf05d636bc3e26"}, {"file": "csv_client\/effects.csv", "sha": "01cb9f4640935f8eafb1fa9af83394fb0fe6eee1"}, {"file": "csv_client\/faces.csv", "sha": "35fffd21436ec0414e5d3e2e8c5f65153e15c486"}, {"file": "csv_client\/health_bars.csv", "sha": "4a38c60ab45b70f732c1d0a3b6c4054ca5aaf652"}, {"file": "csv_client\/hints.csv", "sha": "8b0b027398a3c733207fd84be3aaee994fa40ebc"}, {"file": "csv_client\/links.csv", "sha": "8fcc280ca8ec953a05e4b77d8d349db9d1c875fd"}, {"file": "csv_client\/local_notifications.csv", "sha": "f2b55e772aac69eac430d178203254d2274dad4e"}, {"file": "csv_client\/music.csv", "sha": "8816ac56065190e2d06531c5af05d51dff56791d"}, {"file": "csv_client\/particle_emitters.csv", "sha": "01ab2a61fadb8afdc9ffdc1788a0e1b05139d0db"}, {"file": "csv_client\/particle_emitters.json", "sha": "3013338ff68cc7de9062df6ce5ce320fa4953738"}, {"file": "csv_client\/shop_items.csv", "sha": "8d5a2e4343917054b7b940510b1429f4de771f40"}, {"file": "csv_client\/sounds.csv", "sha": "a1b4745648aefcb14554ccfe4428ff4040fc2191"}, {"file": "csv_client\/tutorial.csv", "sha": "8f6fc00f859d492656675008170c6deebd53a907"}, {"file": "csv_logic\/accessories.csv", "sha": "705ff830cdf097fab188cb1d702f6ff7c9e0cec8"}, {"file": "csv_logic\/alliance_badges.csv", "sha": "d58ebe6d708e3d0519721fb58ff23a98c7027f48"}, {"file": "csv_logic\/alliance_roles.csv", "sha": "bc11c0632058700168d812c2cd07870624584710"}, {"file": "csv_logic\/area_effects.csv", "sha": "00c74759cee30c1b4c58878085858101c1133f17"}, {"file": "csv_logic\/bosses.csv", "sha": "ab12addc596e811e60baa89623bcfa79ed453283"}, {"file": "csv_logic\/campaign.csv", "sha": "24307a9d31dd194a260a256b5c15c8d964737e18"}, {"file": "csv_logic\/cards.csv", "sha": "2b9d75b55ad5da246ad56a29df870f02ef72cda9"}, {"file": "csv_logic\/challenges.csv", "sha": "9cfce47b2b7f6a260d622f9105fdafbaa438a633"}, {"file": "csv_logic\/characters.csv", "sha": "3cc3de7df26f9bee39d185ebeae07cd385003fe7"}, {"file": "csv_logic\/game_mode_variations.csv", "sha": "a8fa53263b80c7f0aff820a8d0fc8851b11c210c"}, {"file": "csv_logic\/globals.csv", "sha": "b21c62b1a4b0f4fe9419374a3e842ea1e48c6012"}, {"file": "csv_logic\/items.csv", "sha": "26235e6bd8401dc7d00f1b9fa43178d5688d7c5e"}, {"file": "csv_logic\/locales.csv", "sha": "9204d1bf6e19f165c7c1ea280fa8cb486f948fab"}, {"file": "csv_logic\/locations.csv", "sha": "447262cd8280ebe6eba1be6eb1ca225028b34649"}, {"file": "csv_logic\/location_themes.csv", "sha": "5882ad828e07d2f820e7cede2f04c3d3527ba3b1"}, {"file": "csv_logic\/maps.csv", "sha": "694c61d7c7cf3b6ae7a456d41a55bbc7e8369573"}, {"file": "csv_logic\/map_blocks.csv", "sha": "349f2edcfa184d2a535e7a183c58fdfe487ba560"}, {"file": "csv_logic\/messages.csv", "sha": "1f7ab8deab0544a2e9570c37a962f10ddd47feb5"}, {"file": "csv_logic\/milestones.csv", "sha": "216e850f4798f66f6c1aa895b1014a4a0cdeeef2"}, {"file": "csv_logic\/name_colors.csv", "sha": "af2cf31ff3b77d00345449e8ee81f503d1d39790"}, {"file": "csv_logic\/pins.csv", "sha": "24ef753b5dbcc9475d47ac69edebeb09b521d777"}, {"file": "csv_logic\/player_thumbnails.csv", "sha": "82abfc345e73a6157ce67e9346d2c046562b8eab"}, {"file": "csv_logic\/projectiles.csv", "sha": "fbbf01d63d23ff0d637b405365cbed3faf25a6c5"}, {"file": "csv_logic\/regions.csv", "sha": "fe2e6ef701e81b1bc5392ff52d05d80966e74b67"}, {"file": "csv_logic\/resources.csv", "sha": "ad585a41713557e1f315dc95e57f27d14abb59c4"}, {"file": "csv_logic\/skills.csv", "sha": "1757ee5adc26f30df4446c9f6aa1f06d98185b6e"}, {"file": "csv_logic\/skins.csv", "sha": "5e925ba5fba9e9b6c6f3bee117f96f7507a5a012"}, {"file": "csv_logic\/skinsrarity.csv", "sha": "cc59933ab880cabfa54aca22a84075e55f4df8e9"}, {"file": "csv_logic\/skin_confs.csv", "sha": "2592833b420a0b1a618e35e79769b6d9e7443d80"}, {"file": "csv_logic\/themes.csv", "sha": "80e7149fc0f158952e04f3c2cea132f3db787f85"}, {"file": "csv_logic\/tiles.csv", "sha": "0c96788c7b48d6a818a2068eac291f46a9225145"}], "sha": "79ec00fc4420bb65bd718ee0c53e594121f29bb8", "version": "26.165.1"}
7 changes: 3 additions & 4 deletions Packets/Messages/Client/Login/Login_Message.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ def process(self):
self.player.err_code = 8
LoginFailedMessage(self.client, self.player, "Your client is outdated, click below to download the new version!").send()

elif self.player.maintenance:
if self.player.maintenance:
LoginFailedMessage(self.client, self.player, "").send()

elif self.player.patch:
if self.fingerprint_sha != self.player.patch_sha:
LoginFailedMessage(self.client, self.player, "").send()
if self.fingerprint_sha != self.player.patch_sha and self.player.patch:
LoginFailedMessage(self.client, self.player, "").send()

elif self.player.low_id != 0:
LoginOkMessage(self.client, self.player).send()
Expand Down
92 changes: 42 additions & 50 deletions Patcher/Lib/ATPatchmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,52 @@
import random
import shutil

def Make():
backup = os.getcwd()
def FP(arg: str) -> str: # get filename in like fingerprint.json
return arg.replace("\\", r"\/").replace("Gamefiles\\/", "")


def iterate_over(path: str) -> list: # get all subfiles and files
r = []
for root, dirs, files in os.walk(path, topdown=False):
for name in files:
if name != 'fingerprint.json':
r.append(os.path.join(root, name))
return r



def shash(inp: str) -> str: # get hash sha1
hash_object = hashlib.sha1(inp.encode())
pbHash = hash_object.hexdigest()
return pbHash



def MasterHasher():

time = str(int(datetime.datetime.timestamp(datetime.datetime.now())))
by = shash(time).encode()
return by

MH = MasterHasher().decode()
base = '''{ "files": [],
def Make():
backup = os.getcwd()

def FP(arg: str) -> str: # get filename in like fingerprint.json
return arg.replace("\\", r"\/").replace("Gamefiles\\/", "")

def iterate_over(path: str) -> list: # get all subfiles and files
r = []
for root, dirs, files in os.walk(path, topdown=False):
for name in files:
if name != 'fingerprint.json':
r.append(os.path.join(root, name))
return r

def shash(inp) -> str: # get hash sha1
print(inp)
hash_object = hashlib.sha1(inp)
pbHash = hash_object.hexdigest()
print(pbHash)
return pbHash

def MasterHasher():

time = str(int(datetime.datetime.timestamp(datetime.datetime.now())))
by = shash(time.encode()).encode()
return by

MH = MasterHasher().decode()
base = '''{ "files": [],
"sha": "''' + MH + '",' + '''
"version": "''' + "26.165." + str(random.randint(1,9)) + '"}'

out = json.loads(base)



all_file = iterate_over("Gamefiles")
"version": "''' + "26.165." + str(random.randint(1, 9)) + '"}'

for file in all_file:

file_cont = open(file, "r", encoding="latin-1").read()
sha = shash(file_cont)
out["files"].append({"file": FP(file), "sha":sha})
out = json.loads(base)


os.chdir("Patchs")
shutil.copytree(backup + "/Gamefiles", os.getcwd() + f"/{MH}")
os.chdir(MH) # mode write doesnt create file unless this

json_out = open("fingerprint.json", "w")
json_out.write(str(out).replace("'", '"').replace("\\\\", "\\")) # WRITE fingerprint.json
json_out.close()
all_file = iterate_over("Gamefiles")

for file in all_file:
file_cont = open(file, "rb").read()
sha = shash(file_cont)
out["files"].append({"file": FP(file), "sha": sha})

os.chdir("Patchs")
shutil.copytree(backup + "/Gamefiles", os.getcwd() + f"/{MH}")
os.chdir(MH) # mode write doesnt create file unless this

json_out = open("fingerprint.json", "w")
json_out.write(str(out).replace("'", '"').replace("\\\\", "\\")) # WRITE fingerprint.json
json_out.close()
Loading

0 comments on commit 936b178

Please sign in to comment.