diff --git a/.gitignore b/.gitignore index e246124..dbb748b 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ whitelist/ venv/ *.buildings *.trackRecords +PPYTHON_PATH diff --git a/PPYTHON_PATH b/PPYTHON_PATH new file mode 100644 index 0000000..42821a1 --- /dev/null +++ b/PPYTHON_PATH @@ -0,0 +1 @@ +"C:\Panda3D-1.11.0-x64\python\ppython.exe" diff --git a/astron/.gitignore b/astron/.gitignore deleted file mode 100644 index e660fd9..0000000 --- a/astron/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bin/ diff --git a/astron/win32/astrond.exe b/astron/win32/astrond.exe new file mode 100644 index 0000000..cee946e Binary files /dev/null and b/astron/win32/astrond.exe differ diff --git a/astron/win32/bsoncxx.dll b/astron/win32/bsoncxx.dll new file mode 100644 index 0000000..54f7428 Binary files /dev/null and b/astron/win32/bsoncxx.dll differ diff --git a/astron/win32/concrt140.dll b/astron/win32/concrt140.dll new file mode 100644 index 0000000..9c69a54 Binary files /dev/null and b/astron/win32/concrt140.dll differ diff --git a/astron/win32/libbson-1.0.dll b/astron/win32/libbson-1.0.dll new file mode 100644 index 0000000..e944230 Binary files /dev/null and b/astron/win32/libbson-1.0.dll differ diff --git a/astron/win32/libmongoc-1.0.dll b/astron/win32/libmongoc-1.0.dll new file mode 100644 index 0000000..fa72a40 Binary files /dev/null and b/astron/win32/libmongoc-1.0.dll differ diff --git a/astron/win32/libuv.dll b/astron/win32/libuv.dll new file mode 100644 index 0000000..17fb703 Binary files /dev/null and b/astron/win32/libuv.dll differ diff --git a/astron/win32/mongocxx.dll b/astron/win32/mongocxx.dll new file mode 100644 index 0000000..5627e45 Binary files /dev/null and b/astron/win32/mongocxx.dll differ diff --git a/astron/win32/msvcp140.dll b/astron/win32/msvcp140.dll new file mode 100644 index 0000000..e4ef4bc Binary files /dev/null and b/astron/win32/msvcp140.dll differ diff --git a/astron/win32/vcruntime140.dll b/astron/win32/vcruntime140.dll new file mode 100644 index 0000000..fa9a49d Binary files /dev/null and b/astron/win32/vcruntime140.dll differ diff --git a/linux/start-ai-server.sh b/linux/start-ai-server.sh new file mode 100644 index 0000000..f27e736 --- /dev/null +++ b/linux/start-ai-server.sh @@ -0,0 +1,14 @@ +#!/bin/sh +cd .. + +BASE_CHANNEL=401000000 +MAX_CHANNELS=999999 +STATE_SERVER=4002 +MESSAGE_DIRECTOR_IP="127.0.0.1:7199" +EVENT_LOGGER_IP="127.0.0.1:7197" +DISTRICT_NAME="Toon Valley" + +python3 -m toontown.ai.AIStart --base-channel ${BASE_CHANNEL} \ + --max-channels ${MAX_CHANNELS} --stateserver ${STATE_SERVER} \ + --messagedirector-ip ${MESSAGE_DIRECTOR_IP} \ + --eventlogger-ip ${EVENT_LOGGER_IP} --district-name "$DISTRICT_NAME" diff --git a/linux/start-astron-server.sh b/linux/start-astron-server.sh new file mode 100644 index 0000000..4aafd49 --- /dev/null +++ b/linux/start-astron-server.sh @@ -0,0 +1,6 @@ +#!/bin/sh +cd ../astron/linux + +# This assumes that your astrond build is located in the +# "astron/linux" directory. +./astrond --loglevel info ../config/astrond.yml diff --git a/linux/start-game.sh b/linux/start-game.sh new file mode 100644 index 0000000..2c30ba5 --- /dev/null +++ b/linux/start-game.sh @@ -0,0 +1,8 @@ +#!/bin/sh +cd .. + +# TODO: Make this actually work, to change token in the meantime, +# change the fake-playtoken variable in etc/Configrc.prc. +export LOGIN_TOKEN=dev + +python3 -m toontown.toonbase.ToontownStart diff --git a/linux/start-uberdog-server.sh b/linux/start-uberdog-server.sh new file mode 100644 index 0000000..e84f0e4 --- /dev/null +++ b/linux/start-uberdog-server.sh @@ -0,0 +1,13 @@ +#!/bin/sh +cd .. + +MAX_CHANNELS=999999 +STATE_SERVER=4002 +MESSAGE_DIRECTOR_IP="127.0.0.1:7199" +EVENT_LOGGER_IP="127.0.0.1:7197" +BASE_CHANNEL=1000000 + +python3 -m toontown.uberdog.UDStart --base-channel ${BASE_CHANNEL} \ + --max-channels ${MAX_CHANNELS} --stateserver ${STATE_SERVER} \ + --messagedirector-ip ${MESSAGE_DIRECTOR_IP} \ + --eventlogger-ip ${EVENT_LOGGER_IP} diff --git a/toontown/ai/AIStart.py b/toontown/ai/AIStart.py index 618d7f3..fc5ea88 100644 --- a/toontown/ai/AIStart.py +++ b/toontown/ai/AIStart.py @@ -1,27 +1,48 @@ +from panda3d.core import * import builtins +import argparse + +parser = argparse.ArgumentParser(description='Open Toontown - AI Server') +parser.add_argument('--base-channel', help='The base channel that the server will use.') +parser.add_argument('--max-channels', help='The number of channels that the server will be able to use.') +parser.add_argument('--stateserver', help='The control channel of this AI\'s designated State Server.') +parser.add_argument('--district-name', help='The name of the district on this AI server.') +parser.add_argument('--messagedirector-ip', + help='The IP address of the Message Director that this AI will connect to.') +parser.add_argument('--eventlogger-ip', help='The IP address of the Astron Event Logger that this AI will log to.') +parser.add_argument('config', nargs='*', default=['etc/Configrc.prc'], + help='PRC file(s) that will be loaded on this AI instance.') +args = parser.parse_args() + +for prc in args.config: + loadPrcFile(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.messagedirector_ip: + localConfig += 'air-connect %s\n' % args.messagedirector_ip +if args.eventlogger_ip: + localConfig += 'eventlog-host %s\n' % args.eventlogger_ip + +loadPrcFileData('AI Args Config', localConfig) + class game: name = 'toontown' process = 'server' builtins.game = game -from panda3d.core import * - -loadPrcFile('etc/Configrc.prc') - from otp.ai.AIBaseGlobal import * from toontown.ai.ToontownAIRepository import ToontownAIRepository -aiConfig = '' -aiConfig += 'air-base-channel %s\n' % 101000000 -aiConfig += 'air-channel-allocation %s\n' % 999999 -aiConfig += 'air-stateserver %s\n' % 4002 -aiConfig += 'district-name %s\n' % 'Toon Valley' -aiConfig += 'air-connect %s\n' % '127.0.0.1:7199' -aiConfig += 'eventlog-host %s\n' % '127.0.0.1:7197' -loadPrcFileData('AI Config', aiConfig) - simbase.air = ToontownAIRepository(config.GetInt('air-base-channel', 1000000), config.GetInt('air-stateserver', 4002), config.GetString('district-name', 'Toon Valley')) host = config.GetString('air-connect', '127.0.0.1:7199') diff --git a/toontown/uberdog/UDStart.py b/toontown/uberdog/UDStart.py index 9192c3e..ccb7d81 100644 --- a/toontown/uberdog/UDStart.py +++ b/toontown/uberdog/UDStart.py @@ -1,5 +1,35 @@ +from panda3d.core import * import builtins +import argparse + +parser = argparse.ArgumentParser(description="Open Toontown - UberDOG Server") +parser.add_argument('--base-channel', help='The base channel that the server will use.') +parser.add_argument('--max-channels', help='The number of channels that the server will be able to use.') +parser.add_argument('--stateserver', help='The control channel of this UberDOG\'s designated State Server.') +parser.add_argument('--messagedirector-ip', + help='The IP address of the Message Director that this UberDOG will connect to.') +parser.add_argument('--eventlogger-ip', help='The IP address of the Astron Event Logger that this UberDOG will log to.') +parser.add_argument('config', nargs='*', default=['etc/Configrc.prc'], + help='PRC file(s) that will be loaded on this UberDOG instance.') +args = parser.parse_args() + +for prc in args.config: + loadPrcFile(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.messagedirector_ip: + localConfig += 'air-connect %s\n' % args.messagedirector_ip +if args.eventlogger_ip: + localConfig += 'eventlog-host %s\n' % args.eventlogger_ip + +loadPrcFileData('UberDOG Args Config', localConfig) class game: name = 'uberDog' @@ -8,21 +38,11 @@ class game: builtins.game = game -from panda3d.core import * - loadPrcFile('etc/Configrc.prc') from otp.ai.AIBaseGlobal import * from toontown.uberdog.ToontownUDRepository import ToontownUDRepository -udConfig = '' -udConfig += 'air-base-channel %s\n' % 1000000 -udConfig += 'air-channel-allocation %s\n' % 999999 -udConfig += 'air-stateserver %s\n' % 4002 -udConfig += 'air-connect %s\n' % '127.0.0.1:7199' -udConfig += 'eventlog-host %s\n' % '127.0.0.1:7197' -loadPrcFileData('UberDOG Config', udConfig) - simbase.air = ToontownUDRepository(config.GetInt('air-base-channel', 1000000), config.GetInt('air-stateserver', 4002)) host = config.GetString('air-connect', '127.0.0.1:7199') diff --git a/win32/start_ai_server.bat b/win32/start_ai_server.bat new file mode 100644 index 0000000..ad78ecc --- /dev/null +++ b/win32/start_ai_server.bat @@ -0,0 +1,14 @@ +@echo off +title Open Toontown - AI (District) Server +cd.. + +rem Read the contents of PPYTHON_PATH into %PPYTHON_PATH%: +set /P PPYTHON_PATH=