summaryrefslogtreecommitdiff
path: root/src/net/manaserv
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/manaserv')
-rw-r--r--src/net/manaserv/chathandler.cpp14
-rw-r--r--src/net/manaserv/generalhandler.cpp18
-rw-r--r--src/net/manaserv/generalhandler.h4
-rw-r--r--src/net/manaserv/inventoryhandler.cpp20
-rw-r--r--src/net/manaserv/inventoryhandler.h4
-rw-r--r--src/net/manaserv/npchandler.cpp62
-rw-r--r--src/net/manaserv/playerhandler.cpp2
7 files changed, 62 insertions, 62 deletions
diff --git a/src/net/manaserv/chathandler.cpp b/src/net/manaserv/chathandler.cpp
index 021dddf0..6c97fae3 100644
--- a/src/net/manaserv/chathandler.cpp
+++ b/src/net/manaserv/chathandler.cpp
@@ -165,8 +165,8 @@ void ChatHandler::handleGameChatMessage(Net::MessageIn &msg)
std::string mes = being->getName() + " : " + chatMsg;
- Mana::Event event(being == player_node ? Mana::Event::Player
- : Mana::Event::Being);
+ Event event(being == player_node ? Event::Player
+ : Event::Being);
event.setString("message", mes);
event.setString("text", chatMsg);
event.setString("nick", being->getName());
@@ -174,7 +174,7 @@ void ChatHandler::handleGameChatMessage(Net::MessageIn &msg)
event.setInt("permissions", player_relations
.checkPermissionSilently(being->getName(),
PlayerRelation::SPEECH_LOG | PlayerRelation::SPEECH_FLOAT));
- event.trigger(Mana::Event::ChatChannel);
+ event.trigger(Event::ChatChannel);
}
void ChatHandler::handleEnterChannelResponse(Net::MessageIn &msg)
@@ -234,18 +234,18 @@ void ChatHandler::handlePrivateMessage(Net::MessageIn &msg)
std::string userNick = msg.readString();
std::string chatMsg = msg.readString();
- Mana::Event event(Mana::Event::Whisper);
+ Event event(Event::Whisper);
event.setString("nick", userNick);
event.setString("message", chatMsg);
- event.trigger(Mana::Event::ChatChannel);
+ event.trigger(Event::ChatChannel);
}
void ChatHandler::handleAnnouncement(Net::MessageIn &msg)
{
std::string chatMsg = msg.readString();
- Mana::Event event(Mana::Event::Announcement);
+ Event event(Event::Announcement);
event.setString("message", chatMsg);
- event.trigger(Mana::Event::ChatChannel);
+ event.trigger(Event::ChatChannel);
}
void ChatHandler::handleChatMessage(Net::MessageIn &msg)
diff --git a/src/net/manaserv/generalhandler.cpp b/src/net/manaserv/generalhandler.cpp
index e5e7ef95..68d5ee9e 100644
--- a/src/net/manaserv/generalhandler.cpp
+++ b/src/net/manaserv/generalhandler.cpp
@@ -91,8 +91,8 @@ GeneralHandler::GeneralHandler():
generalHandler = this;
- listen(Mana::Event::ClientChannel);
- listen(Mana::Event::GameChannel);
+ listen(Event::ClientChannel);
+ listen(Event::GameChannel);
}
void GeneralHandler::load()
@@ -171,12 +171,12 @@ void GeneralHandler::clearHandlers()
clearNetworkHandlers();
}
-void GeneralHandler::event(Mana::Event::Channel channel,
- const Mana::Event &event)
+void GeneralHandler::event(Event::Channel channel,
+ const Event &event)
{
- if (channel == Mana::Event::ClientChannel)
+ if (channel == Event::ClientChannel)
{
- if (event.getType() == Mana::Event::StateChange)
+ if (event.getType() == Event::StateChange)
{
int newState = event.getInt("newState");
@@ -186,15 +186,15 @@ void GeneralHandler::event(Mana::Event::Channel channel,
game->gameLoading();
}
}
- else if (event.getType() == Mana::Event::LoadingDatabases)
+ else if (event.getType() == Event::LoadingDatabases)
{
Attributes::load();
Attributes::informItemDB();
}
}
- else if (channel == Mana::Event::GameChannel)
+ else if (channel == Event::GameChannel)
{
- if (event.getType() == Mana::Event::GuiWindowsLoaded)
+ if (event.getType() == Event::GuiWindowsLoaded)
{
inventoryWindow->setSplitAllowed(true);
skillDialog->loadSkills("mana-skills.xml");
diff --git a/src/net/manaserv/generalhandler.h b/src/net/manaserv/generalhandler.h
index 20c4c338..a840f02f 100644
--- a/src/net/manaserv/generalhandler.h
+++ b/src/net/manaserv/generalhandler.h
@@ -31,7 +31,7 @@
namespace ManaServ {
-class GeneralHandler : public Net::GeneralHandler, public Mana::Listener
+class GeneralHandler : public Net::GeneralHandler, public Listener
{
public:
GeneralHandler();
@@ -46,7 +46,7 @@ class GeneralHandler : public Net::GeneralHandler, public Mana::Listener
void clearHandlers();
- void event(Mana::Event::Channel channel, const Mana::Event &event);
+ void event(Event::Channel channel, const Event &event);
protected:
MessageHandlerPtr mBeingHandler;
diff --git a/src/net/manaserv/inventoryhandler.cpp b/src/net/manaserv/inventoryhandler.cpp
index 0fd57225..ff9b69e6 100644
--- a/src/net/manaserv/inventoryhandler.cpp
+++ b/src/net/manaserv/inventoryhandler.cpp
@@ -52,7 +52,7 @@ InventoryHandler::InventoryHandler()
handledMessages = _messages;
inventoryHandler = this;
- listen(Mana::Event::ItemChannel);
+ listen(Event::ItemChannel);
}
void InventoryHandler::handleMessage(Net::MessageIn &msg)
@@ -108,10 +108,10 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
}
}
-void InventoryHandler::event(Mana::Event::Channel channel,
- const Mana::Event &event)
+void InventoryHandler::event(Event::Channel channel,
+ const Event &event)
{
- if (channel == Mana::Event::ItemChannel)
+ if (channel == Event::ItemChannel)
{
Item *item = event.getItem("item");
@@ -120,13 +120,13 @@ void InventoryHandler::event(Mana::Event::Channel channel,
int index = item->getInvIndex();
- if (event.getType() == Mana::Event::DoEquip)
+ if (event.getType() == Event::DoEquip)
{
MessageOut msg(PGMSG_EQUIP);
msg.writeInt8(index);
gameServerConnection->send(msg);
}
- else if (event.getType() == Mana::Event::DoUnequip)
+ else if (event.getType() == Event::DoUnequip)
{
MessageOut msg(PGMSG_UNEQUIP);
msg.writeInt8(index);
@@ -136,13 +136,13 @@ void InventoryHandler::event(Mana::Event::Channel channel,
// for instance.
mEquips.setEquipment(index, 0, 0);
}
- else if (event.getType() == Mana::Event::DoUse)
+ else if (event.getType() == Event::DoUse)
{
MessageOut msg(PGMSG_USE_ITEM);
msg.writeInt8(index);
gameServerConnection->send(msg);
}
- else if (event.getType() == Mana::Event::DoDrop)
+ else if (event.getType() == Event::DoDrop)
{
int amount = event.getInt("amount", 1);
@@ -151,7 +151,7 @@ void InventoryHandler::event(Mana::Event::Channel channel,
msg.writeInt8(amount);
gameServerConnection->send(msg);
}
- else if (event.getType() == Mana::Event::DoSplit)
+ else if (event.getType() == Event::DoSplit)
{
int amount = event.getInt("amount", 1);
@@ -165,7 +165,7 @@ void InventoryHandler::event(Mana::Event::Channel channel,
gameServerConnection->send(msg);
}
}
- else if (event.getType() == Mana::Event::DoMove)
+ else if (event.getType() == Event::DoMove)
{
int newIndex = event.getInt("newIndex", -1);
diff --git a/src/net/manaserv/inventoryhandler.h b/src/net/manaserv/inventoryhandler.h
index 5577e431..efa318ad 100644
--- a/src/net/manaserv/inventoryhandler.h
+++ b/src/net/manaserv/inventoryhandler.h
@@ -59,14 +59,14 @@ class EquipBackend : public Equipment::Backend
};
class InventoryHandler : public MessageHandler, Net::InventoryHandler,
- public Mana::Listener
+ public Listener
{
public:
InventoryHandler();
void handleMessage(Net::MessageIn &msg);
- void event(Mana::Event::Channel channel, const Mana::Event &event);
+ void event(Event::Channel channel, const Event &event);
bool canSplit(const Item *item);
diff --git a/src/net/manaserv/npchandler.cpp b/src/net/manaserv/npchandler.cpp
index 2642067c..1c89f39f 100644
--- a/src/net/manaserv/npchandler.cpp
+++ b/src/net/manaserv/npchandler.cpp
@@ -62,12 +62,12 @@ void NpcHandler::handleMessage(Net::MessageIn &msg)
}
int npcId = being->getId(), count = 0;
- Mana::Event *event = 0;
+ Event *event = 0;
switch (msg.getId())
{
case GPMSG_NPC_CHOICE:
- event = new Mana::Event(Mana::Event::Menu);
+ event = new Event(Event::Menu);
event->setInt("id", npcId);
while (msg.getUnreadLength())
{
@@ -75,52 +75,52 @@ void NpcHandler::handleMessage(Net::MessageIn &msg)
event->setString("choice" + toString(count), msg.readString());
}
event->setInt("choiceCount", count);
- event->trigger(Mana::Event::NpcChannel);
+ event->trigger(Event::NpcChannel);
break;
case GPMSG_NPC_NUMBER:
- event = new Mana::Event(Mana::Event::IntegerInput);
+ event = new Event(Event::IntegerInput);
event->setInt("id", npcId);
event->setInt("min", msg.readInt32());
event->setInt("max", msg.readInt32());
event->setInt("default", msg.readInt32());
- event->trigger(Mana::Event::NpcChannel);
+ event->trigger(Event::NpcChannel);
break;
case GPMSG_NPC_STRING:
- event = new Mana::Event(Mana::Event::StringInput);
+ event = new Event(Event::StringInput);
event->setInt("id", npcId);
- event->trigger(Mana::Event::NpcChannel);
+ event->trigger(Event::NpcChannel);
break;
case GPMSG_NPC_POST:
- event = new Mana::Event(Mana::Event::Post);
+ event = new Event(Event::Post);
event->setInt("id", npcId);
- event->trigger(Mana::Event::NpcChannel);
+ event->trigger(Event::NpcChannel);
break;
case GPMSG_NPC_ERROR:
- event = new Mana::Event(Mana::Event::End);
+ event = new Event(Event::End);
event->setInt("id", npcId);
- event->trigger(Mana::Event::NpcChannel);
+ event->trigger(Event::NpcChannel);
break;
case GPMSG_NPC_MESSAGE:
- event = new Mana::Event(Mana::Event::Message);
+ event = new Event(Event::Message);
event->setInt("id", npcId);
event->setString("text", msg.readString(msg.getUnreadLength()));
- event->trigger(Mana::Event::NpcChannel);
+ event->trigger(Event::NpcChannel);
delete event;
- event = new Mana::Event(Mana::Event::Next);
+ event = new Event(Event::Next);
event->setInt("id", npcId);
- event->trigger(Mana::Event::NpcChannel);
+ event->trigger(Event::NpcChannel);
break;
case GPMSG_NPC_CLOSE:
- event = new Mana::Event(Mana::Event::Close);
+ event = new Event(Event::Close);
event->setInt("id", npcId);
- event->trigger(Mana::Event::NpcChannel);
+ event->trigger(Event::NpcChannel);
break;
}
@@ -169,9 +169,9 @@ void NpcHandler::talk(int npcId)
msg.writeInt16(npcId);
gameServerConnection->send(msg);
- Mana::Event event(Mana::Event::TalkSent);
+ Event event(Event::TalkSent);
event.setInt("npcId", npcId);
- event.trigger(Mana::Event::NpcChannel);
+ event.trigger(Event::NpcChannel);
}
void NpcHandler::nextDialog(int npcId)
@@ -180,9 +180,9 @@ void NpcHandler::nextDialog(int npcId)
msg.writeInt16(npcId);
gameServerConnection->send(msg);
- Mana::Event event(Mana::Event::NextSent);
+ Event event(Event::NextSent);
event.setInt("npcId", npcId);
- event.trigger(Mana::Event::NpcChannel);
+ event.trigger(Event::NpcChannel);
}
void NpcHandler::closeDialog(int npcId)
@@ -191,9 +191,9 @@ void NpcHandler::closeDialog(int npcId)
msg.writeInt16(npcId);
gameServerConnection->send(msg);
- Mana::Event event(Mana::Event::CloseSent);
+ Event event(Event::CloseSent);
event.setInt("npcId", npcId);
- event.trigger(Mana::Event::NpcChannel);
+ event.trigger(Event::NpcChannel);
}
void NpcHandler::menuSelect(int npcId, int choice)
@@ -203,10 +203,10 @@ void NpcHandler::menuSelect(int npcId, int choice)
msg.writeInt8(choice);
gameServerConnection->send(msg);
- Mana::Event event(Mana::Event::MenuSent);
+ Event event(Event::MenuSent);
event.setInt("npcId", npcId);
event.setInt("choice", choice);
- event.trigger(Mana::Event::NpcChannel);
+ event.trigger(Event::NpcChannel);
}
void NpcHandler::integerInput(int npcId, int value)
@@ -216,10 +216,10 @@ void NpcHandler::integerInput(int npcId, int value)
msg.writeInt32(value);
gameServerConnection->send(msg);
- Mana::Event event(Mana::Event::IntegerInputSent);
+ Event event(Event::IntegerInputSent);
event.setInt("npcId", npcId);
event.setInt("value", value);
- event.trigger(Mana::Event::NpcChannel);
+ event.trigger(Event::NpcChannel);
}
void NpcHandler::stringInput(int npcId, const std::string &value)
@@ -229,10 +229,10 @@ void NpcHandler::stringInput(int npcId, const std::string &value)
msg.writeString(value);
gameServerConnection->send(msg);
- Mana::Event event(Mana::Event::StringInputSent);
+ Event event(Event::StringInputSent);
event.setInt("npcId", npcId);
event.setString("value", value);
- event.trigger(Mana::Event::NpcChannel);
+ event.trigger(Event::NpcChannel);
}
void NpcHandler::sendLetter(int npcId, const std::string &recipient,
@@ -243,11 +243,11 @@ void NpcHandler::sendLetter(int npcId, const std::string &recipient,
msg.writeString(text);
gameServerConnection->send(msg);
- Mana::Event event(Mana::Event::SendLetterSent);
+ Event event(Event::SendLetterSent);
event.setInt("npcId", npcId);
event.setString("recipient", recipient);
event.setString("text", text);
- event.trigger(Mana::Event::NpcChannel);
+ event.trigger(Event::NpcChannel);
}
} // namespace ManaServ
diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp
index 96d01e41..e86f9afa 100644
--- a/src/net/manaserv/playerhandler.cpp
+++ b/src/net/manaserv/playerhandler.cpp
@@ -65,7 +65,7 @@ void RespawnRequestListener::action(const gcn::ActionEvent &event)
{
Net::getPlayerHandler()->respawn();
- Mana::Event::trigger(Mana::Event::NpcChannel, Mana::Event::CloseAll);
+ Event::trigger(Event::NpcChannel, Event::CloseAll);
}
PlayerHandler::PlayerHandler()