Browse Source

report server heartbeats

David Rose 22 years ago
parent
commit
c43178944d
2 changed files with 9 additions and 0 deletions
  1. 7 0
      direct/src/distributed/ClientRepository.py
  2. 2 0
      direct/src/distributed/MsgTypes.py

+ 7 - 0
direct/src/distributed/ClientRepository.py

@@ -537,11 +537,18 @@ class ClientRepository(DirectObject.DirectObject):
             self.bootedText = None
             ClientRepository.notify.warning(
                 "Server is booting us out with no explanation.")
+
+
+    def handleServerHeartbeat(self, di):
+        # Got a heartbeat message from the server.
+        ClientRepository.notify.info("Server heartbeat.")
         
 
     def handleUnexpectedMsgType(self, msgType, di):
         if msgType == CLIENT_GO_GET_LOST:
             self.handleGoGetLost(di)
+        elif msgType == CLIENT_HEARTBEAT:
+            self.handleServerHeartbeat(di)
         else:
             currentLoginState = self.loginFSM.getCurrentState()
             if currentLoginState:

+ 2 - 0
direct/src/distributed/MsgTypes.py

@@ -12,6 +12,8 @@ CLIENT_SET_SHARD =                           31
 CLIENT_CREATE_OBJECT_REQUIRED =              34
 CLIENT_CREATE_OBJECT_REQUIRED_OTHER =        35
 
+CLIENT_HEARTBEAT =                           52
+
 # These messages are ignored when the client is headed to the quiet zone
 QUIET_ZONE_IGNORED_LIST = [