diff options
Diffstat (limited to 'src/net/tmwserv')
-rw-r--r-- | src/net/tmwserv/beinghandler.cpp | 11 | ||||
-rw-r--r-- | src/net/tmwserv/charserverhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwserv/chathandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwserv/generalhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwserv/generalhandler.h | 1 | ||||
-rw-r--r-- | src/net/tmwserv/specialhandler.cpp | 5 | ||||
-rw-r--r-- | src/net/tmwserv/specialhandler.h | 5 |
7 files changed, 25 insertions, 9 deletions
diff --git a/src/net/tmwserv/beinghandler.cpp b/src/net/tmwserv/beinghandler.cpp index acd6b62c..d5092782 100644 --- a/src/net/tmwserv/beinghandler.cpp +++ b/src/net/tmwserv/beinghandler.cpp @@ -37,6 +37,8 @@ #include "gui/okdialog.h" +#include "resources/colordb.h" + #include "utils/gettext.h" #include "net/tmwserv/gameserver/player.h" @@ -95,8 +97,8 @@ static void handleLooks(Player *being, MessageIn &msg) // Order of sent slots. Has to be in sync with the server code. static int const nb_slots = 4; static int const slots[nb_slots] = - { Being::WEAPON_SPRITE, Being::HAT_SPRITE, Being::TOPCLOTHES_SPRITE, - Being::BOTTOMCLOTHES_SPRITE }; + { Player::WEAPON_SPRITE, Player::HAT_SPRITE, Player::TOPCLOTHES_SPRITE, + Player::BOTTOMCLOTHES_SPRITE }; int mask = msg.readInt8(); @@ -144,7 +146,7 @@ void BeingHandler::handleBeingEnterMessage(MessageIn &msg) } Player *p = static_cast< Player * >(being); int hs = msg.readInt8(), hc = msg.readInt8(); - p->setHairStyle(hs, hc); + p->setSprite(Player::HAIR_SPRITE, hs * -1, ColorDB::get(hc)); p->setGender(msg.readInt8() == GENDER_MALE ? GENDER_MALE : GENDER_FEMALE); handleLooks(p, msg); @@ -304,8 +306,7 @@ void BeingHandler::handleBeingLooksChangeMessage(MessageIn &msg) { int style = msg.readInt16(); int color = msg.readInt16(); - player->setHairStyle(style, color); - player->setGender((Gender)msg.readInt16()); + player->setSprite(Player::HAIR_SPRITE, style * -1, ColorDB::get(color)); } } diff --git a/src/net/tmwserv/charserverhandler.cpp b/src/net/tmwserv/charserverhandler.cpp index 0146babb..93181a93 100644 --- a/src/net/tmwserv/charserverhandler.cpp +++ b/src/net/tmwserv/charserverhandler.cpp @@ -38,6 +38,8 @@ #include "gui/charcreatedialog.h" #include "gui/okdialog.h" +#include "resources/colordb.h" + #include "utils/gettext.h" extern Net::Connection *gameServerConnection; @@ -229,7 +231,7 @@ LocalPlayer* CharServerHandler::readPlayerData(MessageIn &msg, int &slot) tempPlayer->setName(msg.readString()); tempPlayer->setGender(msg.readInt8() == GENDER_MALE ? GENDER_MALE : GENDER_FEMALE); int hs = msg.readInt8(), hc = msg.readInt8(); - tempPlayer->setHairStyle(hs, hc); + tempPlayer->setSprite(Player::HAIR_SPRITE, hs * -1, ColorDB::get(hc)); tempPlayer->setLevel(msg.readInt16()); tempPlayer->setCharacterPoints(msg.readInt16()); tempPlayer->setCorrectionPoints(msg.readInt16()); diff --git a/src/net/tmwserv/chathandler.cpp b/src/net/tmwserv/chathandler.cpp index ad3ae49b..c95f6ac5 100644 --- a/src/net/tmwserv/chathandler.cpp +++ b/src/net/tmwserv/chathandler.cpp @@ -298,7 +298,7 @@ void ChatHandler::handleChannelEvent(MessageIn &msg) std::string user1 = line.substr(0, first); std::string user2 = line.substr(first+1, line.length()); channel->getTab()->chatLog(strprintf(_("%s has kicked %s."), - user1, user2), BY_CHANNEL); + user1.c_str(), user2.c_str()), BY_CHANNEL); } break; default: diff --git a/src/net/tmwserv/generalhandler.cpp b/src/net/tmwserv/generalhandler.cpp index d643586b..011433fe 100644 --- a/src/net/tmwserv/generalhandler.cpp +++ b/src/net/tmwserv/generalhandler.cpp @@ -22,6 +22,7 @@ #include "gui/inventorywindow.h" #include "gui/partywindow.h" #include "gui/skilldialog.h" +#include "gui/specialswindow.h" #include "gui/statuswindow.h" #include "net/tmwserv/generalhandler.h" @@ -43,6 +44,7 @@ #include "net/tmwserv/npchandler.h" #include "net/tmwserv/partyhandler.h" #include "net/tmwserv/playerhandler.h" +#include "net/tmwserv/specialhandler.h" #include "net/tmwserv/tradehandler.h" #include "utils/gettext.h" @@ -72,7 +74,8 @@ GeneralHandler::GeneralHandler(): mNpcHandler(new NpcHandler), mPartyHandler(new PartyHandler), mPlayerHandler(new PlayerHandler), - mTradeHandler(new TradeHandler) + mTradeHandler(new TradeHandler), + mSpecialHandler(new SpecialHandler) { accountServerConnection = Net::getConnection(); gameServerConnection = Net::getConnection(); @@ -149,6 +152,7 @@ void GeneralHandler::guiWindowsLoaded() inventoryWindow->setSplitAllowed(true); partyWindow->clearPartyName(); skillDialog->loadSkills("tmw-skills.xml"); + specialsWindow->loadSpecials("specials.xml"); player_node->setExpNeeded(100); diff --git a/src/net/tmwserv/generalhandler.h b/src/net/tmwserv/generalhandler.h index 08e18850..40166ca0 100644 --- a/src/net/tmwserv/generalhandler.h +++ b/src/net/tmwserv/generalhandler.h @@ -63,6 +63,7 @@ class GeneralHandler : public Net::GeneralHandler MessageHandlerPtr mPartyHandler; MessageHandlerPtr mPlayerHandler; MessageHandlerPtr mTradeHandler; + MessageHandlerPtr mSpecialHandler; }; } // namespace TmwServ diff --git a/src/net/tmwserv/specialhandler.cpp b/src/net/tmwserv/specialhandler.cpp index f259e77a..2e4ff1bb 100644 --- a/src/net/tmwserv/specialhandler.cpp +++ b/src/net/tmwserv/specialhandler.cpp @@ -37,6 +37,11 @@ SpecialHandler::SpecialHandler() specialHandler = this; } +void SpecialHandler::handleMessage(MessageIn &msg) +{ + // TODO +} + void SpecialHandler::use(int id) { MessageOut msg(PGMSG_USE_SPECIAL); diff --git a/src/net/tmwserv/specialhandler.h b/src/net/tmwserv/specialhandler.h index c7ebd6a2..b8f0ce90 100644 --- a/src/net/tmwserv/specialhandler.h +++ b/src/net/tmwserv/specialhandler.h @@ -22,15 +22,18 @@ #ifndef NET_TMWSERV_SKILLHANDLER_H #define NET_TMWSERV_SKILLHANDLER_H +#include "net/messagehandler.h" #include "net/specialhandler.h" namespace TmwServ { -class SpecialHandler : public Net::SpecialHandler +class SpecialHandler : public MessageHandler, public Net::SpecialHandler { public: SpecialHandler(); + void handleMessage(MessageIn &msg); + void use(int id); void use(int id, int level, int beingId); |