diff options
author | Dipesh Amin <yaypunkrock@gmail.com> | 2011-08-22 10:39:53 +0100 |
---|---|---|
committer | Dipesh Amin <yaypunkrock@gmail.com> | 2011-08-22 10:39:53 +0100 |
commit | b75d6a31f83173f7649317c4651473e1c9731362 (patch) | |
tree | 032e20f569cc5dd09d1683a1f81404031ee0c662 | |
parent | b9e80443ea8ef7deded058892cff77c0e77d311f (diff) | |
download | manamarket-b75d6a31f83173f7649317c4651473e1c9731362.tar.gz manamarket-b75d6a31f83173f7649317c4651473e1c9731362.tar.bz2 manamarket-b75d6a31f83173f7649317c4651473e1c9731362.tar.xz manamarket-b75d6a31f83173f7649317c4651473e1c9731362.zip |
Move some of the packet handling code.
-rwxr-xr-x | main.py | 21 |
1 files changed, 2 insertions, 19 deletions
@@ -34,6 +34,7 @@ from net.packet import * from net.protocol import * from net.packet_out import * from player import * +import net.packet_handler import tradey import utils @@ -692,25 +693,7 @@ def main(): player_node.y = coord_data[3] elif packet.is_type(SMSG_PLAYER_STAT_UPDATE_1): - stat_type = packet.read_int16() - value = packet.read_int32() - if stat_type == 0x0005: - player_node.HP = value - elif stat_type == 0x0006: - player_node.MaxHP = value - elif stat_type == 0x0007: - player_node.MP = value - elif stat_type == 0x0008: - player_node.MaxMP = value - elif stat_type == 0x000b: - player_node.LEVEL = value - elif stat_type == 0x0018: - logging.info("Weight changed from %s/%s to %s/%s", \ - player_node.WEIGHT, player_node.MaxWEIGHT, value, player_node.MaxWEIGHT) - player_node.WEIGHT = value - elif stat_type == 0x0019: - logging.info("Max Weight: %s", value) - player_node.MaxWEIGHT = value + packet_handler.handle_stat_update_1(packet, player_node, logging) elif packet.is_type(SMSG_PLAYER_STAT_UPDATE_2): stat_type = packet.read_int16() |