diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-07-13 21:39:23 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-07-13 21:39:23 -0600 |
commit | 6d3e53146ba15e4d90670db3067fa7f1a67034e1 (patch) | |
tree | 20c2fd4db10392997ba712ca7e75ed68da044230 /src/net | |
parent | feb73c9a8dcaf9ebd30ad8b00ce08cf41ca65849 (diff) | |
download | mana-6d3e53146ba15e4d90670db3067fa7f1a67034e1.tar.gz mana-6d3e53146ba15e4d90670db3067fa7f1a67034e1.tar.bz2 mana-6d3e53146ba15e4d90670db3067fa7f1a67034e1.tar.xz mana-6d3e53146ba15e4d90670db3067fa7f1a67034e1.zip |
Rename Net::SkillHandler to Net::SpecialHandler
SkillHandler::up moved to PlayerHandler::increaseSkill
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/generalhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/ea/generalhandler.h | 2 | ||||
-rw-r--r-- | src/net/ea/playerhandler.cpp | 9 | ||||
-rw-r--r-- | src/net/ea/playerhandler.h | 2 | ||||
-rw-r--r-- | src/net/ea/specialhandler.cpp (renamed from src/net/ea/skillhandler.cpp) | 24 | ||||
-rw-r--r-- | src/net/ea/specialhandler.h (renamed from src/net/ea/skillhandler.h) | 14 | ||||
-rw-r--r-- | src/net/net.cpp | 8 | ||||
-rw-r--r-- | src/net/net.h | 4 | ||||
-rw-r--r-- | src/net/playerhandler.h | 2 | ||||
-rw-r--r-- | src/net/specialhandler.h (renamed from src/net/skillhandler.h) | 16 | ||||
-rw-r--r-- | src/net/tmwserv/playerhandler.cpp | 5 | ||||
-rw-r--r-- | src/net/tmwserv/playerhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwserv/specialhandler.cpp (renamed from src/net/tmwserv/skillhandler.cpp) | 16 | ||||
-rw-r--r-- | src/net/tmwserv/specialhandler.h (renamed from src/net/tmwserv/skillhandler.h) | 14 |
14 files changed, 70 insertions, 54 deletions
diff --git a/src/net/ea/generalhandler.cpp b/src/net/ea/generalhandler.cpp index 959e7632..8ff62d37 100644 --- a/src/net/ea/generalhandler.cpp +++ b/src/net/ea/generalhandler.cpp @@ -42,7 +42,7 @@ #include "net/ea/playerhandler.h" #include "net/ea/partyhandler.h" #include "net/ea/tradehandler.h" -#include "net/ea/skillhandler.h" +#include "net/ea/specialhandler.h" #include "net/ea/gui/partytab.h" @@ -78,7 +78,7 @@ GeneralHandler::GeneralHandler(): mNpcHandler(new NpcHandler), mPartyHandler(new PartyHandler), mPlayerHandler(new PlayerHandler), - mSkillHandler(new SkillHandler), + mSpecialHandler(new SpecialHandler), mTradeHandler(new TradeHandler) { static const Uint16 _messages[] = { @@ -158,7 +158,7 @@ void GeneralHandler::load() mNetwork->registerHandler(mMapHandler.get()); mNetwork->registerHandler(mNpcHandler.get()); mNetwork->registerHandler(mPlayerHandler.get()); - mNetwork->registerHandler(mSkillHandler.get()); + mNetwork->registerHandler(mSpecialHandler.get()); mNetwork->registerHandler(mTradeHandler.get()); mNetwork->registerHandler(mPartyHandler.get()); } diff --git a/src/net/ea/generalhandler.h b/src/net/ea/generalhandler.h index ebbc84ca..98364e5d 100644 --- a/src/net/ea/generalhandler.h +++ b/src/net/ea/generalhandler.h @@ -66,7 +66,7 @@ class GeneralHandler : public MessageHandler, public Net::GeneralHandler MessageHandlerPtr mNpcHandler; MessageHandlerPtr mPartyHandler; MessageHandlerPtr mPlayerHandler; - MessageHandlerPtr mSkillHandler; + MessageHandlerPtr mSpecialHandler; MessageHandlerPtr mTradeHandler; }; diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index 07b738ee..9eecc445 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -469,6 +469,15 @@ void PlayerHandler::decreaseStat(LocalPlayer::Attribute attr) // Supported by eA? } +void PlayerHandler::increaseSkill(int skillId) +{ + if (player_node->getSkillPoints() <= 0) + return; + + MessageOut outMsg(CMSG_SKILL_LEVELUP_REQUEST); + outMsg.writeInt16(skillId); +} + void PlayerHandler::pickUp(FloorItem *floorItem) { MessageOut outMsg(CMSG_ITEM_PICKUP); diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h index 5dbc171b..dcf53f6f 100644 --- a/src/net/ea/playerhandler.h +++ b/src/net/ea/playerhandler.h @@ -43,6 +43,8 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler void decreaseStat(LocalPlayer::Attribute attr); + void increaseSkill(int skillId); + void pickUp(FloorItem *floorItem); void setDirection(char direction); diff --git a/src/net/ea/skillhandler.cpp b/src/net/ea/specialhandler.cpp index 9fb4e566..e75ed1bb 100644 --- a/src/net/ea/skillhandler.cpp +++ b/src/net/ea/specialhandler.cpp @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "net/ea/skillhandler.h" +#include "net/ea/specialhandler.h" #include "net/ea/protocol.h" @@ -67,11 +67,11 @@ /** should always be zero if failed */ #define SKILL_FAILED 0x00 -Net::SkillHandler *skillHandler; +Net::SpecialHandler *specialHandler; namespace EAthena { -SkillHandler::SkillHandler() +SpecialHandler::SpecialHandler() { static const Uint16 _messages[] = { SMSG_PLAYER_SKILLS, @@ -80,10 +80,10 @@ SkillHandler::SkillHandler() 0 }; handledMessages = _messages; - skillHandler = this; + specialHandler = this; } -void SkillHandler::handleMessage(MessageIn &msg) +void SpecialHandler::handleMessage(MessageIn &msg) { int skillCount; int skillId; @@ -223,26 +223,22 @@ void SkillHandler::handleMessage(MessageIn &msg) } } -void SkillHandler::up(int skillId) +void SpecialHandler::use(int id) { - if (player_node->getSkillPoints() <= 0) - return; - - MessageOut outMsg(CMSG_SKILL_LEVELUP_REQUEST); - outMsg.writeInt16(skillId); + // TODO } -void SkillHandler::use(int skillId, int level, int beingId) +void SpecialHandler::use(int id, int level, int beingId) { // TODO } -void SkillHandler::use(int skillId, int level, int x, int y) +void SpecialHandler::use(int id, int level, int x, int y) { // TODO } -void SkillHandler::use(int skillId, const std::string &map) +void SpecialHandler::use(int id, const std::string &map) { // TODO } diff --git a/src/net/ea/skillhandler.h b/src/net/ea/specialhandler.h index c1965213..eac53569 100644 --- a/src/net/ea/skillhandler.h +++ b/src/net/ea/specialhandler.h @@ -24,24 +24,24 @@ #include "net/messagehandler.h" #include "net/net.h" -#include "net/skillhandler.h" +#include "net/specialhandler.h" namespace EAthena { -class SkillHandler : public MessageHandler, public Net::SkillHandler +class SpecialHandler : public MessageHandler, public Net::SpecialHandler { public: - SkillHandler(); + SpecialHandler(); void handleMessage(MessageIn &msg); - void up(int skillId); + void use(int id); - void use(int skillId, int level, int beingId); + void use(int id, int level, int beingId); - void use(int skillId, int level, int x, int y); + void use(int id, int level, int x, int y); - void use(int skillId, const std::string &map); + void use(int id, const std::string &map); }; } // namespace EAthena diff --git a/src/net/net.cpp b/src/net/net.cpp index a329af1a..7df336c6 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -33,7 +33,7 @@ #include "net/npchandler.h" #include "net/partyhandler.h" #include "net/playerhandler.h" -#include "net/skillhandler.h" +#include "net/specialhandler.h" #include "net/tradehandler.h" extern Net::AdminHandler *adminHandler; @@ -47,7 +47,7 @@ extern Net::MapHandler *mapHandler; extern Net::NpcHandler *npcHandler; extern Net::PartyHandler *partyHandler; extern Net::PlayerHandler *playerHandler; -extern Net::SkillHandler *skillHandler; +extern Net::SpecialHandler *specialHandler; extern Net::TradeHandler *tradeHandler; Net::AdminHandler *Net::getAdminHandler() @@ -111,9 +111,9 @@ Net::PlayerHandler *Net::getPlayerHandler() return playerHandler; } -Net::SkillHandler *Net::getSkillHandler() +Net::SpecialHandler *Net::getSpecialHandler() { - return skillHandler; + return specialHandler; } Net::TradeHandler *Net::getTradeHandler() diff --git a/src/net/net.h b/src/net/net.h index 9154c1ef..1d91faa7 100644 --- a/src/net/net.h +++ b/src/net/net.h @@ -36,7 +36,7 @@ class MapHandler; class NpcHandler; class PartyHandler; class PlayerHandler; -class SkillHandler; +class SpecialHandler; class TradeHandler; AdminHandler *getAdminHandler(); @@ -51,7 +51,7 @@ MapHandler *getMapHandler(); NpcHandler *getNpcHandler(); PartyHandler *getPartyHandler(); PlayerHandler *getPlayerHandler(); -SkillHandler *getSkillHandler(); +SpecialHandler *getSpecialHandler(); TradeHandler *getTradeHandler(); } // namespace Net diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h index 163b48f3..9a185d9c 100644 --- a/src/net/playerhandler.h +++ b/src/net/playerhandler.h @@ -39,6 +39,8 @@ class PlayerHandler virtual void decreaseStat(LocalPlayer::Attribute attr) = 0; + virtual void increaseSkill(int skillId) = 0; + virtual void pickUp(FloorItem *floorItem) = 0; virtual void setDirection(char direction) = 0; diff --git a/src/net/skillhandler.h b/src/net/specialhandler.h index 9db6ac5b..602003aa 100644 --- a/src/net/skillhandler.h +++ b/src/net/specialhandler.h @@ -19,23 +19,23 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef SKILLHANDLER_H -#define SKILLHANDLER_H +#ifndef SPECIALHANDLER_H +#define SPECIALHANDLER_H #include <iosfwd> namespace Net { -class SkillHandler +class SpecialHandler { public: - virtual void up(int skillId) = 0; + virtual void use(int id) = 0; - virtual void use(int skillId, int level, int beingId) = 0; + virtual void use(int id, int level, int beingId) = 0; - virtual void use(int skillId, int level, int x, int y) = 0; + virtual void use(int id, int level, int x, int y) = 0; - virtual void use(int skillId, const std::string &map) = 0; + virtual void use(int id, const std::string &map) = 0; }; } -#endif // SKILLHANDLER_H +#endif // SPECIALHANDLER_H diff --git a/src/net/tmwserv/playerhandler.cpp b/src/net/tmwserv/playerhandler.cpp index 6cf81496..fe1b821c 100644 --- a/src/net/tmwserv/playerhandler.cpp +++ b/src/net/tmwserv/playerhandler.cpp @@ -332,6 +332,11 @@ void PlayerHandler::decreaseStat(LocalPlayer::Attribute attr) // TODO } +void PlayerHandler::increaseSkill(int skillId) +{ + // Not used atm +} + void PlayerHandler::pickUp(FloorItem *floorItem) { int id = floorItem->getId(); diff --git a/src/net/tmwserv/playerhandler.h b/src/net/tmwserv/playerhandler.h index 164d30ae..88844a55 100644 --- a/src/net/tmwserv/playerhandler.h +++ b/src/net/tmwserv/playerhandler.h @@ -42,6 +42,8 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler void decreaseStat(LocalPlayer::Attribute attr); + void increaseSkill(int skillId); + void pickUp(FloorItem *floorItem); void setDirection(char direction); diff --git a/src/net/tmwserv/skillhandler.cpp b/src/net/tmwserv/specialhandler.cpp index e35b896a..5be8272a 100644 --- a/src/net/tmwserv/skillhandler.cpp +++ b/src/net/tmwserv/specialhandler.cpp @@ -19,33 +19,33 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "net/tmwserv/skillhandler.h" +#include "net/tmwserv/specialhandler.h" -Net::SkillHandler *skillHandler; +Net::SpecialHandler *specialHandler; namespace TmwServ { -SkillHandler::SkillHandler() +SpecialHandler::SpecialHandler() { - skillHandler = this; + specialHandler = this; } -void SkillHandler::up(int skillId) +void SpecialHandler::use(int id) { // TODO } -void SkillHandler::use(int skillId, int level, int beingId) +void SpecialHandler::use(int id, int level, int beingId) { // TODO } -void SkillHandler::use(int skillId, int level, int x, int y) +void SpecialHandler::use(int id, int level, int x, int y) { // TODO } -void SkillHandler::use(int skillId, const std::string &map) +void SpecialHandler::use(int id, const std::string &map) { // TODO } diff --git a/src/net/tmwserv/skillhandler.h b/src/net/tmwserv/specialhandler.h index 8c459c4f..c7ebd6a2 100644 --- a/src/net/tmwserv/skillhandler.h +++ b/src/net/tmwserv/specialhandler.h @@ -22,22 +22,22 @@ #ifndef NET_TMWSERV_SKILLHANDLER_H #define NET_TMWSERV_SKILLHANDLER_H -#include "net/skillhandler.h" +#include "net/specialhandler.h" namespace TmwServ { -class SkillHandler : public Net::SkillHandler +class SpecialHandler : public Net::SpecialHandler { public: - SkillHandler(); + SpecialHandler(); - void up(int skillId); + void use(int id); - void use(int skillId, int level, int beingId); + void use(int id, int level, int beingId); - void use(int skillId, int level, int x, int y); + void use(int id, int level, int x, int y); - void use(int skillId, const std::string &map); + void use(int id, const std::string &map); }; } // namespace TmwServ |