diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-04-09 00:16:28 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-04-09 17:54:13 +0200 |
commit | 404d3f7f2f9aa455bea423a6a00025df23cd6687 (patch) | |
tree | 27f6655b3345be1ab109433a55b0512dfe48cb34 /src/net | |
parent | 1e1f619b9ae5aa26058c499c988f45d1fb1b6d53 (diff) | |
download | mana-client-404d3f7f2f9aa455bea423a6a00025df23cd6687.tar.gz mana-client-404d3f7f2f9aa455bea423a6a00025df23cd6687.tar.bz2 mana-client-404d3f7f2f9aa455bea423a6a00025df23cd6687.tar.xz mana-client-404d3f7f2f9aa455bea423a6a00025df23cd6687.zip |
Removed the Mana namespace
It's just an annoyance when it's only applied to a few classes. Either
we place everything in this namespace or nothing, and at the moment I
don't see any rationale for placing everything in a Mana namespace.
Acked-by: Jared Adams
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/manaserv/chathandler.cpp | 14 | ||||
-rw-r--r-- | src/net/manaserv/generalhandler.cpp | 18 | ||||
-rw-r--r-- | src/net/manaserv/generalhandler.h | 4 | ||||
-rw-r--r-- | src/net/manaserv/inventoryhandler.cpp | 20 | ||||
-rw-r--r-- | src/net/manaserv/inventoryhandler.h | 4 | ||||
-rw-r--r-- | src/net/manaserv/npchandler.cpp | 62 | ||||
-rw-r--r-- | src/net/manaserv/playerhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/chathandler.cpp | 24 | ||||
-rw-r--r-- | src/net/tmwa/gamehandler.cpp | 10 | ||||
-rw-r--r-- | src/net/tmwa/gamehandler.h | 4 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.cpp | 12 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.h | 4 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.cpp | 20 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.h | 4 | ||||
-rw-r--r-- | src/net/tmwa/npchandler.cpp | 52 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/tradehandler.cpp | 2 |
17 files changed, 129 insertions, 129 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() diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index a992b1a2..51974eb2 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -82,20 +82,20 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) break; case 0x01: { - Mana::Event event(Mana::Event::WhisperError); + Event event(Event::WhisperError); event.setString("nick", nick); event.setString("error", strprintf(_("Whisper could " "not be sent, %s is offline."), nick.c_str())); - event.trigger(Mana::Event::ChatChannel); + event.trigger(Event::ChatChannel); } break; case 0x02: { - Mana::Event event(Mana::Event::WhisperError); + Event event(Event::WhisperError); event.setString("nick", nick); event.setString("error", strprintf(_("Whisper could " "not be sent, ignored by %s."), nick.c_str())); - event.Event::trigger(Mana::Event::ChatChannel); + event.Event::trigger(Event::ChatChannel); } break; } @@ -115,10 +115,10 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) { if (player_relations.hasPermission(nick, PlayerRelation::WHISPER)) { - Mana::Event event(Mana::Event::Whisper); + Event event(Event::Whisper); event.setString("nick", nick); event.setString("message", chatMsg); - event.trigger(Mana::Event::ChatChannel); + event.trigger(Event::ChatChannel); } } else @@ -174,13 +174,13 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) std::string reducedMessage = chatMsg; chatMsg = removeColors(sender_name) + " : " + reducedMessage; - Mana::Event event(Mana::Event::Being); + Event event(Event::Being); event.setString("message", chatMsg); event.setString("text", reducedMessage); event.setString("nick", sender_name); event.setInt("beingId", beingId); event.setInt("permissions", perms); - event.trigger(Mana::Event::ChatChannel); + event.trigger(Event::ChatChannel); break; } @@ -205,7 +205,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) trim(chatMsg); - Mana::Event event(Mana::Event::Player); + Event event(Event::Player); event.setString("message", mes); event.setString("text", chatMsg); event.setString("nick", player_node->getName()); @@ -213,13 +213,13 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) event.setInt("permissions", player_relations.getDefault() & (PlayerRelation::SPEECH_LOG | PlayerRelation::SPEECH_FLOAT)); - event.trigger(Mana::Event::ChatChannel); + event.trigger(Event::ChatChannel); } else { - Mana::Event event(Mana::Event::Announcement); + Event event(Event::Announcement); event.setString("message", chatMsg); - event.trigger(Mana::Event::ChatChannel); + event.trigger(Event::ChatChannel); } break; } diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index 79686953..0b3c7d38 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -58,7 +58,7 @@ GameHandler::GameHandler() handledMessages = _messages; gameHandler = this; - listen(Mana::Event::GameChannel); + listen(Event::GameChannel); } void GameHandler::handleMessage(Net::MessageIn &msg) @@ -105,15 +105,15 @@ void GameHandler::handleMessage(Net::MessageIn &msg) } } -void GameHandler::event(Mana::Event::Channel channel, const Mana::Event &event) +void GameHandler::event(Event::Channel channel, const Event &event) { - if (channel == Mana::Event::GameChannel) + if (channel == Event::GameChannel) { - if (event.getType() == Mana::Event::EnginesInitialized) + if (event.getType() == Event::EnginesInitialized) { Game::instance()->changeMap(mMap); } - else if (event.getType() == Mana::Event::MapLoaded) + else if (event.getType() == Event::MapLoaded) { MessageOut outMsg(CMSG_MAP_LOADED); } diff --git a/src/net/tmwa/gamehandler.h b/src/net/tmwa/gamehandler.h index 858f16b3..b24bd42b 100644 --- a/src/net/tmwa/gamehandler.h +++ b/src/net/tmwa/gamehandler.h @@ -34,14 +34,14 @@ namespace TmwAthena { class GameHandler : public MessageHandler, public Net::GameHandler, - public Mana::Listener + public Listener { public: GameHandler(); void handleMessage(Net::MessageIn &msg); - void event(Mana::Event::Channel channel, const Mana::Event &event); + void event(Event::Channel channel, const Event &event); void connect(); diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index d4374d4a..ef59ee12 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -108,7 +108,7 @@ GeneralHandler::GeneralHandler(): setStatsList(stats); - listen(Mana::Event::GameChannel); + listen(Event::GameChannel); } GeneralHandler::~GeneralHandler() @@ -217,12 +217,12 @@ void GeneralHandler::clearHandlers() mNetwork->clearHandlers(); } -void GeneralHandler::event(Mana::Event::Channel channel, - const Mana::Event &event) +void GeneralHandler::event(Event::Channel channel, + const Event &event) { - if (channel == Mana::Event::GameChannel) + if (channel == Event::GameChannel) { - if (event.getType() == Mana::Event::GuiWindowsLoaded) + if (event.getType() == Event::GuiWindowsLoaded) { inventoryWindow->setSplitAllowed(false); skillDialog->loadSkills("ea-skills.xml"); @@ -242,7 +242,7 @@ void GeneralHandler::event(Mana::Event::Channel channel, statusWindow->addAttribute(FLEE, _("% Evade"), false, ""); statusWindow->addAttribute(CRIT, _("% Critical"), false, ""); } - else if (event.getType() == Mana::Event::GuiWindowsUnloading) + else if (event.getType() == Event::GuiWindowsUnloading) { socialWindow->removeTab(taGuild); socialWindow->removeTab(taParty); diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index d7b5f743..a5f65e63 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -32,7 +32,7 @@ namespace TmwAthena { class GeneralHandler : public MessageHandler, public Net::GeneralHandler, - public Mana::Listener + public Listener { public: GeneralHandler(); @@ -51,7 +51,7 @@ class GeneralHandler : public MessageHandler, public Net::GeneralHandler, void clearHandlers(); - void event(Mana::Event::Channel channel, const Mana::Event &event); + void event(Event::Channel channel, const Event &event); protected: MessageHandlerPtr mAdminHandler; diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 6bba2afd..18e8febc 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -110,7 +110,7 @@ InventoryHandler::InventoryHandler() mStorage = 0; mStorageWindow = 0; - listen(Mana::Event::ItemChannel); + listen(Event::ItemChannel); } InventoryHandler::~InventoryHandler() @@ -431,12 +431,12 @@ 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) { - if (event.getType() == Mana::Event::DoCloseInventory) + if (event.getType() == Event::DoCloseInventory) { // No need to worry about type MessageOut outMsg(CMSG_CLOSE_STORAGE); @@ -450,24 +450,24 @@ void InventoryHandler::event(Mana::Event::Channel channel, int index = item->getInvIndex() + INVENTORY_OFFSET; - if (event.getType() == Mana::Event::DoEquip) + if (event.getType() == Event::DoEquip) { MessageOut outMsg(CMSG_PLAYER_EQUIP); outMsg.writeInt16(index); outMsg.writeInt16(0); } - else if (event.getType() == Mana::Event::DoUnequip) + else if (event.getType() == Event::DoUnequip) { MessageOut outMsg(CMSG_PLAYER_UNEQUIP); outMsg.writeInt16(index); } - else if (event.getType() == Mana::Event::DoUse) + else if (event.getType() == Event::DoUse) { MessageOut outMsg(CMSG_PLAYER_INVENTORY_USE); outMsg.writeInt16(index); outMsg.writeInt32(item->getId()); // unused } - else if (event.getType() == Mana::Event::DoDrop) + else if (event.getType() == Event::DoDrop) { int amount = event.getInt("amount", 1); @@ -477,7 +477,7 @@ void InventoryHandler::event(Mana::Event::Channel channel, outMsg.writeInt16(index); outMsg.writeInt16(amount); } - else if (event.getType() == Mana::Event::DoMove) + else if (event.getType() == Event::DoMove) { int newIndex = event.getInt("newIndex", -1); diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h index 8edb34ad..afbdd7b4 100644 --- a/src/net/tmwa/inventoryhandler.h +++ b/src/net/tmwa/inventoryhandler.h @@ -119,7 +119,7 @@ class InventoryItem typedef std::list<InventoryItem> InventoryItems; class InventoryHandler : public MessageHandler, public Net::InventoryHandler, - public Mana::Listener + public Listener { public: enum { @@ -133,7 +133,7 @@ class InventoryHandler : public MessageHandler, public Net::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/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index a55a3183..092e3046 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -38,7 +38,7 @@ extern Net::NpcHandler *npcHandler; -static void parseMenu(Mana::Event *event, const std::string &options) +static void parseMenu(Event *event, const std::string &options) { std::istringstream iss(options); @@ -78,50 +78,50 @@ void NpcHandler::handleMessage(Net::MessageIn &msg) } int npcId = msg.readInt32(); - Mana::Event *event = 0; + Event *event = 0; switch (msg.getId()) { case SMSG_NPC_CHOICE: - event = new Mana::Event(Mana::Event::Menu); + event = new Event(Event::Menu); event->setInt("id", npcId); parseMenu(event, msg.readString(msg.getLength() - 8)); - event->trigger(Mana::Event::NpcChannel); + event->trigger(Event::NpcChannel); break; case SMSG_NPC_MESSAGE: - event = new Mana::Event(Mana::Event::Message); + event = new Event(Event::Message); event->setInt("id", npcId); event->setString("text", msg.readString(msg.getLength() - 8)); - event->trigger(Mana::Event::NpcChannel); + event->trigger(Event::NpcChannel); break; case SMSG_NPC_CLOSE: // Show the close button - 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; case SMSG_NPC_NEXT: // Show the next button - 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 SMSG_NPC_INT_INPUT: // Request for an integer - event = new Mana::Event(Mana::Event::IntegerInput); + event = new Event(Event::IntegerInput); event->setInt("id", npcId); - event->trigger(Mana::Event::NpcChannel); + event->trigger(Event::NpcChannel); break; case SMSG_NPC_STR_INPUT: // Request for a 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; } @@ -177,9 +177,9 @@ void NpcHandler::talk(int npcId) outMsg.writeInt32(npcId); outMsg.writeInt8(0); // Unused - 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) @@ -187,9 +187,9 @@ void NpcHandler::nextDialog(int npcId) MessageOut outMsg(CMSG_NPC_NEXT_REQUEST); outMsg.writeInt32(npcId); - 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) @@ -197,9 +197,9 @@ void NpcHandler::closeDialog(int npcId) MessageOut outMsg(CMSG_NPC_CLOSE); outMsg.writeInt32(npcId); - 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) @@ -208,10 +208,10 @@ void NpcHandler::menuSelect(int npcId, int choice) outMsg.writeInt32(npcId); outMsg.writeInt8(choice); - 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) @@ -220,10 +220,10 @@ void NpcHandler::integerInput(int npcId, int value) outMsg.writeInt32(npcId); outMsg.writeInt32(value); - 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) @@ -234,10 +234,10 @@ void NpcHandler::stringInput(int npcId, const std::string &value) outMsg.writeString(value, value.length()); outMsg.writeInt8(0); // Prevent problems with string reading - 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, diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index 4b60414b..ec004917 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -81,7 +81,7 @@ namespace { viewport->closePopupMenu(); - Mana::Event::trigger(Mana::Event::NpcChannel, Mana::Event::CloseAll); + Event::trigger(Event::NpcChannel, Event::CloseAll); } } deathListener; diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp index 80249784..69ba24af 100644 --- a/src/net/tmwa/tradehandler.cpp +++ b/src/net/tmwa/tradehandler.cpp @@ -191,7 +191,7 @@ void TradeHandler::handleMessage(Net::MessageIn &msg) // Successfully added item if (item->isEquippable() && item->isEquipped()) { - item->doEvent(Mana::Event::DoUnequip); + item->doEvent(Event::DoUnequip); } tradeWindow->addItem(item->getId(), true, quantity); |