コード例 #1
0
 def get_players(self, old_players=None):
     try:
         buf = self.sock.recv(4096)
         self.frames_missed_in_row = 0
         return self.parse_server(buf, old_players)
     except timeout:
         self.frames_missed_in_row += 1
         if self.frames_missed_in_row > 3.0 / self.sock.gettimeout():
             print settings.color("Connection lost!", "RED")
             exit()
         if settings.DEBUG or DEBUG_SERVER:
             print "get_players: connection timed out"
         return None
コード例 #2
0
 def get_players(self):
     try:
         buf = self.sock.recv(4096)
         self.frames_missed_in_row = 0
         return self.parse_server(buf)
     except timeout:
         self.frames_missed_in_row += 1
         if self.frames_missed_in_row > 3.0 / self.sock.gettimeout():
             print settings.color("Connection lost!", "RED")
             exit()
         if settings.DEBUG or DEBUG_SERVER:
             print "get_players: connection timed out"
         return None
コード例 #3
0
ファイル: combat.py プロジェクト: Ramlak/TheGameMulti
 def __init__(self, function, msg='Done', values=None):
     self.value = settings.color("[!] " + msg, "YELLOW")
     self.function = function
     self.return_values = values
コード例 #4
0
 def __init__(self, function, msg='Done', values=None):
     self.value = settings.color("[!] " + msg, "YELLOW")
     self.function = function
     self.return_values = values