diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-04-09 00:11:54 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-04-09 17:54:12 +0200 |
commit | 1e1f619b9ae5aa26058c499c988f45d1fb1b6d53 (patch) | |
tree | 1fe58c53388054ced122b5327e33fc2851a0606a /src/net | |
parent | 30d4b0adf4f17f05d1d62fc3428c896ef1079b6b (diff) | |
download | mana-1e1f619b9ae5aa26058c499c988f45d1fb1b6d53.tar.gz mana-1e1f619b9ae5aa26058c499c988f45d1fb1b6d53.tar.bz2 mana-1e1f619b9ae5aa26058c499c988f45d1fb1b6d53.tar.xz mana-1e1f619b9ae5aa26058c499c988f45d1fb1b6d53.zip |
Moved Channels to Mana::Event::Channel
Acked-by: Jared Adams
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/manaserv/chathandler.cpp | 6 | ||||
-rw-r--r-- | src/net/manaserv/generalhandler.cpp | 10 | ||||
-rw-r--r-- | src/net/manaserv/generalhandler.h | 2 | ||||
-rw-r--r-- | src/net/manaserv/inventoryhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/manaserv/inventoryhandler.h | 2 | ||||
-rw-r--r-- | src/net/manaserv/npchandler.cpp | 30 | ||||
-rw-r--r-- | src/net/manaserv/playerhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/chathandler.cpp | 12 | ||||
-rw-r--r-- | src/net/tmwa/gamehandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/gamehandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/npchandler.cpp | 24 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 2 |
16 files changed, 60 insertions, 60 deletions
diff --git a/src/net/manaserv/chathandler.cpp b/src/net/manaserv/chathandler.cpp index 07836c88..021dddf0 100644 --- a/src/net/manaserv/chathandler.cpp +++ b/src/net/manaserv/chathandler.cpp @@ -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(CHANNEL_CHAT); + event.trigger(Mana::Event::ChatChannel); } void ChatHandler::handleEnterChannelResponse(Net::MessageIn &msg) @@ -237,7 +237,7 @@ void ChatHandler::handlePrivateMessage(Net::MessageIn &msg) Mana::Event event(Mana::Event::Whisper); event.setString("nick", userNick); event.setString("message", chatMsg); - event.trigger(CHANNEL_CHAT); + event.trigger(Mana::Event::ChatChannel); } void ChatHandler::handleAnnouncement(Net::MessageIn &msg) @@ -245,7 +245,7 @@ void ChatHandler::handleAnnouncement(Net::MessageIn &msg) std::string chatMsg = msg.readString(); Mana::Event event(Mana::Event::Announcement); event.setString("message", chatMsg); - event.trigger(CHANNEL_CHAT); + event.trigger(Mana::Event::ChatChannel); } void ChatHandler::handleChatMessage(Net::MessageIn &msg) diff --git a/src/net/manaserv/generalhandler.cpp b/src/net/manaserv/generalhandler.cpp index f40b2bc2..e5e7ef95 100644 --- a/src/net/manaserv/generalhandler.cpp +++ b/src/net/manaserv/generalhandler.cpp @@ -91,8 +91,8 @@ GeneralHandler::GeneralHandler(): generalHandler = this; - listen(CHANNEL_CLIENT); - listen(CHANNEL_GAME); + listen(Mana::Event::ClientChannel); + listen(Mana::Event::GameChannel); } void GeneralHandler::load() @@ -171,10 +171,10 @@ void GeneralHandler::clearHandlers() clearNetworkHandlers(); } -void GeneralHandler::event(Channels channel, +void GeneralHandler::event(Mana::Event::Channel channel, const Mana::Event &event) { - if (channel == CHANNEL_CLIENT) + if (channel == Mana::Event::ClientChannel) { if (event.getType() == Mana::Event::StateChange) { @@ -192,7 +192,7 @@ void GeneralHandler::event(Channels channel, Attributes::informItemDB(); } } - else if (channel == CHANNEL_GAME) + else if (channel == Mana::Event::GameChannel) { if (event.getType() == Mana::Event::GuiWindowsLoaded) { diff --git a/src/net/manaserv/generalhandler.h b/src/net/manaserv/generalhandler.h index c8671ec1..20c4c338 100644 --- a/src/net/manaserv/generalhandler.h +++ b/src/net/manaserv/generalhandler.h @@ -46,7 +46,7 @@ class GeneralHandler : public Net::GeneralHandler, public Mana::Listener void clearHandlers(); - void event(Channels channel, const Mana::Event &event); + void event(Mana::Event::Channel channel, const Mana::Event &event); protected: MessageHandlerPtr mBeingHandler; diff --git a/src/net/manaserv/inventoryhandler.cpp b/src/net/manaserv/inventoryhandler.cpp index 56280f40..0fd57225 100644 --- a/src/net/manaserv/inventoryhandler.cpp +++ b/src/net/manaserv/inventoryhandler.cpp @@ -52,7 +52,7 @@ InventoryHandler::InventoryHandler() handledMessages = _messages; inventoryHandler = this; - listen(CHANNEL_ITEM); + listen(Mana::Event::ItemChannel); } void InventoryHandler::handleMessage(Net::MessageIn &msg) @@ -108,10 +108,10 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) } } -void InventoryHandler::event(Channels channel, +void InventoryHandler::event(Mana::Event::Channel channel, const Mana::Event &event) { - if (channel == CHANNEL_ITEM) + if (channel == Mana::Event::ItemChannel) { Item *item = event.getItem("item"); diff --git a/src/net/manaserv/inventoryhandler.h b/src/net/manaserv/inventoryhandler.h index bb68ceeb..5577e431 100644 --- a/src/net/manaserv/inventoryhandler.h +++ b/src/net/manaserv/inventoryhandler.h @@ -66,7 +66,7 @@ class InventoryHandler : public MessageHandler, Net::InventoryHandler, void handleMessage(Net::MessageIn &msg); - void event(Channels channel, const Mana::Event &event); + void event(Mana::Event::Channel channel, const Mana::Event &event); bool canSplit(const Item *item); diff --git a/src/net/manaserv/npchandler.cpp b/src/net/manaserv/npchandler.cpp index 91e57c72..2642067c 100644 --- a/src/net/manaserv/npchandler.cpp +++ b/src/net/manaserv/npchandler.cpp @@ -75,7 +75,7 @@ void NpcHandler::handleMessage(Net::MessageIn &msg) event->setString("choice" + toString(count), msg.readString()); } event->setInt("choiceCount", count); - event->trigger(CHANNEL_NPC); + event->trigger(Mana::Event::NpcChannel); break; case GPMSG_NPC_NUMBER: @@ -84,43 +84,43 @@ void NpcHandler::handleMessage(Net::MessageIn &msg) event->setInt("min", msg.readInt32()); event->setInt("max", msg.readInt32()); event->setInt("default", msg.readInt32()); - event->trigger(CHANNEL_NPC); + event->trigger(Mana::Event::NpcChannel); break; case GPMSG_NPC_STRING: event = new Mana::Event(Mana::Event::StringInput); event->setInt("id", npcId); - event->trigger(CHANNEL_NPC); + event->trigger(Mana::Event::NpcChannel); break; case GPMSG_NPC_POST: event = new Mana::Event(Mana::Event::Post); event->setInt("id", npcId); - event->trigger(CHANNEL_NPC); + event->trigger(Mana::Event::NpcChannel); break; case GPMSG_NPC_ERROR: event = new Mana::Event(Mana::Event::End); event->setInt("id", npcId); - event->trigger(CHANNEL_NPC); + event->trigger(Mana::Event::NpcChannel); break; case GPMSG_NPC_MESSAGE: event = new Mana::Event(Mana::Event::Message); event->setInt("id", npcId); event->setString("text", msg.readString(msg.getUnreadLength())); - event->trigger(CHANNEL_NPC); + event->trigger(Mana::Event::NpcChannel); delete event; event = new Mana::Event(Mana::Event::Next); event->setInt("id", npcId); - event->trigger(CHANNEL_NPC); + event->trigger(Mana::Event::NpcChannel); break; case GPMSG_NPC_CLOSE: event = new Mana::Event(Mana::Event::Close); event->setInt("id", npcId); - event->trigger(CHANNEL_NPC); + event->trigger(Mana::Event::NpcChannel); break; } @@ -171,7 +171,7 @@ void NpcHandler::talk(int npcId) Mana::Event event(Mana::Event::TalkSent); event.setInt("npcId", npcId); - event.trigger(CHANNEL_NPC); + event.trigger(Mana::Event::NpcChannel); } void NpcHandler::nextDialog(int npcId) @@ -182,7 +182,7 @@ void NpcHandler::nextDialog(int npcId) Mana::Event event(Mana::Event::NextSent); event.setInt("npcId", npcId); - event.trigger(CHANNEL_NPC); + event.trigger(Mana::Event::NpcChannel); } void NpcHandler::closeDialog(int npcId) @@ -193,7 +193,7 @@ void NpcHandler::closeDialog(int npcId) Mana::Event event(Mana::Event::CloseSent); event.setInt("npcId", npcId); - event.trigger(CHANNEL_NPC); + event.trigger(Mana::Event::NpcChannel); } void NpcHandler::menuSelect(int npcId, int choice) @@ -206,7 +206,7 @@ void NpcHandler::menuSelect(int npcId, int choice) Mana::Event event(Mana::Event::MenuSent); event.setInt("npcId", npcId); event.setInt("choice", choice); - event.trigger(CHANNEL_NPC); + event.trigger(Mana::Event::NpcChannel); } void NpcHandler::integerInput(int npcId, int value) @@ -219,7 +219,7 @@ void NpcHandler::integerInput(int npcId, int value) Mana::Event event(Mana::Event::IntegerInputSent); event.setInt("npcId", npcId); event.setInt("value", value); - event.trigger(CHANNEL_NPC); + event.trigger(Mana::Event::NpcChannel); } void NpcHandler::stringInput(int npcId, const std::string &value) @@ -232,7 +232,7 @@ void NpcHandler::stringInput(int npcId, const std::string &value) Mana::Event event(Mana::Event::StringInputSent); event.setInt("npcId", npcId); event.setString("value", value); - event.trigger(CHANNEL_NPC); + event.trigger(Mana::Event::NpcChannel); } void NpcHandler::sendLetter(int npcId, const std::string &recipient, @@ -247,7 +247,7 @@ void NpcHandler::sendLetter(int npcId, const std::string &recipient, event.setInt("npcId", npcId); event.setString("recipient", recipient); event.setString("text", text); - event.trigger(CHANNEL_NPC); + event.trigger(Mana::Event::NpcChannel); } } // namespace ManaServ diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp index d3c8822b..96d01e41 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(CHANNEL_NPC, Mana::Event::CloseAll); + Mana::Event::trigger(Mana::Event::NpcChannel, Mana::Event::CloseAll); } PlayerHandler::PlayerHandler() diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 5dc1206f..a992b1a2 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -86,7 +86,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) event.setString("nick", nick); event.setString("error", strprintf(_("Whisper could " "not be sent, %s is offline."), nick.c_str())); - event.trigger(CHANNEL_CHAT); + event.trigger(Mana::Event::ChatChannel); } break; case 0x02: @@ -95,7 +95,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) event.setString("nick", nick); event.setString("error", strprintf(_("Whisper could " "not be sent, ignored by %s."), nick.c_str())); - event.Event::trigger(CHANNEL_CHAT); + event.Event::trigger(Mana::Event::ChatChannel); } break; } @@ -118,7 +118,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) Mana::Event event(Mana::Event::Whisper); event.setString("nick", nick); event.setString("message", chatMsg); - event.trigger(CHANNEL_CHAT); + event.trigger(Mana::Event::ChatChannel); } } else @@ -180,7 +180,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) event.setString("nick", sender_name); event.setInt("beingId", beingId); event.setInt("permissions", perms); - event.trigger(CHANNEL_CHAT); + event.trigger(Mana::Event::ChatChannel); break; } @@ -213,13 +213,13 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) event.setInt("permissions", player_relations.getDefault() & (PlayerRelation::SPEECH_LOG | PlayerRelation::SPEECH_FLOAT)); - event.trigger(CHANNEL_CHAT); + event.trigger(Mana::Event::ChatChannel); } else { Mana::Event event(Mana::Event::Announcement); event.setString("message", chatMsg); - event.trigger(CHANNEL_CHAT); + event.trigger(Mana::Event::ChatChannel); } break; } diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index 3063c044..79686953 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -58,7 +58,7 @@ GameHandler::GameHandler() handledMessages = _messages; gameHandler = this; - listen(CHANNEL_GAME); + listen(Mana::Event::GameChannel); } void GameHandler::handleMessage(Net::MessageIn &msg) @@ -105,9 +105,9 @@ void GameHandler::handleMessage(Net::MessageIn &msg) } } -void GameHandler::event(Channels channel, const Mana::Event &event) +void GameHandler::event(Mana::Event::Channel channel, const Mana::Event &event) { - if (channel == CHANNEL_GAME) + if (channel == Mana::Event::GameChannel) { if (event.getType() == Mana::Event::EnginesInitialized) { diff --git a/src/net/tmwa/gamehandler.h b/src/net/tmwa/gamehandler.h index 18317445..858f16b3 100644 --- a/src/net/tmwa/gamehandler.h +++ b/src/net/tmwa/gamehandler.h @@ -41,7 +41,7 @@ class GameHandler : public MessageHandler, public Net::GameHandler, void handleMessage(Net::MessageIn &msg); - void event(Channels channel, const Mana::Event &event); + void event(Mana::Event::Channel channel, const Mana::Event &event); void connect(); diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index 7000c96c..d4374d4a 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -108,7 +108,7 @@ GeneralHandler::GeneralHandler(): setStatsList(stats); - listen(CHANNEL_GAME); + listen(Mana::Event::GameChannel); } GeneralHandler::~GeneralHandler() @@ -217,10 +217,10 @@ void GeneralHandler::clearHandlers() mNetwork->clearHandlers(); } -void GeneralHandler::event(Channels channel, +void GeneralHandler::event(Mana::Event::Channel channel, const Mana::Event &event) { - if (channel == CHANNEL_GAME) + if (channel == Mana::Event::GameChannel) { if (event.getType() == Mana::Event::GuiWindowsLoaded) { diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index 722c3215..d7b5f743 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -51,7 +51,7 @@ class GeneralHandler : public MessageHandler, public Net::GeneralHandler, void clearHandlers(); - void event(Channels channel, const Mana::Event &event); + void event(Mana::Event::Channel channel, const Mana::Event &event); protected: MessageHandlerPtr mAdminHandler; diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 5ab6af08..6bba2afd 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -110,7 +110,7 @@ InventoryHandler::InventoryHandler() mStorage = 0; mStorageWindow = 0; - listen(CHANNEL_ITEM); + listen(Mana::Event::ItemChannel); } InventoryHandler::~InventoryHandler() @@ -431,10 +431,10 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) } } -void InventoryHandler::event(Channels channel, +void InventoryHandler::event(Mana::Event::Channel channel, const Mana::Event &event) { - if (channel == CHANNEL_ITEM) + if (channel == Mana::Event::ItemChannel) { if (event.getType() == Mana::Event::DoCloseInventory) { diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h index dfbefaa8..8edb34ad 100644 --- a/src/net/tmwa/inventoryhandler.h +++ b/src/net/tmwa/inventoryhandler.h @@ -133,7 +133,7 @@ class InventoryHandler : public MessageHandler, public Net::InventoryHandler, void handleMessage(Net::MessageIn &msg); - void event(Channels channel, const Mana::Event &event); + void event(Mana::Event::Channel channel, const Mana::Event &event); bool canSplit(const Item *item); diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index 85b3b284..a55a3183 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -86,42 +86,42 @@ void NpcHandler::handleMessage(Net::MessageIn &msg) event = new Mana::Event(Mana::Event::Menu); event->setInt("id", npcId); parseMenu(event, msg.readString(msg.getLength() - 8)); - event->trigger(CHANNEL_NPC); + event->trigger(Mana::Event::NpcChannel); break; case SMSG_NPC_MESSAGE: event = new Mana::Event(Mana::Event::Message); event->setInt("id", npcId); event->setString("text", msg.readString(msg.getLength() - 8)); - event->trigger(CHANNEL_NPC); + event->trigger(Mana::Event::NpcChannel); break; case SMSG_NPC_CLOSE: // Show the close button event = new Mana::Event(Mana::Event::Close); event->setInt("id", npcId); - event->trigger(CHANNEL_NPC); + event->trigger(Mana::Event::NpcChannel); break; case SMSG_NPC_NEXT: // Show the next button event = new Mana::Event(Mana::Event::Next); event->setInt("id", npcId); - event->trigger(CHANNEL_NPC); + event->trigger(Mana::Event::NpcChannel); break; case SMSG_NPC_INT_INPUT: // Request for an integer event = new Mana::Event(Mana::Event::IntegerInput); event->setInt("id", npcId); - event->trigger(CHANNEL_NPC); + event->trigger(Mana::Event::NpcChannel); break; case SMSG_NPC_STR_INPUT: // Request for a string event = new Mana::Event(Mana::Event::StringInput); event->setInt("id", npcId); - event->trigger(CHANNEL_NPC); + event->trigger(Mana::Event::NpcChannel); break; } @@ -179,7 +179,7 @@ void NpcHandler::talk(int npcId) Mana::Event event(Mana::Event::TalkSent); event.setInt("npcId", npcId); - event.trigger(CHANNEL_NPC); + event.trigger(Mana::Event::NpcChannel); } void NpcHandler::nextDialog(int npcId) @@ -189,7 +189,7 @@ void NpcHandler::nextDialog(int npcId) Mana::Event event(Mana::Event::NextSent); event.setInt("npcId", npcId); - event.trigger(CHANNEL_NPC); + event.trigger(Mana::Event::NpcChannel); } void NpcHandler::closeDialog(int npcId) @@ -199,7 +199,7 @@ void NpcHandler::closeDialog(int npcId) Mana::Event event(Mana::Event::CloseSent); event.setInt("npcId", npcId); - event.trigger(CHANNEL_NPC); + event.trigger(Mana::Event::NpcChannel); } void NpcHandler::menuSelect(int npcId, int choice) @@ -211,7 +211,7 @@ void NpcHandler::menuSelect(int npcId, int choice) Mana::Event event(Mana::Event::MenuSent); event.setInt("npcId", npcId); event.setInt("choice", choice); - event.trigger(CHANNEL_NPC); + event.trigger(Mana::Event::NpcChannel); } void NpcHandler::integerInput(int npcId, int value) @@ -223,7 +223,7 @@ void NpcHandler::integerInput(int npcId, int value) Mana::Event event(Mana::Event::IntegerInputSent); event.setInt("npcId", npcId); event.setInt("value", value); - event.trigger(CHANNEL_NPC); + event.trigger(Mana::Event::NpcChannel); } void NpcHandler::stringInput(int npcId, const std::string &value) @@ -237,7 +237,7 @@ void NpcHandler::stringInput(int npcId, const std::string &value) Mana::Event event(Mana::Event::StringInputSent); event.setInt("npcId", npcId); event.setString("value", value); - event.trigger(CHANNEL_NPC); + event.trigger(Mana::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 64dda9d4..4b60414b 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -81,7 +81,7 @@ namespace { viewport->closePopupMenu(); - Mana::Event::trigger(CHANNEL_NPC, Mana::Event::CloseAll); + Mana::Event::trigger(Mana::Event::NpcChannel, Mana::Event::CloseAll); } } deathListener; |