mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Add rest of Nirai code changes, And get the game working without compression.
This commit is contained in:
parent
a38ca63a30
commit
e4568ef9fd
8 changed files with 138 additions and 203 deletions
|
@ -1,14 +1,13 @@
|
||||||
from panda3d.core import *
|
from panda3d.core import *
|
||||||
import __builtin__, os
|
import __builtin__, os, sys
|
||||||
import rc4
|
import aes
|
||||||
|
|
||||||
import niraidata
|
import niraidata
|
||||||
|
|
||||||
# Config
|
# Config
|
||||||
prc = niraidata.CONFIG
|
prc = niraidata.CONFIG
|
||||||
key, prc = prc[:32], prc[32:]
|
iv, key, prc = prc[:16], prc[16:32], prc[32:]
|
||||||
rc4.rc4_setkey(key)
|
prc = aes.decrypt(prc, key, iv)
|
||||||
prc = rc4.rc4(prc)
|
|
||||||
|
|
||||||
for line in prc.split('\n'):
|
for line in prc.split('\n'):
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
@ -16,40 +15,25 @@ for line in prc.split('\n'):
|
||||||
loadPrcFileData('nirai config', line)
|
loadPrcFileData('nirai config', line)
|
||||||
|
|
||||||
del prc
|
del prc
|
||||||
|
del iv
|
||||||
|
del key
|
||||||
|
|
||||||
# DC
|
# DC
|
||||||
__builtin__.dcStream = StringStream()
|
__builtin__.dcStream = StringStream()
|
||||||
|
|
||||||
dc = niraidata.DC
|
dc = niraidata.DC
|
||||||
key, dc = dc[:32], dc[32:]
|
iv, key, dc = dc[:16], dc[16:32], dc[32:]
|
||||||
rc4.rc4_setkey(key)
|
dc = aes.decrypt(dc, key, iv)
|
||||||
dc = rc4.rc4(dc)
|
|
||||||
|
|
||||||
dcStream.setData(dc)
|
dcStream.setData(dc)
|
||||||
del dc
|
del dc
|
||||||
rc4.rc4_setkey('\0\0\0\0')
|
del iv
|
||||||
|
del key
|
||||||
|
|
||||||
# Resources
|
# Resources
|
||||||
# TO DO: Sign and verify the phases to prevent editing.
|
# TO DO: Sign and verify the phases to prevent edition
|
||||||
|
|
||||||
vfs = VirtualFileSystem.getGlobalPtr()
|
|
||||||
mfs = (3, 3.5, 4, 5, 5.5, 6, 7, 8, 9, 10, 11, 12, 13)
|
|
||||||
abort = False
|
abort = False
|
||||||
|
|
||||||
for mf in mfs:
|
|
||||||
filename = 'resources/default/phase_%s.mf' % mf
|
|
||||||
if not os.path.isfile(filename):
|
|
||||||
print 'Phase %s not found' % filename
|
|
||||||
abort = True
|
|
||||||
break
|
|
||||||
|
|
||||||
mf = Multifile()
|
|
||||||
mf.openRead(filename)
|
|
||||||
|
|
||||||
if not vfs.mount(mf, '../resources', 0):
|
|
||||||
print 'Unable to mount %s' % filename
|
|
||||||
abort = True
|
|
||||||
break
|
|
||||||
|
|
||||||
# Packs
|
# Packs
|
||||||
pack = os.environ.get('TT_STRIDE_CONTENT_PACK')
|
pack = os.environ.get('TT_STRIDE_CONTENT_PACK')
|
||||||
|
|
200
build/make.py
200
build/make.py
|
@ -1,126 +1,44 @@
|
||||||
from panda3d.core import *
|
from panda3d.core import *
|
||||||
|
|
||||||
import argparse, marshal, struct
|
import argparse, struct
|
||||||
import glob, sys, os
|
import sys, glob
|
||||||
import rc4
|
import os
|
||||||
|
|
||||||
|
sys.path.append('nirai/src')
|
||||||
|
|
||||||
|
from niraitools import *
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--compile-cxx', '-c', action='store_true',
|
parser.add_argument('--compile-cxx', '-c', action='store_true',
|
||||||
help='Compile the CXX codes and generate Nirai.exe into built.')
|
help='Compile the CXX codes and generate stride.exe into built.')
|
||||||
parser.add_argument('--make-nri', '-n', action='store_true',
|
parser.add_argument('--make-nri', '-n', action='store_true',
|
||||||
help='Generate stride NRI.')
|
help='Generate stride NRI.')
|
||||||
|
parser.add_argument('--make-mfs', '-m', action='store_true',
|
||||||
|
help='Make multifiles')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# BEGIN (STRIPPED AND MODIFIED) COPY FROM niraitools.py
|
if not os.path.exists('built'):
|
||||||
class NiraiPackager:
|
os.mkdir('built')
|
||||||
HEADER = 'NRI\n'
|
|
||||||
|
|
||||||
def __init__(self, outfile):
|
def niraicall_obfuscate(code):
|
||||||
self.modules = {}
|
# We'll obfuscate if len(code) % 4 == 0
|
||||||
self.outfile = outfile
|
# This way we make sure both obfuscated and non-obfuscated code work.
|
||||||
|
if len(code) % 4:
|
||||||
|
return False, None
|
||||||
|
|
||||||
def __read_file(self, filename, mangler=None):
|
return True, code[::-1]
|
||||||
with open(filename, 'rb') as f:
|
|
||||||
data = f.read()
|
|
||||||
|
|
||||||
base = filename.rsplit('.', 1)[0].replace('\\', '/').replace('/', '.')
|
niraimarshal.niraicall_obfuscate = niraicall_obfuscate
|
||||||
pkg = base.endswith('.__init__')
|
|
||||||
moduleName = base.rsplit('.', 1)[0] if pkg else base
|
|
||||||
|
|
||||||
name = moduleName
|
|
||||||
if mangler is not None:
|
|
||||||
name = mangler(name)
|
|
||||||
|
|
||||||
if not name:
|
|
||||||
return '', ('', 0)
|
|
||||||
|
|
||||||
try:
|
|
||||||
data = self.compile_module(name, data)
|
|
||||||
|
|
||||||
except:
|
|
||||||
print 'WARNING: Failed to compile', filename
|
|
||||||
return '', ('', 0)
|
|
||||||
|
|
||||||
size = len(data) * (-1 if pkg else 1)
|
|
||||||
return name, (data, size)
|
|
||||||
|
|
||||||
def compile_module(self, name, data):
|
|
||||||
return marshal.dumps(compile(data, name, 'exec'))
|
|
||||||
|
|
||||||
def add_module(self, moduleName, data, size=None, compile=False):
|
|
||||||
if compile:
|
|
||||||
data = self.compile_module(moduleName, data)
|
|
||||||
|
|
||||||
if size is None:
|
|
||||||
size = len(data)
|
|
||||||
|
|
||||||
self.modules[moduleName] = (data, size)
|
|
||||||
|
|
||||||
def add_file(self, filename, mangler=None):
|
|
||||||
print 'Adding file', filename
|
|
||||||
moduleName, (data, size) = self.__read_file(filename, mangler)
|
|
||||||
if moduleName:
|
|
||||||
moduleName = os.path.basename(filename).rsplit('.', 1)[0]
|
|
||||||
self.add_module(moduleName, data, size)
|
|
||||||
|
|
||||||
def add_directory(self, dir, mangler=None):
|
|
||||||
print 'Adding directory', dir
|
|
||||||
|
|
||||||
def _recurse_dir(dir):
|
|
||||||
for f in os.listdir(dir):
|
|
||||||
f = os.path.join(dir, f)
|
|
||||||
|
|
||||||
if os.path.isdir(f):
|
|
||||||
_recurse_dir(f)
|
|
||||||
|
|
||||||
elif f.endswith('py'):
|
|
||||||
moduleName, (data, size) = self.__read_file(f, mangler)
|
|
||||||
if moduleName:
|
|
||||||
self.add_module(moduleName, data, size)
|
|
||||||
|
|
||||||
_recurse_dir(dir)
|
|
||||||
|
|
||||||
def get_mangle_base(self, *path):
|
|
||||||
return len(os.path.join(*path).rsplit('.', 1)[0].replace('\\', '/').replace('/', '.')) + 1
|
|
||||||
|
|
||||||
def write_out(self):
|
|
||||||
f = open(self.outfile, 'wb')
|
|
||||||
f.write(self.HEADER)
|
|
||||||
f.write(self.process_modules())
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
def generate_key(self, size=256):
|
|
||||||
return os.urandom(size)
|
|
||||||
|
|
||||||
def dump_key(self, key):
|
|
||||||
for k in key:
|
|
||||||
print ord(k),
|
|
||||||
|
|
||||||
print
|
|
||||||
|
|
||||||
def process_modules(self):
|
|
||||||
# Pure virtual
|
|
||||||
raise NotImplementedError('process_datagram')
|
|
||||||
|
|
||||||
def get_file_contents(self, filename, keysize=0):
|
|
||||||
with open(filename, 'rb') as f:
|
|
||||||
data = f.read()
|
|
||||||
|
|
||||||
if keysize:
|
|
||||||
key = self.generate_key(keysize)
|
|
||||||
rc4.rc4_setkey(key)
|
|
||||||
data = key + rc4.rc4(data)
|
|
||||||
|
|
||||||
return data
|
|
||||||
# END COPY FROM niraitools.py
|
|
||||||
|
|
||||||
class StridePackager(NiraiPackager):
|
class StridePackager(NiraiPackager):
|
||||||
HEADER = 'STRIDETT'
|
HEADER = 'TTSROCKS'
|
||||||
BASEDIR = '..' + os.sep
|
BASEDIR = '..' + os.sep
|
||||||
|
|
||||||
def __init__(self, outfile):
|
def __init__(self, outfile):
|
||||||
NiraiPackager.__init__(self, outfile)
|
NiraiPackager.__init__(self, outfile)
|
||||||
self.__manglebase = self.get_mangle_base(self.BASEDIR)
|
self.__manglebase = self.get_mangle_base(self.BASEDIR)
|
||||||
|
#self.add_panda3d_dirs()
|
||||||
|
#self.add_default_lib()
|
||||||
|
|
||||||
def add_source_dir(self, dir):
|
def add_source_dir(self, dir):
|
||||||
self.add_directory(self.BASEDIR + dir, mangler=self.__mangler)
|
self.add_directory(self.BASEDIR + dir, mangler=self.__mangler)
|
||||||
|
@ -131,7 +49,7 @@ class StridePackager(NiraiPackager):
|
||||||
|
|
||||||
def __mangler(self, name):
|
def __mangler(self, name):
|
||||||
if name.endswith('AI') or name.endswith('UD') or name in ('ToontownAIRepository', 'ToontownUberRepository',
|
if name.endswith('AI') or name.endswith('UD') or name in ('ToontownAIRepository', 'ToontownUberRepository',
|
||||||
'ToontownInternalRepository'):
|
'ToontownInternalRepository', 'ServiceStart'):
|
||||||
if not 'NonRepeatableRandomSource' in name:
|
if not 'NonRepeatableRandomSource' in name:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
@ -139,26 +57,26 @@ class StridePackager(NiraiPackager):
|
||||||
|
|
||||||
def generate_niraidata(self):
|
def generate_niraidata(self):
|
||||||
print 'Generating niraidata'
|
print 'Generating niraidata'
|
||||||
|
# Config
|
||||||
|
config = self.get_file_contents('../deployment/public_client.prc')
|
||||||
|
|
||||||
config = self.get_file_contents('../dependencies/config/release/en.prc')
|
config_iv = self.generate_key(16)
|
||||||
config += '\n\n' + self.get_file_contents('../dependencies/config/general.prc')
|
config_key = self.generate_key(16)
|
||||||
key = self.generate_key(128)
|
config = config_iv + config_key + aes.encrypt(config, config_key, config_iv)
|
||||||
rc4.rc4_setkey(key)
|
|
||||||
config = key + rc4.rc4(config)
|
|
||||||
|
|
||||||
niraidata = 'CONFIG = %r' % config
|
niraidata = 'CONFIG = %r' % config
|
||||||
niraidata += '\nDC = %r' % self.get_file_contents('../dependencies/astron/dclass/stride.dc', 128)
|
|
||||||
|
# DC
|
||||||
|
niraidata += '\nDC = %r' % self.get_file_contents('../dependencies/astron/dclass/stride.dc', True)
|
||||||
self.add_module('niraidata', niraidata, compile=True)
|
self.add_module('niraidata', niraidata, compile=True)
|
||||||
|
|
||||||
def process_modules(self):
|
def process_modules(self):
|
||||||
with open('base.dg', 'rb') as f:
|
with open('base.dg', 'rb') as f:
|
||||||
basesize, = struct.unpack('<I', f.read(4))
|
basesize, = struct.unpack('<I', f.read(4))
|
||||||
data = f.read()
|
data = f.read()
|
||||||
|
# TODO: Compression
|
||||||
dg = Datagram()
|
dg = Datagram()
|
||||||
dg.addUint32(len(self.modules) + basesize)
|
dg.addUint32(len(self.modules) + basesize)
|
||||||
dg.appendData(data)
|
dg.appendData(data)
|
||||||
|
|
||||||
for moduleName in self.modules:
|
for moduleName in self.modules:
|
||||||
data, size = self.modules[moduleName]
|
data, size = self.modules[moduleName]
|
||||||
|
|
||||||
|
@ -167,19 +85,26 @@ class StridePackager(NiraiPackager):
|
||||||
dg.appendData(data)
|
dg.appendData(data)
|
||||||
|
|
||||||
data = dg.getMessage()
|
data = dg.getMessage()
|
||||||
compressed = compressString(data, 9)
|
#compressed = compressString(data, 9)
|
||||||
key = self.generate_key(100)
|
iv = self.generate_key(16)
|
||||||
fixed = ''.join(chr((i ^ (5 * i + 7)) % ((i + 6) * 10)) for i in xrange(28))
|
key = self.generate_key(16)
|
||||||
rc4.rc4_setkey(key + fixed)
|
fixed_key = ''.join(chr((i ^ (7 * i + 16)) % ((i + 5) * 3)) for i in xrange(16))
|
||||||
data = rc4.rc4(compressed)
|
fixed_iv = ''.join(chr((i ^ (2 * i + 53)) % ((i + 9) * 6)) for i in xrange(16))
|
||||||
return key + data
|
securekeyandiv = aes.encrypt(iv + key, fixed_key, fixed_iv)
|
||||||
|
return securekeyandiv + aes.encrypt(data, key, iv)
|
||||||
|
|
||||||
# 1. Make the NRI
|
# Compile the engine
|
||||||
|
if args.compile_cxx:
|
||||||
|
compiler = NiraiCompiler('stride.exe', libs=set(glob.glob('C:/repos/libpandadna/libpandadna.dir/Release/*.obj')))
|
||||||
|
|
||||||
|
compiler.add_nirai_files()
|
||||||
|
compiler.add_source('src/stride.cxx')
|
||||||
|
|
||||||
|
compiler.run()
|
||||||
|
|
||||||
|
# Compile the game data
|
||||||
if args.make_nri:
|
if args.make_nri:
|
||||||
if not os.path.exists('built'):
|
pkg = StridePackager('built/TTSData.bin')
|
||||||
os.mkdir('built')
|
|
||||||
|
|
||||||
pkg = StridePackager('built/stride.dist')
|
|
||||||
|
|
||||||
pkg.add_source_dir('otp')
|
pkg.add_source_dir('otp')
|
||||||
pkg.add_source_dir('toontown')
|
pkg.add_source_dir('toontown')
|
||||||
|
@ -187,19 +112,18 @@ if args.make_nri:
|
||||||
pkg.add_data_file('NiraiStart')
|
pkg.add_data_file('NiraiStart')
|
||||||
|
|
||||||
pkg.generate_niraidata()
|
pkg.generate_niraidata()
|
||||||
|
|
||||||
pkg.write_out()
|
pkg.write_out()
|
||||||
|
|
||||||
# 2. Compile CXX stuff
|
if args.make_mfs:
|
||||||
if args.compile_cxx:
|
os.chdir('../resources')
|
||||||
if not os.path.exists('built'):
|
cmd = ''
|
||||||
os.mkdir('built')
|
for phasenum in ['3', '3.5', '4', '5', '5.5', '6', '7', '8', '9', '10', '11', '12', '13']:
|
||||||
|
print 'phase_%s' % (phasenum)
|
||||||
|
cmd = 'multify -cf ../build/built/resources/default/phase_%s.mf phase_%s' % (phasenum, phasenum)
|
||||||
|
p = subprocess.Popen(cmd, stdout=sys.stdout, stderr=sys.stderr)
|
||||||
|
v = p.wait()
|
||||||
|
|
||||||
sys.path.append('../../../N2')
|
if v != 0:
|
||||||
from niraitools import NiraiCompiler
|
print 'The following command returned non-zero value (%d): %s' % (v, cmd[:100] + '...')
|
||||||
|
sys.exit(1)
|
||||||
compiler = NiraiCompiler('stride.exe', r'"C:\\Users\\Usuario\\workspace\\nirai-panda3d\\thirdparty\\win-libs-vc10"',
|
|
||||||
libs=set(glob.glob('libpandadna/libpandadna.dir/Release/*.obj')))
|
|
||||||
compiler.add_nirai_files()
|
|
||||||
compiler.add_source('src/stride.cxx')
|
|
||||||
|
|
||||||
compiler.run()
|
|
||||||
|
|
BIN
build/rc4.pyd
BIN
build/rc4.pyd
Binary file not shown.
|
@ -1,18 +1,17 @@
|
||||||
#include "nirai.h"
|
#include "nirai.h"
|
||||||
#include <datagram.h>
|
#include <datagram.h>
|
||||||
#include <datagramIterator.h>
|
#include <datagramIterator.h>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <string>
|
||||||
#include <compress_string.h>
|
#include <compress_string.h>
|
||||||
|
|
||||||
string rc4(const char* data, const char* key, int ds, int ks);
|
|
||||||
|
|
||||||
extern "C" __declspec(dllexport) void initlibpandadna();
|
extern "C" __declspec(dllexport) void initlibpandadna();
|
||||||
void init_libpandadna();
|
void init_libpandadna();
|
||||||
|
|
||||||
const char* header = "STRIDETT";
|
const char* header = "TTSROCKS";
|
||||||
const int header_size = 8;
|
const int header_size = 8;
|
||||||
|
|
||||||
const int keysize = 100;
|
const int key_and_iv_size = 16;
|
||||||
const int fixedsize = 28;
|
|
||||||
|
|
||||||
int niraicall_onPreStart(int argc, char* argv[])
|
int niraicall_onPreStart(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
@ -24,7 +23,7 @@ int niraicall_onLoadGameData()
|
||||||
fstream gd;
|
fstream gd;
|
||||||
|
|
||||||
// Open the file
|
// Open the file
|
||||||
gd.open("stride.dist", ios_base::in | ios_base::binary);
|
gd.open("TTSData.bin", 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;
|
||||||
|
@ -43,31 +42,50 @@ int niraicall_onLoadGameData()
|
||||||
|
|
||||||
delete[] read_header;
|
delete[] read_header;
|
||||||
|
|
||||||
// Extract the key
|
// Decrypt
|
||||||
char* key = new char[keysize + fixedsize];
|
|
||||||
char* fixed = new char[keysize];
|
|
||||||
|
|
||||||
for (int i = 0; i < fixedsize; ++i)
|
|
||||||
fixed[i] = (i ^ (5 * i + 7)) % ((i + 6) * 10);
|
|
||||||
|
|
||||||
gd.read(key, keysize);
|
|
||||||
memcpy(&key[keysize], fixed, fixedsize);
|
|
||||||
|
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
|
|
||||||
ss << gd.rdbuf();
|
ss << gd.rdbuf();
|
||||||
gd.close();
|
gd.close();
|
||||||
|
|
||||||
// Decrypt
|
std::string brawdata = ss.str();
|
||||||
std::string rawdata = ss.str();
|
|
||||||
std::string decrypted_data = rc4(rawdata.c_str(), key, rawdata.size(),
|
// Decrypted the encrypted key and iv
|
||||||
keysize + fixedsize);
|
std::string enckeyandiv = brawdata.substr(0, 48);
|
||||||
|
|
||||||
|
unsigned char* deckeyandiv = new unsigned char[32];
|
||||||
|
unsigned char* fixed_key = new unsigned char[key_and_iv_size];
|
||||||
|
unsigned char* fixed_iv = new unsigned char[key_and_iv_size];
|
||||||
|
|
||||||
|
// Create fixed key and iv
|
||||||
|
|
||||||
|
for (int i = 0; i < key_and_iv_size; ++i)
|
||||||
|
fixed_key[i] = (i ^ (7 * i + 16)) % ((i + 5) * 3);
|
||||||
|
|
||||||
|
for (int i = 0; i < key_and_iv_size; ++i)
|
||||||
|
fixed_iv[i] = (i ^ (2 * i + 53)) % ((i + 9) * 6);
|
||||||
|
|
||||||
|
int deckeyandivsize = AES_decrypt((unsigned char*)enckeyandiv.c_str(), enckeyandiv.size(), fixed_key, fixed_iv, deckeyandiv);
|
||||||
|
|
||||||
|
std::stringstream sss;
|
||||||
|
sss << deckeyandiv;
|
||||||
|
std::string strdeckeyandiv = sss.str();
|
||||||
|
|
||||||
|
// Decrypt the game data
|
||||||
|
std::string rawdata = brawdata.substr(48);
|
||||||
|
unsigned char* iv = (unsigned char*)strdeckeyandiv.substr(0, key_and_iv_size).c_str();
|
||||||
|
unsigned char* key = (unsigned char*)strdeckeyandiv.substr(key_and_iv_size).c_str();
|
||||||
|
unsigned char* decrypted_data = new unsigned char[rawdata.size()];
|
||||||
|
int decsize = AES_decrypt((unsigned char*)rawdata.c_str(), rawdata.size(), key, iv, decrypted_data); // Assumes no error
|
||||||
|
|
||||||
delete[] key;
|
delete[] key;
|
||||||
delete[] fixed;
|
delete[] iv;
|
||||||
|
|
||||||
// Decompress and read
|
// Read
|
||||||
std::string decompressed = decompress_string(decrypted_data);
|
|
||||||
|
|
||||||
Datagram dg(decompressed);
|
// TODO: Compression
|
||||||
|
|
||||||
|
Datagram dg(decrypted_data, decsize);
|
||||||
DatagramIterator dgi(dg);
|
DatagramIterator dgi(dg);
|
||||||
|
|
||||||
unsigned int num_modules = dgi.get_uint32();
|
unsigned int num_modules = dgi.get_uint32();
|
||||||
|
@ -102,6 +120,8 @@ int niraicall_onLoadGameData()
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete[] decrypted_data;
|
||||||
|
|
||||||
memset(&fzns[num_modules], 0, sizeof(_frozen));
|
memset(&fzns[num_modules], 0, sizeof(_frozen));
|
||||||
PyImport_FrozenModules = fzns;
|
PyImport_FrozenModules = fzns;
|
||||||
|
|
||||||
|
@ -111,3 +131,10 @@ int niraicall_onLoadGameData()
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" PyObject* niraicall_deobfuscate(char* code, Py_ssize_t size)
|
||||||
|
{
|
||||||
|
std::string output(code, size);
|
||||||
|
std::reverse(output.begin(), output.end());
|
||||||
|
return PyString_FromStringAndSize(output.data(), size);
|
||||||
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
# Client settings
|
# Client settings
|
||||||
window-title Toontown Stride
|
window-title Toontown Stride
|
||||||
server-version SERVER_VERSION_HERE
|
server-version SERVER_VERSION_HERE
|
||||||
audio-library-name p3openal_audio
|
|
||||||
video-library-name p3ffmpeg
|
video-library-name p3ffmpeg
|
||||||
want-dev #f
|
want-dev #f
|
||||||
preload-avatars #t
|
preload-avatars #t
|
||||||
|
@ -66,6 +65,8 @@ want-old-fireworks #t
|
||||||
want-dev #f
|
want-dev #f
|
||||||
want-pstats 0
|
want-pstats 0
|
||||||
|
|
||||||
|
preferences-filename preferences.json
|
||||||
|
|
||||||
|
|
||||||
# Crates:
|
# Crates:
|
||||||
dont-destroy-crate #t
|
dont-destroy-crate #t
|
||||||
|
|
|
@ -18,6 +18,7 @@ from otp.otpbase import OTPGlobals, OTPLocalizer
|
||||||
from otp.otpgui import OTPDialog
|
from otp.otpgui import OTPDialog
|
||||||
from otp.nametag.NametagConstants import *
|
from otp.nametag.NametagConstants import *
|
||||||
import sys, time, types, random
|
import sys, time, types, random
|
||||||
|
import __builtin__
|
||||||
|
|
||||||
class OTPClientRepository(ClientRepositoryBase):
|
class OTPClientRepository(ClientRepositoryBase):
|
||||||
notify = directNotify.newCategory('OTPClientRepository')
|
notify = directNotify.newCategory('OTPClientRepository')
|
||||||
|
@ -222,7 +223,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
if dcFileNames == None:
|
if dcFileNames == None:
|
||||||
try:
|
try:
|
||||||
# For Nirai
|
# For Nirai
|
||||||
readResult = dcFile.read(dcStream, '__dc__')
|
readResult = dcFile.read(dcStream)
|
||||||
del __builtin__.dcStream
|
del __builtin__.dcStream
|
||||||
|
|
||||||
except NameError:
|
except NameError:
|
||||||
|
|
|
@ -16,21 +16,21 @@ class DNABulkLoader:
|
||||||
|
|
||||||
def loadDNABulk(dnaStorage, file):
|
def loadDNABulk(dnaStorage, file):
|
||||||
dnaLoader = DNALoader()
|
dnaLoader = DNALoader()
|
||||||
fileu = '/' + file
|
file = '/' + file
|
||||||
dnaLoader.loadDNAFile(dnaStorage, fileu)
|
dnaLoader.loadDNAFile(dnaStorage, file)
|
||||||
|
|
||||||
def loadDNAFile(dnaStorage, file):
|
def loadDNAFile(dnaStorage, file):
|
||||||
print 'Reading DNA file...', file
|
print 'Reading DNA file...', file
|
||||||
dnaLoader = DNALoader()
|
dnaLoader = DNALoader()
|
||||||
fileu = '/' + file
|
file = '/' + file
|
||||||
node = dnaLoader.loadDNAFile(dnaStorage, fileu)
|
node = dnaLoader.loadDNAFile(dnaStorage, file)
|
||||||
if node.node().getNumChildren() > 0:
|
if node.node().getNumChildren() > 0:
|
||||||
return node.node()
|
return node.node()
|
||||||
|
|
||||||
def loadDNAFileAI(dnaStorage, file):
|
def loadDNAFileAI(dnaStorage, file):
|
||||||
dnaLoader = DNALoader()
|
dnaLoader = DNALoader()
|
||||||
fileu = '/' + file
|
file = '/' + file
|
||||||
data = dnaLoader.loadDNAFileAI(dnaStorage, fileu)
|
data = dnaLoader.loadDNAFileAI(dnaStorage, file)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def setupDoor(a, b, c, d, e, f):
|
def setupDoor(a, b, c, d, e, f):
|
||||||
|
|
|
@ -19,15 +19,13 @@ sys.path.append(
|
||||||
|
|
||||||
# Temporary hack patch:
|
# Temporary hack patch:
|
||||||
__builtin__.__dict__.update(__import__('pandac.PandaModules', fromlist=['*']).__dict__)
|
__builtin__.__dict__.update(__import__('pandac.PandaModules', fromlist=['*']).__dict__)
|
||||||
from direct.extensions_native import HTTPChannel_extensions
|
|
||||||
from direct.extensions_native import Mat3_extensions
|
|
||||||
from direct.extensions_native import VBase3_extensions
|
|
||||||
from direct.extensions_native import VBase4_extensions
|
|
||||||
from direct.extensions_native import NodePath_extensions
|
|
||||||
|
|
||||||
|
|
||||||
from panda3d.core import loadPrcFile
|
from panda3d.core import loadPrcFile
|
||||||
|
|
||||||
|
if not os.path.exists('user/'):
|
||||||
|
os.mkdir('user/')
|
||||||
|
|
||||||
|
|
||||||
if __debug__:
|
if __debug__:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue