summaryrefslogtreecommitdiff
path: root/src/net/manaserv/npchandler.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-11-03 12:06:48 -0700
committerJared Adams <jaxad0127@gmail.com>2009-11-03 12:06:48 -0700
commite07e2a6db902f2ce0095b65708a98fa4dbf40aa0 (patch)
treeb91b3e3d3f06199dcc34e32834941964a263e0be /src/net/manaserv/npchandler.cpp
parente2897e4a7cb7eb0c4a7e46d72a9a19b909368c26 (diff)
downloadmana-e07e2a6db902f2ce0095b65708a98fa4dbf40aa0.tar.gz
mana-e07e2a6db902f2ce0095b65708a98fa4dbf40aa0.tar.bz2
mana-e07e2a6db902f2ce0095b65708a98fa4dbf40aa0.tar.xz
mana-e07e2a6db902f2ce0095b65708a98fa4dbf40aa0.zip
Simplify ManaServ netcode some more
Diffstat (limited to 'src/net/manaserv/npchandler.cpp')
-rw-r--r--src/net/manaserv/npchandler.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/net/manaserv/npchandler.cpp b/src/net/manaserv/npchandler.cpp
index 7384d18e..4c4aa53f 100644
--- a/src/net/manaserv/npchandler.cpp
+++ b/src/net/manaserv/npchandler.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 "beingmanager.h"
#include "npc.h"
@@ -39,6 +36,8 @@ Net::NpcHandler *npcHandler;
namespace ManaServ {
+extern Connection *gameServerConnection;
+
NpcHandler::NpcHandler()
{
static const Uint16 _messages[] = {
@@ -114,21 +113,22 @@ void NpcHandler::talk(int npcId)
{
MessageOut msg(PGMSG_NPC_TALK);
msg.writeInt16(npcId);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void NpcHandler::nextDialog(int npcId)
{
MessageOut msg(PGMSG_NPC_TALK_NEXT);
msg.writeInt16(npcId);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void NpcHandler::closeDialog(int npcId)
{
MessageOut msg(PGMSG_NPC_TALK_NEXT);
msg.writeInt16(npcId);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
+
npcDialog->setVisible(false);
npcDialog->setText("");
}
@@ -138,7 +138,7 @@ void NpcHandler::listInput(int npcId, int value)
MessageOut msg(PGMSG_NPC_SELECT);
msg.writeInt16(npcId);
msg.writeInt8(value);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void NpcHandler::integerInput(int npcId, int value)
@@ -146,7 +146,7 @@ void NpcHandler::integerInput(int npcId, int value)
MessageOut msg(PGMSG_NPC_NUMBER);
msg.writeInt16(npcId);
msg.writeInt32(value);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void NpcHandler::stringInput(int npcId, const std::string &value)
@@ -154,7 +154,7 @@ void NpcHandler::stringInput(int npcId, const std::string &value)
MessageOut msg(PGMSG_NPC_STRING);
msg.writeInt16(npcId);
msg.writeString(value);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void NpcHandler::sendLetter(int npcId, const std::string &recipient,
@@ -163,7 +163,7 @@ void NpcHandler::sendLetter(int npcId, const std::string &recipient,
MessageOut msg(PGMSG_NPC_POST_SEND);
msg.writeString(recipient);
msg.writeString(text);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void NpcHandler::startShopping(int beingId)
@@ -186,7 +186,7 @@ void NpcHandler::buyItem(int beingId, int itemId, int amount)
MessageOut msg(PGMSG_NPC_BUYSELL);
msg.writeInt16(itemId);
msg.writeInt16(amount);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void NpcHandler::sellItem(int beingId, int itemId, int amount)
@@ -194,7 +194,7 @@ void NpcHandler::sellItem(int beingId, int itemId, int amount)
MessageOut msg(PGMSG_NPC_BUYSELL);
msg.writeInt16(itemId);
msg.writeInt16(amount);
- GameServer::connection->send(msg);
+ gameServerConnection->send(msg);
}
void NpcHandler::endShopping(int beingId)