mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Add some more things needed for deployment.
This commit is contained in:
parent
06a4913f29
commit
ad206df3e9
11 changed files with 3487 additions and 16 deletions
16
dependencies/config/release/dev.prc
vendored
16
dependencies/config/release/dev.prc
vendored
|
@ -2,7 +2,21 @@
|
|||
distribution dev
|
||||
|
||||
# Art assets:
|
||||
model-path resources/
|
||||
vfs-mount resources/phase_3 /phase_3
|
||||
vfs-mount resources/phase_3.5 /phase_3.5
|
||||
vfs-mount resources/phase_4 /phase_4
|
||||
vfs-mount resources/phase_5 /phase_5
|
||||
vfs-mount resources/phase_5.5 /phase_5.5
|
||||
vfs-mount resources/phase_6 /phase_6
|
||||
vfs-mount resources/phase_7 /phase_7
|
||||
vfs-mount resources/phase_8 /phase_8
|
||||
vfs-mount resources/phase_9 /phase_9
|
||||
vfs-mount resources/phase_10 /phase_10
|
||||
vfs-mount resources/phase_11 /phase_11
|
||||
vfs-mount resources/phase_12 /phase_12
|
||||
vfs-mount resources/phase_13 /phase_13
|
||||
vfs-mount resources/server /server
|
||||
model-path /
|
||||
|
||||
# Server:
|
||||
server-version tts-dev
|
||||
|
|
36
deployment/README.txt
Normal file
36
deployment/README.txt
Normal file
|
@ -0,0 +1,36 @@
|
|||
This deployment folder contains files that describe how a release of TT should be run on the gameservers.
|
||||
|
||||
uberdogs.yml contains the 'uberdogs' section of an astrond.yml. Please keep it updated, or else you'll break prod!
|
||||
|
||||
deploy.json describes a the environment for a release of TT. It contains the version of astron to use as well as the version of Panda3D to use.
|
||||
deploy.json also contains a version prefix. This is used to generate dev version strings on the development server (which are probably something like tts-beta-dev-gabcdef0).
|
||||
When we deploy a release to prod, we push a git tag named after the version to the repository (i.e. TT-alpha-v1.3.7). It is required that the tag's name contain the version prefix specified in deploy.json.
|
||||
The key 'server-resources' maps to a list of file extensions of files in the resources directory that are necessary to be used server-side. We do not package and deploy art assets onto servers.
|
||||
|
||||
Last, server.prc is the configuration file we use for specifying config vars related to gameplay (a variable like want-sbhq should be put in server.prc, while a variable like air-stateserver does not belong here). server.prc is the last portion added to generated configuration files.
|
||||
We also have a tag system to allow certain blocks of configuration to be used only in a certain environment. This allows us to generate releases that behaive differently depending on the environment that they are deployed in. For example:
|
||||
|
||||
-----
|
||||
want-toontowncentral #t
|
||||
#<prod>
|
||||
want-bbhq #f
|
||||
#</prod>
|
||||
|
||||
#<dev>
|
||||
want-bbhq #t
|
||||
#</dev>
|
||||
-----
|
||||
|
||||
In prod, the parsed config file would look like this:
|
||||
|
||||
-----
|
||||
want-toontowncentral #t
|
||||
#<prod>
|
||||
want-bbhq #f
|
||||
#</prod>
|
||||
|
||||
#<dev>
|
||||
##UNUSED SECTION
|
||||
##want-bbhq #t
|
||||
#</dev>
|
||||
-----
|
88
deployment/config/public_client.prc
Normal file
88
deployment/config/public_client.prc
Normal file
|
@ -0,0 +1,88 @@
|
|||
# This is the PRC configuration file for a published TTStride client. Note that only
|
||||
# this file and Panda3D's Confauto.prc are included. Any relevant directives in
|
||||
# Config.prc should be reproduced here.
|
||||
|
||||
# Client settings
|
||||
window-title Toontown Stride
|
||||
server-version SERVER_VERSION_HERE
|
||||
audio-library-name p3openal_audio
|
||||
video-library-name p3ffmpeg
|
||||
want-dev #f
|
||||
preload-avatars #t
|
||||
|
||||
|
||||
# Textures:
|
||||
texture-anisotropic-degree 16
|
||||
|
||||
|
||||
# Resources settings
|
||||
model-path /
|
||||
model-cache-models #f
|
||||
model-cache-textures #f
|
||||
vfs-mount phase_3.mf /
|
||||
vfs-mount phase_3.5.mf /
|
||||
vfs-mount phase_4.mf /
|
||||
vfs-mount phase_5.mf /
|
||||
vfs-mount phase_5.5.mf /
|
||||
vfs-mount phase_6.mf /
|
||||
vfs-mount phase_7.mf /
|
||||
vfs-mount phase_8.mf /
|
||||
vfs-mount phase_9.mf /
|
||||
vfs-mount phase_10.mf /
|
||||
vfs-mount phase_11.mf /
|
||||
vfs-mount phase_12.mf /
|
||||
vfs-mount phase_13.mf /
|
||||
default-model-extension .bam
|
||||
|
||||
|
||||
# DC files are NOT configured.
|
||||
# They're wrapped up into the code automatically.
|
||||
|
||||
|
||||
# Core features:
|
||||
want-pets #t
|
||||
want-parties #f
|
||||
want-cogdominiums #t
|
||||
want-lawbot-cogdo #t
|
||||
want-anim-props #t
|
||||
want-game-tables #t
|
||||
want-find-four #t
|
||||
want-chinese-checkers #t
|
||||
want-checkers #t
|
||||
want-house-types #t
|
||||
want-gifting #t
|
||||
want-top-toons #f
|
||||
want-language-selection #t
|
||||
estate-day-night #t
|
||||
want-mat-all-tailors #t
|
||||
|
||||
|
||||
# Temporary:
|
||||
smooth-lag 0.4
|
||||
want-old-fireworks #t
|
||||
|
||||
|
||||
# Developer options:
|
||||
want-dev #f
|
||||
want-pstats 0
|
||||
|
||||
|
||||
# Crates:
|
||||
dont-destroy-crate #t
|
||||
get-key-reward-always #t
|
||||
get-crate-reward-always #t
|
||||
|
||||
|
||||
# Chat:
|
||||
want-whitelist #t
|
||||
|
||||
|
||||
#<dev>
|
||||
show-total-population #t
|
||||
want-instant-parties #t
|
||||
want-instant-delivery #t
|
||||
cogdo-pop-factor 1.5
|
||||
cogdo-ratio 0.5
|
||||
default-directnotify-level info
|
||||
#</dev>
|
||||
|
3247
deployment/config/stride.dc
Normal file
3247
deployment/config/stride.dc
Normal file
File diff suppressed because it is too large
Load diff
7
deployment/deploy.json
Normal file
7
deployment/deploy.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"__fyi__": "If you use anything other than the first 7 characters of the git hash, you just broke everything",
|
||||
"astron": "6b769e6",
|
||||
"panda3d": "b924139",
|
||||
"version-prefix": "tts-alpha-",
|
||||
"server-resources": ["pdna", "dna", "xml", "txt", "dat", "bam", "tff"]
|
||||
}
|
32
deployment/server.prc
Normal file
32
deployment/server.prc
Normal file
|
@ -0,0 +1,32 @@
|
|||
# While dev.prc contains settings for both the dev server and client, the
|
||||
# live server separates these. The client settings go in config/public_client.prc
|
||||
# and server settings go here. Don't forget to update both if necessary.
|
||||
|
||||
# Server settings
|
||||
want-dev #f
|
||||
want-cheesy-expirations #t
|
||||
cogsuit-hack-prevent #t
|
||||
|
||||
|
||||
# Core features:
|
||||
want-pets #t
|
||||
want-parties #f
|
||||
want-cogdominiums #t
|
||||
want-lawbot-cogdo #t
|
||||
want-anim-props #t
|
||||
want-game-tables #t
|
||||
want-find-four #t
|
||||
want-chinese-checkers #t
|
||||
want-checkers #t
|
||||
want-house-types #t
|
||||
want-gifting #t
|
||||
want-top-toons #f
|
||||
want-language-selection #t
|
||||
estate-day-night #t
|
||||
want-mat-all-tailors #t
|
||||
is-server #t
|
||||
|
||||
|
||||
# Chat Settings
|
||||
want-whitelist #t
|
||||
want-sequence-list #t
|
20
deployment/uberdogs.yml
Normal file
20
deployment/uberdogs.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
uberdogs:
|
||||
- class: ClientServicesManager
|
||||
id: 4665
|
||||
anonymous: true
|
||||
|
||||
- class: ChatAgent
|
||||
id: 4681
|
||||
anonymous: false
|
||||
|
||||
- class: FriendManager
|
||||
id: 4501
|
||||
anonymous: false
|
||||
|
||||
- class: TTSFriendsManager
|
||||
id: 4666
|
||||
anonymous: false
|
||||
|
||||
- class: GlobalPartyManager
|
||||
id: 4477
|
||||
anonymous: false
|
|
@ -21,3 +21,12 @@ def inspect(anObject):
|
|||
|
||||
__builtins__['inspect'] = inspect
|
||||
taskMgr.finalInit()
|
||||
|
||||
# The VirtualFileSystem, which has already initialized, doesn't see the mount
|
||||
# directives in the config(s) yet. We have to force it to load those manually:
|
||||
from panda3d.core import VirtualFileSystem, ConfigVariableList, Filename
|
||||
vfs = VirtualFileSystem.getGlobalPtr()
|
||||
mounts = ConfigVariableList('vfs-mount')
|
||||
for mount in mounts:
|
||||
mountfile, mountpoint = (mount.split(' ', 2) + [None, None, None])[:2]
|
||||
vfs.mount(Filename(mountfile), Filename(mountpoint), 0)
|
||||
|
|
|
@ -62,6 +62,8 @@ if ':' in host:
|
|||
port = int(port)
|
||||
simbase.air.connect(host, port)
|
||||
|
||||
isServer = config.GetBool('is-server', False)
|
||||
|
||||
try:
|
||||
run()
|
||||
gc.enable()
|
||||
|
@ -69,5 +71,12 @@ except SystemExit:
|
|||
raise
|
||||
except Exception:
|
||||
info = describeException()
|
||||
|
||||
simbase.air.writeServerEvent('ai-exception', avId=simbase.air.getAvatarIdFromSender(), accId=simbase.air.getAccountIdFromSender(), exception=info)
|
||||
|
||||
if isServer:
|
||||
import datetime
|
||||
with open(config.GetString('ai-crash-log-name', '/opt/var/log/%s-ai-crash-%s.txt' % (config.GetString('district-name', 'Devhaven'), datetime.datetime.now())), 'w+') as file:
|
||||
file.write(info + "\n")
|
||||
|
||||
raise
|
||||
|
|
|
@ -199,7 +199,7 @@ class DistributedBuildingMgrAI:
|
|||
else:
|
||||
street = {'district': self.air.districtId, 'branch': self.branchID}
|
||||
try:
|
||||
self.air.mongodb.toontown.blockinfo.update(street, {'$setOnInsert': street, '$set': {'buildings': backups}}, upsert=True)
|
||||
self.air.dbGlobalCursor.blockInfo.update(street, {'$setOnInsert': street, '$set': {'buildings': backups}}, upsert=True)
|
||||
except AutoReconnect:
|
||||
taskMgr.doMethodLater(config.GetInt('mongodb-retry-time', 2), self.save, 'retrySave', extraArgs=[])
|
||||
|
||||
|
@ -208,10 +208,10 @@ class DistributedBuildingMgrAI:
|
|||
if not self.air.dbConn:
|
||||
blocks = simbase.backups.load('block-info', (self.air.districtId, self.branchId), default={})
|
||||
return blocks
|
||||
self.air.mongodb.toontown.blockinfo.ensure_index([('district', 1), ('branch', 1)])
|
||||
self.air.dbGlobalCursor.blockInfo.ensure_index([('district', 1), ('branch', 1)])
|
||||
street = {'district': self.air.districtId, 'branch': self.branchID}
|
||||
try:
|
||||
doc = self.air.mongodb.toontown.blockinfo.find_one(street)
|
||||
doc = self.air.dbGlobalCursor.blockInfo.find_one(street)
|
||||
except AutoReconnect:
|
||||
return blocks
|
||||
if not doc:
|
||||
|
|
|
@ -2,6 +2,9 @@ from direct.distributed.AstronInternalRepository import AstronInternalRepository
|
|||
from otp.distributed.OtpDoGlobals import *
|
||||
from toontown.distributed.ToontownNetMessengerAI import ToontownNetMessengerAI
|
||||
from direct.distributed.PyDatagram import PyDatagram
|
||||
mongodb_url = ConfigVariableString('mongodb-url', 'mongodb://localhost', 'Specifies the URL of the MongoDB server that' ' stores all gameserver data.')
|
||||
mongodb_replicaset = ConfigVariableString('mongodb-replicaset', '', 'Specifies the replica set of the gameserver data DB.')
|
||||
|
||||
import traceback
|
||||
import sys
|
||||
|
||||
|
@ -14,33 +17,40 @@ class ToontownInternalRepository(AstronInternalRepository):
|
|||
AstronInternalRepository.__init__(
|
||||
self, baseChannel, serverId=serverId, dcFileNames=dcFileNames,
|
||||
dcSuffix=dcSuffix, connectMethod=connectMethod, threadedNet=threadedNet)
|
||||
|
||||
|
||||
def handleConnected(self):
|
||||
self.__messenger = ToontownNetMessengerAI(self)
|
||||
if config.GetBool('want-mongo', False):
|
||||
import pymongo
|
||||
self.dbConn = pymongo.MongoClient(config.GetString('mongodb-url', 'localhost'))
|
||||
import pymongo, urlparse
|
||||
mongourl = mongodb_url.getValue()
|
||||
replicaset = mongodb_replicaset.getValue()
|
||||
db = (urlparse.urlparse(mongourl).path or '/Astron_Dev')[1:]
|
||||
if replicaset:
|
||||
self.mongo = pymongo.MongoClient(mongourl, replicaset=replicaset)
|
||||
else:
|
||||
self.mongo = pymongo.MongoClient(mongourl)
|
||||
self.dbConn = self.mongo[db]
|
||||
self.dbGlobalCursor = self.dbConn.toontownstride
|
||||
self.dbCursor = self.dbGlobalCursor['air-%d' % self.ourChannel]
|
||||
else:
|
||||
self.dbConn = None
|
||||
self.dbGlobalCursor = None
|
||||
self.dbCursor = None
|
||||
|
||||
|
||||
def sendNetEvent(self, message, sentArgs=[]):
|
||||
self.__messenger.send(message, sentArgs)
|
||||
|
||||
|
||||
def addExitEvent(self, message):
|
||||
dg = self.__messenger.prepare(message)
|
||||
self.addPostRemove(dg)
|
||||
|
||||
|
||||
def handleDatagram(self, di):
|
||||
msgType = self.getMsgType()
|
||||
|
||||
|
||||
if msgType == self.__messenger.msgType:
|
||||
self.__messenger.handle(msgType, di)
|
||||
return
|
||||
|
||||
|
||||
AstronInternalRepository.handleDatagram(self, di)
|
||||
|
||||
def getAvatarIdFromSender(self):
|
||||
|
@ -58,10 +68,9 @@ class ToontownInternalRepository(AstronInternalRepository):
|
|||
def readerPollOnce(self):
|
||||
try:
|
||||
return AstronInternalRepository.readerPollOnce(self)
|
||||
|
||||
except SystemExit, KeyboardInterrupt:
|
||||
raise
|
||||
|
||||
|
||||
except Exception as e:
|
||||
if self.getAvatarIdFromSender() > 100000000:
|
||||
dg = PyDatagram()
|
||||
|
@ -69,10 +78,10 @@ class ToontownInternalRepository(AstronInternalRepository):
|
|||
dg.addUint16(166)
|
||||
dg.addString('You were disconnected to prevent a district reset.')
|
||||
self.send(dg)
|
||||
|
||||
|
||||
self.writeServerEvent('INTERNAL-EXCEPTION', self.getAvatarIdFromSender(), self.getAccountIdFromSender(), repr(e), traceback.format_exc())
|
||||
self.notify.warning('INTERNAL-EXCEPTION: %s (%s)' % (repr(e), self.getAvatarIdFromSender()))
|
||||
print traceback.format_exc()
|
||||
sys.exc_clear()
|
||||
|
||||
|
||||
return 1
|
||||
|
|
Loading…
Reference in a new issue