From 37432edac65a6b85c7a3414a421f2afd3e67a14e Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Tue, 31 Mar 2009 15:11:26 -0600 Subject: Add first draft of net handlers eAthena NPC handler has been implemented and is being used for NPC interraction. --- src/net/adminhandler.h | 53 +++++++++++++++++++++++++++++++ src/net/charhandler.h | 40 ++++++++++++++++++++++++ src/net/chathandler.h | 56 +++++++++++++++++++++++++++++++++ src/net/ea/npchandler.cpp | 78 ++++++++++++++++++++++++++++++++++++++++++++++ src/net/ea/npchandler.h | 25 ++++++++++++++- src/net/generalhandler.h | 35 +++++++++++++++++++++ src/net/guildhandler.h | 57 +++++++++++++++++++++++++++++++++ src/net/inventoryhandler.h | 60 +++++++++++++++++++++++++++++++++++ src/net/loginhandler.h | 46 +++++++++++++++++++++++++++ src/net/maphandler.h | 41 ++++++++++++++++++++++++ src/net/net.h | 67 +++++++++++++++++++++++++++++++++++++++ src/net/npchandler.h | 60 +++++++++++++++++++++++++++++++++++ src/net/partyhandler.h | 53 +++++++++++++++++++++++++++++++ src/net/playerhandler.h | 58 ++++++++++++++++++++++++++++++++++ src/net/skillhandler.h | 38 ++++++++++++++++++++++ src/net/tradehandler.h | 51 ++++++++++++++++++++++++++++++ 16 files changed, 817 insertions(+), 1 deletion(-) create mode 100644 src/net/adminhandler.h create mode 100644 src/net/charhandler.h create mode 100644 src/net/chathandler.h create mode 100644 src/net/generalhandler.h create mode 100644 src/net/guildhandler.h create mode 100644 src/net/inventoryhandler.h create mode 100644 src/net/loginhandler.h create mode 100644 src/net/maphandler.h create mode 100644 src/net/net.h create mode 100644 src/net/npchandler.h create mode 100644 src/net/partyhandler.h create mode 100644 src/net/playerhandler.h create mode 100644 src/net/skillhandler.h create mode 100644 src/net/tradehandler.h (limited to 'src/net') diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h new file mode 100644 index 00000000..df013eb3 --- /dev/null +++ b/src/net/adminhandler.h @@ -0,0 +1,53 @@ +/* + * The Mana World + * Copyright (C) 2009 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef ADMINHANDLER_H +#define ADMINHANDLER_H + +#include + +namespace Net { + class AdminHandler + { + public: + void announce(const std::string &text) {} + + void localAnnounce(const std::string &text) {} + + void hide(bool hide) {} + + void kick(int playerId) {} + + void kick(const std::string &name) {} + + void ban(int playerId) {} + + void ban(const std::string &name) {} + + void unban(int playerId) {} + + void unban(const std::string &name) {} + + // TODO + }; +} + +#endif // ADMINHANDLER_H diff --git a/src/net/charhandler.h b/src/net/charhandler.h new file mode 100644 index 00000000..f1535ac3 --- /dev/null +++ b/src/net/charhandler.h @@ -0,0 +1,40 @@ +/* + * The Mana World + * Copyright (C) 2009 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef CHARHANDLER_H +#define CHARHANDLER_H + +#include + +namespace Net { + class CharHandler + { + public: + void ChooseCharacter(int slot); + + void NewCharacter(const std::string &name, bool gender, + int hairstyle, int hairColor); + + void DeleteCharacter(int slot); + }; +} + +#endif // CHARHANDLER_H diff --git a/src/net/chathandler.h b/src/net/chathandler.h new file mode 100644 index 00000000..237ab929 --- /dev/null +++ b/src/net/chathandler.h @@ -0,0 +1,56 @@ +/* + * The Mana World + * Copyright (C) 2009 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef CHATHANDLER_H +#define CHATHANDLER_H + +#include + +namespace Net { + class ChatHandler + { + public: + void talk(const std::string &text); + + void me(const std::string &text); + + void privateMessage(const std::string &recipient, + const std::string &text); + + void channelList() {} + + void enterChannel(int channelId, const std::string &password) {} + + void quitChannel(int channelId) {} + + void sendToChannel(int channelId, const std::string &text) {} + + void userList(int channelId) {} + + void setChannelTopic(int channelId, const std::string &text) {} + + void setUserMode(int channelId, const std::string &name, int mode) {} + + void kickUser(int channelId, const std::string &name) {} + }; +} + +#endif // CHATHANDLER_H diff --git a/src/net/ea/npchandler.cpp b/src/net/ea/npchandler.cpp index 0e0bc53d..136f07fd 100644 --- a/src/net/ea/npchandler.cpp +++ b/src/net/ea/npchandler.cpp @@ -24,6 +24,7 @@ #include "net/ea/protocol.h" #include "net/messagein.h" +#include "net/messageout.h" #include "beingmanager.h" #include "localplayer.h" @@ -36,6 +37,8 @@ #include +NPCHandler *npcHandler; + NPCHandler::NPCHandler() { static const Uint16 _messages[] = { @@ -48,6 +51,7 @@ NPCHandler::NPCHandler() 0 }; handledMessages = _messages; + npcHandler = this; } void NPCHandler::handleMessage(MessageIn &msg) @@ -114,3 +118,77 @@ void NPCHandler::handleMessage(MessageIn &msg) break; } } + +void NPCHandler::talk(int npcId) +{ + MessageOut outMsg(CMSG_NPC_TALK); + outMsg.writeInt32(npcId); + outMsg.writeInt8(0); // Unused +} + +void NPCHandler::nextDialog(int npcId) +{ + MessageOut outMsg(CMSG_NPC_NEXT_REQUEST); + outMsg.writeInt32(npcId); +} + +void NPCHandler::closeDialog(int npcId) +{ + MessageOut outMsg(CMSG_NPC_CLOSE); + outMsg.writeInt32(npcId); +} + +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) +{ + MessageOut outMsg(CMSG_NPC_INT_RESPONSE); + outMsg.writeInt32(npcId); + outMsg.writeInt32(value); +} + +void NPCHandler::stringInput(int npcId, const std::string &value) +{ + MessageOut outMsg(CMSG_NPC_STR_RESPONSE); + outMsg.writeInt16(value.length() + 9); + outMsg.writeInt32(npcId); + outMsg.writeString(value, value.length()); + outMsg.writeInt8(0); // Prevent problems with string reading +} + +void NPCHandler::buy(int beingId) +{ + + MessageOut outMsg(CMSG_NPC_BUY_SELL_REQUEST); + outMsg.writeInt32(beingId); + outMsg.writeInt8(0); // Buy +} + +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) +{ + MessageOut outMsg(CMSG_NPC_BUY_REQUEST); + outMsg.writeInt16(8); // One item (length of packet) + outMsg.writeInt16(amount); + outMsg.writeInt16(itemId); +} + +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 + 2); + outMsg.writeInt16(amount); +} diff --git a/src/net/ea/npchandler.h b/src/net/ea/npchandler.h index 8c252175..71e15e02 100644 --- a/src/net/ea/npchandler.h +++ b/src/net/ea/npchandler.h @@ -23,13 +23,36 @@ #define NET_EA_NPCHANDLER_H #include "net/messagehandler.h" +#include "net/net.h" -class NPCHandler : public MessageHandler +class NPCHandler : public MessageHandler, public Net::NpcHandler { public: NPCHandler(); void handleMessage(MessageIn &msg); + + void talk(int npcId); + + void nextDialog(int npcId); + + void closeDialog(int npcId); + + void listInput(int npcId, int value); + + void integerInput(int npcId, int value); + + void stringInput(int npcId, const std::string &value); + + void buy(int beingId); + + void sell(int beingId); + + void buyItem(int beingId, int itemId, int amount); + + void sellItem(int beingId, int itemId, int amount); }; +extern NPCHandler *npcHandler; + #endif // NET_EA_NPCHANDLER_H diff --git a/src/net/generalhandler.h b/src/net/generalhandler.h new file mode 100644 index 00000000..dd823240 --- /dev/null +++ b/src/net/generalhandler.h @@ -0,0 +1,35 @@ +/* + * The Mana World + * Copyright (C) 2009 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef GENERALHANDLER_H +#define GENERALHANDLER_H + +namespace Net { + class GeneralHandler + { + public: + virtual void load(); + virtual void unload(); + virtual void guiWindowsLoaded() {} + }; +} + +#endif // GENERALHANDLER_H diff --git a/src/net/guildhandler.h b/src/net/guildhandler.h new file mode 100644 index 00000000..2385819a --- /dev/null +++ b/src/net/guildhandler.h @@ -0,0 +1,57 @@ +/* + * The Mana World + * Copyright (C) 2009 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef GUILDHANDLER_H +#define GUILDHANDLER_H + +#include + +namespace Net { + class GuildHandler + { + public: + void create(const std::string &name) {} + + void join(int guildId) {} + + void invite(int guidId, int playerId) {} + + void inviteResponse(int guidId, bool response) {} + + void leave(int guidId) {} + + void kick(int guidId, int playerId) {} + + void chat(int guidId, const std::string &text) {} + + void memberList(int guidId) {} + + void changeMemberPostion(int guildId, int playerId, int level) {} + + void requestAlliance(int guildId, int otherGuildId) {} + + void requestAllianceResponse(int guildId, int otherGuildId, bool response) {} + + void endAlliance(int guildId, int otherGuildId) {} + }; +} + +#endif // GUILDHANDLER_H diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h new file mode 100644 index 00000000..22427099 --- /dev/null +++ b/src/net/inventoryhandler.h @@ -0,0 +1,60 @@ +/* + * The Mana World + * Copyright (C) 2009 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef INVENTORYHANDLER_H +#define INVENTORYHANDLER_H + +#include "item.h" + +#include + +namespace Net { + class InvyHandler + { + public: + void equipItem(Item *item); + + void unequipItem(Item *item); + + void useItem(int slot, Item *item); + + void dropItem(int slot, int amount); + + void splitItem(int slot, int amount) {} + + void openStorage() {} + + void closeStorage() {} + + //void changeCart() {} + + enum StorageType { + INVENTORY, + STORAGE, + CART + }; + + void moveItem(StorageType source, int slot, int amount, + StorageType destination) {} + }; +} + +#endif // INVENTORYHANDLER_H diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h new file mode 100644 index 00000000..ca72248a --- /dev/null +++ b/src/net/loginhandler.h @@ -0,0 +1,46 @@ +/* + * The Mana World + * Copyright (C) 2009 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef LOGINHANDLER_H +#define LOGINHANDLER_H + +#include + +namespace Net { + class LoginHandler + { + public: + virtual void loginAccount(const std::string &username, + const std::string &password); + virtual void changeEmail(const std::string &email) {} + virtual void changePassword(const std::string &username, + const std::string &oldPassword, + const std::string &newPassword) {} + virtual void chooseServer(int server) {} + virtual void registerAccount(const std::string &username, + const std::string &password, + const std::string &email = ""); + virtual void unregisterAccount(const std::string &username, + const std::string &password); + }; +} + +#endif // LOGINHANDLER_H diff --git a/src/net/maphandler.h b/src/net/maphandler.h new file mode 100644 index 00000000..e5157fc6 --- /dev/null +++ b/src/net/maphandler.h @@ -0,0 +1,41 @@ +/* + * The Mana World + * Copyright (C) 2009 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef MAPHANDLER_H +#define MAPHANDLER_H + +#include + +namespace Net { + class MapHandler + { + public: + void connect() {} + + void mapLoaded(const std::string &mapName) {} + + void who() {} + + void quit() {} + }; +} + +#endif // MAPHANDLER_H diff --git a/src/net/net.h b/src/net/net.h new file mode 100644 index 00000000..0d2beffc --- /dev/null +++ b/src/net/net.h @@ -0,0 +1,67 @@ +/* + * The Mana World + * Copyright (C) 2009 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#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(); +} + +#endif // NET_H diff --git a/src/net/npchandler.h b/src/net/npchandler.h new file mode 100644 index 00000000..9ff02f28 --- /dev/null +++ b/src/net/npchandler.h @@ -0,0 +1,60 @@ +/* + * The Mana World + * Copyright (C) 2009 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef NPCHANDLER_H +#define NPCHANDLER_H + +#include + +namespace Net { + class NpcHandler + { + public: + void talk(int npcId); + + void nextDialog(int npcId); + + void closeDialog(int npcId); + + void listInput(int npcId, int value) {} + + void integerInput(int npcId, int value){} + + void stringInput(int npcId, const std::string &value) {} + + void sendLetter(int npcId, const std::string &recipient, + const std::string &text) {} + + void startShoping(int beingId) {} + + void buy(int beingId) {} + + void sell(int beingId) {} + + void buyItem(int beingId, int itemId, int ammount) {} + + void sellItem(int beingId, int itemId, int ammount) {} + + void endShoping(int beingId) {} + }; +} + +#endif // NPCHANDLER_H diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h new file mode 100644 index 00000000..6c400bf1 --- /dev/null +++ b/src/net/partyhandler.h @@ -0,0 +1,53 @@ +/* + * The Mana World + * Copyright (C) 2009 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef PARTYHANDLER_H +#define PARTYHANDLER_H + +#include + +namespace Net { + class PartyHandler + { + public: + void create(const std::string &name="") {} + + void join(int partyId) {} + + void invite(int playerId) {} + + void inviteResponse(bool accept) {} + + void leave() {} + + void kick(int playerId) {} + + void chat(const std::string &text) {} + + void partyMembers() {} + + // void options() {} + + // void message() {} + }; +} + +#endif // PARTYHANDLER_H diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h new file mode 100644 index 00000000..df5e341e --- /dev/null +++ b/src/net/playerhandler.h @@ -0,0 +1,58 @@ +/* + * The Mana World + * Copyright (C) 2009 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef PLAYERHANDLER_H +#define PLAYERHANDLER_H + +#include "being.h" +#include "floor_item.h" + +#include + +namespace Net { + class PlayerHandler + { + public: + void attack(Being *being); + + void emote(int emoteId) {} + + void increaseStat(int statId) {} + + void decreaseStat(int statId) {} + + void pickUp(FloorItem *floorItem) {} + + void setDirection(int direction) {} + + void setDestination(int x, int y, int direction = -1); + + void sit() {} + + void respawn() {} + + void ingorePlayer(const std::string &player, bool ignore) {} + + void ingoreAll(bool ignore) {} + }; +} + +#endif // PLAYERHANDLER_H diff --git a/src/net/skillhandler.h b/src/net/skillhandler.h new file mode 100644 index 00000000..1ab16f05 --- /dev/null +++ b/src/net/skillhandler.h @@ -0,0 +1,38 @@ +/* + * The Mana World + * Copyright (C) 2009 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef SKILLHANDLER_H +#define SKILLHANDLER_H + +#include + +namespace Net { + class SkillHandler + { + public: + void up(int skillId) {} + void use(int skillId, int level, int beingId) {} + void use(int skillId, int level, int x, int y) {} + void use(int skillId, const std::string &map) {} + }; +} + +#endif // SKILLHANDLER_H diff --git a/src/net/tradehandler.h b/src/net/tradehandler.h new file mode 100644 index 00000000..84de3196 --- /dev/null +++ b/src/net/tradehandler.h @@ -0,0 +1,51 @@ +/* + * The Mana World + * Copyright (C) 2009 The Mana World Development Team + * + * This file is part of The Mana World. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef TRADEHANDLER_H +#define TRADEHANDLER_H + +#include "being.h" + +#include + +namespace Net { + class TradeHandler + { + public: + void request(Being *being) {} + + void respond(bool accepet) {} + + void addItem(int slotNum, int amount) {} + + void removeItem(int slotNum, int amount) {} + + void setMoney(int amount) {} + + void confirm() {} + + void finish() {} + + void cancel() {} + }; +} + +#endif // TRADEHANDLER_H -- cgit v1.2.3-70-g09d2