This commit is contained in:
John Cote 2015-06-05 01:05:01 -04:00
parent 0628201fca
commit 0d198f9f5d
8 changed files with 107 additions and 129 deletions

View file

@ -27,7 +27,7 @@ int niraicall_onLoadGameData()
gd.open("stride.dist", ios_base::in | ios_base::binary);
if (!gd.is_open())
{
std::cerr << "unable to open game file" << std::endl;
std::cerr << "Unable to open game file!" << std::endl;
return 1;
}
@ -37,7 +37,7 @@ int niraicall_onLoadGameData()
if (memcmp(header, read_header, header_size))
{
std::cerr << "invalid header" << std::endl;
std::cerr << "Invalid header" << std::endl;
return 1;
}
@ -98,7 +98,7 @@ int niraicall_onLoadGameData()
nassertd(dgi.get_remaining_size() == 0)
{
std::cerr << "corrupted data" << std::endl;
std::cerr << "Corrupted data!" << std::endl;
return 1;
}

View file

@ -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: 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 sys
import random

View file

@ -216,14 +216,14 @@ class RemoteAccountDB(AccountDB):
correctHash = hashAlgo(token + accountServerSecret).digest()
if len(hash) != len(correctHash):
raise ValueError('invalid hash')
raise ValueError('Invalid hash.')
value = 0
for x, y in zip(hash[::-1], correctHash):
value |= ord(x) ^ ord(y)
if value:
raise ValueError('invalid hash')
raise ValueError('Invalid hash.')
token = json.loads(token.decode('base64')[::-1].decode('rot13'))