summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDipesh Amin <yaypunkrock@gmail.com>2011-08-22 10:43:48 +0100
committerDipesh Amin <yaypunkrock@gmail.com>2011-08-22 10:43:48 +0100
commit10a88e29dd96066663fe104fe7bcbd7739bbc729 (patch)
treee2264e99a506e3090ebee673b8af3b760390286f /net
parentb75d6a31f83173f7649317c4651473e1c9731362 (diff)
downloadmanamarket-10a88e29dd96066663fe104fe7bcbd7739bbc729.tar.gz
manamarket-10a88e29dd96066663fe104fe7bcbd7739bbc729.tar.bz2
manamarket-10a88e29dd96066663fe104fe7bcbd7739bbc729.tar.xz
manamarket-10a88e29dd96066663fe104fe7bcbd7739bbc729.zip
oops
Diffstat (limited to 'net')
-rw-r--r--net/packet_handler.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/net/packet_handler.py b/net/packet_handler.py
new file mode 100644
index 0000000..48a0a6d
--- /dev/null
+++ b/net/packet_handler.py
@@ -0,0 +1,24 @@
+from packet import *
+from protocol import *
+
+def handle_stat_update_1(packet, player_node, logging):
+ 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
+