diff --git a/otp/distributed/AccountAI.py b/otp/distributed/AccountAI.py new file mode 100644 index 0000000..1e31caf --- /dev/null +++ b/otp/distributed/AccountAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class AccountAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('AccountAI') diff --git a/otp/distributed/CentralLoggerAI.py b/otp/distributed/CentralLoggerAI.py new file mode 100644 index 0000000..f37d0aa --- /dev/null +++ b/otp/distributed/CentralLoggerAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class CentralLoggerAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('CentralLoggerAI') diff --git a/otp/distributed/DistributedDistrictAI.py b/otp/distributed/DistributedDistrictAI.py new file mode 100644 index 0000000..d3a50ad --- /dev/null +++ b/otp/distributed/DistributedDistrictAI.py @@ -0,0 +1,36 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class DistributedDistrictAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('DistributedDistrictAI') + + def __init__(self, air): + DistributedObjectAI.__init__(self, air) + self.name = '' + self.available = False + + def setName(self, name): + self.name = name + + def d_setName(self, name): + self.sendUpdate('setName', [name]) + + def b_setName(self, name): + self.setName(name) + self.d_setName(name) + + def getName(self): + return self.name + + def setAvailable(self, available): + self.available = available + + def d_setAvailable(self, available): + self.sendUpdate('setAvailable', [available]) + + def b_setAvailable(self, available): + self.setAvailable(available) + self.d_setAvailable(available) + + def getAvailable(self): + return self.available diff --git a/otp/distributed/ObjectServerAI.py b/otp/distributed/ObjectServerAI.py new file mode 100644 index 0000000..bbd9ce1 --- /dev/null +++ b/otp/distributed/ObjectServerAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class ObjectServerAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('ObjectServerAI') diff --git a/otp/friends/GuildManagerAI.py b/otp/friends/GuildManagerAI.py new file mode 100644 index 0000000..fff20ef --- /dev/null +++ b/otp/friends/GuildManagerAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class GuildManagerAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('GuildManagerAI') diff --git a/otp/snapshot/SnapshotDispatcherAI.py b/otp/snapshot/SnapshotDispatcherAI.py new file mode 100644 index 0000000..fc1c402 --- /dev/null +++ b/otp/snapshot/SnapshotDispatcherAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class SnapshotDispatcherAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('SnapshotDispatcherAI') diff --git a/otp/snapshot/SnapshotRendererAI.py b/otp/snapshot/SnapshotRendererAI.py new file mode 100644 index 0000000..e5b2d53 --- /dev/null +++ b/otp/snapshot/SnapshotRendererAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class SnapshotRendererAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('SnapshotRendererAI') diff --git a/otp/uberdog/DistributedChatManagerAI.py b/otp/uberdog/DistributedChatManagerAI.py new file mode 100644 index 0000000..5182697 --- /dev/null +++ b/otp/uberdog/DistributedChatManagerAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class DistributedChatManagerAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('DistributedChatManagerAI') diff --git a/otp/uberdog/OtpAvatarManagerAI.py b/otp/uberdog/OtpAvatarManagerAI.py new file mode 100644 index 0000000..2d77d36 --- /dev/null +++ b/otp/uberdog/OtpAvatarManagerAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class OtpAvatarManagerAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('OtpAvatarManagerAI') diff --git a/otp/web/SettingsMgrAI.py b/otp/web/SettingsMgrAI.py new file mode 100644 index 0000000..afee637 --- /dev/null +++ b/otp/web/SettingsMgrAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class SettingsMgrAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('SettingsMgrAI') diff --git a/toontown/ai/AIStart.py b/toontown/ai/AIStart.py new file mode 100644 index 0000000..07b27ff --- /dev/null +++ b/toontown/ai/AIStart.py @@ -0,0 +1,42 @@ +import __builtin__ + +class game: + name = 'toontown' + process = 'server' + +__builtin__.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') +port = 7199 +if ':' in host: + host, port = host.split(':', 1) + port = int(port) + +simbase.air.connect(host, port) + +try: + run() +except SystemExit: + raise +except Exception: + from otp.otpbase import PythonUtil + print PythonUtil.describeException() + raise diff --git a/toontown/ai/ToontownAIRepository.py b/toontown/ai/ToontownAIRepository.py new file mode 100644 index 0000000..146f86f --- /dev/null +++ b/toontown/ai/ToontownAIRepository.py @@ -0,0 +1,22 @@ +from direct.directnotify import DirectNotifyGlobal +from toontown.distributed.ToontownInternalRepository import ToontownInternalRepository +from toontown.distributed.ToontownDistrictAI import ToontownDistrictAI +from otp.distributed.OtpDoGlobals import * + +class ToontownAIRepository(ToontownInternalRepository): + notify = DirectNotifyGlobal.directNotify.newCategory('ToontownAIRepository') + + def __init__(self, baseChannel, serverId, districtName): + ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='AI') + self.districtName = districtName + self.districtId = None + self.district = None + + def handleConnected(self): + ToontownInternalRepository.handleConnected(self) + + # Generate our district... + self.districtId = self.allocateChannel() + self.district = ToontownDistrictAI(self) + self.district.setName(self.districtName) + self.district.generateWithRequiredAndId(self.districtId, self.getGameDoId(), OTP_ZONE_ID_DISTRICTS) diff --git a/toontown/coderedemption/TTCodeRedemptionMgrAI.py b/toontown/coderedemption/TTCodeRedemptionMgrAI.py new file mode 100644 index 0000000..a47c943 --- /dev/null +++ b/toontown/coderedemption/TTCodeRedemptionMgrAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class TTCodeRedemptionMgrAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('TTCodeRedemptionMgrAI') diff --git a/toontown/distributed/ToontownDistrictAI.py b/toontown/distributed/ToontownDistrictAI.py index 5b3ca54..d9be1a2 100644 --- a/toontown/distributed/ToontownDistrictAI.py +++ b/toontown/distributed/ToontownDistrictAI.py @@ -1,5 +1,22 @@ from direct.directnotify import DirectNotifyGlobal -from direct.distributed.DistributedObjectAI import DistributedObjectAI +from otp.distributed.DistributedDistrictAI import DistributedDistrictAI -class ToontownDistrictAI(DistributedObjectAI): +class ToontownDistrictAI(DistributedDistrictAI): notify = DirectNotifyGlobal.directNotify.newCategory('ToontownDistrictAI') + + def __init__(self, air): + DistributedDistrictAI.__init__(self, air) + self.ahnnLog = False + + def allowAHNNLog(self, ahnnLog): + self.ahnnLog = ahnnLog + + def d_allowAHNNLog(self, ahnnLog): + self.sendUpdate('allowAHNNLog', [ahnnLog]) + + def b_allowAHNNLog(self, ahnnLog): + self.allowAHNNLog(ahnnLog) + self.d_allowAHNNLog(ahnnLog) + + def getAllowAHNNLog(self): + return self.ahnnLog diff --git a/toontown/uberdog/DistributedCpuInfoMgrAI.py b/toontown/uberdog/DistributedCpuInfoMgrAI.py new file mode 100644 index 0000000..b508d3b --- /dev/null +++ b/toontown/uberdog/DistributedCpuInfoMgrAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class DistributedCpuInfoMgrAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('DistributedCpuInfoMgrAI') diff --git a/toontown/uberdog/DistributedDataStoreManagerAI.py b/toontown/uberdog/DistributedDataStoreManagerAI.py new file mode 100644 index 0000000..f0e65ad --- /dev/null +++ b/toontown/uberdog/DistributedDataStoreManagerAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class DistributedDataStoreManagerAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('DistributedDataStoreManagerAI') diff --git a/toontown/uberdog/DistributedDeliveryManagerAI.py b/toontown/uberdog/DistributedDeliveryManagerAI.py new file mode 100644 index 0000000..fa164f6 --- /dev/null +++ b/toontown/uberdog/DistributedDeliveryManagerAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class DistributedDeliveryManagerAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('DistributedDeliveryManagerAI') diff --git a/toontown/uberdog/DistributedInGameNewsMgrAI.py b/toontown/uberdog/DistributedInGameNewsMgrAI.py new file mode 100644 index 0000000..5f09b0b --- /dev/null +++ b/toontown/uberdog/DistributedInGameNewsMgrAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class DistributedInGameNewsMgrAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('DistributedInGameNewsMgrAI') diff --git a/toontown/uberdog/DistributedMailManagerAI.py b/toontown/uberdog/DistributedMailManagerAI.py new file mode 100644 index 0000000..9d5acfe --- /dev/null +++ b/toontown/uberdog/DistributedMailManagerAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class DistributedMailManagerAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('DistributedMailManagerAI') diff --git a/toontown/uberdog/DistributedPartyManagerAI.py b/toontown/uberdog/DistributedPartyManagerAI.py new file mode 100644 index 0000000..2de29d9 --- /dev/null +++ b/toontown/uberdog/DistributedPartyManagerAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class DistributedPartyManagerAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('DistributedPartyManagerAI') diff --git a/toontown/uberdog/DistributedSecurityMgrAI.py b/toontown/uberdog/DistributedSecurityMgrAI.py new file mode 100644 index 0000000..2fec39c --- /dev/null +++ b/toontown/uberdog/DistributedSecurityMgrAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class DistributedSecurityMgrAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('DistributedSecurityMgrAI') diff --git a/toontown/uberdog/DistributedWhitelistMgrAI.py b/toontown/uberdog/DistributedWhitelistMgrAI.py new file mode 100644 index 0000000..88fd5ce --- /dev/null +++ b/toontown/uberdog/DistributedWhitelistMgrAI.py @@ -0,0 +1,5 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI + +class DistributedWhitelistMgrAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory('DistributedWhitelistMgrAI')