本文整理汇总了Python中toontown.distributed.ToontownInternalRepository.ToontownInternalRepository类的典型用法代码示例。如果您正苦于以下问题:Python ToontownInternalRepository类的具体用法?Python ToontownInternalRepository怎么用?Python ToontownInternalRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ToontownInternalRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handleConnected
def handleConnected(self):
self.notify.info('Yarn. Waking up (This may take a while!).')
ToontownInternalRepository.handleConnected(self)
self.districtId = self.allocateChannel()
self.distributedDistrict = ToontownDistrictAI(self)
self.distributedDistrict.setName(self.districtName)
self.distributedDistrict.generateWithRequiredAndId(
self.districtId, self.getGameDoId(), 2)
# Claim ownership of that district...
dg = PyDatagram()
dg.addServerHeader(
self.districtId,
self.ourChannel,
STATESERVER_OBJECT_SET_AI)
dg.addChannel(self.ourChannel)
self.send(dg)
self.notify.info('Creating Global Managers')
self.createGlobals()
self.notify.info('Creating Toontown')
self.createZones()
self.statusSender.start()
self.distributedDistrict.b_setAvailable(1)
self.notify.info('District is now ready.')
示例2: __init__
def __init__(self, baseChannel, stateServerChannel, districtName):
ToontownInternalRepository.__init__(
self, baseChannel, stateServerChannel, dcSuffix='AI')
self.districtName = districtName
self.notify.setInfo(True) # Our AI repository should always log info.
self.hoods = []
self.cogHeadquarters = []
self.dnaStoreMap = {}
self.dnaDataMap = {}
self.suitPlanners = {}
self.buildingManagers = {}
self.factoryMgr = None
self.mintMgr = None
self.lawOfficeMgr = None
self.countryClubMgr = None
self.zoneAllocator = UniqueIdAllocator(ToontownGlobals.DynamicZonesBegin,
ToontownGlobals.DynamicZonesEnd)
self.zoneDataStore = AIZoneDataStore()
self.wantFishing = self.config.GetBool('want-fishing', True)
self.wantHousing = self.config.GetBool('want-housing', True)
self.wantPets = self.config.GetBool('want-pets', True)
self.wantKarts = self.config.GetBool('want-karts', True)
self.wantParties = self.config.GetBool('want-parties', True)
self.wantEmblems = self.config.GetBool('want-emblems', True)
self.wantCogbuildings = self.config.GetBool('want-cogbuildings', True)
self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True)
self.wantTrackClsends = self.config.GetBool('want-track-clsends', False)
self.wantTopToons = self.config.GetBool('want-top-toons', True)
self.baseXpMultiplier = self.config.GetFloat('base-xp-multiplier', 1.0)
self.cogSuitMessageSent = False
示例3: handleConnected
def handleConnected(self):
ToontownInternalRepository.handleConnected(self)
if config.GetBool('want-ClientServicesManagerUD', self.wantUD):
# Only generate the root object once, with the CSMUD.
rootObj = DistributedDirectoryAI(self)
rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)
self.createGlobals()
示例4: __init__
def __init__(self, baseChannel, stateServerChannel, districtName):
ToontownInternalRepository.__init__(
self, baseChannel, stateServerChannel, dcSuffix='AI')
self.districtName = districtName
self.notify.setInfo(True) # Our AI repository should always log info.
self.hoods = []
self.cogHeadquarters = []
self.dnaStoreMap = {}
self.dnaDataMap = {}
self.suitPlanners = {}
self.buildingManagers = {}
self.factoryMgr = None
self.mintMgr = None
self.lawOfficeMgr = None
self.countryClubMgr = None
self.zoneAllocator = UniqueIdAllocator(ToontownGlobals.DynamicZonesBegin,
ToontownGlobals.DynamicZonesEnd)
self.zoneDataStore = AIZoneDataStore()
self.wantFishing = self.config.GetBool('want-fishing', True)
self.wantHousing = self.config.GetBool('want-housing', True)
self.wantPets = self.config.GetBool('want-pets', True)
self.wantParties = self.config.GetBool('want-parties', True)
self.wantCogbuildings = self.config.GetBool('want-cogbuildings', True)
self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True)
self.doLiveUpdates = self.config.GetBool('want-live-updates', False)
self.wantTrackClsends = self.config.GetBool('want-track-clsends', False)
self.wantAchievements = self.config.GetBool('want-achievements', True)
示例5: handleConnected
def handleConnected(self):
ToontownInternalRepository.handleConnected(self)
rootObj = DistributedDirectoryAI(self)
rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)
if config.GetBool('want-rpc-server', False):
endpoint = config.GetString('rpc-server-endpoint', 'http://localhost:8080/')
self.rpcServer = ToontownRPCServer(endpoint, ToontownRPCHandler(self))
self.rpcServer.start(useTaskChain=True)
self.createGlobals()
self.notify.info('Done.')
示例6: __init__
def __init__(self, baseChannel, serverId):
ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='UD')
if config.GetBool('want-mongo-client', False):
url = config.GetString('mongodb-url', 'mongodb://localhost')
replicaset = config.GetString('mongodb-replicaset', '')
if replicaset:
self.mongo = pymongo.MongoClient(url, replicaset=replicaset)
else:
self.mongo = pymongo.MongoClient(url)
db = (urlparse.urlparse(url).path or '/test')[1:]
self.mongodb = self.mongo[db]
self.notify.setInfo(True)
示例7: __init__
def __init__(self, baseChannel, serverId, districtName):
ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='AI')
self.districtName = districtName
self.zoneAllocator = UniqueIdAllocator(ToontownGlobals.DynamicZonesBegin,
ToontownGlobals.DynamicZonesEnd)
NPCToons.generateZone2NpcDict()
self.use_libpandadna = simbase.config.GetBool('use-libpandadna', False)
self.hoods = []
self._dnaStoreMap = {}
if self.use_libpandadna:
self.__loader = DNALoader()
self.zoneDataStore = AIZoneDataStore()
self.useAllMinigames = self.config.GetBool('want-all-minigames', False)
self.doLiveUpdates = True
self.wantCogdominiums = self.config.GetBool('want-cogdo', False)
self.wantParties = self.config.GetBool('want-parties', False)
self.wantEmblems = self.config.GetBool('want-emblems', True)
self.questManager = QuestManagerAI(self)
self.promotionMgr = PromotionManagerAI(self)
self.cogPageManager = CogPageManagerAI(self)
self.cogSuitMgr = CogSuitManagerAI(self)
self.trophyMgr = DistributedTrophyMgrAI(self)
self.fishManager = FishManagerAI()
self.dnaStoreMap = {}
self.mintMgr = MintManagerAI.MintManagerAI(self)
self.factoryMgr = FactoryManagerAI.FactoryManagerAI(self)
self.lawMgr = LawOfficeManagerAI.LawOfficeManagerAI(self)
self.countryClubMgr = CountryClubManagerAI.CountryClubManagerAI(self)
self.buildingManagers = {}
self.suitPlanners = {}
self.wantMegaInvasions = str(self.ourChannel // 1000000) in self.config.GetString('mega-invasion-shards', '402 403').split()
示例8: handleConnected
def handleConnected(self):
ToontownInternalRepository.handleConnected(self)
self.notify.info(True)
if config.GetBool("want-ClientServicesManagerUD", self.wantUD):
self.notify.info("Creating ClientServicesManagerUD...")
# Only generate the root object once, with the CSMUD.
rootObj = DistributedDirectoryAI(self)
rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)
self.notify.info("Creating globals...")
self.createGlobals()
if config.GetBool("want-rpc-server", False):
self.notify.info("Starting RPC server...")
import ToontownRPCHandler
self.rpcserver = RPCServer(ToontownRPCHandler(self))
self.notify.info("Done.")
示例9: __init__
def __init__(self, baseChannel, serverId, districtName):
ToontownInternalRepository.__init__(
self, baseChannel, serverId, dcSuffix='AI')
self.dnaSpawner = DNASpawnerAI(self)
self.districtName = districtName
self.zoneAllocator = UniqueIdAllocator(
ToontownGlobals.DynamicZonesBegin,
ToontownGlobals.DynamicZonesEnd)
self.zoneId2owner = {}
NPCToons.generateZone2NpcDict()
self.hoods = []
self.zoneDataStore = AIZoneDataStore()
self.useAllMinigames = self.config.GetBool('want-all-minigames', False)
self.doLiveUpdates = self.config.GetBool('want-live-updates', True)
self.baseXpMultiplier = self.config.GetFloat('base-xp-multiplier', 1.0)
self.wantHalloween = self.config.GetBool('want-halloween', False)
self.wantChristmas = self.config.GetBool('want-christmas', False)
self.holidayManager = HolidayManagerAI(self)
if config.GetBool('want-pets', True):
self.PetManager = PetManagerAI(self)
self.fishManager = FishManagerAI()
self.questManager = QuestManagerAI(self)
self.cogPageManager = CogPageManagerAI()
self.factoryMgr = FactoryManagerAI(self)
self.mintMgr = MintManagerAI(self)
self.lawOfficeMgr = LawOfficeManagerAI(self)
self.countryClubMgr = CountryClubManagerAI(self)
self.promotionMgr = PromotionManagerAI(self)
self.cogSuitMgr = CogSuitManagerAI(self)
self.suitInvasionManager = SuitInvasionManagerAI(self)
self.statusSender = ShardStatusSender(self)
self.dnaStoreMap = {}
self.buildingManagers = {}
self.suitPlanners = {}
示例10: __init__
def __init__(self, baseChannel, serverId):
ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix="UD")
self.rpcServer = None
self.webRpc = None
if config.GetBool("want-mongo-client", False):
url = config.GetString("mongodb-url", "mongodb://localhost")
replicaset = config.GetString("mongodb-replicaset", "")
if replicaset:
self.mongo = pymongo.MongoClient(url, replicaset=replicaset)
else:
self.mongo = pymongo.MongoClient(url)
db = (urlparse.urlparse(url).path or "/test")[1:]
self.mongodb = self.mongo[db]
else:
self.mongo = None
self.mongodb = None
self.notify.setInfo(True)
示例11: __init__
def __init__(self, baseChannel, serverId, districtName):
ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='AI')
self.dnaSpawner = DNASpawnerAI(self)
self.districtName = districtName
self.notify.setInfo(True) # Our AI repository should always log info.
self.zoneAllocator = UniqueIdAllocator(ToontownGlobals.DynamicZonesBegin,
ToontownGlobals.DynamicZonesEnd)
self.zoneId2owner = {}
NPCToons.generateZone2NpcDict()
self.hoods = []
self.zoneDataStore = AIZoneDataStore()
self.useAllMinigames = self.config.GetBool('want-all-minigames', False)
self.doLiveUpdates = self.config.GetBool('want-live-updates', True)
self.holidayManager = HolidayManagerAI(self)
self.fishManager = FishManagerAI()
self.questManager = QuestManagerAI(self)
self.cogPageManager = CogPageManagerAI()
self.factoryMgr = FactoryManagerAI(self)
self.mintMgr = MintManagerAI(self)
self.lawOfficeMgr = LawOfficeManagerAI(self)
self.countryClubMgr = CountryClubManagerAI(self)
self.promotionMgr = PromotionManagerAI(self)
self.cogSuitMgr = CogSuitManagerAI(self)
self.suitInvasionManager = SuitInvasionManagerAI(self)
self.statusSender = ShardStatusSender(self)
self.dnaStoreMap = {}
self.buildingManagers = {}
self.suitPlanners = {}
示例12: __init__
def __init__(self, baseChannel, serverId, districtName):
ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='AI')
self.districtName = districtName
self.zoneAllocator = UniqueIdAllocator(ToontownGlobals.DynamicZonesBegin,
ToontownGlobals.DynamicZonesEnd)
NPCToons.generateZone2NpcDict()
self.hoods = []
self.zoneDataStore = AIZoneDataStore()
self.useAllMinigames = self.config.GetBool('want-all-minigames', False)
self.doLiveUpdates = False
self.holidayManager = HolidayManagerAI()
self.fishManager = FishManagerAI()
self.mintMgr = MintManagerAI.MintManagerAI(self)
self.factoryMgr = FactoryManagerAI.FactoryManagerAI(self)
示例13: __init__
def __init__(self, baseChannel, serverId):
ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='UD')
self.notify.setInfo(True)
self.wantTopToons = self.config.GetBool('want-top-toons', True)
示例14: handleConnected
def handleConnected(self):
ToontownInternalRepository.handleConnected(self)
threading.Thread(target=self.startDistrict).start()
示例15: __init__
def __init__(self, baseChannel, serverId):
ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='UD')