summaryrefslogtreecommitdiff
path: root/src/net/gameserver
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-02-27 13:54:18 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-02-27 13:54:18 +0000
commit7dff43c3cc3733c7222e3f036b76e896aa86d4e9 (patch)
tree1ab421a28db6b7969a53efbe8cc39429021309a6 /src/net/gameserver
parent9355a8113d0a3e084d67aa181ead54715702ee98 (diff)
downloadmana-7dff43c3cc3733c7222e3f036b76e896aa86d4e9.tar.gz
mana-7dff43c3cc3733c7222e3f036b76e896aa86d4e9.tar.bz2
mana-7dff43c3cc3733c7222e3f036b76e896aa86d4e9.tar.xz
mana-7dff43c3cc3733c7222e3f036b76e896aa86d4e9.zip
Implemented provisorical player respawn.
Diffstat (limited to 'src/net/gameserver')
-rw-r--r--src/net/gameserver/player.cpp11
-rw-r--r--src/net/gameserver/player.h10
2 files changed, 21 insertions, 0 deletions
diff --git a/src/net/gameserver/player.cpp b/src/net/gameserver/player.cpp
index 67edc7ad..d8050d2b 100644
--- a/src/net/gameserver/player.cpp
+++ b/src/net/gameserver/player.cpp
@@ -29,6 +29,11 @@
#include "../messageout.h"
#include "../protocol.h"
+void RespawnRequestListener::action(const gcn::ActionEvent &event)
+{
+ Net::GameServer::Player::respawn();
+}
+
void Net::GameServer::Player::say(const std::string &text)
{
MessageOut msg(PGMSG_SAY);
@@ -168,3 +173,9 @@ void Net::GameServer::Player::lowerAttribute(int attribute)
msg.writeInt8(attribute);
Net::GameServer::connection->send(msg);
}
+
+void Net::GameServer::Player::respawn()
+{
+ MessageOut msg(PGMSG_RESPAWN);
+ Net::GameServer::connection->send(msg);
+}
diff --git a/src/net/gameserver/player.h b/src/net/gameserver/player.h
index 7ebb2830..eea15c2b 100644
--- a/src/net/gameserver/player.h
+++ b/src/net/gameserver/player.h
@@ -26,8 +26,16 @@
#include "../../being.h"
+#include <guichan/actionlistener.hpp>
+
#include <iosfwd>
+
+struct RespawnRequestListener : public gcn::ActionListener
+{
+ void action(const gcn::ActionEvent &event);
+};
+
namespace Net
{
namespace GameServer
@@ -53,6 +61,8 @@ namespace Net
void tradeWithNPC(int item, int amount);
void raiseAttribute(int attribute);
void lowerAttribute(int attribute);
+ void respawn();
+ static RespawnRequestListener respawnListener;
}
}
}