def handleConnected(self):
        self.districtId = self.allocateChannel()

        # register the AI on the state server...
        dg = PyDatagram()
        dg.addServerHeader(self.serverId, self.ourChannel, STATESERVER_ADD_SHARD)
        dg.addUint32(self.districtId)
        dg.addString(self.districtName)
        dg.addUint32(self.districtPopulation)
        self.send(dg)

        # add a post remove to remove the shard from the state server
        # when we disconnect from the message director...
        dg = PyDatagram()
        dg.addServerHeader(self.serverId, self.ourChannel, STATESERVER_REMOVE_SHARD)
        self.addPostRemove(dg)

        self.rootObj = DistributedObjectAI(self)
        self.rootObj.generateWithRequiredAndId(self.districtId, 0, 0)

        self.notify.info('Creating managers...')
        self.createManagers()

        if self.config.GetBool('want-safe-zones', True):
            self.notify.info('Creating safe zones...')
            self.createSafeZones()

        if self.config.GetBool('want-cog-headquarters', True):
            self.notify.info('Creating Cog headquarters...')
            self.createCogHeadquarters()

        self.notify.info('Done.')
Esempio n. 2
0
    def handleConnected(self):
        rootObj = DistributedObjectAI(self)
        rootObj.generateWithRequiredAndId(self.GameGlobalsId, 0, 0)
        self.setAI(self.GameGlobalsId, self.baseChannel)

        authManager = AuthManagerUD(self)
        authManager.generateWithRequiredAndId(1001, self.GameGlobalsId, 0)