Merge branch 'master' into feature/dan

This commit is contained in:
John 2015-08-31 10:31:12 +03:00
commit 88888c3457
14 changed files with 5 additions and 386 deletions

2
.gitignore vendored
View file

@ -24,5 +24,3 @@ dependencies/config/local.prc
bson bson
gridfs gridfs
pymongo pymongo
Toon Bot
DNS

2
.gitmodules vendored
View file

@ -1,6 +1,6 @@
[submodule "resources"] [submodule "resources"]
path = resources path = resources
url=https://github.com/ToontownStride1/resources url=https://github.com/Toontown-Stride/resources
[submodule "build/nirai/src"] [submodule "build/nirai/src"]
path = build/nirai/src path = build/nirai/src
url = https://github.com/nirai-compiler/src url = https://github.com/nirai-compiler/src

Binary file not shown.

View file

@ -25,8 +25,6 @@ accountdb-type developer
shard-low-pop 50 shard-low-pop 50
shard-mid-pop 100 shard-mid-pop 100
game-type developer
# RPC: # RPC:
want-rpc-server #f want-rpc-server #f
rpc-server-endpoint http://localhost:8080/ rpc-server-endpoint http://localhost:8080/

View file

@ -1,36 +0,0 @@
This deployment folder contains files that describe how a release of TTSride 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 TTSride. It contains the version of astron to use as well as the version of Panda3D to use as well as the libpandadna version 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 ttstride-beta-dev-gabcdef0).
When we deploy a release to prod, we push a git tag named after the version to the repository (i.e. ttstride-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>
-----

View file

@ -1,8 +0,0 @@
{
"__fyi__": "If you use anything other than the first 7 characters of the git hash, you just broke everything",
"astron": "696a6c4",
"panda3d": "b924139",
"libpandadna": "a0047ce",
"version-prefix": "stride-beta-",
"server-resources": ["pdna", "txt", "dat", "bam", "ttf"]
}

View file

@ -1,108 +0,0 @@
# 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 [Beta]
server-version SERVER_VERSION_HERE
video-library-name p3ffmpeg
want-dev #f
preload-avatars #t
game-type remote
# Graphics:
aux-display pandagl
aux-display pandadx9
aux-display p3tinydisplay
# Textures:
texture-anisotropic-degree 16
server-timezone EST/EDT/-5
# Resources settings
model-path /
model-cache-models #f
model-cache-textures #f
vfs-mount resources/default/phase_3.mf /
vfs-mount resources/default/phase_3.5.mf /
vfs-mount resources/default/phase_4.mf /
vfs-mount resources/default/phase_5.mf /
vfs-mount resources/default/phase_5.5.mf /
vfs-mount resources/default/phase_6.mf /
vfs-mount resources/default/phase_7.mf /
vfs-mount resources/default/phase_8.mf /
vfs-mount resources/default/phase_9.mf /
vfs-mount resources/default/phase_10.mf /
vfs-mount resources/default/phase_11.mf /
vfs-mount resources/default/phase_12.mf /
vfs-mount resources/default/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-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 #t
want-language-selection #t
estate-day-night #f
want-mat-all-tailors #t
# Temporary:
smooth-lag 0.4
want-old-fireworks #t
# Developer options:
want-dev #f
want-pstats 0
# Chat:
want-whitelist #f
want-sequence-list #f
want-emblems #f
cogdo-want-barrel-room #f
#<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
# Core features:
want-lawbot-cogdo #f
# Crates:
dont-destroy-crate #t
get-key-reward-always #t
get-crate-reward-always #t
#</dev>
#<prod>
dont-destroy-crate #f
get-key-reward-always #f
get-crate-reward-always #f
want-lawbot-cogdo #f
#</prod>

View file

@ -1,50 +0,0 @@
# 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-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 #t
want-language-selection #t
estate-day-night #f
want-mat-all-tailors #t
is-server #t
# Developer options:
show-population #t
want-instant-parties #t
want-instant-delivery #t
cogdo-pop-factor 1.5
cogdo-ratio 0.5
default-directnotify-level info
# Crates:
dont-destroy-crate #t
get-key-reward-always #t
get-crate-reward-always #t
want-lawbot-cogdo #f
server-timezone EST/EDT/-5
want-emblems #f
cogdo-want-barrel-room #f
# Chat Settings
want-whitelist #f
want-sequence-list #f

View file

@ -1,72 +0,0 @@
import __builtin__
__builtin__.process = 'ai'
# Temporary hack patch:
__builtin__.__dict__.update(__import__('pandac.PandaModules', fromlist=['*']).__dict__)
from direct.extensions_native import HTTPChannel_extensions
import argparse, gc, os
# Panda3D 1.10.0 is 63.
gc.disable()
parser = argparse.ArgumentParser()
parser.add_argument('--base-channel', help='The base channel that the server may use.')
parser.add_argument('--max-channels', help='The number of channels the server may use.')
parser.add_argument('--stateserver', help="The control channel of this AI's designated State Server.")
parser.add_argument('--district-name', help="What this AI Server's district will be named.")
parser.add_argument('--astron-ip', help="The IP address of the Astron Message Director to connect to.")
parser.add_argument('--eventlogger-ip', help="The IP address of the Astron Event Logger to log to.")
parser.add_argument('config', nargs='*', default=['dependencies/config/general.prc', 'dependencies/config/release/dev.prc'], help="PRC file(s) to load.")
args = parser.parse_args()
for prc in args.config:
loadPrcFile(prc)
if os.path.isfile('dependencies/config/local.prc'):
loadPrcFile('dependencies/config/local.prc')
localconfig = ''
if args.base_channel: localconfig += 'air-base-channel %s\n' % args.base_channel
if args.max_channels: localconfig += 'air-channel-allocation %s\n' % args.max_channels
if args.stateserver: localconfig += 'air-stateserver %s\n' % args.stateserver
if args.district_name: localconfig += 'district-name %s\n' % args.district_name
if args.astron_ip: localconfig += 'air-connect %s\n' % args.astron_ip
if args.eventlogger_ip: localconfig += 'eventlog-host %s\n' % args.eventlogger_ip
loadPrcFileData('Command-line', localconfig)
from otp.ai.AIBaseGlobal import *
from toontown.ai.ToontownAIRepository import ToontownAIRepository
simbase.air = ToontownAIRepository(config.GetInt('air-base-channel', 401000000),
config.GetInt('air-stateserver', 4002),
config.GetString('district-name', 'Devhaven'))
host = config.GetString('air-connect', '127.0.0.1')
port = 7100
if ':' in host:
host, port = host.split(':', 1)
port = int(port)
simbase.air.connect(host, port)
gc.enable()
isServer = config.GetBool('is-server', False)
try:
run()
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

View file

@ -1,70 +0,0 @@
import __builtin__
__builtin__.process = 'uberdog'
# Temporary hack patch:
__builtin__.__dict__.update(__import__('pandac.PandaModules', fromlist=['*']).__dict__)
from direct.extensions_native import HTTPChannel_extensions
import argparse, os
parser = argparse.ArgumentParser()
parser.add_argument('--base-channel', help='The base channel that the server may use.')
parser.add_argument('--max-channels', help='The number of channels the server may use.')
parser.add_argument('--stateserver', help="The control channel of this UD's designated State Server.")
parser.add_argument('--astron-ip', help="The IP address of the Astron Message Director to connect to.")
parser.add_argument('--eventlogger-ip', help="The IP address of the Astron Event Logger to log to.")
parser.add_argument('config', nargs='*', default=['dependencies/config/general.prc', 'dependencies/config/release/dev.prc'], help="PRC file(s) to load.")
args = parser.parse_args()
for prc in args.config:
loadPrcFile(prc)
if os.path.isfile('dependencies/config/local.prc'):
loadPrcFile('dependencies/config/local.prc')
localconfig = ''
if args.base_channel:
localconfig += 'air-base-channel %s\n' % args.base_channel
if args.max_channels:
localconfig += 'air-channel-allocation %s\n' % args.max_channels
if args.stateserver:
localconfig += 'air-stateserver %s\n' % args.stateserver
if args.astron_ip:
localconfig += 'air-connect %s\n' % args.astron_ip
if args.eventlogger_ip:
localconfig += 'eventlog-host %s\n' % args.eventlogger_ip
loadPrcFileData('Command-line', localconfig)
from otp.ai.AIBaseGlobal import *
from toontown.uberdog.ToontownUberRepository import ToontownUberRepository
simbase.air = ToontownUberRepository(config.GetInt('air-base-channel', 400000000),
config.GetInt('air-stateserver', 4002))
host = config.GetString('air-connect', '127.0.0.1')
port = 7100
if ':' in host:
host, port = host.split(':', 1)
port = int(port)
simbase.air.connect(host, port)
isServer = config.GetBool('is-server', False)
if isServer:
import datetime
try:
run()
except SystemExit:
raise
except Exception:
info = describeException()
simbase.air.writeServerEvent('uberdog-exception', simbase.air.getAvatarIdFromSender(), simbase.air.getAccountIdFromSender(), info)
if isServer:
with open(config.GetString('ud-crash-log-name', '/opt/var/log/Uberdog-crash-%s.txt' % (datetime.datetime.now())), 'w+') as file:
file.write(info + "\n")
raise

View file

@ -1,20 +0,0 @@
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

View file

@ -469,7 +469,7 @@ class OTPClientRepository(ClientRepositoryBase):
self.handler = self.handleMessageType self.handler = self.handleMessageType
messenger.send('connectionIssue') messenger.send('connectionIssue')
url = self.serverList[0] url = self.serverList[0]
self.notify.warning('Failed to connect to %s (%s %s). Notifying user.' % (config.GetString('TTS_GAMESERVER'), statusCode, statusString)) self.notify.warning('Failed to connect to %s (%s %s). Notifying user.' % (url.cStr(), statusCode, statusString))
dialogClass = OTPGlobals.getGlobalDialogClass() dialogClass = OTPGlobals.getGlobalDialogClass()
self.failedToConnectBox = dialogClass(message=OTPLocalizer.CRNoConnectTryAgain % (url.getServer(), url.getPort()), doneEvent='failedToConnectAck', text_wordwrap=18, style=OTPDialog.TwoChoice) self.failedToConnectBox = dialogClass(message=OTPLocalizer.CRNoConnectTryAgain % (url.getServer(), url.getPort()), doneEvent='failedToConnectAck', text_wordwrap=18, style=OTPDialog.TwoChoice)
self.failedToConnectBox.show() self.failedToConnectBox.show()

@ -1 +1 @@
Subproject commit af09e769b860512c03de6fff4a585e96d674e89b Subproject commit 4e2986832f047ae4e8f6256d187a6d111a526f5d

View file

@ -46,20 +46,7 @@ class TTSLauncher:
return self.getValue('TTS_PLAYCOOKIE') return self.getValue('TTS_PLAYCOOKIE')
def getGameServer(self): def getGameServer(self):
if config.GetString('game-type', 'developer') != 'remote':
return self.getValue('TTS_GAMESERVER') return self.getValue('TTS_GAMESERVER')
return self.getServer(self.getValue('TTS_GAMESERVER'))
def getServer(self, gameserver):
import DNS
DNS.DiscoverNameServers()
srv_req = DNS.Request(qtype = 'srv')
srv_result = srv_req.req('_toontown._tcp.'+ gameserver)
for result in srv_result.answers:
if result['typename'] == 'SRV':
data = result['data']
return data[3] + ":" + str(data[2])
def getValue(self, key, default = None): def getValue(self, key, default = None):
return os.environ.get(key, default) return os.environ.get(key, default)