diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/adminhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/adminhandler.h | 23 | ||||
-rw-r--r-- | src/net/ea/chathandler.cpp | 1 | ||||
-rw-r--r-- | src/net/ea/chathandler.h | 25 | ||||
-rw-r--r-- | src/net/ea/inventoryhandler.cpp | 14 | ||||
-rw-r--r-- | src/net/ea/inventoryhandler.h | 25 | ||||
-rw-r--r-- | src/net/ea/maphandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/maphandler.h | 13 | ||||
-rw-r--r-- | src/net/ea/npchandler.cpp | 42 | ||||
-rw-r--r-- | src/net/ea/npchandler.h | 36 | ||||
-rw-r--r-- | src/net/ea/partyhandler.cpp | 5 | ||||
-rw-r--r-- | src/net/ea/partyhandler.h | 19 | ||||
-rw-r--r-- | src/net/ea/playerhandler.h | 25 | ||||
-rw-r--r-- | src/net/ea/skillhandler.h | 5 | ||||
-rw-r--r-- | src/net/ea/tradehandler.h | 19 | ||||
-rw-r--r-- | src/net/inventoryhandler.h | 24 | ||||
-rw-r--r-- | src/net/maphandler.h | 12 | ||||
-rw-r--r-- | src/net/messagehandler.h | 2 | ||||
-rw-r--r-- | src/net/net.h | 68 | ||||
-rw-r--r-- | src/net/npchandler.h | 30 | ||||
-rw-r--r-- | src/net/partyhandler.h | 26 | ||||
-rw-r--r-- | src/net/playerhandler.h | 28 |
22 files changed, 248 insertions, 198 deletions
diff --git a/src/net/ea/adminhandler.cpp b/src/net/ea/adminhandler.cpp index c1194ef1..04c946c0 100644 --- a/src/net/ea/adminhandler.cpp +++ b/src/net/ea/adminhandler.cpp @@ -62,7 +62,7 @@ void AdminHandler::handleMessage(MessageIn &msg) if (id == 0) localChatTab->chatLog(_("Kick failed!"), BY_SERVER); else - localChatTab->chatLog(_("Kick succedded!"), BY_SERVER); + localChatTab->chatLog(_("Kick succeeded!"), BY_SERVER); break; } } diff --git a/src/net/ea/adminhandler.h b/src/net/ea/adminhandler.h index ae40e9d7..a7db0113 100644 --- a/src/net/ea/adminhandler.h +++ b/src/net/ea/adminhandler.h @@ -22,6 +22,7 @@ #ifndef NET_EA_ADMINHANDLER_H #define NET_EA_ADMINHANDLER_H +#include "net/adminhandler.h" #include "net/messagehandler.h" #include "net/net.h" @@ -30,27 +31,27 @@ class AdminHandler : public MessageHandler, public Net::AdminHandler public: AdminHandler(); - virtual void handleMessage(MessageIn &msg); + void handleMessage(MessageIn &msg); - virtual void announce(const std::string &text); + void announce(const std::string &text); - virtual void localAnnounce(const std::string &text); + void localAnnounce(const std::string &text); - virtual void hide(bool hide); + void hide(bool hide); - virtual void kick(int playerId); + void kick(int playerId); - virtual void kick(const std::string &name); + void kick(const std::string &name); - virtual void ban(int playerId); + void ban(int playerId); - virtual void ban(const std::string &name); + void ban(const std::string &name); - virtual void unban(int playerId); + void unban(int playerId); - virtual void unban(const std::string &name); + void unban(const std::string &name); - virtual void mute(int playerId, int type, int limit); + void mute(int playerId, int type, int limit); }; extern AdminHandler *adminHandler; diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 2949c3dc..3abf2b24 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -29,6 +29,7 @@ #include "being.h" #include "beingmanager.h" #include "game.h" +#include "localplayer.h" #include "player_relations.h" #include "gui/widgets/chattab.h" diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h index 99c580dd..6ca71b80 100644 --- a/src/net/ea/chathandler.h +++ b/src/net/ea/chathandler.h @@ -22,6 +22,7 @@ #ifndef NET_EA_CHATHANDLER_H #define NET_EA_CHATHANDLER_H +#include "net/chathandler.h" #include "net/messagehandler.h" #include "net/net.h" @@ -30,30 +31,30 @@ class ChatHandler : public MessageHandler, public Net::ChatHandler public: ChatHandler(); - virtual void handleMessage(MessageIn &msg); + void handleMessage(MessageIn &msg); - virtual void talk(const std::string &text); + void talk(const std::string &text); - virtual void me(const std::string &text); + void me(const std::string &text); - virtual void privateMessage(const std::string &recipient, + void privateMessage(const std::string &recipient, const std::string &text); - virtual void channelList(); + void channelList(); - virtual void enterChannel(int channelId, const std::string &password); + void enterChannel(int channelId, const std::string &password); - virtual void quitChannel(int channelId); + void quitChannel(int channelId); - virtual void sendToChannel(int channelId, const std::string &text); + void sendToChannel(int channelId, const std::string &text); - virtual void userList(int channelId); + void userList(int channelId); - virtual void setChannelTopic(int channelId, const std::string &text); + void setChannelTopic(int channelId, const std::string &text); - virtual void setUserMode(int channelId, const std::string &name, int mode); + void setUserMode(int channelId, const std::string &name, int mode); - virtual void kickUser(int channelId, const std::string &name); + void kickUser(int channelId, const std::string &name); }; extern ChatHandler *chatHandler; diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index 423d2e9c..7dfb6277 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -47,7 +47,7 @@ enum { debugInventory = 1 }; -InventoryHandler *invyHandler; +InventoryHandler *inventoryHandler; InventoryHandler::InventoryHandler() { @@ -66,7 +66,7 @@ InventoryHandler::InventoryHandler() 0 }; handledMessages = _messages; - invyHandler = this; + inventoryHandler = this; } void InventoryHandler::handleMessage(MessageIn &msg) @@ -337,6 +337,16 @@ void InventoryHandler::dropItem(Item *item, int amount) outMsg.writeInt16(amount); } +void InventoryHandler::splitItem(Item *item, int amount) +{ + // Not implemented for eAthena (possible?) +} + +void InventoryHandler::openStorage() +{ + // Doesn't apply to eAthena, since opening happens through NPCs? +} + void InventoryHandler::closeStorage() { MessageOut outMsg(CMSG_CLOSE_STORAGE); diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h index def4285f..bfebc9b3 100644 --- a/src/net/ea/inventoryhandler.h +++ b/src/net/ea/inventoryhandler.h @@ -22,30 +22,35 @@ #ifndef NET_EA_INVENTORYHANDLER_H #define NET_EA_INVENTORYHANDLER_H +#include "net/inventoryhandler.h" #include "net/messagehandler.h" #include "net/net.h" -class InventoryHandler : public MessageHandler, public Net::InvyHandler +class InventoryHandler : public MessageHandler, public Net::InventoryHandler { public: InventoryHandler(); - virtual void handleMessage(MessageIn &msg); + void handleMessage(MessageIn &msg); - virtual void equipItem(Item *item); + void equipItem(Item *item); - virtual void unequipItem(Item *item); + void unequipItem(Item *item); - virtual void useItem(Item *item); + void useItem(Item *item); - virtual void dropItem(Item *item, int amount); + void dropItem(Item *item, int amount); - virtual void closeStorage(); + void splitItem(Item *item, int amount); - virtual void moveItem(StorageType source, int slot, int amount, - StorageType destination); + void openStorage(); + + void closeStorage(); + + void moveItem(StorageType source, int slot, int amount, + StorageType destination); }; -extern InventoryHandler *invyHandler; +extern InventoryHandler *inventoryHandler; #endif // NET_EA_INVENTORYHANDLER_H diff --git a/src/net/ea/maphandler.cpp b/src/net/ea/maphandler.cpp index c7fe42d9..fefeac86 100644 --- a/src/net/ea/maphandler.cpp +++ b/src/net/ea/maphandler.cpp @@ -1,6 +1,6 @@ /* * The Mana World - * Copyright (C) 2004 The Mana World Development Team + * Copyright (C) 2009 The Mana World Development Team * * This file is part of The Mana World. * diff --git a/src/net/ea/maphandler.h b/src/net/ea/maphandler.h index c264cf10..77811b4e 100644 --- a/src/net/ea/maphandler.h +++ b/src/net/ea/maphandler.h @@ -1,6 +1,6 @@ /* * The Mana World - * Copyright (C) 2004 The Mana World Development Team + * Copyright (C) 2009 The Mana World Development Team * * This file is part of The Mana World. * @@ -22,6 +22,7 @@ #ifndef NET_EA_MAPHANDLER_H #define NET_EA_MAPHANDLER_H +#include "net/maphandler.h" #include "net/messagehandler.h" #include "net/net.h" @@ -30,15 +31,15 @@ class MapHandler : public MessageHandler, public Net::MapHandler public: MapHandler(); - virtual void handleMessage(MessageIn &msg); + void handleMessage(MessageIn &msg); - virtual void connect(); + void connect(); - virtual void mapLoaded(const std::string &mapName); + void mapLoaded(const std::string &mapName); - virtual void who(); + void who(); - virtual void quit(); + void quit(); }; extern MapHandler *mapHandler; diff --git a/src/net/ea/npchandler.cpp b/src/net/ea/npchandler.cpp index 9f9bc6a6..33e478cb 100644 --- a/src/net/ea/npchandler.cpp +++ b/src/net/ea/npchandler.cpp @@ -39,9 +39,9 @@ #include <SDL_types.h> -NPCHandler *npcHandler; +NpcHandler *npcHandler; -NPCHandler::NPCHandler() +NpcHandler::NpcHandler() { static const Uint16 _messages[] = { SMSG_NPC_CHOICE, @@ -56,7 +56,7 @@ NPCHandler::NPCHandler() npcHandler = this; } -void NPCHandler::handleMessage(MessageIn &msg) +void NpcHandler::handleMessage(MessageIn &msg) { int id; @@ -121,40 +121,40 @@ void NPCHandler::handleMessage(MessageIn &msg) } } -void NPCHandler::talk(int npcId) +void NpcHandler::talk(int npcId) { MessageOut outMsg(CMSG_NPC_TALK); outMsg.writeInt32(npcId); outMsg.writeInt8(0); // Unused } -void NPCHandler::nextDialog(int npcId) +void NpcHandler::nextDialog(int npcId) { MessageOut outMsg(CMSG_NPC_NEXT_REQUEST); outMsg.writeInt32(npcId); } -void NPCHandler::closeDialog(int npcId) +void NpcHandler::closeDialog(int npcId) { MessageOut outMsg(CMSG_NPC_CLOSE); outMsg.writeInt32(npcId); } -void NPCHandler::listInput(int npcId, int value) +void NpcHandler::listInput(int npcId, int value) { MessageOut outMsg(CMSG_NPC_LIST_CHOICE); outMsg.writeInt32(npcId); outMsg.writeInt8(value); } -void NPCHandler::integerInput(int npcId, int value) +void NpcHandler::integerInput(int npcId, int value) { MessageOut outMsg(CMSG_NPC_INT_RESPONSE); outMsg.writeInt32(npcId); outMsg.writeInt32(value); } -void NPCHandler::stringInput(int npcId, const std::string &value) +void NpcHandler::stringInput(int npcId, const std::string &value) { MessageOut outMsg(CMSG_NPC_STR_RESPONSE); outMsg.writeInt16(value.length() + 9); @@ -163,23 +163,32 @@ void NPCHandler::stringInput(int npcId, const std::string &value) outMsg.writeInt8(0); // Prevent problems with string reading } -void NPCHandler::buy(int beingId) +void NpcHandler::sendLetter(int npcId, const std::string &recipient, + const std::string &text) { + // TODO +} +void NpcHandler::startShopping(int beingId) +{ + // TODO +} + +void NpcHandler::buy(int beingId) +{ MessageOut outMsg(CMSG_NPC_BUY_SELL_REQUEST); outMsg.writeInt32(beingId); outMsg.writeInt8(0); // Buy } -void NPCHandler::sell(int beingId) +void NpcHandler::sell(int beingId) { - MessageOut outMsg(CMSG_NPC_BUY_SELL_REQUEST); outMsg.writeInt32(beingId); outMsg.writeInt8(1); // Sell } -void NPCHandler::buyItem(int beingId, int itemId, int amount) +void NpcHandler::buyItem(int beingId, int itemId, int amount) { MessageOut outMsg(CMSG_NPC_BUY_REQUEST); outMsg.writeInt16(8); // One item (length of packet) @@ -187,10 +196,15 @@ void NPCHandler::buyItem(int beingId, int itemId, int amount) outMsg.writeInt16(itemId); } -void NPCHandler::sellItem(int beingId, int itemId, int amount) +void NpcHandler::sellItem(int beingId, int itemId, int amount) { MessageOut outMsg(CMSG_NPC_SELL_REQUEST); outMsg.writeInt16(8); // One item (length of packet) outMsg.writeInt16(itemId + INVENTORY_OFFSET); outMsg.writeInt16(amount); } + +void NpcHandler::endShopping(int beingId) +{ + // TODO +} diff --git a/src/net/ea/npchandler.h b/src/net/ea/npchandler.h index a8212ce0..9ca83f11 100644 --- a/src/net/ea/npchandler.h +++ b/src/net/ea/npchandler.h @@ -24,35 +24,43 @@ #include "net/messagehandler.h" #include "net/net.h" +#include "net/npchandler.h" -class NPCHandler : public MessageHandler, public Net::NpcHandler +class NpcHandler : public MessageHandler, public Net::NpcHandler { public: - NPCHandler(); + NpcHandler(); - virtual void handleMessage(MessageIn &msg); + void handleMessage(MessageIn &msg); - virtual void talk(int npcId); + void talk(int npcId); - virtual void nextDialog(int npcId); + void nextDialog(int npcId); - virtual void closeDialog(int npcId); + void closeDialog(int npcId); - virtual void listInput(int npcId, int value); + void listInput(int npcId, int value); - virtual void integerInput(int npcId, int value); + void integerInput(int npcId, int value); - virtual void stringInput(int npcId, const std::string &value); + void stringInput(int npcId, const std::string &value); - virtual void buy(int beingId); + void sendLetter(int npcId, const std::string &recipient, + const std::string &text); - virtual void sell(int beingId); + void startShopping(int beingId); - virtual void buyItem(int beingId, int itemId, int amount); + void buy(int beingId); - virtual void sellItem(int beingId, int itemId, int amount); + void sell(int beingId); + + void buyItem(int beingId, int itemId, int amount); + + void sellItem(int beingId, int itemId, int amount); + + void endShopping(int beingId); }; -extern NPCHandler *npcHandler; +extern NpcHandler *npcHandler; #endif // NET_EA_NPCHANDLER_H diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp index 94abe0f1..38adaa7e 100644 --- a/src/net/ea/partyhandler.cpp +++ b/src/net/ea/partyhandler.cpp @@ -255,3 +255,8 @@ void PartyHandler::chat(const std::string &text) outMsg.writeInt16(text.length() + 4); outMsg.writeString(text, text.length()); } + +void PartyHandler::requestPartyMembers() +{ + // Our eAthena doesn't have this message +} diff --git a/src/net/ea/partyhandler.h b/src/net/ea/partyhandler.h index 5db4d43a..df38bd6c 100644 --- a/src/net/ea/partyhandler.h +++ b/src/net/ea/partyhandler.h @@ -24,6 +24,7 @@ #include "net/messagehandler.h" #include "net/net.h" +#include "net/partyhandler.h" class PartyHandler : public MessageHandler, public Net::PartyHandler { @@ -32,21 +33,23 @@ class PartyHandler : public MessageHandler, public Net::PartyHandler ~PartyHandler(); - virtual void handleMessage(MessageIn &msg); + void handleMessage(MessageIn &msg); - virtual void create(const std::string &name=""); + void create(const std::string &name = ""); - virtual void join(int partyId); + void join(int partyId); - virtual void invite(int playerId); + void invite(int playerId); - virtual void inviteResponse(bool accept); + void inviteResponse(bool accept); - virtual void leave(); + void leave(); - virtual void kick(int playerId); + void kick(int playerId); - virtual void chat(const std::string &text); + void chat(const std::string &text); + + void requestPartyMembers(); }; extern PartyHandler *partyHandler; diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h index f1d45a79..cc84dec0 100644 --- a/src/net/ea/playerhandler.h +++ b/src/net/ea/playerhandler.h @@ -24,35 +24,36 @@ #include "net/messagehandler.h" #include "net/net.h" +#include "net/playerhandler.h" class PlayerHandler : public MessageHandler, public Net::PlayerHandler { public: PlayerHandler(); - virtual void handleMessage(MessageIn &msg); + void handleMessage(MessageIn &msg); - virtual void attack(Being *being); + void attack(Being *being); - virtual void emote(int emoteId); + void emote(int emoteId); - virtual void increaseStat(LocalPlayer::Attribute attr); + void increaseStat(LocalPlayer::Attribute attr); - virtual void decreaseStat(LocalPlayer::Attribute attr); + void decreaseStat(LocalPlayer::Attribute attr); - virtual void pickUp(FloorItem *floorItem); + void pickUp(FloorItem *floorItem); - virtual void setDirection(int direction); + void setDirection(int direction); - virtual void setDestination(int x, int y, int direction = -1); + void setDestination(int x, int y, int direction = -1); - virtual void changeAction(Being::Action action); + void changeAction(Being::Action action); - virtual void respawn(); + void respawn(); - virtual void ingorePlayer(const std::string &player, bool ignore); + void ingorePlayer(const std::string &player, bool ignore); - virtual void ingoreAll(bool ignore); + void ingoreAll(bool ignore); }; extern PlayerHandler *playerHandler; diff --git a/src/net/ea/skillhandler.h b/src/net/ea/skillhandler.h index f3d1b9de..b4e464ed 100644 --- a/src/net/ea/skillhandler.h +++ b/src/net/ea/skillhandler.h @@ -24,15 +24,16 @@ #include "net/messagehandler.h" #include "net/net.h" +#include "net/skillhandler.h" class SkillHandler : public MessageHandler, public Net::SkillHandler { public: SkillHandler(); - virtual void handleMessage(MessageIn &msg); + void handleMessage(MessageIn &msg); - virtual void up(int skillId); + void up(int skillId); }; extern SkillHandler *skillHandler; diff --git a/src/net/ea/tradehandler.h b/src/net/ea/tradehandler.h index af7a064f..b6e0fdf8 100644 --- a/src/net/ea/tradehandler.h +++ b/src/net/ea/tradehandler.h @@ -24,29 +24,30 @@ #include "net/messagehandler.h" #include "net/net.h" +#include "net/tradehandler.h" class TradeHandler : public MessageHandler, public Net::TradeHandler { public: TradeHandler(); - virtual void handleMessage(MessageIn &msg); + void handleMessage(MessageIn &msg); - virtual void request(Being *being); + void request(Being *being); - virtual void respond(bool accept); + void respond(bool accept); - virtual void addItem(int slotNum, int amount); + void addItem(int slotNum, int amount); - virtual void removeItem(int slotNum, int amount); + void removeItem(int slotNum, int amount); - virtual void setMoney(int amount); + void setMoney(int amount); - virtual void confirm(); + void confirm(); - virtual void finish(); + void finish(); - virtual void cancel(); + void cancel(); }; extern TradeHandler *tradeHandler; diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h index cbd1b6c5..73a07710 100644 --- a/src/net/inventoryhandler.h +++ b/src/net/inventoryhandler.h @@ -27,24 +27,25 @@ #include <iosfwd> namespace Net { -class InvyHandler + +class InventoryHandler { public: - virtual void equipItem(Item *item) {} + virtual void equipItem(Item *item) = 0; - virtual void unequipItem(Item *item) {} + virtual void unequipItem(Item *item) = 0; - virtual void useItem(Item *item) {} + virtual void useItem(Item *item) = 0; - virtual void dropItem(Item *item, int amount) {} + virtual void dropItem(Item *item, int amount) = 0; - virtual void splitItem(Item *item, int amount) {} + virtual void splitItem(Item *item, int amount) = 0; - virtual void openStorage() {} + virtual void openStorage() = 0; - virtual void closeStorage() {} + virtual void closeStorage() = 0; - //void changeCart() {} + //void changeCart() = 0; enum StorageType { INVENTORY, @@ -53,8 +54,9 @@ class InvyHandler }; virtual void moveItem(StorageType source, int slot, int amount, - StorageType destination) {} + StorageType destination) = 0; }; -} + +} // namespace Net #endif // INVENTORYHANDLER_H diff --git a/src/net/maphandler.h b/src/net/maphandler.h index be33e074..80f9183f 100644 --- a/src/net/maphandler.h +++ b/src/net/maphandler.h @@ -25,17 +25,19 @@ #include <iosfwd> namespace Net { + class MapHandler { public: - virtual void connect() {} + virtual void connect() = 0; - virtual void mapLoaded(const std::string &mapName) {} + virtual void mapLoaded(const std::string &mapName) = 0; - virtual void who() {} + virtual void who() = 0; - virtual void quit() {} + virtual void quit() = 0; }; -} + +} // namespace Net #endif // MAPHANDLER_H diff --git a/src/net/messagehandler.h b/src/net/messagehandler.h index 261a8351..9b207dcc 100644 --- a/src/net/messagehandler.h +++ b/src/net/messagehandler.h @@ -50,4 +50,4 @@ class MessageHandler #endif }; -#endif +#endif // NET_MESSAGEHANDLER_H diff --git a/src/net/net.h b/src/net/net.h index aa2c8a27..75ee3aed 100644 --- a/src/net/net.h +++ b/src/net/net.h @@ -22,46 +22,36 @@ #ifndef NET_H #define NET_H -#include "net/adminhandler.h" -#include "net/charhandler.h" -#include "net/chathandler.h" -#include "net/generalhandler.h" -#include "net/guildhandler.h" -#include "net/inventoryhandler.h" -#include "net/loginhandler.h" -#include "net/maphandler.h" -#include "net/npchandler.h" -#include "net/partyhandler.h" -#include "net/playerhandler.h" -#include "net/skillhandler.h" -#include "net/tradehandler.h" - namespace Net { -Net::AdminHandler *getAdminHandler(); - -Net::CharHandler *getCharHandler(); - -Net::ChatHandler *getChatHandler(); - -Net::GeneralHandler *getGeneralHandler(); - -Net::GuildHandler *getGuildHandler(); - -Net::InvyHandler *getInvyHandler(); - -Net::LoginHandler *getLoginHandler(); - -Net::MapHandler *getMapHandler(); - -Net::NpcHandler *getNpcHandler(); - -Net::PartyHandler *getPartyHandler(); - -Net::PlayerHandler *getPlayerHandler(); - -Net::SkillHandler *getSkillHandler(); -Net::TradeHandler *getTradeHandler(); -} +class AdminHandler; +class CharHandler; +class ChatHandler; +class GeneralHandler; +class GuildHandler; +class InventoryHandler; +class LoginHandler; +class MapHandler; +class NpcHandler; +class PartyHandler; +class PlayerHandler; +class SkillHandler; +class TradeHandler; + +AdminHandler *getAdminHandler(); +CharHandler *getCharHandler(); +ChatHandler *getChatHandler(); +GeneralHandler *getGeneralHandler(); +GuildHandler *getGuildHandler(); +InventoryHandler *getInventoryHandler(); +LoginHandler *getLoginHandler(); +MapHandler *getMapHandler(); +NpcHandler *getNpcHandler(); +PartyHandler *getPartyHandler(); +PlayerHandler *getPlayerHandler(); +SkillHandler *getSkillHandler(); +TradeHandler *getTradeHandler(); + +} // namespace Net #endif // NET_H diff --git a/src/net/npchandler.h b/src/net/npchandler.h index 18e52b48..1f211c41 100644 --- a/src/net/npchandler.h +++ b/src/net/npchandler.h @@ -25,36 +25,38 @@ #include <iosfwd> namespace Net { + class NpcHandler { public: - virtual void talk(int npcId) {} + virtual void talk(int npcId) = 0; - virtual void nextDialog(int npcId) {} + virtual void nextDialog(int npcId) = 0; - virtual void closeDialog(int npcId) {} + virtual void closeDialog(int npcId) = 0; - virtual void listInput(int npcId, int value) {} + virtual void listInput(int npcId, int value) = 0; - virtual void integerInput(int npcId, int value){} + virtual void integerInput(int npcId, int value) = 0; - virtual void stringInput(int npcId, const std::string &value) {} + virtual void stringInput(int npcId, const std::string &value) = 0; virtual void sendLetter(int npcId, const std::string &recipient, - const std::string &text) {} + const std::string &text) = 0; - virtual void startShoping(int beingId) {} + virtual void startShopping(int beingId) = 0; - virtual void buy(int beingId) {} + virtual void buy(int beingId) = 0; - virtual void sell(int beingId) {} + virtual void sell(int beingId) = 0; - virtual void buyItem(int beingId, int itemId, int ammount) {} + virtual void buyItem(int beingId, int itemId, int ammount) = 0; - virtual void sellItem(int beingId, int itemId, int ammount) {} + virtual void sellItem(int beingId, int itemId, int ammount) = 0; - virtual void endShoping(int beingId) {} + virtual void endShopping(int beingId) = 0; }; -} + +} // namespace Net #endif // NPCHANDLER_H diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h index b58bd5f4..2d61d9cd 100644 --- a/src/net/partyhandler.h +++ b/src/net/partyhandler.h @@ -22,32 +22,34 @@ #ifndef PARTYHANDLER_H #define PARTYHANDLER_H -#include <iosfwd> +#include <string> namespace Net { + class PartyHandler { public: - virtual void create(const std::string &name="") {} + virtual void create(const std::string &name = "") = 0; - virtual void join(int partyId) {} + virtual void join(int partyId) = 0; - virtual void invite(int playerId) {} + virtual void invite(int playerId) = 0; - virtual void inviteResponse(bool accept) {} + virtual void inviteResponse(bool accept) = 0; - virtual void leave() {} + virtual void leave() = 0; - virtual void kick(int playerId) {} + virtual void kick(int playerId) = 0; - virtual void chat(const std::string &text) {} + virtual void chat(const std::string &text) = 0; - virtual void partyMembers() {} + virtual void requestPartyMembers() = 0; - // virtual void options() {} + // virtual void options() = 0; - // virtual void message() {} + // virtual void message() = 0; }; -} + +} // namespace Net #endif // PARTYHANDLER_H diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h index b451331e..6e277dc3 100644 --- a/src/net/playerhandler.h +++ b/src/net/playerhandler.h @@ -26,34 +26,34 @@ #include "floor_item.h" #include "localplayer.h" -#include <iosfwd> - namespace Net { + class PlayerHandler { public: - virtual void attack(Being *being) {} + virtual void attack(Being *being) = 0; - virtual void emote(int emoteId) {} + virtual void emote(int emoteId) = 0; - virtual void increaseStat(LocalPlayer::Attribute attr) {} + virtual void increaseStat(LocalPlayer::Attribute attr) = 0; - virtual void decreaseStat(LocalPlayer::Attribute attr) {} + virtual void decreaseStat(LocalPlayer::Attribute attr) = 0; - virtual void pickUp(FloorItem *floorItem) {} + virtual void pickUp(FloorItem *floorItem) = 0; - virtual void setDirection(int direction) {} + virtual void setDirection(int direction) = 0; - virtual void setDestination(int x, int y, int direction = -1) {} + virtual void setDestination(int x, int y, int direction = -1) = 0; - virtual void changeAction(Being::Action action) {} + virtual void changeAction(Being::Action action) = 0; - virtual void respawn() {} + virtual void respawn() = 0; - virtual void ingorePlayer(const std::string &player, bool ignore) {} + virtual void ingorePlayer(const std::string &player, bool ignore) = 0; - virtual void ingoreAll(bool ignore) {} + virtual void ingoreAll(bool ignore) = 0; }; -} + +} // namespace Net #endif // PLAYERHANDLER_H |