def handleAvatarResponseMsg(self, di):
     self.loadingScreen.endStep('waitForAv')
     avatarId = di.getUint32()
     returnCode = di.getUint8()
     if returnCode == 0:
         self.loadingScreen.show(waitForLocation=True, expectedLoadScale=4)
         self.loadingScreen.beginStep('LocalAvatar', 36, 120)
         localAvatar = LocalPirate(self)
         localAvatar.dclass = self.dclassesByName['DistributedPlayerPirate']
         localAvatar.doId = avatarId
         self.localAvatarDoId = avatarId
         self.doId2do[avatarId] = localAvatar
         localAvatar.setLocation(parentId=None, zoneId=None)
         localAvatar.generate()
         localAvatar.updateAllRequiredFields(localAvatar.dclass, di)
         self.loadingScreen.endStep('LocalAvatar')
         self.loginFSM.request('playingGame')
     else:
         self.notify.error('Bad avatar: return code %d' % returnCode)
Exemple #2
0
    def handleAvatarResponseMsg(self, di):
        self.loadingScreen.endStep('waitForAv')
        self.cleanupWaitingForDatabase()
        avatarId = di.getUint32()
        returnCode = di.getUint8()
        if returnCode == 0:
            dclass = self.dclassesByName['DistributedPlayerPirate']
            NametagGlobals.setMasterArrowsOn(0)
            self.loadingScreen.show(waitForLocation=True, expectedLoadScale=4)
            self.loadingScreen.beginStep('LocalAvatar', 36, 120)
            localAvatar = LocalPirate(self)
            localAvatar.dclass = dclass
            if __dev__:
                __builtins__['lu'] = self.getDo

            localAvatar.doId = avatarId
            self.localAvatarDoId = avatarId
            self.doId2do[avatarId] = localAvatar
            parentId = None
            zoneId = None
            localAvatar.setLocation(parentId, zoneId)
            localAvatar.generate()
            localAvatar.updateAllRequiredFields(dclass, di)
            locUID = localAvatar.getReturnLocation()
            if __dev__ and not getBase().config.GetBool(
                    'login-location-used-pcr', False):
                bp.loginCfg()
                ConfigVariableBool('login-location-used-pcr').setValue(True)
                config_location = getBase().config.GetString(
                    'login-location', '').lower()
                config_location_uid = PLocalizer.LocationUids.get(
                    config_location)
                if config_location and config_location_uid:
                    locUID = config_location_uid
                    localAvatar.setReturnLocation(locUID)

            if locUID:
                self.loadingScreen.showTarget(locUID)
                self.loadingScreen.showHint(locUID)
            else:
                locUID = '1150922126.8dzlu'
                localAvatar.setReturnLocation(locUID)
                self.loadingScreen.showTarget(jail=True)
            self.loadingScreen.endStep('LocalAvatar')
            self.loginFSM.request('playingGame')
        else:
            self.notify.error('Bad avatar: return code %d' % returnCode)
 def handleAvatarResponseMsg(self, di):
     self.loadingScreen.endStep('waitForAv')
     self.cleanupWaitingForDatabase()
     avatarId = di.getUint32()
     avatarId = 100000001
     returnCode = 0 #di.getUint8()
     if returnCode == 0:
         dclass = self.dclassesByName['DistributedPlayerPirate']
         NametagGlobals.setMasterArrowsOn(0)
         self.loadingScreen.show(waitForLocation = True, expectedLoadScale = 4)
         self.loadingScreen.beginStep('LocalAvatar', 36, 120)
         localAvatar = LocalPirate(self)
         localAvatar.dclass = dclass
         if __dev__:
             __builtins__['lu'] = self.getDo 
         print "PiratesClientRepository: avId: {0}".format(str(avatarId))
         localAvatar.doId = avatarId
         self.localAvatarDoId = avatarId
         self.doId2do[avatarId] = localAvatar
         parentId = di.getUint32()
         zoneId = di.getUint32()
         localAvatar.setLocation(parentId, zoneId)
         localAvatar.generate()
         localAvatar.updateAllRequiredFields(dclass, di)
         locUID = localAvatar.getReturnLocation()
         if __dev__ and not getBase().config.GetBool('login-location-used-pcr', False):
             bp.loginCfg()
             ConfigVariableBool('login-location-used-pcr').setValue(True)
             config_location = getBase().config.GetString('login-location', '').lower()
             config_location_uid = PLocalizer.LocationUids.get(config_location)
             if config_location and config_location_uid:
                 locUID = config_location_uid
                 localAvatar.setReturnLocation(locUID)
         if locUID:
             self.loadingScreen.showTarget(locUID)
             self.loadingScreen.showHint(locUID)
         else:
             locUID = '1150922126.8dzlu'
             localAvatar.setReturnLocation(locUID)
             self.loadingScreen.showTarget(jail = True)
         self.loadingScreen.endStep('LocalAvatar')
         self.loginFSM.request('playingGame')
     else:
         self.notify.error('Bad avatar: return code %d' % returnCode)
 def handleAvatarResponseMsg(self, avatarId, di):
     self.loadingScreen.show(waitForLocation=True, expectedLoadScale=4)
     self.loadingScreen.beginStep('LocalAvatar', 36, 120)
     localAvatar = LocalPirate(self)
     localAvatar.dclass = self.dclassesByName['DistributedPlayerPirate']
     localAvatar.doId = avatarId
     self.localAvatarDoId = avatarId
     self.doId2do[avatarId] = localAvatar
     localAvatar.setLocation(parentId=None, zoneId=None)
     localAvatar.generateInit()
     localAvatar.generate()
     localAvatar.dclass.receiveUpdateBroadcastRequiredOwner(localAvatar, di)
     localAvatar.announceGenerate()
     localAvatar.postGenerateMessage()
     self.loadingScreen.endStep('LocalAvatar')
     self.loginFSM.request('playingGame')
 def handleAvatarResponseMsg(self, avatarId, di):
     self.localAvatarDoId = avatarId
     self.loadingScreen.endStep('waitForAv')
     self.cleanupWaitingForDatabase()
     dclass = self.dclassesByName['DistributedPlayerPirate']
     NametagGlobals.setMasterArrowsOn(0)
     self.loadingScreen.beginStep('LocalAvatar', 36, 120)
     #self.loadingScreen.show(waitForLocation = True, expectedLoadScale = 4)
     localAvatar = LocalPirate(self)
     localAvatar.dclass = dclass
     base.localAvatar = localAvatar
     __builtins__['localAvatar'] = base.localAvatar
     localAvatar.doId = avatarId
     self.doId2do[avatarId] = localAvatar
     parentId = None
     zoneId = None
     localAvatar.setLocation(parentId, zoneId)
     localAvatar.generate()
     localAvatar.updateAllRequiredFields(dclass, di)
     locUID = localAvatar.getReturnLocation()
     if not locUID:
         locUID = '1150922126.8dzlu'
         localAvatar.setReturnLocation(locUID)
     self.loadingScreen.showTarget(locUID)
     self.loadingScreen.showHint(locUID)
     self.loadingScreen.endStep('LocalAvatar')
     self.loginFSM.request('playingGame')