mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
verbose disconnect reasons
This commit is contained in:
parent
b4ed038469
commit
350369ae57
@ -41,6 +41,9 @@ class ClientRepository(DirectObject.DirectObject):
|
|||||||
# is weak.
|
# is weak.
|
||||||
self.connectHttp = base.config.GetBool('connect-http', 1)
|
self.connectHttp = base.config.GetBool('connect-http', 1)
|
||||||
|
|
||||||
|
self.bootedIndex = None
|
||||||
|
self.bootedText = None
|
||||||
|
|
||||||
self.tcpConn = None
|
self.tcpConn = None
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -75,7 +78,8 @@ class ClientRepository(DirectObject.DirectObject):
|
|||||||
the return status code giving reason for failure, if it is
|
the return status code giving reason for failure, if it is
|
||||||
known.
|
known.
|
||||||
"""
|
"""
|
||||||
|
self.bootedIndex = None
|
||||||
|
self.bootedText = None
|
||||||
if self.connectHttp:
|
if self.connectHttp:
|
||||||
ch = self.http.makeChannel(0)
|
ch = self.http.makeChannel(0)
|
||||||
ch.beginConnectTo(serverURL)
|
ch.beginConnectTo(serverURL)
|
||||||
@ -488,7 +492,26 @@ class ClientRepository(DirectObject.DirectObject):
|
|||||||
"Asked to update non-existent DistObj " + str(doId))
|
"Asked to update non-existent DistObj " + str(doId))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def handleGoGetLost(self, di):
|
||||||
|
# The server told us it's about to drop the connection on us.
|
||||||
|
# Get ready!
|
||||||
|
if (di.getRemainingSize() > 0):
|
||||||
|
self.bootedIndex = di.getUint16()
|
||||||
|
self.bootedText = di.getString()
|
||||||
|
|
||||||
|
ClientRepository.notify.warning(
|
||||||
|
"Server is booting us out (%d): %s" % (self.bootedIndex, self.bootedText))
|
||||||
|
else:
|
||||||
|
self.bootedIndex = None
|
||||||
|
self.bootedText = None
|
||||||
|
ClientRepository.notify.warning(
|
||||||
|
"Server is booting us out with no explanation.")
|
||||||
|
|
||||||
|
|
||||||
def handleUnexpectedMsgType(self, msgType, di):
|
def handleUnexpectedMsgType(self, msgType, di):
|
||||||
|
if msgType == CLIENT_GO_GET_LOST:
|
||||||
|
self.handleGoGetLost(di)
|
||||||
|
else:
|
||||||
currentLoginState = self.loginFSM.getCurrentState()
|
currentLoginState = self.loginFSM.getCurrentState()
|
||||||
if currentLoginState:
|
if currentLoginState:
|
||||||
currentLoginStateName = currentLoginState.getName()
|
currentLoginStateName = currentLoginState.getName()
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
"""MsgTypes module: contains distributed object message types"""
|
"""MsgTypes module: contains distributed object message types"""
|
||||||
|
|
||||||
|
# Sent by the server when it is dropping the connection deliberately.
|
||||||
|
CLIENT_GO_GET_LOST = 4
|
||||||
|
|
||||||
CLIENT_OBJECT_UPDATE_FIELD = 24
|
CLIENT_OBJECT_UPDATE_FIELD = 24
|
||||||
CLIENT_OBJECT_UPDATE_FIELD_RESP = 24
|
CLIENT_OBJECT_UPDATE_FIELD_RESP = 24
|
||||||
CLIENT_OBJECT_DISABLE_RESP = 25
|
CLIENT_OBJECT_DISABLE_RESP = 25
|
||||||
|
Loading…
x
Reference in New Issue
Block a user