Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Just another commit

  • Loading branch information...
commit 841a5d0493392aecb8d540574d38991804499ae7 1 parent 8ba616a
Keabard authored
Showing with 23 additions and 19 deletions.
  1. +1 −1  lib/honcore/client.py
  2. +16 −15 lib/honcore/networking.py
  3. +6 −3 main.py
View
2  lib/honcore/client.py
@@ -263,7 +263,7 @@ def _game_connect(self):
Finally sends a valid authentication packet. Any exceptions are raised to the top method.
"""
- if self.account == None or self.account.cookie == None or self.account.game_session_key == None or self.account.auth_hash == None:
+ if self.account == None or self.account.cookie == None:
raise GameServerError(205)
if self.__game_socket is None:
View
31 lib/honcore/networking.py
@@ -969,7 +969,7 @@ def on_auth_accepted(self, *p):
""" Set the authenticated state to True"""
self.authenticated = True
- def on_server_state(self, packet_body, packet_second_id):
+ def on_server_state(self, packet_body, packet_second_id, packet_third_id):
""" Send the server_state response to the game server
packetHeader[headerIndex][0],
packetHeader[headerIndex][1],
@@ -986,7 +986,7 @@ def on_server_state(self, packet_body, packet_second_id):
ULInt32("packet_body")
)
- if packet_second_id == 0x01:
+ if packet_second_id == 0x01 and packet_third_id == 0x00:
packet_header = 0
loading_state = 194
else:
@@ -1109,18 +1109,18 @@ def send_auth_info(self, player_name, cookie, ip, acc_key, account_id, acc_key_h
# Setup a SocketSender for packet [HON_CONNECTION_ID]01c9
- periodic_c = Struct("periodic_packet",
- ULInt16("hon_connection_id"),
- Byte("magic_byte"),
- Byte("magic_byte2"))
-
- periodic_packet = periodic_c.build(Container(
- hon_connection_id = HON_CONNECTION_ID,
- magic_byte = 1,
- magic_byte2 = 201,
- ))
-
- self.add_sender(period = 0.3, packet = periodic_packet)
+# periodic_c = Struct("periodic_packet",
+# ULInt16("hon_connection_id"),
+# Byte("magic_byte"),
+# Byte("magic_byte2"))
+#
+# periodic_packet = periodic_c.build(Container(
+# hon_connection_id = HON_CONNECTION_ID,
+# magic_byte = 1,
+# magic_byte2 = 201,
+# ))
+#
+# self.add_sender(period = 0.3, packet = periodic_packet)
def send_magic_packet(self):
@@ -1214,7 +1214,8 @@ def parse_server_state(self, packet):
return {
'packet_body' : r.packet_body,
- 'packet_second_id' : struct.unpack('B', packet[0])[0]
+ 'packet_second_id' : struct.unpack('B', packet[0])[0],
+ 'packet_third_id' : struct.unpack('B', packet[1])[0]
}
def parse_game_message(self, packet):
View
9 main.py
@@ -45,9 +45,9 @@ def on_authenticated(self):
for buddy in self.get_buddies():
if buddy.status != HON_STATUS_OFFLINE:
print "%s is online" % buddy
- time.sleep(2)
- self.create_game("Test")
- time.sleep(1)
+# time.sleep(2)
+# self.create_game("Test")
+# time.sleep(1)
def on_whisper(self, player, message):
print "Whisper from %s : %s"%(player, message)
@@ -90,6 +90,9 @@ def on_joined_channel(self, channel, channel_id, topic, operators, users):
def on_game_invite(self, player, server_ip):
print "Game invite from %s : %s"%(player, server_ip)
self.send_whisper(player, "Merci pour l'invite connard")
+ self.account.game_ip = server_ip.split(':')[0]
+ self.account.game_port = int(server_ip.split(':')[1])
+ self._game_connect()
def on_buddy_invite(self, player, pass_int):
print 'BUDDY INVITE RECEIVED : %s %s'%(player, pass_int)
Please sign in to comment.
Something went wrong with that request. Please try again.