コード例 #1
0
 def __init__(self, baseChannel, serverId):
     CogInvasionInternalRepository.__init__(self, baseChannel, serverId,
                 ['resources/phase_3/etc/direct.dc', 'resources/phase_3/etc/toon.dc'], dcSuffix='UD')
     self.notify.setInfo(True)
     self.activeTokens = []
     self.parentMgr = ParentMgr()
     self.holiday = 0
     self.loginServerConn = None
コード例 #2
0
    def handleConnected(self):
        CogInvasionInternalRepository.handleConnected(self)
        rootObj = DistributedRootAI(self)
        rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)
        
        # Let's start the login server connection server.
        self.loginServerConn = LoginServerConnection(self, 9001)

        self.createObjects()
        self.notify.info('Successfully started Cog Invasion Online Uber Repository!')
    def __init__(self, baseChannel, stateServerChannel):
        CogInvasionInternalRepository.__init__(
            self,
            baseChannel,
            stateServerChannel, [
                'resources/phase_3/etc/direct.dc',
                'resources/phase_3/etc/toon.dc'
            ],
            dcSuffix='AI')
        self.notify.setInfo(True)
        self.district = None
        self.zoneAllocator = UniqueIdAllocator(ZoneUtil.DynamicZonesBegin,
                                               ZoneUtil.DynamicZonesEnd)
        self.zoneDataStore = AIZoneDataStore()
        self.hoods = {}
        self.dnaStoreMap = {}
        self.dnaDataMap = {}
        self.districtNameMgr = self.generateGlobalObject(
            DO_ID_DISTRICT_NAME_MANAGER, 'DistrictNameManager')
        self.holidayMgr = self.generateGlobalObject(DO_ID_HOLIDAY_MANAGER,
                                                    'HolidayManager')
        self.uin = self.generateGlobalObject(DO_ID_UNIQUE_INTEREST_NOTIFIER,
                                             'UniqueInterestNotifier')
        self.csm = self.generateGlobalObject(DO_ID_CLIENT_SERVICES_MANAGER,
                                             'ClientServicesManager')
        self.statsMgr = self.generateGlobalObject(DO_ID_STATS_MANAGER,
                                                  'StatsManager')

        # Anything that is a DistributedAvatarAI (Toons, Suits, etc).
        # This is a per-zone list of avatars.
        self.avatars = {}
        self.numAvatars = 0

        self.battleZones = {}

        if DO_SIMULATION:
            self.zonePhysics = {}
            self.bspLoader = BSPLoader()
            self.bspLoader.setAi(True)
            self.bspLoader.setMaterialsFile("phase_14/etc/materials.txt")
            #self.bspLoader.setTextureContentsFile("phase_14/etc/texturecontents.txt")
            #self.bspLoader.setServerEntityDispatcher(self)
            self.bspLoader.read(
                "phase_14/etc/sewer_entrance_room_indoors/sewer_entrance_room_indoors.bsp"
            )
            PhysicsUtils.makeBulletCollFromGeoms(self.bspLoader.getResult(),
                                                 enableNow=False)
 def handleConnected(self):
     CogInvasionInternalRepository.handleConnected(self)
     self.districtNameMgr.d_requestDistrictName()
     self.holidayMgr.d_srvRequestHoliday()
コード例 #5
0
 def handleDatagram(self, di):
     msgType = self.getMsgType()
     if msgType == STORE_LOGIN_TOKEN:
         self.__handleLoginToken(di)
     else:
         CogInvasionInternalRepository.handleDatagram(self, di)
コード例 #6
0
 def lostConnection(self):
     CogInvasionInternalRepository.lostConnection(self)
     self.loginServerConn.close()
コード例 #7
0
 def shutdown(self):
     CogInvasionInternalRepository.shutdown(self)
     self.loginServerConn.close()