diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-06 22:46:15 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-06 22:46:15 +0200 |
commit | f0fd20fdd649eb61fa0d2444d910a2b0882e3580 (patch) | |
tree | ee879af37c773e8a40b353e6e1e714ab5e1f45b1 /src/net/tmwserv/gameserver | |
parent | 7ee2220427d8735c777f504517c24c49afda699f (diff) | |
download | mana-f0fd20fdd649eb61fa0d2444d910a2b0882e3580.tar.gz mana-f0fd20fdd649eb61fa0d2444d910a2b0882e3580.tar.bz2 mana-f0fd20fdd649eb61fa0d2444d910a2b0882e3580.tar.xz mana-f0fd20fdd649eb61fa0d2444d910a2b0882e3580.zip |
Moved many MessageOut constructions around
No real point in having these abstracted away twice. We're using network
interfaces now instead of functions structured in namespaces.
Diffstat (limited to 'src/net/tmwserv/gameserver')
-rw-r--r-- | src/net/tmwserv/gameserver/player.cpp | 90 | ||||
-rw-r--r-- | src/net/tmwserv/gameserver/player.h | 12 |
2 files changed, 0 insertions, 102 deletions
diff --git a/src/net/tmwserv/gameserver/player.cpp b/src/net/tmwserv/gameserver/player.cpp index ec346d9f..a3e1458c 100644 --- a/src/net/tmwserv/gameserver/player.cpp +++ b/src/net/tmwserv/gameserver/player.cpp @@ -33,13 +33,6 @@ void RespawnRequestListener::action(const gcn::ActionEvent &event) Net::GameServer::Player::respawn(); } -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(int x, int y) { MessageOut msg(PGMSG_WALK); @@ -65,35 +58,6 @@ void Net::GameServer::Player::moveItem(int oldSlot, int newSlot, int amount) Net::GameServer::connection->send(msg); } -void Net::GameServer::Player::drop(int slot, int amount) -{ - MessageOut msg(PGMSG_DROP); - msg.writeInt8(slot); - msg.writeInt8(amount); - Net::GameServer::connection->send(msg); -} - -void Net::GameServer::Player::equip(int slot) -{ - MessageOut msg(PGMSG_EQUIP); - msg.writeInt8(slot); - Net::GameServer::connection->send(msg); -} - -void Net::GameServer::Player::unequip(int slot) -{ - MessageOut msg(PGMSG_UNEQUIP); - msg.writeInt8(slot); - Net::GameServer::connection->send(msg); -} - -void Net::GameServer::Player::useItem(int slot) -{ - MessageOut msg(PGMSG_USE_ITEM); - msg.writeInt8(slot); - Net::GameServer::connection->send(msg); -} - void Net::GameServer::Player::attack(int direction) { MessageOut msg(PGMSG_ATTACK); @@ -108,28 +72,6 @@ void Net::GameServer::Player::useSpecial(int special) Net::GameServer::connection->send(msg); } -void Net::GameServer::Player::changeAction(Being::Action action) -{ - MessageOut msg(PGMSG_ACTION_CHANGE); - msg.writeInt8(action); - Net::GameServer::connection->send(msg); -} - -void Net::GameServer::Player::talkToNPC(int id, bool restart) -{ - MessageOut msg(restart ? PGMSG_NPC_TALK : PGMSG_NPC_TALK_NEXT); - msg.writeInt16(id); - Net::GameServer::connection->send(msg); -} - -void Net::GameServer::Player::selectFromNPC(int id, int choice) -{ - MessageOut msg(PGMSG_NPC_SELECT); - msg.writeInt16(id); - msg.writeInt8(choice); - Net::GameServer::connection->send(msg); -} - void Net::GameServer::Player::requestTrade(int id) { MessageOut msg(PGMSG_TRADE_REQUEST); @@ -143,14 +85,6 @@ void Net::GameServer::Player::acceptTrade(bool accept) Net::GameServer::connection->send(msg); } -void Net::GameServer::Player::tradeItem(int slot, int amount) -{ - MessageOut msg(PGMSG_TRADE_ADD_ITEM); - msg.writeInt8(slot); - msg.writeInt8(amount); - Net::GameServer::connection->send(msg); -} - void Net::GameServer::Player::tradeMoney(int amount) { MessageOut msg(PGMSG_TRADE_SET_MONEY); @@ -158,23 +92,6 @@ void Net::GameServer::Player::tradeMoney(int amount) Net::GameServer::connection->send(msg); } -void Net::GameServer::Player::tradeWithNPC(int item, int amount) -{ - MessageOut msg(PGMSG_NPC_BUYSELL); - msg.writeInt16(item); - msg.writeInt16(amount); - Net::GameServer::connection->send(msg); -} - -void Net::GameServer::Player::sendLetter(const std::string &player, - const std::string &text) -{ - MessageOut msg(PGMSG_NPC_POST_SEND); - msg.writeString(player); - msg.writeString(text); - Net::GameServer::connection->send(msg); -} - void Net::GameServer::Player::raiseAttribute(int attribute) { MessageOut msg(PGMSG_RAISE_ATTRIBUTE); @@ -194,10 +111,3 @@ void Net::GameServer::Player::respawn() MessageOut msg(PGMSG_RESPAWN); Net::GameServer::connection->send(msg); } - -void Net::GameServer::Player::changeDir(unsigned char dir) -{ - MessageOut msg(PGMSG_DIRECTION_CHANGE); - msg.writeInt8(dir); - Net::GameServer::connection->send(msg); -} diff --git a/src/net/tmwserv/gameserver/player.h b/src/net/tmwserv/gameserver/player.h index 3f33c7d5..eddd9102 100644 --- a/src/net/tmwserv/gameserver/player.h +++ b/src/net/tmwserv/gameserver/player.h @@ -40,30 +40,18 @@ namespace Net { namespace Player { - void say(const std::string &text); void walk(int x, int y); void pickUp(int x, int y); void moveItem(int oldSlot, int newSlot, int amount); - void drop(int slot, int amount); - void equip(int slot); - void unequip(int slot); - void useItem(int slot); void attack(int direction); void useSpecial(int special); - void changeAction(Being::Action action); - void talkToNPC(int id, bool restart); - void selectFromNPC(int id, int choice); void requestTrade(int id); void acceptTrade(bool accept); - void tradeItem(int slot, int amount); void tradeMoney(int amount); - void tradeWithNPC(int item, int amount); - void sendLetter(const std::string &player, const std::string &text); void raiseAttribute(int attribute); void lowerAttribute(int attribute); void respawn(); static RespawnRequestListener respawnListener; - void changeDir(unsigned char dir); } } } |