mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Cleanup
This commit is contained in:
parent
0628201fca
commit
0d198f9f5d
8 changed files with 107 additions and 129 deletions
|
@ -27,7 +27,7 @@ int niraicall_onLoadGameData()
|
||||||
gd.open("stride.dist", ios_base::in | ios_base::binary);
|
gd.open("stride.dist", ios_base::in | ios_base::binary);
|
||||||
if (!gd.is_open())
|
if (!gd.is_open())
|
||||||
{
|
{
|
||||||
std::cerr << "unable to open game file" << std::endl;
|
std::cerr << "Unable to open game file!" << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ int niraicall_onLoadGameData()
|
||||||
|
|
||||||
if (memcmp(header, read_header, header_size))
|
if (memcmp(header, read_header, header_size))
|
||||||
{
|
{
|
||||||
std::cerr << "invalid header" << std::endl;
|
std::cerr << "Invalid header" << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ int niraicall_onLoadGameData()
|
||||||
|
|
||||||
nassertd(dgi.get_remaining_size() == 0)
|
nassertd(dgi.get_remaining_size() == 0)
|
||||||
{
|
{
|
||||||
std::cerr << "corrupted data" << std::endl;
|
std::cerr << "Corrupted data!" << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,28 +106,6 @@ loadPrcFileData('Settings: musicVol', 'audio-master-music-volume %s' % settings[
|
||||||
loadPrcFileData('Settings: sfxVol', 'audio-master-sfx-volume %s' % settings['sfxVol'])
|
loadPrcFileData('Settings: sfxVol', 'audio-master-sfx-volume %s' % settings['sfxVol'])
|
||||||
loadPrcFileData('Settings: loadDisplay', 'load-display %s' % settings['loadDisplay'])
|
loadPrcFileData('Settings: loadDisplay', 'load-display %s' % settings['loadDisplay'])
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
from toontown.toonbase.ContentPacksManager import ContentPackError
|
|
||||||
from toontown.toonbase.ContentPacksManager import ContentPacksManager
|
|
||||||
|
|
||||||
|
|
||||||
contentPacksFilepath = ConfigVariableString(
|
|
||||||
'content-packs-filepath', 'user/contentpacks/').getValue()
|
|
||||||
contentPacksSortFilename = ConfigVariableString(
|
|
||||||
'content-packs-sort-filename', 'sort.yaml').getValue()
|
|
||||||
if not os.path.exists(contentPacksFilepath):
|
|
||||||
os.makedirs(contentPacksFilepath)
|
|
||||||
__builtin__.ContentPackError = ContentPackError
|
|
||||||
__builtin__.contentPacksMgr = ContentPacksManager(
|
|
||||||
filepath=contentPacksFilepath, sortFilename=contentPacksSortFilename)
|
|
||||||
contentPacksMgr.applyAll()
|
|
||||||
|
|
||||||
languagePack = settings['language'].lower() + '.mf'
|
|
||||||
|
|
||||||
if contentPacksMgr.isApplicable(languagePack):
|
|
||||||
contentPacksMgr.applyMultifile(languagePack)
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
import random
|
import random
|
||||||
|
|
|
@ -216,14 +216,14 @@ class RemoteAccountDB(AccountDB):
|
||||||
|
|
||||||
correctHash = hashAlgo(token + accountServerSecret).digest()
|
correctHash = hashAlgo(token + accountServerSecret).digest()
|
||||||
if len(hash) != len(correctHash):
|
if len(hash) != len(correctHash):
|
||||||
raise ValueError('invalid hash')
|
raise ValueError('Invalid hash.')
|
||||||
|
|
||||||
value = 0
|
value = 0
|
||||||
for x, y in zip(hash[::-1], correctHash):
|
for x, y in zip(hash[::-1], correctHash):
|
||||||
value |= ord(x) ^ ord(y)
|
value |= ord(x) ^ ord(y)
|
||||||
|
|
||||||
if value:
|
if value:
|
||||||
raise ValueError('invalid hash')
|
raise ValueError('Invalid hash.')
|
||||||
|
|
||||||
token = json.loads(token.decode('base64')[::-1].decode('rot13'))
|
token = json.loads(token.decode('base64')[::-1].decode('rot13'))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue