Merge branch 'develop' into friends

This commit is contained in:
John Cote 2021-09-17 20:47:59 -04:00
commit baa857cfcc
15 changed files with 198 additions and 8 deletions

3
.gitignore vendored
View File

@ -12,6 +12,9 @@ whitelist/
.idea
venv/
*.json
!win32/.vscode/tasks.json
!linux/.vscode/tasks.json
!darwin/.vscode/tasks.json
*.buildings
*.trackRecords
PPYTHON_PATH

View File

@ -19,7 +19,7 @@ If you install Panda3D outside the default directory (or use the x86 installer),
## macOS 10.9+
[Panda3D Wheel for macOS 10.9+ (Python3.9, x86_64)](https://drive.google.com/file/d/1_6WJxrkNfwisK5pe5ubJJy1psEp0IIft/view?usp=sharing)
Installing the provided Panda3D wheel requires Python 3.9, which is not installed on your system by default whatsoever. We recommand installing Python 3.9 through [Homebrew](https://brew.sh/) (Make sure that the xcode command line tools are installed first `xcode-select --install`):
Installing the provided Panda3D wheel requires Python 3.9, which is not installed on your system by default whatsoever. We recommend installing Python 3.9 through [Homebrew](https://brew.sh/) (Make sure that the xcode command line tools are installed first `xcode-select --install`):
```shell
$ brew install python@3.9
```
@ -37,12 +37,12 @@ To start the server and run the game locally, go to your platform directory (`wi
`Astron Server -> UberDOG (UD) Server -> AI (District) Server -> Game Client`
Be sure to wait till the servers have finished booting before starting the next. If everything's done correctly, you should be able to make your toon and play the game! There is no support for Magic Words (commands) yet, [but it is currently in the works!](https://github.com/open-toontown/open-toontown/projects/1)
Be sure to wait till the servers have finished booting before starting the next. If done correctly, you should be able to make your toon and play the game! There is no support for Magic Words (commands) yet, [but it is currently in the works!](https://github.com/open-toontown/open-toontown/projects/1)
# Contributing
Submitting issues and Pull Requests are encouraged and welcome.
How you commit changes is your choice, but when committing, please include what you did as well as a basic description, just so we know exactly what you did. Here are some examples:
How you commit changes is your choice, but please include what you did and a basic description so that we know exactly what was modified. Here are some examples:
* `minigames: Fix crash when entering the trolley`
* `racing: Fix possible race condition when two racers tied`

47
darwin/.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,47 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Darwin - Start Game",
"type": "shell",
"command": "./start-game.sh",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Darwin - Start AI Server",
"type": "shell",
"command": "./start-ai-server.sh",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Darwin - Start Astron Server",
"type": "shell",
"command": "./start-astron-server.sh",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Darwin - Start UberDOG Server",
"type": "shell",
"command": "./start-uberdog-server.sh",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
]
}

View File

@ -96,3 +96,4 @@ early-event-sphere 1
accept-clock-skew 1
text-minfilter linear_mipmap_linear
gc-save-all 0
server-data-folder data

47
linux/.vscode/tasks.json vendored Executable file
View File

@ -0,0 +1,47 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Linux - Start Game",
"type": "shell",
"command": "./start-game.sh",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Linux - Start AI Server",
"type": "shell",
"command": "./start-ai-server.sh",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Linux - Start Astron Server",
"type": "shell",
"command": "./start-astron-server.sh",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Linux - Start UberDOG Server",
"type": "shell",
"command": "./start-uberdog-server.sh",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
]
}

0
linux/start-ai-server.sh Normal file → Executable file
View File

0
linux/start-astron-server.sh Normal file → Executable file
View File

0
linux/start-game.sh Normal file → Executable file
View File

0
linux/start-uberdog-server.sh Normal file → Executable file
View File

View File

@ -50,6 +50,7 @@ from toontown.suit.SuitInvasionManagerAI import SuitInvasionManagerAI
from toontown.toon import NPCToons
from toontown.toonbase import ToontownGlobals
from toontown.uberdog.DistributedInGameNewsMgrAI import DistributedInGameNewsMgrAI
import os
class ToontownAIRepository(ToontownInternalRepository):
@ -61,6 +62,9 @@ class ToontownAIRepository(ToontownInternalRepository):
self.doLiveUpdates = config.GetBool('want-live-updates', True)
self.wantCogdominiums = config.GetBool('want-cogdominiums', True)
self.useAllMinigames = config.GetBool('want-all-minigames', True)
self.dataFolder = config.GetString('server-data-folder', '')
if self.dataFolder:
self.dataFolder = self.dataFolder + '/'
self.districtId = None
self.district = None
self.districtStats = None
@ -111,6 +115,9 @@ class ToontownAIRepository(ToontownInternalRepository):
self.notify.info('Declaring ownership...')
self.district.setAI(self.ourChannel)
# Setup necessary files and things.
self.setupFiles()
# Create our local objects.
self.notify.info('Creating local objects...')
self.createLocals()
@ -505,3 +512,7 @@ class ToontownAIRepository(ToontownInternalRepository):
"""
if __astron__:
self.toontownFriendsManager.sendRequestSecret(requesterId)
def setupFiles(self):
if not os.path.exists(self.dataFolder):
os.mkdir(self.dataFolder)

View File

@ -11,7 +11,6 @@ import time, random
class DistributedBuildingMgrAI:
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedBuildingMgrAI')
serverDatafolder = simbase.config.GetString('server-data-folder', '')
def __init__(self, air, branchID, dnaStore, trophyMgr):
self.branchID = branchID
@ -231,7 +230,7 @@ class DistributedBuildingMgrAI:
return building
def getFileName(self):
f = '%s%s_%d_buildings.json' % (self.serverDatafolder, self.shard, self.branchID)
f = '%s%s_%d_buildings.json' % (self.air.dataFolder, self.shard, self.branchID)
return f
def saveTo(self, file):

View File

@ -9,7 +9,6 @@ import os, pickle
class RaceManagerAI(DirectObject.DirectObject):
notify = DirectNotifyGlobal.directNotify.newCategory('RaceManagerAI')
serverDataFolder = simbase.config.GetString('server-data-folder', '')
def __init__(self, air):
DirectObject.DirectObject.__init__(self)
@ -620,7 +619,7 @@ class RaceManagerAI(DirectObject.DirectObject):
self.notify.warning(str(sys.exc_info()[1]))
def getFilename(self):
return '%s%s.trackRecords' % (self.serverDataFolder, self.shard)
return '%s%s.trackRecords' % (self.air.dataFolder, self.shard)
def loadRecords(self):
try:

View File

@ -633,7 +633,7 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
if oldestAge > timeout:
self.notify.info('Street %d has %d buildings; reclaiming %0.2f-hour-old building.' % (self.zoneId, len(suitBuildings), oldestAge / 3600.0))
oldest.b_setVictorList([0, 0, 0, 0])
oldest.updateSavedBy(None)
oldest.updateSavedBy([])
oldest.toonTakeOver()
self.__waitForNextUpkeep()
return Task.done

36
vscode.code-workspace Normal file
View File

@ -0,0 +1,36 @@
{
"folders": [
{
"name": "Source",
"path": "."
},
{
"name": "Windows Scripts",
"path": "win32"
},
{
"name": "Linux Scripts",
"path": "linux"
},
{
"name": "Darwin Scripts",
"path": "darwin"
}
],
"settings": {
"files.exclude": {
"**/__pycache__": true,
"**/.idea": true,
"**/.pyc,**/*.pyo,**/*.pyd": true,
"**/*_buildings.json": true,
"**/darwin": true,
"**/errorCode": true,
"**/linux": true,
"**/news": true,
"**/resources": true,
"**/sign": true,
"**/whitelist": true,
"**/win32": true
}
}
}

47
win32/.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,47 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Windows - Start Game",
"type": "shell",
"command": "./start_game.bat",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Windows - Start AI Server",
"type": "shell",
"command": "./start_ai_server.bat",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Windows - Start Astron Server",
"type": "shell",
"command": "./start_astron_server.bat",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Windows - Start UberDOG Server",
"type": "shell",
"command": "./start_uberdog_server.bat",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
]
}