| | |
| | | # @remarks
|
| | | def _Process(self):
|
| | | return
|
| | | #self.IsKillSelf()
|
| | | #===============================================================================
|
| | | # playerId = self.robot.GetPlayerInfo().GetPlayerID()
|
| | | # curPosX, curPosY = self.robot.GetPlayerInfo().GetPos()
|
| | | # |
| | | # |
| | | # curTime = self.GetTick()
|
| | | # |
| | | # if self.playerDieTime > 0 and curTime - self.playerDieTime > ReBornTime:
|
| | | # if self.robot.GetIsLoginOK():
|
| | | # #发包复活
|
| | | # self.PlayerReborn()
|
| | | # |
| | | # self.playerDieTime = 0
|
| | | #===============================================================================
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | # @return None
|
| | | # @remarks
|
| | | def ReConnect(self, curTime):
|
| | | if self.robot.IsConnected():
|
| | | curPosX, curPosY = self.robot.GetPlayerInfo().GetPos()
|
| | | |
| | | if self.__IsCorrectPos(curPosX, curPosY):
|
| | | return
|
| | | |
| | | self.SendGMRoleDead()
|
| | | # self.robot.DestroyRobot()
|
| | | # self.playerDisconnectTime = curTime
|
| | | |
| | | logging.info('坐标错误,断开')
|
| | | |
| | | else:
|
| | | if self.robot.GetIsLoginOK():
|
| | | self.robot.DestroyRobot()
|
| | | |
| | | if self.playerDisconnectTime == 0:
|
| | | self.playerDisconnectTime = curTime
|
| | | |
| | | if self.playerDisconnectTime > 0 and curTime - self.playerDisconnectTime > ReConnectTime:
|
| | | |
| | | self.robot.ReCreateRobot()
|
| | | |
| | | if self.robot.IsConnected(): |
| | | self.playerDisconnectTime = 0
|
| | | logging.info('重新连接了')
|
| | | self.robot.SetIsLoginOK(False)
|
| | | self.robot.SetLastDisconnectReason(1)
|
| | | from Robot import RobotMgr
|
| | | RobotMgr.GetRobotMgr().DisconnectServer(self.robot)
|
| | |
|
| | | return
|
| | |
|