Adding a periodic IMC2 keepalive event. Other IMC2-connected games are now aware of our presence via the keepalive. Woot.

This commit is contained in:
Greg Taylor 2009-04-11 06:59:25 +00:00
parent a7e89c1e54
commit 191f49ff4c
5 changed files with 106 additions and 9 deletions

View file

@ -25,6 +25,7 @@ class IMC2Protocol(StatefulTelnetProtocol):
IMC2_PROTOCOL_INSTANCE = self
self.is_authenticated = False
self.auth_type = None
self.server_name = None
self.network_name = None
self.sequence = None
@ -61,9 +62,10 @@ class IMC2Protocol(StatefulTelnetProtocol):
"""
if line[:2] == "PW":
line_split = line.split(' ')
self.server_name = line_split[1]
self.network_name = line_split[4]
self.is_authenticated = True
self.sequence = time.time()
self.sequence = int(time.time())
print "IMC2: Successfully authenticated to the '%s' network." % self.network_name
def lineReceived(self, line):