diff options
Diffstat (limited to 'src/net/tmwa')
-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 |
10 files changed, 67 insertions, 67 deletions
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); |