diff options
-rw-r--r-- | src/CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/Makefile.am | 10 | ||||
-rw-r--r-- | src/gui/skilldialog.cpp | 4 | ||||
-rw-r--r-- | src/localplayer.cpp | 1 | ||||
-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 | ||||
-rw-r--r-- | tmw.cbp | 10 |
19 files changed, 87 insertions, 72 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 33f9e88c..a3c817e1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -262,7 +262,7 @@ SET(SRCS net/partyhandler.h net/playerhandler.h net/serverinfo.h - net/skillhandler.h + net/specialhandler.h net/tradehandler.h resources/action.cpp resources/action.h @@ -457,8 +457,8 @@ SET(SRCS_EA net/ea/playerhandler.cpp net/ea/playerhandler.h net/ea/protocol.h - net/ea/skillhandler.cpp - net/ea/skillhandler.h + net/ea/specialhandler.cpp + net/ea/specialhandler.h net/ea/tradehandler.cpp net/ea/tradehandler.h ) @@ -543,8 +543,8 @@ SET(SRCS_TMW net/tmwserv/playerhandler.cpp net/tmwserv/playerhandler.h net/tmwserv/protocol.h - net/tmwserv/skillhandler.cpp - net/tmwserv/skillhandler.h + net/tmwserv/specialhandler.cpp + net/tmwserv/specialhandler.h net/tmwserv/tradehandler.cpp net/tmwserv/tradehandler.h guild.cpp diff --git a/src/Makefile.am b/src/Makefile.am index bc6d7184..03d37015 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -211,7 +211,7 @@ tmw_SOURCES = gui/widgets/avatar.cpp \ net/partyhandler.h \ net/playerhandler.h \ net/serverinfo.h \ - net/skillhandler.h \ + net/specialhandler.h \ net/tradehandler.h \ resources/action.cpp \ resources/action.h \ @@ -449,8 +449,8 @@ tmw_SOURCES += \ net/tmwserv/playerhandler.cpp \ net/tmwserv/playerhandler.h \ net/tmwserv/protocol.h \ - net/tmwserv/skillhandler.cpp \ - net/tmwserv/skillhandler.h \ + net/tmwserv/specialhandler.cpp \ + net/tmwserv/specialhandler.h \ net/tmwserv/tradehandler.cpp \ net/tmwserv/tradehandler.h \ guild.cpp \ @@ -497,8 +497,8 @@ tmw_SOURCES += \ net/ea/playerhandler.cpp \ net/ea/playerhandler.h \ net/ea/protocol.h \ - net/ea/skillhandler.cpp \ - net/ea/skillhandler.h \ + net/ea/specialhandler.cpp \ + net/ea/specialhandler.h \ net/ea/tradehandler.cpp \ net/ea/tradehandler.h endif diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index 8ed6b097..5e700387 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -38,7 +38,7 @@ #include "log.h" #include "net/net.h" -#include "net/skillhandler.h" +#include "net/playerhandler.h" #include "utils/dtor.h" #include "utils/gettext.h" @@ -112,7 +112,7 @@ void SkillDialog::action(const gcn::ActionEvent &event) SkillEntry *disp = dynamic_cast<SkillEntry*>(event.getSource()->getParent()); if (disp) - Net::getSkillHandler()->up(disp->mInfo->id); + Net::getPlayerHandler()->increaseSkill(disp->mInfo->id); } else if (event.getId() == "close") { diff --git a/src/localplayer.cpp b/src/localplayer.cpp index fd0c0264..fac0d5d0 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -58,7 +58,6 @@ #include "net/tmwserv/chatserver/guild.h" #else #include "net/ea/partyhandler.h" -#include "net/ea/skillhandler.h" #endif #include "resources/animation.h" 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 @@ -643,11 +643,11 @@ <Option target="eAthena" /> <Option target="UNIX eAthena" /> </Unit> - <Unit filename="src/net/ea/skillhandler.cpp"> + <Unit filename="src/net/ea/specialhandler.cpp"> <Option target="eAthena" /> <Option target="UNIX eAthena" /> </Unit> - <Unit filename="src/net/ea/skillhandler.h"> + <Unit filename="src/net/ea/specialhandler.h"> <Option target="eAthena" /> <Option target="UNIX eAthena" /> </Unit> @@ -676,7 +676,7 @@ <Unit filename="src/net/npchandler.h" /> <Unit filename="src/net/partyhandler.h" /> <Unit filename="src/net/playerhandler.h" /> - <Unit filename="src/net/skillhandler.h" /> + <Unit filename="src/net/specialhandler.h" /> <Unit filename="src/net/tmwserv/accountserver/account.cpp"> <Option target="TMWServ" /> <Option target="Unix TMWSERV" /> @@ -908,11 +908,11 @@ <Option target="TMWServ" /> <Option target="Unix TMWSERV" /> </Unit> - <Unit filename="src/net/tmwserv/skillhandler.cpp"> + <Unit filename="src/net/tmwserv/specialhandler.cpp"> <Option target="TMWServ" /> <Option target="Unix TMWSERV" /> </Unit> - <Unit filename="src/net/tmwserv/skillhandler.h"> + <Unit filename="src/net/tmwserv/specialhandler.h"> <Option target="TMWServ" /> <Option target="Unix TMWSERV" /> </Unit> |