Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Just another commit

  • Loading branch information...
commit 841a5d0493392aecb8d540574d38991804499ae7 1 parent 8ba616a
Keabard authored
2  lib/honcore/client.py
@@ -263,7 +263,7 @@ def _game_connect(self):
263 263 Finally sends a valid authentication packet. Any exceptions are raised to the top method.
264 264 """
265 265
266   - if self.account == None or self.account.cookie == None or self.account.game_session_key == None or self.account.auth_hash == None:
  266 + if self.account == None or self.account.cookie == None:
267 267 raise GameServerError(205)
268 268
269 269 if self.__game_socket is None:
31 lib/honcore/networking.py
@@ -969,7 +969,7 @@ def on_auth_accepted(self, *p):
969 969 """ Set the authenticated state to True"""
970 970 self.authenticated = True
971 971
972   - def on_server_state(self, packet_body, packet_second_id):
  972 + def on_server_state(self, packet_body, packet_second_id, packet_third_id):
973 973 """ Send the server_state response to the game server
974 974 packetHeader[headerIndex][0],
975 975 packetHeader[headerIndex][1],
@@ -986,7 +986,7 @@ def on_server_state(self, packet_body, packet_second_id):
986 986 ULInt32("packet_body")
987 987 )
988 988
989   - if packet_second_id == 0x01:
  989 + if packet_second_id == 0x01 and packet_third_id == 0x00:
990 990 packet_header = 0
991 991 loading_state = 194
992 992 else:
@@ -1109,18 +1109,18 @@ def send_auth_info(self, player_name, cookie, ip, acc_key, account_id, acc_key_h
1109 1109
1110 1110 # Setup a SocketSender for packet [HON_CONNECTION_ID]01c9
1111 1111
1112   - periodic_c = Struct("periodic_packet",
1113   - ULInt16("hon_connection_id"),
1114   - Byte("magic_byte"),
1115   - Byte("magic_byte2"))
1116   -
1117   - periodic_packet = periodic_c.build(Container(
1118   - hon_connection_id = HON_CONNECTION_ID,
1119   - magic_byte = 1,
1120   - magic_byte2 = 201,
1121   - ))
1122   -
1123   - self.add_sender(period = 0.3, packet = periodic_packet)
  1112 +# periodic_c = Struct("periodic_packet",
  1113 +# ULInt16("hon_connection_id"),
  1114 +# Byte("magic_byte"),
  1115 +# Byte("magic_byte2"))
  1116 +#
  1117 +# periodic_packet = periodic_c.build(Container(
  1118 +# hon_connection_id = HON_CONNECTION_ID,
  1119 +# magic_byte = 1,
  1120 +# magic_byte2 = 201,
  1121 +# ))
  1122 +#
  1123 +# self.add_sender(period = 0.3, packet = periodic_packet)
1124 1124
1125 1125
1126 1126 def send_magic_packet(self):
@@ -1214,7 +1214,8 @@ def parse_server_state(self, packet):
1214 1214
1215 1215 return {
1216 1216 'packet_body' : r.packet_body,
1217   - 'packet_second_id' : struct.unpack('B', packet[0])[0]
  1217 + 'packet_second_id' : struct.unpack('B', packet[0])[0],
  1218 + 'packet_third_id' : struct.unpack('B', packet[1])[0]
1218 1219 }
1219 1220
1220 1221 def parse_game_message(self, packet):
9 main.py
@@ -45,9 +45,9 @@ def on_authenticated(self):
45 45 for buddy in self.get_buddies():
46 46 if buddy.status != HON_STATUS_OFFLINE:
47 47 print "%s is online" % buddy
48   - time.sleep(2)
49   - self.create_game("Test")
50   - time.sleep(1)
  48 +# time.sleep(2)
  49 +# self.create_game("Test")
  50 +# time.sleep(1)
51 51
52 52 def on_whisper(self, player, message):
53 53 print "Whisper from %s : %s"%(player, message)
@@ -90,6 +90,9 @@ def on_joined_channel(self, channel, channel_id, topic, operators, users):
90 90 def on_game_invite(self, player, server_ip):
91 91 print "Game invite from %s : %s"%(player, server_ip)
92 92 self.send_whisper(player, "Merci pour l'invite connard")
  93 + self.account.game_ip = server_ip.split(':')[0]
  94 + self.account.game_port = int(server_ip.split(':')[1])
  95 + self._game_connect()
93 96
94 97 def on_buddy_invite(self, player, pass_int):
95 98 print 'BUDDY INVITE RECEIVED : %s %s'%(player, pass_int)

0 comments on commit 841a5d0

Please sign in to comment.
Something went wrong with that request. Please try again.