diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-01-04 22:28:08 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-01-04 22:28:08 +0000 |
commit | 90290b7aaf2a55187598e67c31d33f5735f574ce (patch) | |
tree | 64826ee1d40e993ab70c9d6f077ded33c747edf0 /src/net/gameserver | |
parent | 4eec29ac0f6a9b05562ac0fbe3d4e5d7e82deeac (diff) | |
download | mana-90290b7aaf2a55187598e67c31d33f5735f574ce.tar.gz mana-90290b7aaf2a55187598e67c31d33f5735f574ce.tar.bz2 mana-90290b7aaf2a55187598e67c31d33f5735f574ce.tar.xz mana-90290b7aaf2a55187598e67c31d33f5735f574ce.zip |
Client-side hack for picking up items.
Diffstat (limited to 'src/net/gameserver')
-rw-r--r-- | src/net/gameserver/player.cpp | 20 | ||||
-rw-r--r-- | src/net/gameserver/player.h | 9 |
2 files changed, 9 insertions, 20 deletions
diff --git a/src/net/gameserver/player.cpp b/src/net/gameserver/player.cpp index 0a47a6bc..763f3d28 100644 --- a/src/net/gameserver/player.cpp +++ b/src/net/gameserver/player.cpp @@ -32,38 +32,30 @@ void Net::GameServer::Player::say(const std::string &text) { MessageOut msg(PGMSG_SAY); - msg.writeString(text); - Net::GameServer::connection->send(msg); } -void Net::GameServer::Player::walk(short x, short y) +void Net::GameServer::Player::walk(int x, int y) { MessageOut msg(PGMSG_WALK); - msg.writeShort(x); msg.writeShort(y); - Net::GameServer::connection->send(msg); } -void Net::GameServer::Player::useItem(int itemId) +void Net::GameServer::Player::pickUp(int x, int y) { - MessageOut msg(PGMSG_USE_ITEM); - - msg.writeLong(itemId); - + MessageOut msg(PGMSG_PICKUP); + msg.writeShort(x); + msg.writeShort(y); Net::GameServer::connection->send(msg); } -void Net::GameServer::Player::equip(int itemId, char slot) +void Net::GameServer::Player::equip(int slot) { MessageOut msg(PGMSG_EQUIP); - - msg.writeLong(itemId); msg.writeByte(slot); - Net::GameServer::connection->send(msg); } diff --git a/src/net/gameserver/player.h b/src/net/gameserver/player.h index d8f572ae..a5429e65 100644 --- a/src/net/gameserver/player.h +++ b/src/net/gameserver/player.h @@ -28,17 +28,14 @@ namespace Net { - class Connection; - namespace GameServer { namespace Player { void say(const std::string &text); - void walk(short x, short y); -// void pickUp(...); - void useItem(int itemId); - void equip(int itemId, char slot); + void walk(int x, int y); + void pickUp(int x, int y); + void equip(int slot); void attack(unsigned char direction); } } |