@@ -68,8 +68,13 @@ class RConConnection():
|
||||
if not toread:
|
||||
raise RConException(self.rid, "Request timed out.")
|
||||
|
||||
res_len, res_id, res_type = \
|
||||
struct.unpack("<iii", self.sock.recv(12, socket.MSG_WAITALL))
|
||||
try:
|
||||
res_len, res_id, res_type = \
|
||||
struct.unpack("<iii", self.sock.recv(12, socket.MSG_WAITALL))
|
||||
except Exception as e:
|
||||
raise RConException(self.rid,
|
||||
"RCon protocol error. Are you sure you're " + \
|
||||
"talking to the RCon port? Error: %s" % e)
|
||||
res_data = self.sock.recv(res_len - 4 - 4)
|
||||
res_data = res_data[:-2]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user