def initAvatar(self): self.extract_ip() iBase.initBase(self) iAchievement.initAchievement(self) iRecordOperation.initRecord(self) self.initFinish() if self.is_reconnect and self.isInRoom: # 如果需要断线重连, 则进行处理 self.client and self.client.beginGame(1) # 预防可能出现的问题, 不要卡登录 try: self.process_reconnection() self.room.notify_player_online_status(self.userId, 1) except: import traceback ERROR_MSG(traceback.format_exc()) self.is_reconnect = False else: self.room = None self.client and self.client.beginGame(0) # 更新代理房间列表 self.updatePlayingRoomList() # 更新亲友圈列表 self.updateClubList() # 全服公告 world_notice = KBEngine.globalData["GameWorld"].world_notice if world_notice and world_notice != '#': self.recvWorldNotice(world_notice, 3)
def initAvatar(self): self.extract_ip() iBase.initBase(self) iGroup.initGroup(self) iAchievement.initAchievement(self) iRecordOperation.initRecord(self) iSportOperation.initSportOperation(self) self.initFinish() # KBEngine.globalData['GameWorld'].addOneUser(self, self.userId) if self.inRoom: # 如果需要断线重连, 则进行处理 self.client and self.client.beginGame(1) self.process_reconnection() try: self.room.notify_player_online_status(self.userId, 1) except: pass self.is_reconnect = False else: self.client and self.client.beginGame(0) # 全服公告 world_notice = KBEngine.globalData["GameWorld"].world_notice if world_notice and world_notice != '#': self.recvWorldNotice(world_notice, 3) self.loginCheckDailyTask() self.hourlyTimer = None self.setTimerByHour()
def initAvatar(self): self.extrace_ip() iBase.initBase(self) iAchievement.initAchievement(self) self.initFinish() KBEngine.globalData['GameWorld'].addOneUser(self, self.userId) if self.is_reconnect and self.room: # 如果需要断线重连, 则进行处理 self.client and self.client.beginGame(1) self.process_reconnection() self.room.notify_player_online_status(self.userId, 1) self.is_reconnect = False else: self.client and self.client.beginGame(0) # 全服公告 world_notice = KBEngine.globalData["GameWorld"].world_notice if world_notice and world_notice != '#': self.recvWorldNotice(world_notice, 3)