Poodletooth-iLand/toontown/toonbase/ClientStartDist.py

41 lines
1.3 KiB
Python
Raw Normal View History

2015-03-03 22:10:12 +00:00
#!/usr/bin/env python2
# This is the "main" module that will start a production copy of
2015-03-10 22:36:03 +00:00
# Toontown United.
2015-03-03 22:10:12 +00:00
# This is a temp patch.
2015-03-10 22:36:03 +00:00
# It should really be done by the runtime (e.g. united.exe):
2015-03-03 22:10:12 +00:00
import sys
sys.path = ['.']
# Replace some modules that do exec:
import collections
collections.namedtuple = lambda *x: tuple
# This is included in the package by the prepare_client script. It contains the
# PRC file data, and (stripped) DC file:
import game_data
import __builtin__
# Load all of the packaged PRC config page(s):
from pandac.PandaModules import *
for i, config in enumerate(game_data.CONFIG):
name = 'GameData config page #' + str(i)
loadPrcFileData(name, config)
# The VirtualFileSystem, which has already initialized, doesn't see the mount
# directives in the config(s) yet. We have to force it to load them manually:
vfs = VirtualFileSystem.getGlobalPtr()
mounts = ConfigVariableList('vfs-mount')
for mount in mounts:
mountFile, mountPoint = (mount.split(' ', 2) + [None, None, None])[:2]
mountFile = Filename(mountFile)
mountFile.makeAbsolute()
mountPoint = Filename(mountPoint)
vfs.mount(mountFile, mountPoint, 0)
# Next, let's get the DC stream:
__builtin__.dcStream = StringStream(game_data.DC)
# Finally, start the game:
import toontown.toonbase.ClientStart