summaryrefslogtreecommitdiff
path: root/src/net/manaserv
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-04-09 00:11:54 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-04-09 17:54:12 +0200
commit1e1f619b9ae5aa26058c499c988f45d1fb1b6d53 (patch)
tree1fe58c53388054ced122b5327e33fc2851a0606a /src/net/manaserv
parent30d4b0adf4f17f05d1d62fc3428c896ef1079b6b (diff)
downloadmana-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/manaserv')
-rw-r--r--src/net/manaserv/chathandler.cpp6
-rw-r--r--src/net/manaserv/generalhandler.cpp10
-rw-r--r--src/net/manaserv/generalhandler.h2
-rw-r--r--src/net/manaserv/inventoryhandler.cpp6
-rw-r--r--src/net/manaserv/inventoryhandler.h2
-rw-r--r--src/net/manaserv/npchandler.cpp30
-rw-r--r--src/net/manaserv/playerhandler.cpp2
7 files changed, 29 insertions, 29 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()