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/playerhandler.cpp | |
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/playerhandler.cpp')
-rw-r--r-- | src/net/tmwserv/playerhandler.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/net/tmwserv/playerhandler.cpp b/src/net/tmwserv/playerhandler.cpp index f13484eb..441b5021 100644 --- a/src/net/tmwserv/playerhandler.cpp +++ b/src/net/tmwserv/playerhandler.cpp @@ -21,11 +21,14 @@ #include "net/tmwserv/playerhandler.h" +#include "net/tmwserv/connection.h" #include "net/tmwserv/protocol.h" +#include "net/tmwserv/gameserver/internal.h" #include "net/tmwserv/gameserver/player.h" #include "net/messagein.h" +#include "net/messageout.h" #include "effectmanager.h" #include "engine.h" @@ -362,13 +365,19 @@ void PlayerHandler::pickUp(FloorItem *floorItem) void PlayerHandler::setDirection(char direction) { - Net::GameServer::Player::changeDir(direction); + MessageOut msg(PGMSG_DIRECTION_CHANGE); + msg.writeInt8(direction); + Net::GameServer::connection->send(msg); } -void PlayerHandler::setDestination(int x, int y, int direction) +void PlayerHandler::setDestination(int x, int y, int /* direction */) { - Net::GameServer::Player::walk(x, y); - //Debugging fire burst + MessageOut msg(PGMSG_WALK); + msg.writeInt16(x); + msg.writeInt16(y); + Net::GameServer::connection->send(msg); + + // Debugging fire burst effectManager->trigger(15, x, y); } @@ -376,7 +385,10 @@ void PlayerHandler::changeAction(Being::Action action) { if (action == Being::SIT) player_node->setAction(action); - Net::GameServer::Player::changeAction(action); + + MessageOut msg(PGMSG_ACTION_CHANGE); + msg.writeInt8(action); + Net::GameServer::connection->send(msg); } void PlayerHandler::respawn() |