From a5f9e965323ad4b211405736eda7557cbe6a013a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 24 Feb 2013 15:44:24 +0300 Subject: Rename specialhandler to skillhandler. --- src/net/eathena/generalhandler.cpp | 6 +-- src/net/eathena/generalhandler.h | 2 +- src/net/eathena/skillhandler.cpp | 96 ++++++++++++++++++++++++++++++++++++++ src/net/eathena/skillhandler.h | 54 +++++++++++++++++++++ src/net/eathena/specialhandler.cpp | 96 -------------------------------------- src/net/eathena/specialhandler.h | 54 --------------------- 6 files changed, 154 insertions(+), 154 deletions(-) create mode 100644 src/net/eathena/skillhandler.cpp create mode 100644 src/net/eathena/skillhandler.h delete mode 100644 src/net/eathena/specialhandler.cpp delete mode 100644 src/net/eathena/specialhandler.h (limited to 'src/net/eathena') diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp index 5ac27b5cc..c656b944d 100644 --- a/src/net/eathena/generalhandler.cpp +++ b/src/net/eathena/generalhandler.cpp @@ -53,7 +53,7 @@ #include "net/eathena/playerhandler.h" #include "net/eathena/protocol.h" #include "net/eathena/tradehandler.h" -#include "net/eathena/specialhandler.h" +#include "net/eathena/skillhandler.h" #include "net/eathena/gui/guildtab.h" #include "net/eathena/gui/partytab.h" @@ -87,7 +87,7 @@ GeneralHandler::GeneralHandler() : mNpcHandler(new NpcHandler), mPartyHandler(new PartyHandler), mPlayerHandler(new PlayerHandler), - mSpecialHandler(new SpecialHandler), + mSkillHandler(new SkillHandler), mTradeHandler(new TradeHandler) { static const uint16_t _messages[] = @@ -183,7 +183,7 @@ void GeneralHandler::load() mNetwork->registerHandler(mLoginHandler.get()); mNetwork->registerHandler(mNpcHandler.get()); mNetwork->registerHandler(mPlayerHandler.get()); - mNetwork->registerHandler(mSpecialHandler.get()); + mNetwork->registerHandler(mSkillHandler.get()); mNetwork->registerHandler(mTradeHandler.get()); mNetwork->registerHandler(mPartyHandler.get()); } diff --git a/src/net/eathena/generalhandler.h b/src/net/eathena/generalhandler.h index 23b9cf66b..58c0d1e2e 100644 --- a/src/net/eathena/generalhandler.h +++ b/src/net/eathena/generalhandler.h @@ -77,7 +77,7 @@ class GeneralHandler final : public MessageHandler, MessageHandlerPtr mNpcHandler; MessageHandlerPtr mPartyHandler; MessageHandlerPtr mPlayerHandler; - MessageHandlerPtr mSpecialHandler; + MessageHandlerPtr mSkillHandler; MessageHandlerPtr mTradeHandler; }; diff --git a/src/net/eathena/skillhandler.cpp b/src/net/eathena/skillhandler.cpp new file mode 100644 index 000000000..a36ba7435 --- /dev/null +++ b/src/net/eathena/skillhandler.cpp @@ -0,0 +1,96 @@ +/* + * The ManaPlus Client + * Copyright (C) 2004-2009 The Mana World Development Team + * Copyright (C) 2009-2010 The Mana Developers + * Copyright (C) 2011-2013 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "net/eathena/skillhandler.h" + +#include "logger.h" + +#include "net/eathena/protocol.h" + +#include "debug.h" + +extern Net::SkillHandler *skillHandler; + +namespace EAthena +{ + +SkillHandler::SkillHandler() : + MessageHandler(), + Ea::SkillHandler() +{ + static const uint16_t _messages[] = + { + SMSG_PLAYER_SKILLS, + SMSG_SKILL_FAILED, + SMSG_PLAYER_SKILL_UP, + 0 + }; + handledMessages = _messages; + skillHandler = this; +} + +void SkillHandler::handleMessage(Net::MessageIn &msg) +{ + switch (msg.getId()) + { + case SMSG_PLAYER_SKILLS: + processPlayerSkills(msg); + break; + + case SMSG_PLAYER_SKILL_UP: + processPlayerSkillUp(msg); + break; + + case SMSG_SKILL_FAILED: + processSkillFailed(msg); + break; + + default: + break; + } +} + +void SkillHandler::useBeing(int id, int level, int beingId) +{ + MessageOut outMsg(CMSG_SKILL_USE_BEING); + outMsg.writeInt16(static_cast(id)); + outMsg.writeInt16(static_cast(level)); + outMsg.writeInt32(beingId); +} + +void SkillHandler::usePos(int id, int level, int x, int y) +{ + MessageOut outMsg(CMSG_SKILL_USE_POSITION); + outMsg.writeInt16(static_cast(level)); + outMsg.writeInt16(static_cast(id)); + outMsg.writeInt16(static_cast(x)); + outMsg.writeInt16(static_cast(y)); +} + +void SkillHandler::useMap(int id, const std::string &map) +{ + MessageOut outMsg(CMSG_SKILL_USE_MAP); + outMsg.writeInt16(static_cast(id)); + outMsg.writeString(map, 16); +} + +} // namespace EAthena diff --git a/src/net/eathena/skillhandler.h b/src/net/eathena/skillhandler.h new file mode 100644 index 000000000..be2025da7 --- /dev/null +++ b/src/net/eathena/skillhandler.h @@ -0,0 +1,54 @@ +/* + * The ManaPlus Client + * Copyright (C) 2004-2009 The Mana World Development Team + * Copyright (C) 2009-2010 The Mana Developers + * Copyright (C) 2011-2013 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef NET_EATHENA_SKILLHANDLER_H +#define NET_EATHENA_SKILLHANDLER_H + +#include "net/net.h" +#include "net/skillhandler.h" + +#include "net/ea/skillhandler.h" + +#include "net/eathena/messagehandler.h" + +namespace EAthena +{ + +class SkillHandler final : public MessageHandler, public Ea::SkillHandler +{ + public: + SkillHandler(); + + A_DELETE_COPY(SkillHandler) + + void handleMessage(Net::MessageIn &msg); + + void useBeing(int id, int level, int beingId); + + void usePos(int id, int level, int x, int y); + + void useMap(int id, const std::string &map); +}; + +} // namespace EAthena + +#endif // NET_EATHENA_SKILLHANDLER_H diff --git a/src/net/eathena/specialhandler.cpp b/src/net/eathena/specialhandler.cpp deleted file mode 100644 index e30dc6024..000000000 --- a/src/net/eathena/specialhandler.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "net/eathena/specialhandler.h" - -#include "logger.h" - -#include "net/eathena/protocol.h" - -#include "debug.h" - -extern Net::SpecialHandler *specialHandler; - -namespace EAthena -{ - -SpecialHandler::SpecialHandler() : - MessageHandler(), - Ea::SpecialHandler() -{ - static const uint16_t _messages[] = - { - SMSG_PLAYER_SKILLS, - SMSG_SKILL_FAILED, - SMSG_PLAYER_SKILL_UP, - 0 - }; - handledMessages = _messages; - specialHandler = this; -} - -void SpecialHandler::handleMessage(Net::MessageIn &msg) -{ - switch (msg.getId()) - { - case SMSG_PLAYER_SKILLS: - processPlayerSkills(msg); - break; - - case SMSG_PLAYER_SKILL_UP: - processPlayerSkillUp(msg); - break; - - case SMSG_SKILL_FAILED: - processSkillFailed(msg); - break; - - default: - break; - } -} - -void SpecialHandler::useBeing(int id, int level, int beingId) -{ - MessageOut outMsg(CMSG_SKILL_USE_BEING); - outMsg.writeInt16(static_cast(id)); - outMsg.writeInt16(static_cast(level)); - outMsg.writeInt32(beingId); -} - -void SpecialHandler::usePos(int id, int level, int x, int y) -{ - MessageOut outMsg(CMSG_SKILL_USE_POSITION); - outMsg.writeInt16(static_cast(level)); - outMsg.writeInt16(static_cast(id)); - outMsg.writeInt16(static_cast(x)); - outMsg.writeInt16(static_cast(y)); -} - -void SpecialHandler::useMap(int id, const std::string &map) -{ - MessageOut outMsg(CMSG_SKILL_USE_MAP); - outMsg.writeInt16(static_cast(id)); - outMsg.writeString(map, 16); -} - -} // namespace EAthena diff --git a/src/net/eathena/specialhandler.h b/src/net/eathena/specialhandler.h deleted file mode 100644 index 8e77a8439..000000000 --- a/src/net/eathena/specialhandler.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef NET_EATHENA_SKILLHANDLER_H -#define NET_EATHENA_SKILLHANDLER_H - -#include "net/net.h" -#include "net/specialhandler.h" - -#include "net/ea/specialhandler.h" - -#include "net/eathena/messagehandler.h" - -namespace EAthena -{ - -class SpecialHandler final : public MessageHandler, public Ea::SpecialHandler -{ - public: - SpecialHandler(); - - A_DELETE_COPY(SpecialHandler) - - void handleMessage(Net::MessageIn &msg); - - void useBeing(int id, int level, int beingId); - - void usePos(int id, int level, int x, int y); - - void useMap(int id, const std::string &map); -}; - -} // namespace EAthena - -#endif // NET_EATHENA_SKILLHANDLER_H -- cgit v1.2.3-70-g09d2