ai: AI server progress
This commit is contained in:
parent
d047b77154
commit
1f8044c25e
22 changed files with 209 additions and 2 deletions
5
otp/distributed/AccountAI.py
Normal file
5
otp/distributed/AccountAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class AccountAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('AccountAI')
|
5
otp/distributed/CentralLoggerAI.py
Normal file
5
otp/distributed/CentralLoggerAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class CentralLoggerAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('CentralLoggerAI')
|
36
otp/distributed/DistributedDistrictAI.py
Normal file
36
otp/distributed/DistributedDistrictAI.py
Normal file
|
@ -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
|
5
otp/distributed/ObjectServerAI.py
Normal file
5
otp/distributed/ObjectServerAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class ObjectServerAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('ObjectServerAI')
|
5
otp/friends/GuildManagerAI.py
Normal file
5
otp/friends/GuildManagerAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class GuildManagerAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('GuildManagerAI')
|
5
otp/snapshot/SnapshotDispatcherAI.py
Normal file
5
otp/snapshot/SnapshotDispatcherAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class SnapshotDispatcherAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('SnapshotDispatcherAI')
|
5
otp/snapshot/SnapshotRendererAI.py
Normal file
5
otp/snapshot/SnapshotRendererAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class SnapshotRendererAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('SnapshotRendererAI')
|
5
otp/uberdog/DistributedChatManagerAI.py
Normal file
5
otp/uberdog/DistributedChatManagerAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class DistributedChatManagerAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedChatManagerAI')
|
5
otp/uberdog/OtpAvatarManagerAI.py
Normal file
5
otp/uberdog/OtpAvatarManagerAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class OtpAvatarManagerAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('OtpAvatarManagerAI')
|
5
otp/web/SettingsMgrAI.py
Normal file
5
otp/web/SettingsMgrAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class SettingsMgrAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('SettingsMgrAI')
|
42
toontown/ai/AIStart.py
Normal file
42
toontown/ai/AIStart.py
Normal file
|
@ -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
|
22
toontown/ai/ToontownAIRepository.py
Normal file
22
toontown/ai/ToontownAIRepository.py
Normal file
|
@ -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)
|
5
toontown/coderedemption/TTCodeRedemptionMgrAI.py
Normal file
5
toontown/coderedemption/TTCodeRedemptionMgrAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class TTCodeRedemptionMgrAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('TTCodeRedemptionMgrAI')
|
|
@ -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
|
||||
|
|
5
toontown/uberdog/DistributedCpuInfoMgrAI.py
Normal file
5
toontown/uberdog/DistributedCpuInfoMgrAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class DistributedCpuInfoMgrAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedCpuInfoMgrAI')
|
5
toontown/uberdog/DistributedDataStoreManagerAI.py
Normal file
5
toontown/uberdog/DistributedDataStoreManagerAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class DistributedDataStoreManagerAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedDataStoreManagerAI')
|
5
toontown/uberdog/DistributedDeliveryManagerAI.py
Normal file
5
toontown/uberdog/DistributedDeliveryManagerAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class DistributedDeliveryManagerAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedDeliveryManagerAI')
|
5
toontown/uberdog/DistributedInGameNewsMgrAI.py
Normal file
5
toontown/uberdog/DistributedInGameNewsMgrAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class DistributedInGameNewsMgrAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedInGameNewsMgrAI')
|
5
toontown/uberdog/DistributedMailManagerAI.py
Normal file
5
toontown/uberdog/DistributedMailManagerAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class DistributedMailManagerAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedMailManagerAI')
|
5
toontown/uberdog/DistributedPartyManagerAI.py
Normal file
5
toontown/uberdog/DistributedPartyManagerAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class DistributedPartyManagerAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedPartyManagerAI')
|
5
toontown/uberdog/DistributedSecurityMgrAI.py
Normal file
5
toontown/uberdog/DistributedSecurityMgrAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class DistributedSecurityMgrAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedSecurityMgrAI')
|
5
toontown/uberdog/DistributedWhitelistMgrAI.py
Normal file
5
toontown/uberdog/DistributedWhitelistMgrAI.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class DistributedWhitelistMgrAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedWhitelistMgrAI')
|
Loading…
Reference in a new issue