summaryrefslogtreecommitdiff
path: root/src/net/manaserv/playerhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/manaserv/playerhandler.cpp')
-rw-r--r--src/net/manaserv/playerhandler.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp
index fabf7c25..276b2c3a 100644
--- a/src/net/manaserv/playerhandler.cpp
+++ b/src/net/manaserv/playerhandler.cpp
@@ -26,9 +26,6 @@
#include "net/manaserv/messageout.h"
#include "net/manaserv/protocol.h"
-#include "net/manaserv/gameserver/internal.h"
-#include "net/manaserv/gameserver/player.h"
-
#include "net/net.h"
#include "effectmanager.h"
@@ -94,6 +91,13 @@ Net::PlayerHandler *playerHandler;
namespace ManaServ {
+void RespawnRequestListener::action(const gcn::ActionEvent &event)
+{
+ Net::getPlayerHandler()->respawn();
+}
+
+extern Connection *gameServerConnection;
+
PlayerHandler::PlayerHandler()
{
static const Uint16 _messages[] = {
@@ -328,7 +332,7 @@ void PlayerHandler::attack(int id)
{
MessageOut msg(PGMSG_ATTACK);
msg.writeInt16(id);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void PlayerHandler::emote(int emoteId)
@@ -340,14 +344,14 @@ void PlayerHandler::increaseAttribute(size_t attr)
{
MessageOut msg(PGMSG_RAISE_ATTRIBUTE);
msg.writeInt8(attr);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void PlayerHandler::decreaseAttribute(size_t attr)
{
MessageOut msg(PGMSG_LOWER_ATTRIBUTE);
msg.writeInt8(attr);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void PlayerHandler::increaseSkill(int skillId)
@@ -361,14 +365,14 @@ void PlayerHandler::pickUp(FloorItem *floorItem)
MessageOut msg(PGMSG_PICKUP);
msg.writeInt16(id >> 16);
msg.writeInt16(id & 0xFFFF);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void PlayerHandler::setDirection(char direction)
{
MessageOut msg(PGMSG_DIRECTION_CHANGE);
msg.writeInt8(direction);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void PlayerHandler::setDestination(int x, int y, int /* direction */)
@@ -376,7 +380,7 @@ void PlayerHandler::setDestination(int x, int y, int /* direction */)
MessageOut msg(PGMSG_WALK);
msg.writeInt16(x);
msg.writeInt16(y);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void PlayerHandler::changeAction(Being::Action action)
@@ -385,12 +389,13 @@ void PlayerHandler::changeAction(Being::Action action)
MessageOut msg(PGMSG_ACTION_CHANGE);
msg.writeInt8(action);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void PlayerHandler::respawn()
{
- // TODO
+ MessageOut msg(PGMSG_RESPAWN);
+ gameServerConnection->send(msg);
}
void PlayerHandler::ignorePlayer(const std::string &player, bool ignore)