mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 04:02:40 -06:00
60 lines
1.3 KiB
Python
60 lines
1.3 KiB
Python
from panda3d.core import *
|
|
import __builtin__, os, sys
|
|
import aes
|
|
|
|
import niraidata
|
|
|
|
# Config
|
|
prc = niraidata.CONFIG
|
|
iv, key, prc = prc[:16], prc[16:32], prc[32:]
|
|
prc = aes.decrypt(prc, key, iv)
|
|
|
|
for line in prc.split('\n'):
|
|
line = line.strip()
|
|
if line:
|
|
loadPrcFileData('nirai config', line)
|
|
|
|
del prc
|
|
del iv
|
|
del key
|
|
|
|
# DC
|
|
__builtin__.dcStream = StringStream()
|
|
|
|
dc = niraidata.DC
|
|
iv, key, dc = dc[:16], dc[16:32], dc[32:]
|
|
dc = aes.decrypt(dc, key, iv)
|
|
|
|
dcStream.setData(dc)
|
|
del dc
|
|
del iv
|
|
del key
|
|
|
|
# Resources
|
|
# TO DO: Sign and verify the phases to prevent edition
|
|
abort = False
|
|
|
|
|
|
# Packs
|
|
pack = os.environ.get('TT_STRIDE_CONTENT_PACK')
|
|
if pack and pack != 'default':
|
|
print 'Loading content pack', pack
|
|
for file in glob.glob('resources/%s/*.mf' % pack):
|
|
mf = Multifile()
|
|
mf.openReadWrite(Filename(file))
|
|
names = mf.getSubfileNames()
|
|
for name in names:
|
|
ext = os.path.splitext(name)[1]
|
|
if ext not in ('.jpg', '.jpeg', '.ogg', '.rgb'):
|
|
mf.removeSubfile(name)
|
|
|
|
mf.flush()
|
|
|
|
if not vfs.mount(mf, '../resources', 0):
|
|
print 'Unable to mount %s' % filename
|
|
abort = True
|
|
break
|
|
|
|
if not abort:
|
|
# Run
|
|
import toontown.toonbase.ToontownStart
|