diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-10-10 22:14:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-10-10 22:15:57 +0300 |
commit | aa3f63fd497558a02feb3ddbc44f31eac091f39b (patch) | |
tree | 0e28b9b1f0501dd8be9e1a38db4ec1777fa3fbfa /src/net | |
parent | 7c10a6b61e9d06a4ae9cc9f942dfacb6fcfd9d3d (diff) | |
download | manaverse-aa3f63fd497558a02feb3ddbc44f31eac091f39b.tar.gz manaverse-aa3f63fd497558a02feb3ddbc44f31eac091f39b.tar.bz2 manaverse-aa3f63fd497558a02feb3ddbc44f31eac091f39b.tar.xz manaverse-aa3f63fd497558a02feb3ddbc44f31eac091f39b.zip |
Remove most unused files.
Diffstat (limited to 'src/net')
412 files changed, 0 insertions, 58871 deletions
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h deleted file mode 100644 index 6d3497be3..000000000 --- a/src/net/adminhandler.h +++ /dev/null @@ -1,192 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_ADMINHANDLER_H -#define NET_ADMINHANDLER_H - -#include "enums/simpletypes/beingid.h" -#include "enums/simpletypes/itemcolor.h" - -#include <string> - -#include "localconsts.h" - -class Being; - -namespace Net -{ - -class AdminHandler notfinal -{ - public: - AdminHandler() - { } - - A_DELETE_COPY(AdminHandler) - - virtual ~AdminHandler() - { } - - virtual void announce(const std::string &text) const = 0; - - virtual void localAnnounce(const std::string &text) const = 0; - - virtual void hide(const bool hide) const = 0; - - virtual void kick(const BeingId playerId) const = 0; - - virtual void kickName(const std::string &name) const = 0; - - virtual void kickAll() const = 0; - - virtual void ban(const int playerId) const = 0; - - virtual void banName(const std::string &name) const = 0; - - virtual void unban(const int playerId) const = 0; - - virtual void unbanName(const std::string &name) const = 0; - - virtual void mute(const Being *const being, - const int type, - const int limit) const = 0; - - virtual void muteName(const std::string &name) const = 0; - - virtual void warp(const std::string &map, - const int x, const int y) const = 0; - - virtual void slide(const int x, const int y) const = 0; - - virtual void createItems(const int id, - const ItemColor color, - const int amount) const = 0; - - virtual void gotoName(const std::string &name) const = 0; - - virtual void recallName(const std::string &name) const = 0; - - virtual void alive(const std::string &name) const = 0; - - virtual void ipcheckName(const std::string &name) const = 0; - - virtual void resetStats() const = 0; - - virtual void resetSkills() const = 0; - - virtual void requestLogin(const Being *const being) const = 0; - - virtual void setTileType(const int x, const int y, - const int type) const = 0; - - virtual void unequipAll(const Being *const being) const = 0; - - virtual void requestStats(const std::string &name) const = 0; - - virtual void monsterInfo(const std::string &name) const = 0; - - virtual void itemInfo(const std::string &name) const = 0; - - virtual void whoDrops(const std::string &name) const = 0; - - virtual void mobSearch(const std::string &name) const = 0; - - virtual void mobSpawnSearch(const std::string &name) const = 0; - - virtual void playerGmCommands(const std::string &name) const = 0; - - virtual void playerCharGmCommands(const std::string &name) const = 0; - - virtual void showLevel(const std::string &name) const = 0; - - virtual void showStats(const std::string &name) const = 0; - - virtual void showStorageList(const std::string &name) const = 0; - - virtual void showCartList(const std::string &name) const = 0; - - virtual void showInventoryList(const std::string &name) const = 0; - - virtual void locatePlayer(const std::string &name) const = 0; - - virtual void showAccountInfo(const std::string &name) const = 0; - - virtual void spawn(const std::string &name) const = 0; - - virtual void spawnSlave(const std::string &name) const = 0; - - virtual void spawnClone(const std::string &name) const = 0; - - virtual void spawnSlaveClone(const std::string &name) const = 0; - - virtual void spawnEvilClone(const std::string &name) const = 0; - - virtual void savePosition(const std::string &name) const = 0; - - virtual void loadPosition(const std::string &name) const = 0; - - virtual void randomWarp(const std::string &name) const = 0; - - virtual void gotoNpc(const std::string &name) const = 0; - - virtual void killer(const std::string &name) const = 0; - - virtual void killable(const std::string &name) const = 0; - - virtual void heal(const std::string &name) const = 0; - - virtual void disguise(const std::string &name) const = 0; - - virtual void immortal(const std::string &name) const = 0; - - virtual void hide(const std::string &name) const = 0; - - virtual void nuke(const std::string &name) const = 0; - - virtual void kill(const std::string &name) const = 0; - - virtual void jail(const std::string &name) const = 0; - - virtual void unjail(const std::string &name) const = 0; - - virtual void npcMove(const std::string &name, - const int x, - const int y) const = 0; - - virtual void hideNpc(const std::string &name) const = 0; - - virtual void showNpc(const std::string &name) const = 0; - - virtual void changePartyLeader(const std::string &name) const = 0; - - virtual void partyRecall(const std::string &name) const = 0; - - virtual void breakGuild(const std::string &name) const = 0; - - virtual void guildRecall(const std::string &name) const = 0; -}; - -} // namespace Net - -extern Net::AdminHandler *adminHandler; - -#endif // NET_ADMINHANDLER_H diff --git a/src/net/auctionhandler.h b/src/net/auctionhandler.h deleted file mode 100644 index ce2c004d6..000000000 --- a/src/net/auctionhandler.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_AUCTIONHANDLER_H -#define NET_AUCTIONHANDLER_H - -#include "enums/net/auctionsearchtype.h" - -#include <string> - -#include "localconsts.h" - -class Item; - -namespace Net -{ - -class AuctionHandler notfinal -{ - public: - AuctionHandler() - { } - - A_DELETE_COPY(AuctionHandler) - - virtual ~AuctionHandler() - { } - - virtual void cancelReg() const = 0; - - virtual void setItem(const Item *const item, - const int amount) const = 0; - - virtual void reg(const int currentPrice, - const int maxPrice, - const int hours) const = 0; - - virtual void cancel(const int auctionId) const = 0; - - virtual void close(const int auctionId) const = 0; - - virtual void bid(const int auctionId, - const int money) const = 0; - - virtual void search(const AuctionSearchTypeT type, - const int auctionId, - const std::string &text, - const int page) const = 0; - - virtual void buy() const = 0; - - virtual void sell() const = 0; -}; - -} // namespace Net - -extern Net::AuctionHandler *auctionHandler; - -#endif // NET_AUCTIONHANDLER_H diff --git a/src/net/bankhandler.h b/src/net/bankhandler.h deleted file mode 100644 index a827178fb..000000000 --- a/src/net/bankhandler.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_BANKHANDLER_H -#define NET_BANKHANDLER_H - -#include "localconsts.h" - -namespace Net -{ - -class BankHandler notfinal -{ - public: - BankHandler() - { } - - A_DELETE_COPY(BankHandler) - - virtual ~BankHandler() - { } - - virtual void deposit(const int money) const = 0; - - virtual void withdraw(const int money) const = 0; - - virtual void check() const = 0; - - virtual void open() const = 0; - - virtual void close() const = 0; -}; - -} // namespace Net - -extern Net::BankHandler *bankHandler; - -#endif // NET_BANKHANDLER_H diff --git a/src/net/battlegroundhandler.h b/src/net/battlegroundhandler.h deleted file mode 100644 index 1e62b93ad..000000000 --- a/src/net/battlegroundhandler.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_BATTLEGROUNDHANDLER_H -#define NET_BATTLEGROUNDHANDLER_H - -#include "enums/net/battlegroundtype.h" - -#include <string> - -#include "localconsts.h" - -namespace Net -{ - -class BattleGroundHandler notfinal -{ - public: - BattleGroundHandler() - { } - - A_DELETE_COPY(BattleGroundHandler) - - virtual ~BattleGroundHandler() - { } - - virtual void registerBg(const BattleGroundTypeT &type, - const std::string &name) const = 0; - - virtual void rekoveRequest(const std::string &name) const = 0; - - virtual void beginAck(const bool result, - const std::string &bgName, - const std::string &gameName) const = 0; - - virtual void checkState(const std::string &name) const = 0; -}; - -} // namespace Net - -extern Net::BattleGroundHandler *battleGroundHandler; - -#endif // NET_BATTLEGROUNDHANDLER_H diff --git a/src/net/beinghandler.h b/src/net/beinghandler.h deleted file mode 100644 index ccf998def..000000000 --- a/src/net/beinghandler.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004 The Mana World Development Team - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_BEINGHANDLER_H -#define NET_BEINGHANDLER_H - -#include "being/being.h" - -#include "enums/being/rank.h" - -namespace Net -{ - -class BeingHandler notfinal -{ - public: - BeingHandler() - { } - - A_DELETE_COPY(BeingHandler) - - virtual ~BeingHandler() - { } - - virtual void requestNameById(const BeingId id) const = 0; - - virtual void requestNameByCharId(const int id) const = 0; - - virtual void undress(Being *const being) const = 0; - - virtual void requestRanks(const RankT rank) const = 0; - - virtual void viewPlayerEquipment(const Being *const being) const = 0; -}; - -} // namespace Net - -extern Net::BeingHandler *beingHandler; - -#endif // NET_BEINGHANDLER_H diff --git a/src/net/buyingstorehandler.h b/src/net/buyingstorehandler.h deleted file mode 100644 index 1ab94de88..000000000 --- a/src/net/buyingstorehandler.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_BUYINGSTOREHANDLER_H -#define NET_BUYINGSTOREHANDLER_H - -#include "utils/vector.h" - -#include <string> - -#include "localconsts.h" - -class Being; -class Item; -class ShopItem; - -namespace Net -{ - -class BuyingStoreHandler notfinal -{ - public: - BuyingStoreHandler() - { } - - A_DELETE_COPY(BuyingStoreHandler) - - virtual ~BuyingStoreHandler() - { } - - virtual void open(const Being *const being) const = 0; - - virtual void create(const std::string &name, - const int maxMoney, - const bool flag, - const STD_VECTOR<ShopItem*> &items) const = 0; - - virtual void close() const = 0; - - virtual void sell(const Being *const being, - const int storeId, - const Item *const item, - const int amount) const = 0; -}; - -} // namespace Net - -extern Net::BuyingStoreHandler *buyingStoreHandler; - -#endif // NET_BUYINGSTOREHANDLER_H diff --git a/src/net/buysellhandler.h b/src/net/buysellhandler.h deleted file mode 100644 index e6f66129c..000000000 --- a/src/net/buysellhandler.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_BUYSELLHANDLER_H -#define NET_BUYSELLHANDLER_H - -#include "resources/item/shopitem.h" - -class BuyDialog; - -namespace Net -{ - -class BuySellHandler notfinal -{ - public: - BuySellHandler() - { } - - A_DELETE_COPY(BuySellHandler) - - virtual ~BuySellHandler() - { } - - virtual void requestSellList(const std::string &nick) const = 0; - - virtual void requestBuyList(const std::string &nick) const = 0; - - virtual void sendBuyRequest(const std::string &nick, - const ShopItem *const item, - const int amount) const = 0; - - virtual void sendSellRequest(const std::string &nick, - const ShopItem *const item, - const int amount) const = 0; - - virtual void close() const = 0; - - virtual void cleanDialogReference(const BuyDialog *const dialog) - const = 0; -}; - -} // namespace Net - -extern Net::BuySellHandler *buySellHandler; - -#endif // NET_BUYSELLHANDLER_H diff --git a/src/net/cashshophandler.h b/src/net/cashshophandler.h deleted file mode 100644 index 68b7c3ceb..000000000 --- a/src/net/cashshophandler.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_CASHSHOPHANDLER_H -#define NET_CASHSHOPHANDLER_H - -#include "enums/simpletypes/itemcolor.h" - -#include "utils/vector.h" - -#include "localconsts.h" - -class ShopItem; - -namespace Net -{ - -class CashShopHandler notfinal -{ - public: - CashShopHandler() - { } - - A_DELETE_COPY(CashShopHandler) - - virtual ~CashShopHandler() - { } - - virtual void buyItem(const int points, - const int itemId, - const ItemColor color, - const int amount) const = 0; - - virtual void buyItems(const int points, - const STD_VECTOR<ShopItem*> &items) const = 0; - - virtual void close() const = 0; - - virtual void requestPoints() const = 0; - - virtual void requestTab(const int tab) const = 0; - - virtual void schedule() const = 0; -}; - -} // namespace Net - -extern Net::CashShopHandler *cashShopHandler; - -#endif // NET_CASHSHOPHANDLER_H diff --git a/src/net/character.h b/src/net/character.h deleted file mode 100644 index b2340e154..000000000 --- a/src/net/character.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_CHARACTER_H -#define NET_CHARACTER_H - -#include "being/localplayer.h" -#include "being/playerinfo.h" - -#include "utils/delete2.h" - -#include "localconsts.h" - -namespace Net -{ - -/** - * A structure to hold information about a character. - */ -struct Character final -{ - Character() : - dummy(nullptr), - data(), - slot(0U) - { - } - - A_DELETE_COPY(Character) - - ~Character() - { - delete2(dummy); - } - - LocalPlayer *dummy; /**< A dummy representing this character */ - PlayerInfoBackend data; - uint16_t slot; /**< The index in the list of characters */ -}; - -typedef std::list<Character*> Characters; - -} // namespace Net - -#endif // NET_CHARACTER_H diff --git a/src/net/characters.h b/src/net/characters.h deleted file mode 100644 index 429abd848..000000000 --- a/src/net/characters.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_CHARACTERS_H -#define NET_CHARACTERS_H - -#include <list> - -#include "localconsts.h" - -namespace Net -{ - struct Character; - - typedef std::list<Character*> Characters; -} // namespace Net - -#endif // NET_CHARACTERS_H diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp deleted file mode 100644 index c6bef957c..000000000 --- a/src/net/charserverhandler.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/charserverhandler.h" - -#include "gui/windows/charselectdialog.h" - -#include "debug.h" - -namespace Net -{ - -Net::Characters CharServerHandler::mCharacters; -Net::Character *CharServerHandler::mSelectedCharacter = nullptr; -CharSelectDialog *CharServerHandler::mCharSelectDialog = nullptr; -CharCreateDialog *CharServerHandler::mCharCreateDialog = nullptr; - -void CharServerHandler::updateCharSelectDialog() -{ - if (mCharSelectDialog != nullptr) - mCharSelectDialog->setCharacters(mCharacters); -} - -void CharServerHandler::unlockCharSelectDialog() -{ - if (mCharSelectDialog != nullptr) - mCharSelectDialog->unlock(); -} - -} // namespace Net diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h deleted file mode 100644 index 7d14a3bab..000000000 --- a/src/net/charserverhandler.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_CHARSERVERHANDLER_H -#define NET_CHARSERVERHANDLER_H - -#include "enums/being/gender.h" - -#include "enums/simpletypes/beingid.h" - -#include "net/characters.h" - -#include "utils/vector.h" - -#include <string> - -class CharCreateDialog; -class CharSelectDialog; - -namespace Net -{ - -struct Character; - -class CharServerHandler notfinal -{ - public: - A_DELETE_COPY(CharServerHandler) - - virtual ~CharServerHandler() - { } - - virtual void setCharSelectDialog(CharSelectDialog *const window) - const = 0; - - virtual void setCharCreateDialog(CharCreateDialog *const window) - const = 0; - - virtual void requestCharacters() const = 0; - - virtual void chooseCharacter(Net::Character *const character) - const = 0; - - virtual void newCharacter(const std::string &name, - const int slot, - const GenderT gender, - const int hairstyle, - const int hairColor, - const unsigned char race, - const uint16_t look, - const STD_VECTOR<int> &stats) const = 0; - - virtual void deleteCharacter(Net::Character *const character, - const std::string &email) const = 0; - - virtual void renameCharacter(const BeingId id, - const std::string &newName) const = 0; - - virtual void switchCharacter() const = 0; - - virtual unsigned int baseSprite() const A_WARN_UNUSED = 0; - - virtual unsigned int hairSprite() const A_WARN_UNUSED = 0; - - virtual unsigned int hatSprite() const A_WARN_UNUSED = 0; - - virtual unsigned int maxSprite() const A_WARN_UNUSED = 0; - - virtual void clear() const = 0; - - virtual bool isNeedCreatePin() const = 0; - - virtual void setNewPincode(const std::string &pin) const = 0; - - virtual void changeSlot(const int oldSlot, - const int newSlot) const = 0; - - virtual void ping() const = 0; - - /** The list of available characters. */ - static Net::Characters mCharacters; - - static CharSelectDialog *mCharSelectDialog; - static CharCreateDialog *mCharCreateDialog; - - /** The selected character. */ - static Net::Character *mSelectedCharacter; - - static void updateCharSelectDialog(); - static void unlockCharSelectDialog(); - - protected: - CharServerHandler() - { - mCharacters.clear(); - mSelectedCharacter = nullptr; - mCharSelectDialog = nullptr; - mCharCreateDialog = nullptr; - } -}; - -} // namespace Net - -extern Net::CharServerHandler *charServerHandler; - -#endif // NET_CHARSERVERHANDLER_H diff --git a/src/net/chathandler.h b/src/net/chathandler.h deleted file mode 100644 index e43912ca2..000000000 --- a/src/net/chathandler.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_CHATHANDLER_H -#define NET_CHATHANDLER_H - -#include <string> - -#include "localconsts.h" - -struct ChatObject; - -namespace Net -{ - -class ChatHandler notfinal -{ - public: - ChatHandler() - { } - - A_DELETE_COPY(ChatHandler) - - virtual ~ChatHandler() - { } - - virtual void talk(const std::string &restrict text, - const std::string &restrict channel) const = 0; - - virtual void talkPet(const std::string &restrict text, - const std::string &restrict channel) const = 0; - - virtual void talkRaw(const std::string &text) const = 0; - - virtual void me(const std::string &restrict text, - const std::string &restrict channel) const = 0; - - virtual void privateMessage(const std::string &restrict recipient, - const std::string &restrict text) - const = 0; - - virtual void channelMessage(const std::string &restrict channel, - const std::string &restrict text) - const = 0; - - virtual void joinChannel(const std::string &channel) const = 0; - - virtual void partChannel(const std::string &channel) const = 0; - - virtual void who() const = 0; - - virtual void sendRaw(const std::string &args) const = 0; - - virtual void ignoreAll() const = 0; - - virtual void unIgnoreAll() const = 0; - - virtual void ignore(const std::string &nick) const = 0; - - virtual void unIgnore(const std::string &nick) const = 0; - - virtual void requestIgnoreList() const = 0; - - virtual void clear() const = 0; - - virtual void createChatRoom(const std::string &title, - const std::string &password, - const int limit, - const bool isPublic) const = 0; - - virtual void leaveChatRoom() const = 0; - - virtual void battleTalk(const std::string &text) const = 0; - - virtual void joinChat(const ChatObject *const chat, - const std::string &password) const = 0; - - virtual void setChatRoomOptions(const int limit, - const bool isPublic, - const std::string &password, - const std::string &title) const = 0; - - virtual void setChatRoomOwner(const std::string &nick) const = 0; - - virtual void kickFromChatRoom(const std::string &nick) const = 0; -}; - -} // namespace Net - -extern Net::ChatHandler *chatHandler; - -#endif // NET_CHATHANDLER_H diff --git a/src/net/download.cpp b/src/net/download.cpp deleted file mode 100644 index 9068f15ca..000000000 --- a/src/net/download.cpp +++ /dev/null @@ -1,643 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/download.h" - -#include "configuration.h" -#include "logger.h" -#include "settings.h" - -#include "fs/files.h" - -#include "utils/cast.h" -#include "utils/sdlhelper.h" - -#include <zlib.h> - -#include <sstream> - -#include "debug.h" - -const char *DOWNLOAD_ERROR_MESSAGE_THREAD - = "Could not create download thread!"; - -extern volatile bool isTerminate; - -enum -{ - OPTIONS_NONE = 0, - OPTIONS_MEMORY = 1 -}; - -namespace Net -{ - -std::string Download::mUploadResponse; - -Download::Download(void *const ptr, - const std::string &url, - const DownloadUpdate updateFunction, - const bool ignoreError, - const bool isUpload, - const bool isXml) : - mPtr(ptr), - mUrl(url), - mOptions(), - mFileName(), - mUrlQueue(), - mWriteFunction(nullptr), - mAdler(0), - mUpdateFunction(updateFunction), - mThread(nullptr), - mCurl(nullptr), - mHeaders(nullptr), - mFormPost(nullptr), - mError(static_cast<char*>(calloc(CURL_ERROR_SIZE + 1, 1))), - mIgnoreError(ignoreError), - mUpload(isUpload), - mIsXml(isXml) -{ - if (mError != nullptr) - mError[0] = 0; - - mOptions.cancel = 0; - mOptions.memoryWrite = 0; - mOptions.checkAdler = 1u; - if (!mUpload) - { - const std::string serverName = settings.serverName; - if (!serverName.empty()) - { - if (mUrl.find('?') == std::string::npos) - mUrl.append("?host="); - else - mUrl.append("&host="); - mUrl.append(serverName); - } - } - mUrlQueue.push(url); -} - -Download::~Download() -{ - if (mFormPost != nullptr) - { - curl_formfree(mFormPost); - mFormPost = nullptr; - } - - if (mHeaders != nullptr) - { - curl_slist_free_all(mHeaders); - mHeaders = nullptr; - } - - SDL::WaitThread(mThread); - mThread = nullptr; - free(mError); -} - -/** - * Calculates the Alder-32 checksum for the given file. - */ -unsigned long Download::fadler32(FILE *const file) -{ - if (file == nullptr) - return 0; - - // Obtain file size - fseek(file, 0, SEEK_END); - const long fileSize = ftell(file); - if (fileSize < 0) - { // file size error - return 0; - } - rewind(file); - - // Calculate Adler-32 checksum - char *const buffer = new char[CAST_SIZE(fileSize)]; - const uInt read = static_cast<uInt>(fread(buffer, 1, fileSize, file)); - unsigned long adler = adler32(0L, nullptr, 0); - adler = adler32(static_cast<uInt>(adler), - reinterpret_cast<Bytef*>(buffer), read); - delete [] buffer; - return adler; -} - -unsigned long Download::adlerBuffer(const char *const buffer, int size) -{ - FUNC_BLOCK("Download::adlerBuffer", 1) - unsigned long adler = adler32(0L, nullptr, 0); - return adler32(static_cast<uInt>(adler), - reinterpret_cast<const Bytef*>(buffer), size); -} - -void Download::addHeader(const std::string &header) -{ - mHeaders = curl_slist_append(mHeaders, header.c_str()); -} - -void Download::noCache() -{ - addHeader("pragma: no-cache"); - addHeader("Cache-Control: no-cache"); -} - -void Download::setFile(const std::string &filename, const int64_t adler32) -{ - mOptions.memoryWrite = 0; - mFileName = filename; - - if (adler32 > -1) - { - mAdler = static_cast<unsigned long>(adler32); - mOptions.checkAdler = 1u; - } - else - { - mOptions.checkAdler = 0; - } -} - -void Download::setWriteFunction(WriteFunction write) -{ - mOptions.memoryWrite = 1u; - mWriteFunction = write; -} - -bool Download::start() -{ - logger->log("Starting download: %s", mUrl.c_str()); - - mThread = SDL::createThread(&downloadThread, "download", this); - if (mThread == nullptr) - { - logger->log1(DOWNLOAD_ERROR_MESSAGE_THREAD); - if (mError != nullptr) - strcpy(mError, DOWNLOAD_ERROR_MESSAGE_THREAD); - mUpdateFunction(mPtr, DownloadStatus::ThreadError, 0, 0); - if (!mIgnoreError) - return false; - } - - return true; -} - -void Download::cancel() -{ - logger->log("Canceling download: %s", mUrl.c_str()); - - mOptions.cancel = 1u; - SDL::WaitThread(mThread); - mThread = nullptr; -} - -const char *Download::getError() const -{ - return mError; -} - -int Download::downloadProgress(void *clientp, double dltotal, double dlnow, - double ultotal A_UNUSED, double ulnow A_UNUSED) -{ - Download *const d = reinterpret_cast<Download *>(clientp); - - if (d == nullptr) - return -5; - - if (d->mUpload) - return 0; - - if (d->mOptions.cancel != 0u) - { - return d->mUpdateFunction(d->mPtr, DownloadStatus::Cancelled, - CAST_SIZE(dltotal), - CAST_SIZE(dlnow)); - } - - return d->mUpdateFunction(d->mPtr, DownloadStatus::Idle, - CAST_SIZE(dltotal), - CAST_SIZE(dlnow)); -} - -int Download::downloadThread(void *ptr) -{ - int attempts = 0; - bool complete = false; - Download *const d = reinterpret_cast<Download*>(ptr); - CURLcode res; - - if (d == nullptr) - return 0; - - std::string outFilename; - if (d->mUpload) - { - outFilename = d->mFileName; - prepareForm(&d->mFormPost, outFilename); - } - else - { - if (d->mOptions.memoryWrite == 0u) - outFilename = d->mFileName + ".part"; - else - outFilename.clear(); - } - - while (!d->mUrlQueue.empty()) - { - attempts = 0; - complete = false; - d->mUrl = d->mUrlQueue.front(); - d->mUrlQueue.pop(); - - logger->log_r("selected url: %s", d->mUrl.c_str()); - while (attempts < 3 && - !complete && - (d->mOptions.cancel == 0u) && - isTerminate == false) - { - d->mUpdateFunction(d->mPtr, DownloadStatus::Starting, 0, 0); - - if ((d->mOptions.cancel != 0u) || isTerminate == true) - { - return 0; - } - d->mCurl = curl_easy_init(); - - if (d->mCurl != nullptr && - d->mOptions.cancel == 0u && - isTerminate == false) - { - FILE *file = nullptr; - - if (d->mUpload) - { - logger->log_r("Uploading: %s", d->mUrl.c_str()); - curl_easy_setopt(d->mCurl, CURLOPT_URL, d->mUrl.c_str()); - curl_easy_setopt(d->mCurl, CURLOPT_HTTPPOST, d->mFormPost); - curl_easy_setopt(d->mCurl, CURLOPT_WRITEFUNCTION, - &Download::writeFunction); - mUploadResponse.clear(); - } - else - { - logger->log_r("Downloading: %s", d->mUrl.c_str()); - curl_easy_setopt(d->mCurl, CURLOPT_FOLLOWLOCATION, 1); - curl_easy_setopt(d->mCurl, CURLOPT_HTTPHEADER, - d->mHeaders); - if (d->mOptions.memoryWrite != 0u) - { - curl_easy_setopt(d->mCurl, CURLOPT_FAILONERROR, 1); - curl_easy_setopt(d->mCurl, CURLOPT_WRITEFUNCTION, - d->mWriteFunction); - curl_easy_setopt(d->mCurl, CURLOPT_WRITEDATA, d->mPtr); - } - else - { - file = fopen(outFilename.c_str(), "w+b"); - if (file != nullptr) - { - curl_easy_setopt(d->mCurl, CURLOPT_WRITEDATA, - file); - } - } - curl_easy_setopt(d->mCurl, - CURLOPT_USERAGENT, - settings.userAgent.c_str()); - - curl_easy_setopt(d->mCurl, CURLOPT_ERRORBUFFER, d->mError); - curl_easy_setopt(d->mCurl, CURLOPT_URL, d->mUrl.c_str()); - curl_easy_setopt(d->mCurl, CURLOPT_NOPROGRESS, 0); - curl_easy_setopt(d->mCurl, CURLOPT_PROGRESSFUNCTION, - &downloadProgress); - curl_easy_setopt(d->mCurl, CURLOPT_PROGRESSDATA, ptr); -#if LIBCURL_VERSION_NUM >= 0x070a00 - curl_easy_setopt(d->mCurl, CURLOPT_NOSIGNAL, 1); -#endif // LIBCURL_VERSION_NUM >= 0x070a00 - curl_easy_setopt(d->mCurl, CURLOPT_CONNECTTIMEOUT, 30); - curl_easy_setopt(d->mCurl, CURLOPT_TIMEOUT, 1800); - addHeaders(d->mCurl); - addProxy(d->mCurl); - secureCurl(d->mCurl); - } - - if ((res = curl_easy_perform(d->mCurl)) != 0 && - (d->mOptions.cancel == 0u) && - isTerminate == false) - { - PRAGMA45(GCC diagnostic push) - PRAGMA45(GCC diagnostic ignored "-Wswitch-enum") - switch (res) - { - case CURLE_ABORTED_BY_CALLBACK: - d->mOptions.cancel = 1u; - break; - case CURLE_COULDNT_CONNECT: - default: - break; - } - PRAGMA45(GCC diagnostic pop) - - if (res != 0u) - { - if (d->mError != nullptr) - { - logger->log_r("curl error %d: %s host: %s", - res, d->mError, d->mUrl.c_str()); - } - attempts++; - continue; - } - - if ((d->mOptions.cancel != 0u) || isTerminate == true) - break; - -// d->mUpdateFunction(d->mPtr, DownloadStatus::Error, 0, 0); - - if (file != nullptr) - { - fclose(file); - file = nullptr; - } - if (!d->mUpload && (d->mOptions.memoryWrite == 0u)) - ::remove(outFilename.c_str()); - attempts++; - continue; - } - - curl_easy_cleanup(d->mCurl); - d->mCurl = nullptr; - - if (d->mUpload) - { - if (file != nullptr) - { - fclose(file); - file = nullptr; - } - // need check first if we read data from server - complete = true; - } - else - { - if (d->mOptions.memoryWrite == 0u) - { - // Don't check resources.xml checksum - if (d->mOptions.checkAdler != 0u) - { - const unsigned long adler = fadler32(file); - - if (d->mAdler != adler) - { - if (file != nullptr) - { - fclose(file); - file = nullptr; - } - - // Remove the corrupted file - ::remove(d->mFileName.c_str()); - logger->log_r("Checksum for file %s failed:" - " (%lx/%lx)", - d->mFileName.c_str(), - adler, d->mAdler); - attempts++; - continue; - } - } - - if (file != nullptr) - { - fclose(file); - file = nullptr; - } - - // Any existing file with this name is deleted first, - // otherwise the rename will fail on Windows. - if ((d->mOptions.cancel == 0u) && isTerminate == false) - { - if (d->mIsXml) - { - if (!XML::Document::validateXml(outFilename)) - { - logger->log_r("Xml file validation error"); - attempts++; - continue; - } - } - - ::remove(d->mFileName.c_str()); - Files::renameFile(outFilename, d->mFileName); - - // Check if we can open it and no errors were - // encountered during renaming - file = fopen(d->mFileName.c_str(), "rb"); - if (file != nullptr) - { - fclose(file); - file = nullptr; - complete = true; - } - } - } - else - { - // It's stored in memory, we're done - complete = true; - } - } - } - - if (d->mCurl != nullptr) - { - curl_easy_cleanup(d->mCurl); - d->mCurl = nullptr; - } - - if ((d->mOptions.cancel != 0u) || isTerminate == true) - { - return 0; - } - attempts++; - } - - if ((complete && attempts < 3) || (d->mOptions.cancel != 0u)) - break; - } - - if ((d->mOptions.cancel != 0u) || isTerminate == true) - { - // Nothing to do... - } - else if (!complete || attempts >= 3) - { - d->mUpdateFunction(d->mPtr, DownloadStatus::Error, 0, 0); - } - else - { - d->mUpdateFunction(d->mPtr, DownloadStatus::Complete, 0, 0); - } - - return 0; -} - -void Download::addProxy(CURL *const curl) -{ - const int mode = config.getIntValue("downloadProxyType"); - if (mode == 0) - return; - - if (mode > 1) - { - curl_easy_setopt(curl, CURLOPT_PROXY, - config.getStringValue("downloadProxy").c_str()); - } - - switch (mode) - { - case 1: // direct connection - default: - curl_easy_setopt(curl, CURLOPT_PROXY, ""); - break; - case 2: // HTTP -#if LIBCURL_VERSION_NUM >= 0x070300 - curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, - config.getIntValue("downloadProxyTunnel")); -#endif // LIBCURL_VERSION_NUM >= 0x070300 - break; - case 3: // HTTP 1.0 -#if LIBCURL_VERSION_NUM >= 0x071304 - curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP_1_0); -#endif // LIBCURL_VERSION_NUM >= 0x071304 -#if LIBCURL_VERSION_NUM >= 0x070300 - curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, - config.getIntValue("downloadProxyTunnel")); -#endif // LIBCURL_VERSION_NUM >= 0x070300 - break; - case 4: // SOCKS4 -#if LIBCURL_VERSION_NUM >= 0x070a00 - curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); -#endif // LIBCURL_VERSION_NUM >= 0x070a00 - break; - case 5: // SOCKS4A -#if LIBCURL_VERSION_NUM >= 0x071200 - curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A); -#elif LIBCURL_VERSION_NUM >= 0x071000 - curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); -#endif // LIBCURL_VERSION_NUM >= 0x071200 - - break; - case 6: // SOCKS5 -#if LIBCURL_VERSION_NUM >= 0x071200 - curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); -#endif // LIBCURL_VERSION_NUM >= 0x071200 - - break; - case 7: // SOCKS5 hostname -#if LIBCURL_VERSION_NUM >= 0x071200 - curl_easy_setopt(curl, CURLOPT_PROXYTYPE, - CURLPROXY_SOCKS5_HOSTNAME); -#endif // LIBCURL_VERSION_NUM >= 0x071200 - - break; - } -} - -#if LIBCURL_VERSION_NUM >= 0x070a08 -void Download::secureCurl(CURL *const curl) -#else // LIBCURL_VERSION_NUM >= 0x070f01 -void Download::secureCurl(CURL *const curl A_UNUSED) -#endif // LIBCURL_VERSION_NUM >= 0x070f01 -{ -#if LIBCURL_VERSION_NUM >= 0x071304 - curl_easy_setopt(curl, CURLOPT_PROTOCOLS, - CURLPROTO_HTTP | CURLPROTO_HTTPS); - curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS, - CURLPROTO_HTTP | CURLPROTO_HTTPS); -#endif // LIBCURL_VERSION_NUM >= 0x071304 -#if LIBCURL_VERSION_NUM >= 0x071500 - curl_easy_setopt(curl, CURLOPT_WILDCARDMATCH, 0); -#endif // LIBCURL_VERSION_NUM >= 0x071500 -#if LIBCURL_VERSION_NUM >= 0x070f01 - curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 3); -#endif // LIBCURL_VERSION_NUM >= 0x070f01 -#if LIBCURL_VERSION_NUM >= 0x070a08 - curl_easy_setopt(curl, CURLOPT_MAXFILESIZE, 536870912); -#endif // LIBCURL_VERSION_NUM >= 0x070a08 - -#if LIBCURL_VERSION_NUM >= 0x073100 - curl_easy_setopt(curl, CURLOPT_TCP_FASTOPEN, 1L); -#endif // LIBCURL_VERSION_NUM >= 0x073100 - - curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1L); - curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 60L); -} - -#if LIBCURL_VERSION_NUM >= 0x071507 -void Download::addHeaders(CURL *const curl) -{ - curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, ""); -} -#else // LIBCURL_VERSION_NUM >= 0x071507 - -void Download::addHeaders(CURL *const curl A_UNUSED) -{ -} -#endif // LIBCURL_VERSION_NUM >= 0x071507 - -void Download::prepareForm(curl_httppost **form, const std::string &fileName) -{ - curl_httppost *lastPtr = nullptr; - - std::ifstream file; - file.open(fileName.c_str(), std::ios::in); - if (!file.is_open()) - return; - - char *line = new char[10001]; - std::ostringstream str; - while (file.getline(line, 10000)) - str << line << "\n"; - - delete [] line; - - curl_formadd(form, &lastPtr, - CURLFORM_COPYNAME, "sprunge", - CURLFORM_COPYCONTENTS, str.str().c_str(), - CURLFORM_END); -} - -size_t Download::writeFunction(void *ptr, - size_t size, - size_t nmemb, - void *stream A_UNUSED) -{ - const size_t totalMem = size * nmemb; - char *buf = new char[totalMem + 1]; - memcpy(buf, ptr, totalMem); - buf[totalMem] = 0; - mUploadResponse.append(buf); - delete [] buf; - return totalMem; -} - -} // namespace Net diff --git a/src/net/download.h b/src/net/download.h deleted file mode 100644 index ce99b7b91..000000000 --- a/src/net/download.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_DOWNLOAD_H -#define NET_DOWNLOAD_H - -#include "enums/net/downloadstatus.h" - -#include <curl/curl.h> - -#include <string> -#include <queue> - -#include "localconsts.h" - -typedef int (*DownloadUpdate)(void *ptr, - const DownloadStatusT status, - size_t total, - const size_t remaining); - -// Matches what CURL expects -typedef size_t (*WriteFunction)( void *ptr, size_t size, size_t nmemb, - void *stream); - -struct SDL_Thread; - -namespace Net -{ -class Download final -{ - public: - Download(void *const ptr, - const std::string &url, - const DownloadUpdate updateFunction, - const bool ignoreError, - const bool isUpload, - const bool isXml); - - A_DELETE_COPY(Download) - - ~Download(); - - void addHeader(const std::string &header); - - /** - * Convience method for adding no-cache headers. - */ - void noCache(); - - void setFile(const std::string &filename, const int64_t adler32 = -1); - - void setWriteFunction(WriteFunction write); - - /** - * Starts the download thread. - * @returns true if thread was created - * false if the thread could not be made or download wasn't - * properly setup - */ - bool start(); - - /** - * Cancels the download. Returns immediately, the cancelled status will - * be noted in the next avialable update call. - */ - void cancel(); - - void addMirror(const std::string &str) - { mUrlQueue.push(str); } - - const char *getError() const A_WARN_UNUSED; - - void setIgnoreError(const bool n) - { mIgnoreError = n; } - - static size_t writeFunction(void *ptr, size_t size, - size_t nmemb, void *stream); - - static void prepareForm(curl_httppost **form, - const std::string &fileName); - - static unsigned long fadler32(FILE *const file) A_WARN_UNUSED; - - static void addProxy(CURL *const curl); - - static void secureCurl(CURL *const curl); - - static void addHeaders(CURL *const curl); - - static unsigned long adlerBuffer(const char *const buffer, int size); - - static std::string getUploadResponse() - { return mUploadResponse; } - - private: - static int downloadThread(void *ptr); - static int downloadProgress(void *clientp, double dltotal, - double dlnow, double ultotal, - double ulnow); - static std::string mUploadResponse; - void *mPtr; - std::string mUrl; - struct - { - unsigned cancel : 1; - unsigned memoryWrite: 1; - unsigned checkAdler: 1; - } mOptions; - std::string mFileName; - std::queue<std::string> mUrlQueue; - WriteFunction mWriteFunction; - unsigned long mAdler; - DownloadUpdate mUpdateFunction; - SDL_Thread *mThread; - CURL *mCurl; - curl_slist *mHeaders; - curl_httppost *mFormPost; - char *mError; - bool mIgnoreError; - bool mUpload; - bool mIsXml; -}; - -} // namespace Net - -#endif // NET_DOWNLOAD_H diff --git a/src/net/ea/adminhandler.cpp b/src/net/ea/adminhandler.cpp deleted file mode 100644 index 4188fc803..000000000 --- a/src/net/ea/adminhandler.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/adminhandler.h" - -#include "utils/gmfunctions.h" -#include "utils/stringutils.h" - -#include "debug.h" - -namespace Ea -{ - -void AdminHandler::kickName(const std::string &name) const -{ - Gm::runCommand("kick", name); -} - -void AdminHandler::ban(const int playerId A_UNUSED) const -{ - // Not supported -} - -void AdminHandler::banName(const std::string &name) const -{ - Gm::runCommand("ban", name); -} - -void AdminHandler::unban(const int playerId A_UNUSED) const -{ - // Not supported -} - -void AdminHandler::unbanName(const std::string &name) const -{ - Gm::runCommand("unban", name); -} - -void AdminHandler::ipcheckName(const std::string &name) const -{ - Gm::runCommand("ipcheck", name); -} - -void AdminHandler::createItems(const int id, - const ItemColor color A_UNUSED, - const int amount) const -{ - Gm::runCommand("item", - strprintf("%d %d", id, amount)); -} - -void AdminHandler::spawn(const std::string &name) const -{ - Gm::runCommand("spawn", name); -} - -} // namespace Ea diff --git a/src/net/ea/adminhandler.h b/src/net/ea/adminhandler.h deleted file mode 100644 index f300fda55..000000000 --- a/src/net/ea/adminhandler.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_ADMINHANDLER_H -#define NET_EA_ADMINHANDLER_H - -#include "net/adminhandler.h" - -#include "localconsts.h" - -namespace Ea -{ - -class AdminHandler notfinal : public Net::AdminHandler -{ - public: - AdminHandler() - { } - - A_DELETE_COPY(AdminHandler) - - virtual ~AdminHandler() - { } - - void kickName(const std::string &name) const override final; - - void ban(const int playerId) const override final A_CONST; - - void banName(const std::string &name) const override final; - - void unban(const int playerId) const override final A_CONST; - - void unbanName(const std::string &name) const override final; - - void ipcheckName(const std::string &name) const override final; - - void createItems(const int id, - const ItemColor color, - const int amount) const override final; - - void spawn(const std::string &name) const override final; -}; - -} // namespace Ea - -#endif // NET_EA_ADMINHANDLER_H diff --git a/src/net/ea/adminrecv.cpp b/src/net/ea/adminrecv.cpp deleted file mode 100644 index a083ed78d..000000000 --- a/src/net/ea/adminrecv.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/adminrecv.h" - -#include "notifymanager.h" - -#include "enums/resources/notifytypes.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace Ea -{ - -void AdminRecv::processKickAck(Net::MessageIn &msg) -{ - if (msg.readInt32("flag") == 0) - NotifyManager::notify(NotifyTypes::KICK_FAIL); - else - NotifyManager::notify(NotifyTypes::KICK_SUCCEED); -} - -} // namespace Ea diff --git a/src/net/ea/adminrecv.h b/src/net/ea/adminrecv.h deleted file mode 100644 index 71451aa21..000000000 --- a/src/net/ea/adminrecv.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_ADMINRECV_H -#define NET_EA_ADMINRECV_H - -#include "localconsts.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace Ea -{ - namespace AdminRecv - { - void processKickAck(Net::MessageIn &msg); - } // namespace AdminRecv -} // namespace Ea - -#endif // NET_EA_ADMINRECV_H diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp deleted file mode 100644 index 4f62175c3..000000000 --- a/src/net/ea/beinghandler.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/beinghandler.h" - -#include "net/ea/beingrecv.h" - -#include "debug.h" - -namespace Ea -{ - -BeingHandler::BeingHandler(const bool enableSync) : - Net::BeingHandler() -{ - BeingRecv::mSync = enableSync; - BeingRecv::mSpawnId = BeingId_zero; -} - -} // namespace Ea diff --git a/src/net/ea/beinghandler.h b/src/net/ea/beinghandler.h deleted file mode 100644 index 625077855..000000000 --- a/src/net/ea/beinghandler.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_BEINGHANDLER_H -#define NET_EA_BEINGHANDLER_H - -#include "net/beinghandler.h" - -namespace Ea -{ - -class BeingHandler notfinal : public Net::BeingHandler -{ - public: - A_DELETE_COPY(BeingHandler) - - protected: - explicit BeingHandler(const bool enableSync); -}; - -} // namespace Ea - -#endif // NET_EA_BEINGHANDLER_H diff --git a/src/net/ea/beingrecv.cpp b/src/net/ea/beingrecv.cpp deleted file mode 100644 index b2859d76f..000000000 --- a/src/net/ea/beingrecv.cpp +++ /dev/null @@ -1,520 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/beingrecv.h" - -#include "actormanager.h" -#include "configuration.h" -#include "game.h" -#include "notifymanager.h" -#include "party.h" - -#include "being/localplayer.h" -#include "being/playerrelation.h" -#include "being/playerrelations.h" - -#include "enums/resources/notifytypes.h" - -#include "enums/resources/map/mapitemtype.h" - -#include "gui/viewport.h" - -#include "gui/windows/socialwindow.h" - -#include "utils/foreach.h" - -#include "resources/map/map.h" - -#include "net/messagein.h" -#include "net/serverfeatures.h" - -#include "debug.h" - -namespace Ea -{ - -namespace BeingRecv -{ - bool mSync = false; - BeingId mSpawnId = BeingId_zero; -} // namespace BeingRecv - -void BeingRecv::processBeingRemove(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingRemove") - if ((actorManager == nullptr) || (localPlayer == nullptr)) - { - BLOCK_END("BeingRecv::processBeingRemove") - return; - } - - // A being should be removed or has died - - const BeingId id = msg.readBeingId("being id"); - const uint8_t type = msg.readUInt8("remove flag"); - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing == nullptr) - { - BLOCK_END("BeingRecv::processBeingRemove") - return; - } - - localPlayer->followMoveTo(dstBeing, localPlayer->getNextDestX(), - localPlayer->getNextDestY()); - - // If this is player's current target, clear it. - if (dstBeing == localPlayer->getTarget()) - localPlayer->stopAttack(true); - - if (type == 1U) - { - if (dstBeing->getCurrentAction() != BeingAction::DEAD) - { - dstBeing->setAction(BeingAction::DEAD, 0); - dstBeing->recalcSpritesOrder(); - } - } - else if (type == 0U && dstBeing->getType() == ActorType::Npc) - { - const BeingInfo *const info = dstBeing->getInfo(); - if ((info == nullptr) || (info->getAllowDelete() != 0)) - actorManager->destroy(dstBeing); - } - else - { - if (dstBeing->getType() == ActorType::Player) - { - if (socialWindow != nullptr) - socialWindow->updateActiveList(); - const std::string name = dstBeing->getName(); - if (!name.empty() && config.getBoolValue("logPlayerActions")) - { - switch (type) - { - case 0: - dstBeing->serverRemove(); - break; - case 1: - NotifyManager::notify( - NotifyTypes::BEING_REMOVE_DIED, - name); - break; - case 2: - NotifyManager::notify( - NotifyTypes::BEING_REMOVE_LOGGED_OUT, - name); - break; - case 3: - NotifyManager::notify( - NotifyTypes::BEING_REMOVE_WARPED, - name); - break; - case 4: - NotifyManager::notify( - NotifyTypes::BEING_REMOVE_TRICK_DEAD, - name); - break; - default: - NotifyManager::notify( - NotifyTypes::BEING_REMOVE_UNKNOWN, - name); - break; - } - } - } - actorManager->destroy(dstBeing); - } - BLOCK_END("BeingRecv::processBeingRemove") -} - -void BeingRecv::processBeingAction(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingAction") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processBeingAction") - return; - } - - Being *const srcBeing = actorManager->findBeing( - msg.readBeingId("src being id")); - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("dst being id")); - - msg.readInt32("tick"); - const int srcSpeed = msg.readInt32("src speed"); - msg.readInt32("dst speed"); - const int param1 = msg.readInt16("param1"); - msg.readInt16("param 2"); - const AttackTypeT type = static_cast<AttackTypeT>( - msg.readUInt8("type")); - msg.readInt16("param 3"); - - switch (type) - { - case AttackType::HIT: // Damage - case AttackType::CRITICAL: // Critical Damage - case AttackType::MULTI: // Critical Damage - case AttackType::REFLECT: // Reflected Damage - case AttackType::FLEE: // Lucky Dodge - if (srcBeing != nullptr) - { - if (srcSpeed != 0 && srcBeing->getType() == ActorType::Player) - srcBeing->setAttackDelay(srcSpeed); - // attackid=1, type - srcBeing->handleAttack(dstBeing, param1, 1); - if (srcBeing->getType() == ActorType::Player) - srcBeing->setAttackTime(); - } - if (dstBeing != nullptr) - { - // level not present, using 1 - dstBeing->takeDamage(srcBeing, param1, - static_cast<AttackTypeT>(type), 1); - } - break; - - case AttackType::PICKUP: - break; - // tmw server can send here garbage? -// if (srcBeing) -// srcBeing->setAction(BeingAction::DEAD, 0); - - case AttackType::SIT: - if (srcBeing != nullptr) - { - srcBeing->setAction(BeingAction::SIT, 0); - if (srcBeing->getType() == ActorType::Player) - { - srcBeing->setMoveTime(); - if (localPlayer != nullptr) - localPlayer->imitateAction(srcBeing, BeingAction::SIT); - } - } - break; - - case AttackType::STAND: - if (srcBeing != nullptr) - { - srcBeing->setAction(BeingAction::STAND, 0); - if (srcBeing->getType() == ActorType::Player) - { - srcBeing->setMoveTime(); - if (localPlayer != nullptr) - { - localPlayer->imitateAction(srcBeing, - BeingAction::STAND); - } - } - } - break; - default: - case AttackType::SPLASH: - case AttackType::SKILL: - case AttackType::REPEATE: - case AttackType::MULTI_REFLECT: - case AttackType::TOUCH_SKILL: - case AttackType::MISS: - case AttackType::SKILLMISS: - UNIMPLEMENTEDPACKETFIELD(CAST_S32(type)); - break; - } - BLOCK_END("BeingRecv::processBeingAction") -} - -void BeingRecv::processBeingEmotion(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingEmotion") - if ((localPlayer == nullptr) || (actorManager == nullptr)) - { - BLOCK_END("BeingRecv::processBeingEmotion") - return; - } - - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - if (dstBeing == nullptr) - { - DEBUGLOGSTR("invisible player?"); - msg.readUInt8("emote"); - BLOCK_END("BeingRecv::processBeingEmotion") - return; - } - - const uint8_t emote = msg.readUInt8("emote"); - if ((emote != 0u) && - playerRelations.hasPermission(dstBeing, PlayerRelation::EMOTE)) - { - dstBeing->setEmote(emote, 0); - localPlayer->imitateEmote(dstBeing, emote); - } - if (dstBeing->getType() == ActorType::Player) - dstBeing->setOtherTime(); - BLOCK_END("BeingRecv::processBeingEmotion") -} - -void BeingRecv::processNameResponse(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processNameResponse") - if ((localPlayer == nullptr) || (actorManager == nullptr)) - { - BLOCK_END("BeingRecv::processNameResponse") - return; - } - - const BeingId beingId = msg.readBeingId("being id"); - const std::string name = msg.readString(24, "name"); - Being *const dstBeing = actorManager->findBeing(beingId); - - actorManager->updateNameId(name, beingId); - - if (dstBeing != nullptr) - { - if (beingId == localPlayer->getId()) - { - localPlayer->pingResponse(); - } - else - { - if (dstBeing->getType() != ActorType::Portal) - { - dstBeing->setName(name); - } - else if (viewport != nullptr) - { - Map *const map = viewport->getMap(); - if (map != nullptr) - { - map->addPortalTile(name, MapItemType::PORTAL, - dstBeing->getTileX(), dstBeing->getTileY()); - } - } - dstBeing->updateGuild(); - dstBeing->addToCache(); - - if (dstBeing->getType() == ActorType::Player) - dstBeing->updateColors(); - - if (localPlayer != nullptr) - { - const Party *const party = localPlayer->getParty(); - if (party != nullptr && party->isMember(dstBeing->getId())) - { - PartyMember *const member = party->getMember( - dstBeing->getId()); - - if (member != nullptr) - member->setName(dstBeing->getName()); - } - localPlayer->checkNewName(dstBeing); - } - BLOCK_END("BeingRecv::processNameResponse") - return; - } - } - BLOCK_END("BeingRecv::processNameResponse") -} - -void BeingRecv::processPlayerStop(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processPlayerStop") - if ((actorManager == nullptr) || (localPlayer == nullptr)) - { - BLOCK_END("BeingRecv::processPlayerStop") - return; - } - - const BeingId id = msg.readBeingId("account id"); - - if (mSync || id != localPlayer->getId()) - { - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing != nullptr) - { - const uint16_t x = msg.readInt16("x"); - const uint16_t y = msg.readInt16("y"); - dstBeing->setTileCoords(x, y); - if (dstBeing->getCurrentAction() == BeingAction::MOVE) - dstBeing->setAction(BeingAction::STAND, 0); - BLOCK_END("BeingRecv::processPlayerStop") - return; - } - } - msg.readInt16("x"); - msg.readInt16("y"); - BLOCK_END("BeingRecv::processPlayerStop") -} - -void BeingRecv::processPlayerMoveToAttack(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processPlayerStop") - msg.readInt32("target id"); - msg.readInt16("target x"); - msg.readInt16("target y"); - msg.readInt16("x"); - msg.readInt16("y"); - msg.readInt16("attack range"); - - if (localPlayer != nullptr) - localPlayer->fixAttackTarget(); - BLOCK_END("BeingRecv::processPlayerStop") -} - -void BeingRecv::processSkillNoDamage(Net::MessageIn &msg) -{ - const int id = msg.readInt16("skill id"); - int heal; - if (msg.getVersion() >= 20131223) - heal = msg.readInt32("heal"); - else - heal = msg.readInt16("heal"); - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("dst being id")); - Being *const srcBeing = actorManager->findBeing( - msg.readBeingId("src being id")); - msg.readUInt8("fail"); - - if (srcBeing != nullptr) - srcBeing->handleSkill(dstBeing, heal, id, 1); -} - -void BeingRecv::processPvpMapMode(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processPvpMapMode") - const Game *const game = Game::instance(); - if (game == nullptr) - { - BLOCK_END("BeingRecv::processPvpMapMode") - return; - } - - Map *const map = game->getCurrentMap(); - if (map != nullptr) - map->setPvpMode(msg.readInt16("pvp mode")); - BLOCK_END("BeingRecv::processPvpMapMode") -} - -void BeingRecv::processBeingMove3(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingMove3") - if ((actorManager == nullptr) || !serverFeatures->haveMove3()) - { - BLOCK_END("BeingRecv::processBeingMove3") - return; - } - - static const int16_t dirx[8] = {0, -1, -1, -1, 0, 1, 1, 1}; - static const int16_t diry[8] = {1, 1, 0, -1, -1, -1, 0, 1}; - - const int len = msg.readInt16("len") - 14; - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - if (dstBeing == nullptr || - dstBeing == localPlayer) - { - DEBUGLOGSTR("invisible player?"); - msg.readInt16("speed"); - msg.readInt16("x"); - msg.readInt16("y"); - unsigned char *bytes = msg.readBytes(len, "moving path"); - delete [] bytes; - BLOCK_END("BeingRecv::processBeingMove3") - return; - } - const int16_t speed = msg.readInt16("speed"); - dstBeing->setWalkSpeed(speed); - const int16_t x = msg.readInt16("x"); - const int16_t y = msg.readInt16("y"); - const unsigned char *moves = msg.readBytes(len, "moving path"); - - Path path; - if (moves != nullptr) - { - int x2 = dstBeing->getCachedX(); - int y2 = dstBeing->getCachedY(); - Path path2; - path2.push_back(Position(x2, y2)); - for (int f = len - 1; f >= 0; f --) - { - const unsigned char dir = moves[f]; - if (dir <= 7) - { - x2 -= dirx[dir]; - y2 -= diry[dir]; - path2.push_back(Position(x2, y2)); - if (x2 == x && y2 == y) - break; - } - else - { - logger->log("bad move packet: %d", dir); - } - } - - if (!path2.empty()) - { - const Position &pos = path2.back(); - if (x != pos.x || - y != pos.y) - { - dstBeing->setTileCoords(pos.x, pos.y); - } - } - - path2.pop_back(); - FOR_EACHR (PathRIterator, it, path2) - { - path.push_back(*it); - } - delete [] moves; - } - - if (path.empty()) - return; - - dstBeing->setAction(BeingAction::STAND, 0); - dstBeing->setTileCoords(x, y); - dstBeing->setPath(path); - BLOCK_END("BeingRecv::processBeingMove3") -} - -Being *BeingRecv::createBeing(const BeingId id, - const int job) -{ - if (actorManager == nullptr) - return nullptr; - - ActorTypeT type = ActorType::Unknown; - if (job <= 25 || (job >= 4001 && job <= 4049)) - type = ActorType::Player; - else if (job >= 46 && job <= 1000) - type = ActorType::Npc; - else if (job > 1000 && job <= 2000) - type = ActorType::Monster; - else if (job == 45) - type = ActorType::Portal; - - return actorManager->createBeing( - id, type, fromInt(job, BeingTypeId)); -} - -} // namespace Ea diff --git a/src/net/ea/beingrecv.h b/src/net/ea/beingrecv.h deleted file mode 100644 index 878d53fb6..000000000 --- a/src/net/ea/beingrecv.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_BEINGRECV_H -#define NET_EA_BEINGRECV_H - -#include "enums/simpletypes/beingid.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -class Being; - -namespace Ea -{ - namespace BeingRecv - { - extern bool mSync; - extern BeingId mSpawnId; - - void processBeingRemove(Net::MessageIn &msg); - void processBeingAction(Net::MessageIn &msg); - void processBeingEmotion(Net::MessageIn &msg); - void processNameResponse(Net::MessageIn &msg); - void processPlayerStop(Net::MessageIn &msg); - void processPlayerMoveToAttack(Net::MessageIn &msg); - void processSkillNoDamage(Net::MessageIn &msg); - void processPvpMapMode(Net::MessageIn &msg); - void processBeingMove3(Net::MessageIn &msg); - Being *createBeing(const BeingId id, - const int job); - } // namespace BeingRecv -} // namespace Ea - -#endif // NET_EA_BEINGRECV_H diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp deleted file mode 100644 index 21769cef4..000000000 --- a/src/net/ea/buysellhandler.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/buysellhandler.h" - -#include "net/ea/buysellrecv.h" - -#include "debug.h" - -namespace Ea -{ - -BuySellHandler::BuySellHandler() -{ - BuySellRecv::mNpcId = BeingId_zero; - BuySellRecv::mBuyDialog = nullptr; -} - -void BuySellHandler::cleanDialogReference(const BuyDialog *const dialog) const -{ - if (BuySellRecv::mBuyDialog == dialog) - BuySellRecv::mBuyDialog = nullptr; -} - -} // namespace Ea diff --git a/src/net/ea/buysellhandler.h b/src/net/ea/buysellhandler.h deleted file mode 100644 index 2c5e1caad..000000000 --- a/src/net/ea/buysellhandler.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_BUYSELLHANDLER_H -#define NET_EA_BUYSELLHANDLER_H - -#include "net/buysellhandler.h" - -namespace Ea -{ - -class BuySellHandler notfinal : public Net::BuySellHandler -{ - public: - BuySellHandler(); - - A_DELETE_COPY(BuySellHandler) - - void cleanDialogReference(const BuyDialog *const dialog) const - override final; -}; - -} // namespace Ea - -#endif // NET_EA_BUYSELLHANDLER_H diff --git a/src/net/ea/buysellrecv.cpp b/src/net/ea/buysellrecv.cpp deleted file mode 100644 index 95f69129f..000000000 --- a/src/net/ea/buysellrecv.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/buysellrecv.h" - -#include "notifymanager.h" - -#include "being/playerinfo.h" - -#include "const/net/inventory.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/buyselldialog.h" -#include "gui/windows/npcselldialog.h" - -#include "gui/widgets/createwidget.h" - -#include "net/messagein.h" - -#include "resources/inventory/inventory.h" - -#include "resources/item/item.h" - -#include "debug.h" - -namespace Ea -{ - -namespace BuySellRecv -{ - BeingId mNpcId = BeingId_zero; - BuyDialog *mBuyDialog = nullptr; -} // namespace BuySellRecv - -void BuySellRecv::processNpcBuySellChoice(Net::MessageIn &msg) -{ - if (!BuySellDialog::isActive()) - { - mNpcId = msg.readBeingId("npc id"); - CREATEWIDGET(BuySellDialog, mNpcId); - } -} - -void BuySellRecv::processNpcSell(Net::MessageIn &msg) -{ - msg.readInt16("len"); - const int n_items = (msg.getLength() - 4) / 10; - if (n_items > 0) - { - SellDialog *const dialog = CREATEWIDGETR(NpcSellDialog, mNpcId); - dialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY)); - - for (int k = 0; k < n_items; k++) - { - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int value = msg.readInt32("value"); - msg.readInt32("value?"); - - const Item *const item = PlayerInfo::getInventory() - ->getItem(index); - - if ((item != nullptr) && item->isEquipped() == Equipped_false) - dialog->addItem(item, value); - } - } - else - { - NotifyManager::notify(NotifyTypes::SELL_LIST_EMPTY); - } -} - -} // namespace Ea diff --git a/src/net/ea/buysellrecv.h b/src/net/ea/buysellrecv.h deleted file mode 100644 index 7d70044fe..000000000 --- a/src/net/ea/buysellrecv.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_BUYSELLRECV_H -#define NET_EA_BUYSELLRECV_H - -#include "enums/simpletypes/beingid.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -class BuyDialog; - -namespace Ea -{ - namespace BuySellRecv - { - extern BeingId mNpcId; - extern BuyDialog *mBuyDialog; - - void processNpcBuySellChoice(Net::MessageIn &msg); - void processNpcSell(Net::MessageIn &msg); - } // namespace BuySellRecv -} // namespace Ea - -#endif // NET_EA_BUYSELLRECV_H diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp deleted file mode 100644 index ae8da9e4a..000000000 --- a/src/net/ea/charserverhandler.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/charserverhandler.h" - -#include "net/character.h" -#include "net/serverinfo.h" - -#include "net/ea/eaprotocol.h" - -#include "utils/dtor.h" - -#include "debug.h" - -namespace Ea -{ - -extern ServerInfo mapServer; - -CharServerHandler::CharServerHandler() : - Net::CharServerHandler() -{ -} - -CharServerHandler::~CharServerHandler() -{ - clear(); -} - -void CharServerHandler::setCharSelectDialog(CharSelectDialog *const window) - const -{ - mCharSelectDialog = window; - updateCharSelectDialog(); -} - -void CharServerHandler::requestCharacters() const -{ - connect(); -} - -unsigned int CharServerHandler::baseSprite() const -{ - return EA_SPRITE_BASE; -} - -unsigned int CharServerHandler::hairSprite() const -{ - return EA_SPRITE_HAIR_COLOR; -} - -unsigned int CharServerHandler::maxSprite() const -{ - return EA_SPRITE_VECTOREND; -} - -void CharServerHandler::clear() const -{ - delete_all(mCharacters); - mCharacters.clear(); -} - -} // namespace Ea diff --git a/src/net/ea/charserverhandler.h b/src/net/ea/charserverhandler.h deleted file mode 100644 index 1faa59403..000000000 --- a/src/net/ea/charserverhandler.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_CHARSERVERHANDLER_H -#define NET_EA_CHARSERVERHANDLER_H - -#include "net/charserverhandler.h" - -namespace Ea -{ - -/** - * Deals with incoming messages from the character server. - */ -class CharServerHandler notfinal : public Net::CharServerHandler -{ - public: - A_DELETE_COPY(CharServerHandler) - - ~CharServerHandler(); - - void setCharSelectDialog(CharSelectDialog *const window) const - override final; - - void requestCharacters() const override final; - - unsigned int baseSprite() const override final A_CONST A_WARN_UNUSED; - - unsigned int hairSprite() const override final A_CONST A_WARN_UNUSED; - - unsigned int maxSprite() const override final A_CONST A_WARN_UNUSED; - - virtual void connect() const = 0; - - void clear() const override final; - - protected: - CharServerHandler(); -}; - -} // namespace Ea - -#endif // NET_EA_CHARSERVERHANDLER_H diff --git a/src/net/ea/charserverrecv.cpp b/src/net/ea/charserverrecv.cpp deleted file mode 100644 index d058dfe6d..000000000 --- a/src/net/ea/charserverrecv.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/charserverrecv.h" - -#include "client.h" - -#include "gui/windows/charcreatedialog.h" -#include "gui/windows/okdialog.h" - -#include "gui/widgets/createwidget.h" - -#include "net/character.h" -#include "net/charserverhandler.h" -#include "net/messagein.h" - -#include "utils/gettext.h" - -#include "debug.h" - -namespace Ea -{ - -void CharServerRecv::processCharLoginError(Net::MessageIn &msg) -{ - BLOCK_START("CharServerRecv::processCharLoginError") - switch (msg.readUInt8("error")) - { - case 0: - // TRANSLATORS: error message - errorMessage = _("Access denied. Most likely, there are " - "too many players on this server."); - break; - case 1: - // TRANSLATORS: error message - errorMessage = _("Cannot use this ID."); - break; - default: - // TRANSLATORS: error message - errorMessage = _("Unknown char-server failure."); - break; - } - client->setState(State::ERROR); - BLOCK_END("CharServerRecv::processCharLoginError") -} - -void CharServerRecv::processCharCreateFailed(Net::MessageIn &msg) -{ - BLOCK_START("CharServerRecv::processCharCreateFailed") - switch (msg.readUInt8("error")) - { - case 1: - case 0: - default: - // TRANSLATORS: error message - errorMessage = _("Failed to create character. Most " - "likely the name is already taken."); - break; - case 2: - // TRANSLATORS: error message - errorMessage = _("Wrong name."); - break; - case 3: - // TRANSLATORS: error message - errorMessage = _("Incorrect stats."); - break; - case 4: - // TRANSLATORS: error message - errorMessage = _("Incorrect hair."); - break; - case 5: - // TRANSLATORS: error message - errorMessage = _("Incorrect slot."); - break; - case 6: - // TRANSLATORS: error message - errorMessage = _("Incorrect race."); - break; - case 7: - // TRANSLATORS: error message - errorMessage = _("Incorrect look."); - break; - } - CREATEWIDGET(OkDialog, - // TRANSLATORS: error message header - _("Error"), - errorMessage, - // TRANSLATORS: ok dialog button - _("OK"), - DialogType::ERROR, - Modal_true, - ShowCenter_true, - nullptr, - 260); - if (Net::CharServerHandler::mCharCreateDialog != nullptr) - Net::CharServerHandler::mCharCreateDialog->unlock(); - BLOCK_END("CharServerRecv::processCharCreateFailed") -} - -void CharServerRecv::processCharDelete(Net::MessageIn &msg A_UNUSED) -{ - BLOCK_START("CharServerRecv::processCharDelete") - delete Net::CharServerHandler::mSelectedCharacter; - Net::CharServerHandler::mCharacters.remove( - Net::CharServerHandler::mSelectedCharacter); - Net::CharServerHandler::mSelectedCharacter = nullptr; - Net::CharServerHandler::updateCharSelectDialog(); - Net::CharServerHandler::unlockCharSelectDialog(); - CREATEWIDGET(OkDialog, - // TRANSLATORS: info message header - _("Info"), - // TRANSLATORS: info message - _("Character deleted."), - // TRANSLATORS: ok dialog button - _("OK"), - DialogType::OK, - Modal_true, - ShowCenter_true, - nullptr, - 260); - BLOCK_END("CharServerRecv::processCharDelete") -} - -} // namespace Ea diff --git a/src/net/ea/charserverrecv.h b/src/net/ea/charserverrecv.h deleted file mode 100644 index 5e105210c..000000000 --- a/src/net/ea/charserverrecv.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_CHARSERVERRECV_H -#define NET_EA_CHARSERVERRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace Ea -{ - namespace CharServerRecv - { - void processCharLoginError(Net::MessageIn &msg); - void processCharCreateFailed(Net::MessageIn &msg); - void processCharDelete(Net::MessageIn &msg); - } // namespace CharServerRecv -} // namespace Ea - -#endif // NET_EA_CHARSERVERRECV_H diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp deleted file mode 100644 index 8937852c6..000000000 --- a/src/net/ea/chathandler.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/chathandler.h" - -#include "configuration.h" - -#include "net/ea/chatrecv.h" - -#include "debug.h" - -namespace Ea -{ - -ChatHandler::ChatHandler() -{ - if (!ChatRecv::mSentWhispers.empty()) - ChatRecv::mSentWhispers.pop(); - ChatRecv::mMotdTime = 0; - ChatRecv::mShowAllLang = (serverConfig.getValue("showAllLang", 0) != 0); - ChatRecv::mShowMotd = config.getBoolValue("showmotd"); - ChatRecv::mSkipping = true; -} - -ChatHandler::~ChatHandler() -{ - clear(); -} - -void ChatHandler::clear() const -{ - ChatRecv::mShowMotd = config.getBoolValue("showmotd"); - ChatRecv::mSkipping = true; -} - -void ChatHandler::me(const std::string &restrict text, - const std::string &restrict channel) const -{ - // here need string duplication - std::string action = strprintf("*%s*", text.c_str()); - talk(action, channel); -} - -} // namespace Ea diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h deleted file mode 100644 index b19105193..000000000 --- a/src/net/ea/chathandler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_CHATHANDLER_H -#define NET_EA_CHATHANDLER_H - -#include "net/chathandler.h" - -#include <queue> - -namespace Ea -{ - -typedef std::queue<std::string> WhisperQueue; - -class ChatHandler notfinal : public Net::ChatHandler -{ - public: - ChatHandler(); - - A_DELETE_COPY(ChatHandler) - - ~ChatHandler(); - - void me(const std::string &restrict text, - const std::string &restrict channel) const override final; - - void clear() const override final; -}; - -} // namespace Ea - -#endif // NET_EA_CHATHANDLER_H diff --git a/src/net/ea/chatrecv.cpp b/src/net/ea/chatrecv.cpp deleted file mode 100644 index 87db3fa98..000000000 --- a/src/net/ea/chatrecv.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/chatrecv.h" - -#include "actormanager.h" -#include "configuration.h" -#include "notifymanager.h" - -#include "being/being.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/chatwindow.h" - -#include "gui/widgets/tabs/chat/chattab.h" - -#include "net/messagein.h" - -#include "utils/gettext.h" - -#include "debug.h" - -namespace Ea -{ - -namespace ChatRecv -{ - WhisperQueue mSentWhispers; - time_t mMotdTime = 0; - bool mShowAllLang = false; - bool mShowMotd = false; - bool mSkipping = true; -} // namespace ChatRecv - -std::string ChatRecv::getPopLastWhisperNick() -{ - std::string nick; - if (mSentWhispers.empty()) - { - nick = "user"; - } - else - { - nick = mSentWhispers.front(); - mSentWhispers.pop(); - } - return nick; -} - -std::string ChatRecv::getLastWhisperNick() -{ - std::string nick; - if (mSentWhispers.empty()) - nick = "user"; - else - nick = mSentWhispers.front(); - return nick; -} - -void ChatRecv::processWhisperResponseContinue(Net::MessageIn &msg, - const uint8_t type) -{ - const std::string nick = getPopLastWhisperNick(); - switch (type) - { - case 0x00: - // Success (don't need to report) - break; - case 0x01: - if (chatWindow != nullptr) - { - chatWindow->addWhisper(nick, - // TRANSLATORS: chat message - strprintf(_("Whisper could not be sent, %s is offline."), - nick.c_str()), - ChatMsgType::BY_SERVER); - } - break; - case 0x02: - if (chatWindow != nullptr) - { - chatWindow->addWhisper(nick, - // TRANSLATORS: chat message - strprintf(_("Whisper could not " - "be sent, ignored by %s."), nick.c_str()), - ChatMsgType::BY_SERVER); - } - break; - case 0x03: - if (chatWindow != nullptr) - { - chatWindow->addWhisper(nick, - // TRANSLATORS: chat message - _("Whisper could not " - "be sent, you ignored by all players."), - ChatMsgType::BY_SERVER); - } - break; - default: - UNIMPLEMENTEDPACKETFIELD(type); - break; - } - BLOCK_END("ChatRecv::processWhisperResponse") -} - -void ChatRecv::processMVPEffect(Net::MessageIn &msg) -{ - BLOCK_START("ChatRecv::processMVPEffect") - // Display MVP player - const BeingId id = msg.readBeingId("being id"); - if (localChatTab != nullptr && - actorManager != nullptr && - config.getBoolValue("showMVP")) - { - const Being *const being = actorManager->findBeing(id); - if (being == nullptr) - NotifyManager::notify(NotifyTypes::MVP_PLAYER, ""); - else - NotifyManager::notify(NotifyTypes::MVP_PLAYER, being->getName()); - } - BLOCK_END("ChatRecv::processMVPEffect") -} - -void ChatRecv::processIgnoreAllResponse(Net::MessageIn &msg) -{ - BLOCK_START("ChatRecv::processIgnoreAllResponse") - const uint8_t action = msg.readUInt8("action"); - const uint8_t fail = msg.readUInt8("result"); - if (localChatTab == nullptr) - { - BLOCK_END("ChatRecv::processIgnoreAllResponse") - return; - } - - switch (action) - { - case 0: - { - switch (fail) - { - case 0: - NotifyManager::notify(NotifyTypes::WHISPERS_IGNORED); - break; - default: - NotifyManager::notify(NotifyTypes:: - WHISPERS_IGNORE_FAILED); - break; - } - break; - } - case 1: - { - switch (fail) - { - case 0: - NotifyManager::notify(NotifyTypes::WHISPERS_UNIGNORED); - break; - default: - NotifyManager::notify(NotifyTypes:: - WHISPERS_UNIGNORE_FAILED); - break; - } - break; - } - default: - // unknown result - break; - } - BLOCK_END("ChatRecv::processIgnoreAllResponse") -} - -} // namespace Ea diff --git a/src/net/ea/chatrecv.h b/src/net/ea/chatrecv.h deleted file mode 100644 index 4a8427ea7..000000000 --- a/src/net/ea/chatrecv.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_CHATRECV_H -#define NET_EA_CHATRECV_H - -#if defined(__GXX_EXPERIMENTAL_CXX0X__) -#if defined(__APPLE__) -#include <tr1/cstdint> -#endif // defined(__APPLE__) -#else // defined(__GXX_EXPERIMENTAL_CXX0X__) -#include <stdint.h> -#endif // defined(__GXX_EXPERIMENTAL_CXX0X__) - -#include <string> -#include <queue> -#ifndef __time_t_defined -#include <sys/time.h> -#endif // __time_t_defined - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace Ea -{ - typedef std::queue<std::string> WhisperQueue; - - namespace ChatRecv - { - void processMVPEffect(Net::MessageIn &msg); - void processIgnoreAllResponse(Net::MessageIn &msg); - void processWhisperResponseContinue(Net::MessageIn &msg, - const uint8_t type); - std::string getPopLastWhisperNick(); - std::string getLastWhisperNick(); - - extern WhisperQueue mSentWhispers; - extern time_t mMotdTime; - extern bool mShowAllLang; - extern bool mShowMotd; - extern bool mSkipping; - } // namespace ChatRecv -} // namespace Ea - -#endif // NET_EA_CHATRECV_H diff --git a/src/net/ea/eaprotocol.h b/src/net/ea/eaprotocol.h deleted file mode 100644 index 2a8831a24..000000000 --- a/src/net/ea/eaprotocol.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_EAPROTOCOL_H -#define NET_EA_EAPROTOCOL_H - -enum -{ - EA_SPRITE_BASE = 0, - EA_SPRITE_HAIR = 1, - EA_SPRITE_WEAPON = 2, - EA_SPRITE_HEAD_BOTTOM = 3, - EA_SPRITE_HEAD_TOP = 4, - EA_SPRITE_HEAD_MID = 5, - EA_SPRITE_HAIR_COLOR = 6, - EA_SPRITE_CLOTHES_COLOR = 7, - EA_SPRITE_SHIELD = 8, - EA_SPRITE_SHOES = 9, - EA_SPRITE_BODY = 10, - EA_SPRITE_FLOOR = 11, - EA_SPRITE_ROBE = 12, - EA_SPRITE_EVOL2 = 13, - EA_SPRITE_EVOL3 = 14, - EA_SPRITE_EVOL4 = 15, - EA_SPRITE_EVOL5 = 16, - EA_SPRITE_EVOL6 = 17, - EA_SPRITE_EVOL7 = 18, - EA_SPRITE_EVOL8 = 19, - EA_SPRITE_EVOL9 = 20, - EA_SPRITE_EVOL10 = 21, - EA_SPRITE_EVOL11 = 22, - EA_SPRITE_EVOL12 = 23, - EA_SPRITE_EVOL13 = 24, - EA_SPRITE_EVOL14 = 25, - EA_SPRITE_VECTOREND -}; - -#endif // NET_EA_EAPROTOCOL_H diff --git a/src/net/ea/equipbackend.h b/src/net/ea/equipbackend.h deleted file mode 100644 index 15aeb93fb..000000000 --- a/src/net/ea/equipbackend.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_EQUIPBACKEND_H -#define NET_EA_EQUIPBACKEND_H - -#include "resources/item/item.h" - -#include "being/playerinfo.h" - -#include "const/equipment.h" - -#include "gui/windows/inventorywindow.h" - -namespace Ea -{ - -class EquipBackend final : public Equipment::Backend -{ - public: - EquipBackend() - { - memset(mEquipment, -1, sizeof(mEquipment)); - } - - A_DELETE_COPY(EquipBackend) - - Item *getEquipment(const int index) const override final A_WARN_UNUSED - { - int invyIndex = mEquipment[index]; - if (invyIndex == -1) - return nullptr; - - const Inventory *const inv = PlayerInfo::getInventory(); - if (inv != nullptr) - return inv->getItem(invyIndex); - return nullptr; - } - - void clear() override final - { - Inventory *const inv = PlayerInfo::getInventory(); - if (inv == nullptr) - return; - for (int i = 0; i < EQUIPMENT_SIZE; i++) - { - if (mEquipment[i] != -1) - { - Item* item = inv->getItem(i); - if (item != nullptr) - item->setEquipped(Equipped_false); - } - - mEquipment[i] = -1; - } - } - - void setEquipment(const int index, const int inventoryIndex) - { - Inventory *const inv = PlayerInfo::getInventory(); - if (inv == nullptr) - return; - - if (index < 0 || index >= EQUIPMENT_SIZE) - return; - - // Unequip existing item - Item *item = inv->getItem(mEquipment[index]); - - if (item != nullptr) - item->setEquipped(Equipped_false); - - // not checking index because it must be safe - mEquipment[index] = inventoryIndex; - - item = inv->getItem(inventoryIndex); - if (item != nullptr) - item->setEquipped(Equipped_true); - - if (inventoryWindow != nullptr) - inventoryWindow->updateButtons(); - } - - private: - int mEquipment[EQUIPMENT_SIZE]; -}; - -} // namespace Ea - -#endif // NET_EA_EQUIPBACKEND_H diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp deleted file mode 100644 index 3fe6a4e51..000000000 --- a/src/net/ea/gamehandler.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/gamehandler.h" - -#include "game.h" - -#include "net/ea/gamerecv.h" - -#include "debug.h" - -namespace Ea -{ - -GameHandler::GameHandler() : - Net::GameHandler() -{ - GameRecv::mMap.clear(); - GameRecv::mCharID = BeingId_zero; -} - -void GameHandler::who() const -{ -} - -void GameHandler::setMap(const std::string &map) -{ - GameRecv::mMap = map.substr(0, map.rfind('.')); -} - -void GameHandler::clear() const -{ - GameRecv::mMap.clear(); - GameRecv::mCharID = BeingId_zero; -} - -void GameHandler::initEngines() const -{ - if (!GameRecv::mMap.empty()) - Game::instance()->changeMap(GameRecv::mMap); -} - -} // namespace Ea diff --git a/src/net/ea/gamehandler.h b/src/net/ea/gamehandler.h deleted file mode 100644 index b64d5cf25..000000000 --- a/src/net/ea/gamehandler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_GAMEHANDLER_H -#define NET_EA_GAMEHANDLER_H - -#include "net/gamehandler.h" - -namespace Ea -{ - -class GameHandler notfinal : public Net::GameHandler -{ - public: - GameHandler(); - - A_DELETE_COPY(GameHandler) - - void who() const override final A_CONST; - - bool removeDeadBeings() const override final A_WARN_UNUSED - { return true; } - - static void setMap(const std::string &map); - - void clear() const override final; - - void initEngines() const override final; -}; - -} // namespace Ea - -#endif // NET_EA_GAMEHANDLER_H diff --git a/src/net/ea/gamerecv.cpp b/src/net/ea/gamerecv.cpp deleted file mode 100644 index 230e3e012..000000000 --- a/src/net/ea/gamerecv.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/gamerecv.h" - -#include "client.h" -#include "notifymanager.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/okdialog.h" - -#include "gui/widgets/createwidget.h" - -#include "net/messagein.h" - -#include "utils/gettext.h" - -#include "debug.h" - -namespace Ea -{ - -namespace GameRecv -{ - std::string mMap; - BeingId mCharID = BeingId_zero; -} // namespace GameRecv - -void GameRecv::processWhoAnswer(Net::MessageIn &msg) -{ - NotifyManager::notify(NotifyTypes::ONLINE_USERS, - msg.readInt32("users count")); -} - -void GameRecv::processCharSwitchResponse(Net::MessageIn &msg) -{ - if (msg.readUInt8("response") != 0u) - client->setState(State::SWITCH_CHARACTER); -} - -void GameRecv::processMapQuitResponse(Net::MessageIn &msg) -{ - if (msg.readInt16("response") != 0) - { - CREATEWIDGET(OkDialog, - // TRANSLATORS: error header - _("Game"), - // TRANSLATORS: error message - _("Request to quit denied!"), - // TRANSLATORS: ok dialog button - _("OK"), - DialogType::ERROR, - Modal_true, - ShowCenter_true, - nullptr, - 260); - } -} - -} // namespace Ea diff --git a/src/net/ea/gamerecv.h b/src/net/ea/gamerecv.h deleted file mode 100644 index f0c5d8f41..000000000 --- a/src/net/ea/gamerecv.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_GAMERECV_H -#define NET_EA_GAMERECV_H - -#include "enums/simpletypes/beingid.h" - -#include <string> - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace Ea -{ - namespace GameRecv - { - extern std::string mMap; - extern BeingId mCharID; // < Saved for map-server switching - - void processWhoAnswer(Net::MessageIn &msg); - void processCharSwitchResponse(Net::MessageIn &msg); - void processMapQuitResponse(Net::MessageIn &msg); - } // namespace GameRecv -} // namespace Ea - -#endif // NET_EA_GAMERECV_H diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp deleted file mode 100644 index 1f816f7c1..000000000 --- a/src/net/ea/inventoryhandler.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/inventoryhandler.h" - -#include "net/ea/equipbackend.h" -#include "net/ea/inventoryrecv.h" - -#include "utils/delete2.h" - -#include "debug.h" - -namespace Ea -{ - -InventoryHandler::InventoryHandler() : - Net::InventoryHandler() -{ - InventoryRecv::mEquips.clear(); - InventoryRecv::mInventoryItems.clear(); - InventoryRecv::mStorage = nullptr; - storageWindow = nullptr; - while (!InventoryRecv::mSentPickups.empty()) - InventoryRecv::mSentPickups.pop(); - InventoryRecv::mDebugInventory = true; -} - -InventoryHandler::~InventoryHandler() -{ - if (storageWindow != nullptr) - { - storageWindow->close(); - storageWindow = nullptr; - } - - delete2(InventoryRecv::mStorage); -} - -void InventoryHandler::clear() const -{ - delete2(InventoryRecv::mStorage); -} - -bool InventoryHandler::canSplit(const Item *const item A_UNUSED) const -{ - return false; -} - -void InventoryHandler::splitItem(const Item *const item A_UNUSED, - const int amount A_UNUSED) const -{ - // Not implemented for eAthena (possible?) -} - -void InventoryHandler::moveItem(const int oldIndex A_UNUSED, - const int newIndex A_UNUSED) const -{ - // Not implemented for eAthena (possible?) -} - -size_t InventoryHandler::getSize(const InventoryTypeT type) const -{ - switch (type) - { - case InventoryType::Inventory: - case InventoryType::MailEdit: - return 100; - case InventoryType::Storage: - return 0; // Comes from server after items - case InventoryType::Trade: - return 12; - case InventoryType::Npc: - case InventoryType::Cart: - case InventoryType::Vending: - case InventoryType::Craft: - case InventoryType::TypeEnd: - case InventoryType::MailView: - default: - return 0; - } -} -void InventoryHandler::destroyStorage() const -{ - BLOCK_START("InventoryHandler::closeStorage") - if (storageWindow != nullptr) - { - InventoryWindow *const inv = storageWindow; - storageWindow->close(); - inv->unsetInventory(); - } - BLOCK_END("InventoryHandler::closeStorage") -} - -void InventoryHandler::forgotStorage() const -{ - storageWindow = nullptr; -} - -void InventoryHandler::pushPickup(const BeingId floorId) -{ - InventoryRecv::mSentPickups.push(floorId); -} - -Inventory *InventoryHandler::getStorage() const -{ - return InventoryRecv::mStorage; -} - -} // namespace Ea diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h deleted file mode 100644 index f968a3216..000000000 --- a/src/net/ea/inventoryhandler.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_INVENTORYHANDLER_H -#define NET_EA_INVENTORYHANDLER_H - -#include "localconsts.h" - -#include "net/inventoryhandler.h" - -#include <queue> - -namespace Ea -{ - -typedef std::queue<BeingId> PickupQueue; - -class InventoryHandler notfinal : public Net::InventoryHandler -{ - public: - A_DELETE_COPY(InventoryHandler) - - virtual ~InventoryHandler(); - - void clear() const override final; - - bool canSplit(const Item *const item) const - override final A_CONST A_WARN_UNUSED; - - void splitItem(const Item *const item, - const int amount) const override final A_CONST; - - void moveItem(const int oldIndex, - const int newIndex) const override final A_CONST; - - size_t getSize(const InventoryTypeT type) const override final - A_CONST A_WARN_UNUSED; - - static void pushPickup(const BeingId floorId); - - void destroyStorage() const override final; - - void forgotStorage() const override final; - - Inventory *getStorage() const override final; - - protected: - InventoryHandler(); -}; - -} // namespace Ea - -#endif // NET_EA_INVENTORYHANDLER_H diff --git a/src/net/ea/inventoryitem.h b/src/net/ea/inventoryitem.h deleted file mode 100644 index daf5cd65e..000000000 --- a/src/net/ea/inventoryitem.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_INVENTORYITEM_H -#define NET_EA_INVENTORYITEM_H - -#include "const/resources/item/cards.h" - -#include "enums/resources/item/itemtype.h" - -#include "enums/simpletypes/damaged.h" -#include "enums/simpletypes/equipm.h" -#include "enums/simpletypes/favorite.h" -#include "enums/simpletypes/identified.h" -#include "enums/simpletypes/itemcolor.h" - -#include "utils/vector.h" - -#include "resources/item/itemoptionslist.h" - -#include "localconsts.h" - -namespace Ea -{ - -/** - * Used to cache storage data until we get size data for it. - */ -class InventoryItem final -{ - public: - int slot; - int id; - ItemTypeT type; - int cards[maxCards]; - ItemOptionsList *options; - int quantity; - uint8_t refine; - ItemColor color; - Identified identified; - Damaged damaged; - Favorite favorite; - Equipm equip; - - InventoryItem(const int slot0, - const int id0, - const ItemTypeT type0, - const int *const cards0, - ItemOptionsList *options0, - const int quantity0, - const uint8_t refine0, - const ItemColor color0, - const Identified identified0, - const Damaged damaged0, - const Favorite favorite0, - Equipm equip0) : - slot(slot0), - id(id0), - type(type0), - cards(), - options(ItemOptionsList::copy(options0)), - quantity(quantity0), - refine(refine0), - color(color0), - identified(identified0), - damaged(damaged0), - favorite(favorite0), - equip(equip0) - { - if (cards0 == nullptr) - return; - for (int f = 0; f < 4; f ++) - cards[f] = cards0[f]; - } - - InventoryItem(const InventoryItem &c) : - slot(c.slot), - id(c.id), - type(c.type), - cards(), - options(ItemOptionsList::copy(c.options)), - quantity(c.quantity), - refine(c.refine), - color(c.color), - identified(c.identified), - damaged(c.damaged), - favorite(c.favorite), - equip(c.equip) - { - for (int f = 0; f < 4; f ++) - cards[f] = c.cards[f]; - } - - A_DEFAULT_COPY(InventoryItem) - - ~InventoryItem() - { - delete options; - } -}; - -typedef STD_VECTOR<InventoryItem> InventoryItems; - -} // namespace Ea - -#endif // NET_EA_INVENTORYITEM_H diff --git a/src/net/ea/inventoryrecv.cpp b/src/net/ea/inventoryrecv.cpp deleted file mode 100644 index 3e8c239e9..000000000 --- a/src/net/ea/inventoryrecv.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/inventoryrecv.h" - -#include "notifymanager.h" - -#include "being/localplayer.h" - -#include "const/net/inventory.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/widgets/createwidget.h" - -#include "net/inventoryhandler.h" -#include "net/messagein.h" - -#include "net/ea/equipbackend.h" - -#include "utils/delete2.h" -#include "utils/foreach.h" - -#include "listeners/arrowslistener.h" - -#include "debug.h" - -namespace Ea -{ - -namespace InventoryRecv -{ - EquipBackend mEquips; - InventoryItems mInventoryItems; - Inventory *mStorage = nullptr; - PickupQueue mSentPickups; - bool mDebugInventory = true; -} // namespace InventoryRecv - -void InventoryRecv::processPlayerInventoryUse(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerInventoryUse") - Inventory *const inventory = localPlayer != nullptr - ? PlayerInfo::getInventory() : nullptr; - - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - msg.readInt16("item id"); - msg.readInt32("id?"); - const int amount = msg.readInt16("amount"); - msg.readUInt8("type"); - - if (inventory != nullptr) - { - if (Item *const item = inventory->getItem(index)) - { - if (amount != 0) - item->setQuantity(amount); - else - inventory->removeItemAt(index); - } - } - BLOCK_END("InventoryRecv::processPlayerInventoryUse") -} - -void InventoryRecv::processItemUseResponse(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processItemUseResponse") - Inventory *const inventory = localPlayer != nullptr - ? PlayerInfo::getInventory() : nullptr; - - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int amount = msg.readInt16("amount"); - - if (msg.readUInt8("result") == 0) - { - NotifyManager::notify(NotifyTypes::USE_FAILED); - } - else - { - if (inventory != nullptr) - { - if (Item *const item = inventory->getItem(index)) - { - if (amount != 0) - item->setQuantity(amount); - else - inventory->removeItemAt(index); - } - } - } - BLOCK_END("InventoryRecv::processItemUseResponse") -} - -void InventoryRecv::processPlayerStorageStatus(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerStorageStatus") - /* - * This is the closest we get to an "Open Storage" packet from the - * server. It always comes after the two SMSG_PLAYER_STORAGE_... - * packets that update storage contents. - */ - msg.readInt16("used count"); - const int size = msg.readInt16("max size"); - - if (mStorage == nullptr) - mStorage = new Inventory(InventoryType::Storage, size); - - FOR_EACH (Ea::InventoryItems::const_iterator, it, mInventoryItems) - { - mStorage->setItem((*it).slot, - (*it).id, - (*it).type, - (*it).quantity, - (*it).refine, - (*it).color, - (*it).identified, - (*it).damaged, - (*it).favorite, - (*it).equip, - Equipped_false); - } - mInventoryItems.clear(); - - if (storageWindow == nullptr) - { - CREATEWIDGETV(storageWindow, InventoryWindow, mStorage); - } - BLOCK_END("InventoryRecv::processPlayerStorageStatus") -} - -void InventoryRecv::processPlayerStorageClose(Net::MessageIn &msg A_UNUSED) -{ - BLOCK_START("InventoryRecv::processPlayerStorageClose") - // Storage access has been closed - // Storage window deletes itself - if (storageWindow != nullptr) - { - storageWindow->unsetInventory(); - storageWindow->close(); - } - storageWindow = nullptr; - - if (mStorage != nullptr) - mStorage->clear(); - - delete2(mStorage); - BLOCK_END("InventoryRecv::processPlayerStorageClose") -} - -void InventoryRecv::processPlayerAttackRange(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerAttackRange") - const int range = msg.readInt16("range"); - if (localPlayer != nullptr) - localPlayer->setAttackRange(range); - PlayerInfo::setStatBase(Attributes::PLAYER_ATTACK_RANGE, range); - PlayerInfo::setStatMod(Attributes::PLAYER_ATTACK_RANGE, 0); - BLOCK_END("InventoryRecv::processPlayerAttackRange") -} - -void InventoryRecv::processPlayerArrowEquip(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerArrowEquip") - int index = msg.readInt16("index"); - if (index <= 1) - return; - - index -= INVENTORY_OFFSET; - mEquips.setEquipment(inventoryHandler->getProjectileSlot(), index); - ArrowsListener::distributeEvent(); - BLOCK_END("InventoryRecv::processPlayerArrowEquip") -} - -} // namespace Ea diff --git a/src/net/ea/inventoryrecv.h b/src/net/ea/inventoryrecv.h deleted file mode 100644 index 33c4f4682..000000000 --- a/src/net/ea/inventoryrecv.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_INVENTORYRECV_H -#define NET_EA_INVENTORYRECV_H - -#include "localconsts.h" - -#include "enums/simpletypes/beingid.h" - -#include "net/ea/inventoryitem.h" - -#include <queue> - -namespace Net -{ - class MessageIn; -} // namespace Net - -class Inventory; - -namespace Ea -{ - typedef std::queue<BeingId> PickupQueue; - - class EquipBackend; - - namespace InventoryRecv - { - extern EquipBackend mEquips; - extern InventoryItems mInventoryItems; - extern Inventory *mStorage; - extern PickupQueue mSentPickups; - extern bool mDebugInventory; - - void processPlayerInventoryUse(Net::MessageIn &msg); - void processItemUseResponse(Net::MessageIn &msg); - void processPlayerStorageStatus(Net::MessageIn &msg); - void processPlayerStorageClose(Net::MessageIn &msg); - void processPlayerAttackRange(Net::MessageIn &msg); - void processPlayerArrowEquip(Net::MessageIn &msg); - } // namespace InventoryRecv -} // namespace Ea - -#endif // NET_EA_INVENTORYRECV_H diff --git a/src/net/ea/itemhandler.cpp b/src/net/ea/itemhandler.cpp deleted file mode 100644 index b5a676cb7..000000000 --- a/src/net/ea/itemhandler.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/itemhandler.h" - -#include "debug.h" - -namespace Ea -{ - -ItemHandler::ItemHandler() -{ -} - -ItemHandler::~ItemHandler() -{ -} - -} // namespace Ea diff --git a/src/net/ea/itemhandler.h b/src/net/ea/itemhandler.h deleted file mode 100644 index 405886b4a..000000000 --- a/src/net/ea/itemhandler.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_ITEMHANDLER_H -#define NET_EA_ITEMHANDLER_H - -#include "localconsts.h" - -namespace Ea -{ - -class ItemHandler notfinal -{ - public: - ItemHandler(); - - A_DELETE_COPY(ItemHandler) - - virtual ~ItemHandler(); -}; - -} // namespace Ea - -#endif // NET_EA_ITEMHANDLER_H diff --git a/src/net/ea/itemrecv.cpp b/src/net/ea/itemrecv.cpp deleted file mode 100644 index 59256535d..000000000 --- a/src/net/ea/itemrecv.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/itemrecv.h" - -#include "actormanager.h" - -#include "being/flooritem.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace Ea -{ - -void ItemRecv::processItemRemove(Net::MessageIn &msg) -{ - if (actorManager != nullptr) - { - if (FloorItem *const item = actorManager - ->findItem(msg.readBeingId("floor item id"))) - { - actorManager->destroy(item); - } - } -} - -} // namespace Ea diff --git a/src/net/ea/itemrecv.h b/src/net/ea/itemrecv.h deleted file mode 100644 index 5e159b791..000000000 --- a/src/net/ea/itemrecv.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_ITEMRECV_H -#define NET_EA_ITEMRECV_H - -#include "localconsts.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace Ea -{ - namespace ItemRecv - { - void processItemRemove(Net::MessageIn &msg); - } // namespace ItemRecv -} // namespace Ea - -#endif // NET_EA_ITEMRECV_H diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp deleted file mode 100644 index 28aefef7a..000000000 --- a/src/net/ea/loginhandler.cpp +++ /dev/null @@ -1,183 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/loginhandler.h" - -#include "client.h" -#include "configuration.h" -#include "logger.h" -#include "settings.h" - -#include "utils/cast.h" -#include "utils/dtor.h" - -#include "net/logindata.h" - -#include "net/ea/loginrecv.h" - -#include "debug.h" - -namespace Ea -{ - -LoginHandler::LoginHandler() : - Net::LoginHandler() -{ - LoginRecv::mVersionResponse = false; - LoginRecv::mRegistrationEnabled = true; - LoginRecv::mUpdateHost.clear(); - LoginRecv::mWorlds.clear(); - LoginRecv::mToken.clear(); -} - -LoginHandler::~LoginHandler() -{ - delete_all(LoginRecv::mWorlds); -} - -bool LoginHandler::isRegistrationEnabled() const -{ - return LoginRecv::mRegistrationEnabled; -} - -void LoginHandler::getRegistrationDetails() const -{ - // Not supported, so move on - client->setState(State::REGISTER); -} - -void LoginHandler::loginAccount(LoginData *const loginData1) const -{ - if (loginData1 != nullptr) - { - loginData1->resetCharacterSlots(); - sendLoginRegister(loginData1->username, loginData1->password, ""); - } -} - -void LoginHandler::chooseServer(const unsigned int server, - const bool persistentIp) const -{ - if (CAST_SIZE(server) >= LoginRecv::mWorlds.size() || - (LoginRecv::mWorlds[server] == nullptr)) - { - return; - } - - ServerInfo *const charServer = getCharServer(); - if (charServer != nullptr) - { - if (config.getBoolValue("usePersistentIP") || persistentIp) - { - charServer->hostname = settings.serverName; - } - else - { - charServer->hostname = ipToString( - LoginRecv::mWorlds[server]->address); - } - charServer->port = LoginRecv::mWorlds[server]->port; - } - - client->setState(State::UPDATE); -} - -void LoginHandler::registerAccount(const LoginData *const loginData1) const -{ - if (loginData1 == nullptr) - return; - - std::string username = loginData1->username; - switch (loginData1->gender) - { - case Gender::FEMALE: - username.append("_F"); - break; - case Gender::MALE: - username.append("_M"); - break; - case Gender::OTHER: - username.append("_O"); - break; - case Gender::UNSPECIFIED: - default: - break; - } - - sendLoginRegister(username, loginData1->password, loginData1->email); -} - -const Worlds &LoginHandler::getWorlds() const -{ - return LoginRecv::mWorlds; -} - -void LoginHandler::clearWorlds() const -{ - delete_all(LoginRecv::mWorlds); - LoginRecv::mWorlds.clear(); -} - -void LoginHandler::loginOrRegister(LoginData *const data) const -{ - if (data == nullptr) - return; - - logger->log("Username is %s", data->username.c_str()); - - // Send login infos - if (data->registerLogin) - registerAccount(data); - else - loginAccount(data); - - // Clear the password, avoids auto login when returning to login - data->password.clear(); - - const bool remember = data->remember; - if (remember) - serverConfig.setValue("username", data->username); - else - serverConfig.setValue("username", ""); - serverConfig.setValue("remember", remember); -} - -void LoginHandler::logout() const -{ -} - -void LoginHandler::changeEmail(const std::string &email A_UNUSED) const -{ -} - -void LoginHandler::unregisterAccount(const std::string &username A_UNUSED, - const std::string &password - A_UNUSED) const -{ -} - -const Token &LoginHandler::getToken() const -{ - return LoginRecv::mToken; -} - -} // namespace Ea diff --git a/src/net/ea/loginhandler.h b/src/net/ea/loginhandler.h deleted file mode 100644 index d475fc184..000000000 --- a/src/net/ea/loginhandler.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_LOGINHANDLER_H -#define NET_EA_LOGINHANDLER_H - -#include "net/loginhandler.h" - -class LoginData; - -struct Token; - -namespace Ea -{ - -class LoginHandler notfinal : public Net::LoginHandler -{ - public: - A_DELETE_COPY(LoginHandler) - - virtual ~LoginHandler(); - - bool isRegistrationEnabled() const override final A_WARN_UNUSED; - - void getRegistrationDetails() const override final; - - unsigned int getMaxPasswordLength() const override A_WARN_UNUSED - { return 24; } - - void loginAccount(LoginData *const loginData) const override final; - - void chooseServer(const unsigned int server, - const bool persistentIp) const override; - - void registerAccount(const LoginData *const loginData) - const override final; - - const Worlds &getWorlds() const override final A_CONST A_WARN_UNUSED; - - void clearWorlds() const override final; - - virtual ServerInfo *getCharServer() const A_WARN_UNUSED = 0; - - const Token &getToken() const A_CONST A_WARN_UNUSED; - - void logout() const override final A_CONST; - - void changeEmail(const std::string &email) const - override final A_CONST; - - void unregisterAccount(const std::string &username, - const std::string &password) - const override final A_CONST; - - void loginOrRegister(LoginData *const data) const override final; - - protected: - LoginHandler(); - - virtual void sendLoginRegister(const std::string &username, - const std::string &password, - const std::string &email) const = 0; -}; - -} // namespace Ea - -#endif // NET_EA_LOGINHANDLER_H diff --git a/src/net/ea/loginrecv.cpp b/src/net/ea/loginrecv.cpp deleted file mode 100644 index 2591a417c..000000000 --- a/src/net/ea/loginrecv.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/loginrecv.h" - -#include "client.h" - -#include "fs/paths.h" - -#include "gui/windows/logindialog.h" - -#include "utils/gettext.h" - -#include "net/logindata.h" -#include "net/messagein.h" - -#include "debug.h" - -namespace Ea -{ - -namespace LoginRecv -{ - std::string mUpdateHost; - Worlds mWorlds; - Token mToken; - bool mVersionResponse = false; - bool mRegistrationEnabled = true; -} // namespace LoginRecv - -void LoginRecv::processUpdateHost(Net::MessageIn &msg) -{ - const int len = msg.readInt16("len") - 4; - mUpdateHost = msg.readString(len, "update host"); - - if (!checkPath(mUpdateHost)) - { - mUpdateHost.clear(); - logger->log1("Warning: incorrect update server name"); - } - loginData.updateHost = mUpdateHost; - - logger->log("Received update host \"%s\" from login server.", - mUpdateHost.c_str()); -} - -void LoginRecv::processLoginError(Net::MessageIn &msg) -{ - const uint8_t code = msg.readUInt8("error"); - logger->log("Login::error code: %u", CAST_U32(code)); - std::string date = msg.readString(20, "date"); - - switch (code) - { - case 0: - // TRANSLATORS: error message - errorMessage = _("Unregistered ID."); - break; - case 1: - // TRANSLATORS: error message - errorMessage = _("Wrong password."); - LoginDialog::savedPassword.clear(); - break; - case 2: - // TRANSLATORS: error message - errorMessage = _("Account expired."); - break; - case 3: - // TRANSLATORS: error message - errorMessage = _("Rejected from server."); - break; - case 4: - // TRANSLATORS: error message - errorMessage = _("You have been permanently banned from " - "the game. Please contact the GM team."); - break; - case 5: - // TRANSLATORS: error message - errorMessage = _("Client too old or wrong server type.\n" - "Please update client on http://manaplus.org"); - break; - case 6: - // TRANSLATORS: error message - errorMessage = strprintf(_("You have been temporarily " - "banned from the game until %s.\nPlease contact the GM " - "team via the forums."), date.c_str()); - break; - case 7: - // TRANSLATORS: error message - errorMessage = _("Server overpopulated."); - break; - case 9: - // TRANSLATORS: error message - errorMessage = _("This user name is already taken."); - break; - case 10: - // TRANSLATORS: error message - errorMessage = _("Wrong name."); - break; - case 11: - // TRANSLATORS: error message - errorMessage = _("Incorrect email."); - break; - case 99: - // TRANSLATORS: error message - errorMessage = _("Username permanently erased."); - break; - default: - // TRANSLATORS: error message - errorMessage = _("Unknown error."); - break; - } - client->setState(State::ERROR); -} - -} // namespace Ea diff --git a/src/net/ea/loginrecv.h b/src/net/ea/loginrecv.h deleted file mode 100644 index 80ac08e44..000000000 --- a/src/net/ea/loginrecv.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_LOGINRECV_H -#define NET_EA_LOGINRECV_H - -#include "net/worldinfo.h" - -#include "net/ea/token.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace Ea -{ - namespace LoginRecv - { - extern std::string mUpdateHost; - extern Worlds mWorlds; - extern Token mToken; - extern bool mVersionResponse; - extern bool mRegistrationEnabled; - - void processUpdateHost(Net::MessageIn &msg); - void processLoginError(Net::MessageIn &msg); - } // namespace LoginRecv -} // namespace Ea - -#endif // NET_EA_LOGINRECV_H diff --git a/src/net/ea/maprecv.cpp b/src/net/ea/maprecv.cpp deleted file mode 100644 index dbe9d4559..000000000 --- a/src/net/ea/maprecv.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/maprecv.h" - -#include "gui/viewport.h" - -#include "resources/map/map.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace Ea -{ - -void MapRecv::processSetTilesType(Net::MessageIn &msg) -{ - const int x1 = msg.readInt16("x1"); - const int y1 = msg.readInt16("y1"); - const int x2 = msg.readInt16("x2"); - const int y2 = msg.readInt16("y2"); - const BlockTypeT mask = static_cast<BlockTypeT>(msg.readInt32("mask")); - const int layer = msg.readInt32("layer"); - const std::string name = msg.readString(16, "map name"); - if (layer != 0) - return; - Map *const map = viewport->getMap(); - if ((map != nullptr) && map->getGatName() == name) - { - for (int y = y1; y <= y2; y ++) - { - for (int x = x1; x <= x2; x ++) - map->setBlockMask(x, y, mask); - } - map->updateConditionLayers(); - map->preCacheLayers(); - } -} - -} // namespace Ea diff --git a/src/net/ea/maprecv.h b/src/net/ea/maprecv.h deleted file mode 100644 index 48c19d158..000000000 --- a/src/net/ea/maprecv.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_MAPRECV_H -#define NET_EA_MAPRECV_H - -#include "localconsts.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace Ea -{ - namespace MapRecv - { - void processSetTilesType(Net::MessageIn &msg); - } // namespace MapRecv -} // namespace Ea - -#endif // NET_EA_MAPRECV_H diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp deleted file mode 100644 index 1ae4d2323..000000000 --- a/src/net/ea/network.cpp +++ /dev/null @@ -1,372 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/network.h" - -#include "configuration.h" -#include "logger.h" - -#include "net/packetinfo.h" - -#include "utils/cast.h" -#include "utils/delete2.h" -#include "utils/gettext.h" -#include "utils/sdlhelper.h" - -#include <sstream> - -#include "debug.h" - -#ifndef SDL_BIG_ENDIAN -#error missing SDL_endian.h -#endif // SDL_BYTEORDER - -extern unsigned int mLastHost; - -namespace Ea -{ - -const unsigned int BUFFER_SIZE = 1000000; -const unsigned int BUFFER_LIMIT = 930000; - -int networkThread(void *data) -{ - Network *const network = static_cast<Network *>(data); - - if ((network == nullptr) || !network->realConnect()) - return -1; - - network->receive(); - - return 0; -} - -Network::Network() : - mSocket(nullptr), - mServer(), - mPackets(nullptr), - mInBuffer(new char[BUFFER_SIZE]), - mOutBuffer(new char[BUFFER_SIZE]), - mInSize(0), - mOutSize(0), - mToSkip(0), - mState(IDLE), - mError(), - mWorkerThread(nullptr), - mMutexIn(SDL_CreateMutex()), - mMutexOut(SDL_CreateMutex()), - mSleep(config.getIntValue("networksleep")), - mPauseDispatch(false) -{ - TcpNet::init(); -} - -Network::~Network() -{ - if (mState != IDLE && mState != NET_ERROR) - disconnect(); - - SDL_DestroyMutex(mMutexIn); - mMutexIn = nullptr; - SDL_DestroyMutex(mMutexOut); - mMutexOut = nullptr; - - delete2Arr(mInBuffer); - delete2Arr(mOutBuffer); - delete2Arr(mPackets); - - TcpNet::quit(); -} - -bool Network::connect(const ServerInfo &server) -{ - if (mState != IDLE && mState != NET_ERROR) - { - logger->log1("Tried to connect an already connected socket!"); - return false; - } - - if (server.hostname.empty()) - { - // TRANSLATORS: error message - setError(_("Empty address given to Network::connect()!")); - return false; - } - - logger->log("Network::Connecting to %s:%i", - server.hostname.c_str(), server.port); - - mServer.hostname = server.hostname; - mServer.althostname = server.althostname; - mServer.port = server.port; - - // Reset to sane values - mOutSize = 0; - mInSize = 0; - mToSkip = 0; - - mState = CONNECTING; - mWorkerThread = SDL::createThread(&networkThread, "network", this); - if (mWorkerThread == nullptr) - { - setError("Unable to create network worker thread"); - return false; - } - - return true; -} - -void Network::disconnect() -{ - BLOCK_START("Network::disconnect") - mState = IDLE; - - SDL::WaitThread(mWorkerThread); - mWorkerThread = nullptr; - - if (mSocket != nullptr) - { - TcpNet::closeSocket(mSocket); - mSocket = nullptr; - if (mSleep > 0) - SDL_Delay(mSleep); - } - BLOCK_END("Network::disconnect") -} - -void Network::flush() -{ - if ((mOutSize == 0u) || mState != CONNECTED) - return; - - SDL_mutexP(mMutexOut); - const int ret = TcpNet::send(mSocket, mOutBuffer, mOutSize); -/* - if (logger) - { - logger->dlog(std::string("Send ").append( - toString(mOutSize)).append(" bytes")); - } -*/ - if (ret < CAST_S32(mOutSize)) - { - SDL_mutexV(mMutexOut); - setError("Error in TcpNet::send(): " + - std::string(TcpNet::getError())); - } - mOutSize = 0; - SDL_mutexV(mMutexOut); -} - -void Network::skip(const int len) -{ - SDL_mutexP(mMutexIn); - mToSkip += len; - if (mInSize == 0u) - { - SDL_mutexV(mMutexIn); - return; - } - - if (mInSize >= mToSkip) - { - mInSize -= mToSkip; - memmove(mInBuffer, mInBuffer + CAST_SIZE(mToSkip), mInSize); - mToSkip = 0; - } - else - { - mToSkip -= mInSize; - mInSize = 0; - } - SDL_mutexV(mMutexIn); -} - -bool Network::realConnect() -{ - IPaddress ipAddress; - - if (TcpNet::resolveHost(&ipAddress, mServer.hostname.c_str(), - mServer.port) == -1) - { - if (mServer.althostname.empty() || TcpNet::resolveHost(&ipAddress, - mServer.althostname.c_str(), mServer.port) == -1) - { - const std::string errorMessage = std::string( - // TRANSLATORS: error message - _("Unable to resolve host \"")).append( - mServer.hostname).append("\"."); - setError(errorMessage); - logger->log_r("TcpNet::ResolveHost: %s", errorMessage.c_str()); - return false; - } - logger->log_r("using alt host name: %s", mServer.althostname.c_str()); - } - - mState = CONNECTING; - - mSocket = TcpNet::open(&ipAddress); - if (mSocket == nullptr) - { - logger->log_r("Error in TcpNet::open(): %s", TcpNet::getError()); - setError(TcpNet::getError()); - return false; - } - - mLastHost = ipAddress.host; - logger->log_r("Network::Started session with %s:%i", - ipToString(ipAddress.host), ipAddress.port); - - mState = CONNECTED; - return true; -} - -void Network::receive() -{ - TcpNet::SocketSet set; - - if ((set = TcpNet::allocSocketSet(1)) == nullptr) - { - setError("Error in TcpNet::allocSocketSet(): " + - std::string(TcpNet::getError())); - return; - } - - if (TcpNet::addSocket(set, mSocket) == -1) - { - setError("Error in TcpNet::addSocket(): " + - std::string(TcpNet::getError())); - } - - while (mState == CONNECTED) - { - const int numReady = TcpNet::checkSockets( - set, (CAST_U32(500))); - switch (numReady) - { - case -1: - logger->log_r("Error: TcpNet::checkSockets"); - break; - // FALLTHROUGH - case 0: - break; - - case 1: - { - // Receive data from the socket - SDL_mutexP(mMutexIn); - if (mInSize > BUFFER_LIMIT) - { - SDL_mutexV(mMutexIn); - SDL_Delay(100); - continue; - } - - const int ret = TcpNet::recv(mSocket, - mInBuffer + CAST_SIZE(mInSize), - BUFFER_SIZE - mInSize); - - if (ret == 0) - { - // We got disconnected - mState = IDLE; - logger->log_r("Disconnected."); - } - else if (ret < 0) - { - // TRANSLATORS: error message - setError(_("Connection to server terminated. ") + - std::string(TcpNet::getError())); - } - else - { -// DEBUGLOG("Receive " + toString(ret) + " bytes"); - mInSize += ret; - if (mToSkip != 0u) - { - if (mInSize >= mToSkip) - { - mInSize -= mToSkip; - memmove(mInBuffer, - mInBuffer + CAST_SIZE(mToSkip), - mInSize); - mToSkip = 0; - } - else - { - mToSkip -= mInSize; - mInSize = 0; - } - } - } - SDL_mutexV(mMutexIn); - break; - } - - default: - // more than one socket is ready.. - // this should not happen since we only listen once socket. - std::stringstream errorStream; - errorStream << "Error in TcpNet::recv(), " << numReady - << " sockets are ready: " << TcpNet::getError(); - setError(errorStream.str()); - break; - } - } - - if (TcpNet::delSocket(set, mSocket) == -1) - logger->log_r("Error in TcpNet::delSocket(): %s", TcpNet::getError()); - - TcpNet::freeSocketSet(set); -} - -void Network::setError(const std::string &error) -{ - logger->log_r("Network error: %s", error.c_str()); - mError = error; - mState = NET_ERROR; -} - -uint16_t Network::readWord(const int pos) const -{ -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - return SDL_Swap16(*reinterpret_cast<uint16_t*>( - mInBuffer + CAST_SIZE(pos))); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - return (*reinterpret_cast<uint16_t*>( - mInBuffer + CAST_SIZE(pos))); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN -} - -void Network::fixSendBuffer() -{ - if (mOutSize > BUFFER_LIMIT) - { - if (mState != CONNECTED) - mOutSize = 0; - else - flush(); - } -} - -} // namespace Ea diff --git a/src/net/ea/network.h b/src/net/ea/network.h deleted file mode 100644 index cd5be69e3..000000000 --- a/src/net/ea/network.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_NETWORK_H -#define NET_EA_NETWORK_H - -#include "net/serverinfo.h" - -PRAGMACLANG6GCC(GCC diagnostic push) -PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast") -#include "net/sdltcpnet.h" -PRAGMACLANG6GCC(GCC diagnostic pop) - -struct PacketInfo; - -namespace Ea -{ - -class Network notfinal -{ - public: - Network(); - - A_DELETE_COPY(Network) - - virtual ~Network(); - - bool connect(const ServerInfo &server); - - void disconnect(); - - ServerInfo getServer() const A_WARN_UNUSED - { return mServer; } - - int getState() const A_WARN_UNUSED - { return mState; } - - const std::string &getError() const A_WARN_UNUSED - { return mError; } - - bool isConnected() const A_WARN_UNUSED - { return mState == CONNECTED; } - - int getInSize() const A_WARN_UNUSED - { return mInSize; } - - void skip(const int len); - - void flush(); - - void fixSendBuffer(); - - void pauseDispatch() - { mPauseDispatch = true; } - - // ERROR replaced by NET_ERROR because already defined in Windows - enum - { - IDLE = 0, - CONNECTED, - CONNECTING, - DATA, - NET_ERROR - }; - - protected: - friend int networkThread(void *data); - - void setError(const std::string &error); - - uint16_t readWord(const int pos) const A_WARN_UNUSED; - - bool realConnect(); - - void receive(); - - TcpNet::Socket mSocket; - - ServerInfo mServer; - - PacketInfo *mPackets; - - char *mInBuffer; - char *mOutBuffer; - unsigned int mInSize; - unsigned int mOutSize; - - unsigned int mToSkip; - - int mState; - std::string mError; - - SDL_Thread *mWorkerThread; - SDL_mutex *mMutexIn; - SDL_mutex *mMutexOut; - int mSleep; - bool mPauseDispatch; -}; - -} // namespace Ea - -#endif // NET_EA_NETWORK_H diff --git a/src/net/ea/npchandler.cpp b/src/net/ea/npchandler.cpp deleted file mode 100644 index e7ac6fa65..000000000 --- a/src/net/ea/npchandler.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/npchandler.h" - -#include "net/ea/npcrecv.h" - -#include "debug.h" - -namespace Ea -{ - -NpcHandler::NpcHandler() -{ - NpcRecv::mDialog = nullptr; - NpcRecv::mRequestLang = false; -} - -NpcDialog *NpcHandler::getCurrentNpcDialog() const -{ - return NpcRecv::mDialog; -} - -} // namespace Ea diff --git a/src/net/ea/npchandler.h b/src/net/ea/npchandler.h deleted file mode 100644 index 2f3503957..000000000 --- a/src/net/ea/npchandler.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_NPCHANDLER_H -#define NET_EA_NPCHANDLER_H - -#include "net/npchandler.h" - -#include "localconsts.h" - -namespace Ea -{ - -class NpcHandler notfinal : public Net::NpcHandler -{ - public: - A_DELETE_COPY(NpcHandler) - - NpcDialog *getCurrentNpcDialog() const override final; - - protected: - NpcHandler(); -}; - -} // namespace Ea - -#endif // NET_EA_NPCHANDLER_H diff --git a/src/net/ea/npcrecv.cpp b/src/net/ea/npcrecv.cpp deleted file mode 100644 index 098f07e79..000000000 --- a/src/net/ea/npcrecv.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/npcrecv.h" - -#include "gui/viewport.h" - -#include "gui/windows/npcdialog.h" - -#include "net/messagein.h" -#include "net/npchandler.h" - -#include "utils/langs.h" - -#include "debug.h" - -namespace Ea -{ - -namespace NpcRecv -{ - NpcDialog *mDialog = nullptr; - bool mRequestLang = false; -} // namespace NpcRecv - -void NpcRecv::processNpcChoice(Net::MessageIn &msg) -{ - msg.readInt16("len"); - npcHandler->getNpc(msg, NpcAction::Other); - mRequestLang = false; - - if (mDialog != nullptr) - { - mDialog->choiceRequest(); - mDialog->parseListItems(msg.readString(msg.getLength() - 8, - "select items")); - } - else - { - msg.readString(msg.getLength() - 8, "select items"); - } -} - -void NpcRecv::processNpcMessage(Net::MessageIn &msg) -{ - msg.readInt16("len"); - npcHandler->getNpc(msg, NpcAction::Other); - mRequestLang = false; - - const std::string message = msg.readString(msg.getLength() - 8, "message"); - // ignore future legacy npc commands. - if (message.size() > 3 && message.substr(0, 3) == "###") - return; - if (mDialog != nullptr) - mDialog->addText(message); -} - -void NpcRecv::processNpcClose(Net::MessageIn &msg) -{ - // Show the close button - npcHandler->getNpc(msg, NpcAction::Close); - mRequestLang = false; - if (mDialog != nullptr) - mDialog->showCloseButton(); -} - -void NpcRecv::processNpcNext(Net::MessageIn &msg) -{ - // Show the next button - npcHandler->getNpc(msg, NpcAction::Next); - mRequestLang = false; - if (mDialog != nullptr) - mDialog->showNextButton(); -} - -void NpcRecv::processNpcIntInput(Net::MessageIn &msg) -{ - // Request for an integer - npcHandler->getNpc(msg, NpcAction::Other); - mRequestLang = false; - if (mDialog != nullptr) - mDialog->integerRequest(0); -} - -void NpcRecv::processNpcStrInput(Net::MessageIn &msg) -{ - // Request for a string - BeingId npcId = npcHandler->getNpc(msg, NpcAction::Other); - if (mRequestLang) - { - mRequestLang = false; - npcHandler->stringInput(npcId, getLangSimple()); - } - else if (mDialog != nullptr) - { - mDialog->textRequest(""); - } -} - -void NpcRecv::processNpcCommand(Net::MessageIn &msg) -{ - const BeingId npcId = npcHandler->getNpc(msg, NpcAction::Other); - mRequestLang = false; - - const int cmd = msg.readInt16("cmd"); - const BeingId id = msg.readBeingId("id"); - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - switch (cmd) - { - case 0: - mRequestLang = true; - break; - - case 1: - if (viewport != nullptr) - viewport->moveCameraToActor(npcId); - break; - - case 2: - if (viewport != nullptr) - { - if (id == BeingId_zero) - viewport->moveCameraToPosition(x, y); - else - viewport->moveCameraToActor(id, x, y); - } - break; - - case 3: - if (viewport != nullptr) - viewport->returnCamera(); - break; - - case 4: - if (viewport != nullptr) - { - viewport->moveCameraRelative(x, y); - } - break; - case 5: // close dialog - if (mDialog != nullptr) - mDialog->restoreCamera(); - npcHandler->closeDialog(npcId); - break; - case 6: // show avatar - if (mDialog != nullptr) - { - mDialog->showAvatar(fromInt(id, BeingTypeId)); - } - break; - case 7: // set avatar direction - if (mDialog != nullptr) - { - mDialog->setAvatarDirection( - Net::MessageIn::fromServerDirection( - CAST_U8(id))); - } - break; - case 8: // set avatar action - if (mDialog != nullptr) - mDialog->setAvatarAction(toInt(id, int)); - break; - case 9: // clear npc dialog - if (mDialog != nullptr) - mDialog->clearRows(); - break; - case 10: // send selected item id - { - int invSize = toInt(id, int); - if (invSize == 0) - invSize = 1; - if (mDialog != nullptr) - mDialog->itemRequest(invSize); - break; - } - case 11: // send selected item index - { - int invSize = toInt(id, int); - if (invSize == 0) - invSize = 1; - if (mDialog != nullptr) - mDialog->itemIndexRequest(invSize); - break; - } - case 12: // send complex items - { - int invSize = toInt(id, int); - if (invSize == 0) - invSize = 1; - if (mDialog != nullptr) - mDialog->itemCraftRequest(invSize); - break; - } - case 14: - { - const NpcDialogs::iterator it = NpcDialog::mNpcDialogs.find(npcId); - if (it != NpcDialog::mNpcDialogs.end()) - { - NpcDialog *const dialog = (*it).second; - if (dialog != nullptr) - dialog->close(); - if (dialog == Ea::NpcRecv::mDialog) - Ea::NpcRecv::mDialog = nullptr; - NpcDialog::mNpcDialogs.erase(it); - } - break; - } - default: - UNIMPLEMENTEDPACKETFIELD(cmd); - break; - } -} - -void NpcRecv::processChangeTitle(Net::MessageIn &msg) -{ - msg.readInt16("len"); - npcHandler->getNpc(msg, NpcAction::Other); - mRequestLang = false; - if (mDialog != nullptr) - { - const std::string str = msg.readString(-1, "title"); - mDialog->setCaption(str); - } -} - -} // namespace Ea diff --git a/src/net/ea/npcrecv.h b/src/net/ea/npcrecv.h deleted file mode 100644 index 1cf7fa058..000000000 --- a/src/net/ea/npcrecv.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_NPCRECV_H -#define NET_EA_NPCRECV_H - -#include "localconsts.h" - -class NpcDialog; - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace Ea -{ - namespace NpcRecv - { - extern NpcDialog *mDialog; - extern bool mRequestLang; - - void processNpcChoice(Net::MessageIn &msg); - void processNpcMessage(Net::MessageIn &msg); - void processNpcClose(Net::MessageIn &msg); - void processNpcNext(Net::MessageIn &msg); - void processNpcIntInput(Net::MessageIn &msg); - void processNpcStrInput(Net::MessageIn &msg); - void processNpcCommand(Net::MessageIn &msg); - void processChangeTitle(Net::MessageIn &msg); - } // namespace NpcRecv -} // namespace Ea - -#endif // NET_EA_NPCRECV_H diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp deleted file mode 100644 index 23f7347b9..000000000 --- a/src/net/ea/partyhandler.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/partyhandler.h" - -#include "party.h" - -#include "net/ea/partyrecv.h" - -#include "gui/widgets/tabs/chat/partytab.h" - -#include "utils/delete2.h" - -#include "debug.h" - -namespace Ea -{ - -PartyHandler::PartyHandler() : - Net::PartyHandler() -{ - PartyRecv::mShareExp = PartyShare::UNKNOWN; - PartyRecv::mShareItems = PartyShare::UNKNOWN; - taParty = Party::getParty(1); -} - -PartyHandler::~PartyHandler() -{ - delete2(partyTab); - taParty = nullptr; -} - -void PartyHandler::join(const int partyId A_UNUSED) const -{ -} - -void PartyHandler::reload() -{ - taParty = Party::getParty(1); -} - -void PartyHandler::clear() const -{ - taParty = nullptr; -} - -ChatTab *PartyHandler::getTab() const -{ - return partyTab; -} - -PartyShareT PartyHandler::getShareExperience() const -{ - return PartyRecv::mShareExp; -} - -PartyShareT PartyHandler::getShareItems() const -{ - return PartyRecv::mShareItems; -} - -} // namespace Ea diff --git a/src/net/ea/partyhandler.h b/src/net/ea/partyhandler.h deleted file mode 100644 index 2be323d85..000000000 --- a/src/net/ea/partyhandler.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_PARTYHANDLER_H -#define NET_EA_PARTYHANDLER_H - -#include "net/partyhandler.h" - -class Party; - -namespace Ea -{ -class PartyHandler notfinal : public Net::PartyHandler -{ - public: - PartyHandler(); - - A_DELETE_COPY(PartyHandler) - - virtual ~PartyHandler(); - - void join(const int partyId) const override final A_CONST; - - PartyShareT getShareExperience() const override final A_WARN_UNUSED; - - PartyShareT getShareItems() const override final A_WARN_UNUSED; - - static void reload(); - - void clear() const override final; - - ChatTab *getTab() const override final; -}; - -extern Party *taParty; - -} // namespace Ea - -#endif // NET_EA_PARTYHANDLER_H diff --git a/src/net/ea/partyrecv.cpp b/src/net/ea/partyrecv.cpp deleted file mode 100644 index d81bb4295..000000000 --- a/src/net/ea/partyrecv.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/partyrecv.h" - -#include "actormanager.h" -#include "configuration.h" -#include "notifymanager.h" -#include "party.h" - -#include "being/localplayer.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/chatwindow.h" -#include "gui/windows/socialwindow.h" - -#include "net/messagein.h" - -#include "gui/widgets/tabs/chat/partytab.h" - -#include "utils/delete2.h" - -#include "debug.h" - -namespace Ea -{ - -Party *taParty = nullptr; - -namespace PartyRecv -{ - PartyShareT mShareExp = PartyShare::UNKNOWN; - PartyShareT mShareItems = PartyShare::UNKNOWN; -} // namespace PartyRecv - -void PartyRecv::processPartyCreate(Net::MessageIn &msg) -{ - if (msg.readUInt8("flag") != 0u) - NotifyManager::notify(NotifyTypes::PARTY_CREATE_FAILED); - else - NotifyManager::notify(NotifyTypes::PARTY_CREATED); -} - -void PartyRecv::processPartyExpSettingsContinue(Net::MessageIn &msg, - const PartyShareT exp) -{ - switch (exp) - { - case PartyShare::YES: - if (mShareExp == PartyShare::YES) - break; - mShareExp = PartyShare::YES; - NotifyManager::notify(NotifyTypes::PARTY_EXP_SHARE_ON); - break; - case PartyShare::NO: - if (mShareExp == PartyShare::NO) - break; - mShareExp = PartyShare::NO; - NotifyManager::notify(NotifyTypes::PARTY_EXP_SHARE_OFF); - break; - case PartyShare::NOT_POSSIBLE: - if (mShareExp == PartyShare::NOT_POSSIBLE) - break; - mShareExp = PartyShare::NOT_POSSIBLE; - NotifyManager::notify(NotifyTypes::PARTY_EXP_SHARE_ERROR); - break; - default: - case PartyShare::UNKNOWN: - UNIMPLEMENTEDPACKETFIELD(CAST_S32(exp)); - break; - } -} - -void PartyRecv::processPartyItemSettingsContinue(Net::MessageIn &msg, - const PartyShareT item) -{ - switch (item) - { - case PartyShare::YES: - if (mShareItems == PartyShare::YES) - break; - mShareItems = PartyShare::YES; - NotifyManager::notify(NotifyTypes::PARTY_ITEM_SHARE_ON); - break; - case PartyShare::NO: - if (mShareItems == PartyShare::NO) - break; - mShareItems = PartyShare::NO; - NotifyManager::notify(NotifyTypes::PARTY_ITEM_SHARE_OFF); - break; - case PartyShare::NOT_POSSIBLE: - if (mShareItems == PartyShare::NOT_POSSIBLE) - break; - mShareItems = PartyShare::NOT_POSSIBLE; - NotifyManager::notify(NotifyTypes::PARTY_ITEM_SHARE_ERROR); - break; - default: - case PartyShare::UNKNOWN: - UNIMPLEMENTEDPACKETFIELD(CAST_S32(item)); - break; - } -} - -void PartyRecv::processPartyLeave(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("account id"); - const std::string nick = msg.readString(24, "nick"); - const int reason = msg.readUInt8("flag"); - if (localPlayer == nullptr) - return; - - if (id == localPlayer->getId()) - { - switch (reason) - { - case 0: - default: - NotifyManager::notify(NotifyTypes::PARTY_LEFT); - break; - - case 1: - NotifyManager::notify(NotifyTypes::PARTY_KICKED); - break; - - case 2: - NotifyManager::notify(NotifyTypes::PARTY_LEFT_DENY); - break; - - case 3: - NotifyManager::notify(NotifyTypes::PARTY_KICK_DENY); - break; - } - - if (reason >= 2) - return; - - if (Ea::taParty != nullptr) - { - Ea::taParty->removeFromMembers(); - Ea::taParty->clearMembers(); - } - - delete2(partyTab) - - if ((socialWindow != nullptr) && (Ea::taParty != nullptr)) - socialWindow->removeTab(Ea::taParty); - localPlayer->setPartyName(""); - } - else - { - switch (reason) - { - case 0: - default: - NotifyManager::notify(NotifyTypes::PARTY_USER_LEFT, nick); - break; - - case 1: - NotifyManager::notify(NotifyTypes::PARTY_USER_KICKED, nick); - break; - - case 2: - NotifyManager::notify(NotifyTypes::PARTY_USER_LEFT_DENY, nick); - break; - - case 3: - NotifyManager::notify(NotifyTypes::PARTY_USER_KICK_DENY, nick); - break; - } - - if (reason >= 2) - return; - - if (actorManager != nullptr) - { - Being *const b = actorManager->findBeing(id); - if ((b != nullptr) && b->getType() == ActorType::Player) - { - b->setParty(nullptr); - b->setPartyName(""); - } - } - if (Ea::taParty != nullptr) - Ea::taParty->removeMember(id); - } -} - -void PartyRecv::processPartyUpdateCoords(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("account id"); - PartyMember *m = nullptr; - if (Ea::taParty != nullptr) - m = Ea::taParty->getMember(id); - if (m != nullptr) - { - m->setX(msg.readInt16("x")); - m->setY(msg.readInt16("y")); - } - else - { - msg.readInt16("x"); - msg.readInt16("y"); - } -} - -void PartyRecv::createTab() -{ - partyTab = new PartyTab(chatWindow); - if (config.getBoolValue("showChatHistory")) - partyTab->loadFromLogFile("#Party"); -} - -} // namespace Ea diff --git a/src/net/ea/partyrecv.h b/src/net/ea/partyrecv.h deleted file mode 100644 index 07629567d..000000000 --- a/src/net/ea/partyrecv.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_PARTYRECV_H -#define NET_EA_PARTYRECV_H - -#include "enums/net/partyshare.h" - -class Party; - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace Ea -{ - namespace PartyRecv - { - extern PartyShareT mShareExp; - extern PartyShareT mShareItems; - - void processPartyCreate(Net::MessageIn &msg); - void processPartyLeave(Net::MessageIn &msg); - void processPartyUpdateCoords(Net::MessageIn &msg); - void processPartyExpSettingsContinue(Net::MessageIn &msg, - const PartyShareT exp); - void processPartyItemSettingsContinue(Net::MessageIn &msg, - const PartyShareT item); - - void createTab(); - } // namespace PartyRecv - extern Party *taParty; -} // namespace Ea - -#endif // NET_EA_PARTYRECV_H diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp deleted file mode 100644 index 3300c5c8d..000000000 --- a/src/net/ea/playerhandler.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/playerhandler.h" - -#include "being/playerinfo.h" - -#include "debug.h" - -namespace Ea -{ - -PlayerHandler::PlayerHandler() -{ -} - -void PlayerHandler::ignorePlayer(const std::string &player A_UNUSED, - const bool ignore A_UNUSED) const -{ -} - -void PlayerHandler::ignoreAll(const bool ignore A_UNUSED) const -{ -} - -int PlayerHandler::getDefaultWalkSpeed() const -{ - return 150; -} - -bool PlayerHandler::canUseMagic() const -{ - return PlayerInfo::getStatEffective(Attributes::PLAYER_MATK) > 0; -} - -} // namespace Ea diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h deleted file mode 100644 index d852d1086..000000000 --- a/src/net/ea/playerhandler.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_PLAYERHANDLER_H -#define NET_EA_PLAYERHANDLER_H - -#include "net/playerhandler.h" - -namespace Ea -{ - -class PlayerHandler notfinal : public Net::PlayerHandler -{ - public: - PlayerHandler(); - - A_DELETE_COPY(PlayerHandler) - - void ignorePlayer(const std::string &player, - const bool ignore) const override final A_CONST; - - void ignoreAll(const bool ignore) const override final A_CONST; - - bool canUseMagic() const override final; - - int getDefaultWalkSpeed() const override final A_WARN_UNUSED; -}; - -} // namespace Ea - -#endif // NET_EA_PLAYERHANDLER_H diff --git a/src/net/ea/playerrecv.cpp b/src/net/ea/playerrecv.cpp deleted file mode 100644 index edc604907..000000000 --- a/src/net/ea/playerrecv.cpp +++ /dev/null @@ -1,266 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/playerrecv.h" - -#include "game.h" -#include "notifymanager.h" -#include "settings.h" -#include "soundmanager.h" - -#include "being/localplayer.h" -#include "being/playerinfo.h" - -#include "const/net/nostat.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/viewport.h" - -#include "gui/windows/statuswindow.h" - -#include "input/inputmanager.h" - -#include "resources/map/map.h" - -#include "net/playerhandler.h" - -#include "utils/stdmove.h" -#include "utils/stringutils.h" - -#include "debug.h" - -// Max. distance we are willing to scroll after a teleport; -// everything beyond will reset the port hard. -static const int MAP_TELEPORT_SCROLL_DISTANCE = 8; - -namespace Ea -{ - -void PlayerRecv::processPlayerWarp(Net::MessageIn &msg) -{ - BLOCK_START("PlayerRecv::processPlayerWarp") - std::string mapPath = msg.readString(16, "map name"); - int x = msg.readInt16("x"); - int y = msg.readInt16("y"); - - logger->log("Warping to %s (%d, %d)", mapPath.c_str(), x, y); - - if (localPlayer == nullptr) - logger->log1("SMSG_PLAYER_WARP localPlayer null"); - - /* - * We must clear the local player's target *before* the call - * to changeMap, as it deletes all beings. - */ - if (localPlayer != nullptr) - localPlayer->stopAttack(); - - Game *const game = Game::instance(); - if (game == nullptr) - { - BLOCK_END("PlayerRecv::processPlayerWarp") - return; - } - - const std::string ¤tMapName = game->getCurrentMapName(); - const bool sameMap = (currentMapName == mapPath); - - // Switch the actual map, deleting the previous one if necessary - mapPath = mapPath.substr(0, mapPath.rfind('.')); - game->changeMap(mapPath); - - int scrollOffsetX = 0; - int scrollOffsetY = 0; - - if (localPlayer != nullptr) - { - const Map *const map = game->getCurrentMap(); - if (map != nullptr) - { - if (x >= map->getWidth()) - x = map->getWidth() - 1; - if (y >= map->getHeight()) - y = map->getHeight() - 1; - if (x < 0) - x = 0; - if (y < 0) - y = 0; - /* Scroll if neccessary */ - if (!sameMap - || (abs(x - localPlayer->getTileX()) - > MAP_TELEPORT_SCROLL_DISTANCE) - || (abs(y - localPlayer->getTileY()) - > MAP_TELEPORT_SCROLL_DISTANCE)) - { - scrollOffsetX = (x - localPlayer->getTileX()) - * map->getTileWidth(); - scrollOffsetY = (y - localPlayer->getTileY()) - * map->getTileHeight(); - } - } - - localPlayer->setAction(BeingAction::STAND, 0); - localPlayer->setTileCoords(x, y); - localPlayer->navigateClean(); - localPlayer->reset(); - } - - logger->log("Adjust scrolling by %d:%d", scrollOffsetX, scrollOffsetY); - - if (viewport != nullptr) - { - viewport->returnCamera(); - viewport->scrollBy(scrollOffsetX, scrollOffsetY); - } - BLOCK_END("PlayerRecv::processPlayerWarp") -} - -void PlayerRecv::processPlayerStatUpdate1(Net::MessageIn &msg) -{ - BLOCK_START("PlayerRecv::processPlayerStatUpdate1") - const int type = msg.readInt16("type"); - const int value = msg.readInt32("value"); - if (localPlayer == nullptr) - { - BLOCK_END("PlayerRecv::processPlayerStatUpdate1") - return; - } - - playerHandler->setStat(msg, type, value, NoStat, Notify_true); - BLOCK_END("PlayerRecv::processPlayerStatUpdate1") -} - -void PlayerRecv::processPlayerStatUpdate2(Net::MessageIn &msg) -{ - BLOCK_START("PlayerRecv::processPlayerStatUpdate2") - const int type = msg.readInt16("type"); - const int value = msg.readInt32("value"); - playerHandler->setStat(msg, type, value, NoStat, Notify_true); - BLOCK_END("PlayerRecv::processPlayerStatUpdate2") -} - -void PlayerRecv::processPlayerStatUpdate3(Net::MessageIn &msg) -{ - BLOCK_START("PlayerRecv::processPlayerStatUpdate3") - const int type = msg.readInt32("type"); - const int base = msg.readInt32("base"); - const int bonus = msg.readInt32("bonus"); - - playerHandler->setStat(msg, type, base, bonus, Notify_false); - BLOCK_END("PlayerRecv::processPlayerStatUpdate3") -} - -void PlayerRecv::processPlayerStatUpdate4(Net::MessageIn &msg) -{ - BLOCK_START("PlayerRecv::processPlayerStatUpdate4") - const uint16_t type = msg.readInt16("type"); - const uint8_t ok = msg.readUInt8("flag"); - const int value = msg.readUInt8("value"); - - if (ok != 1) - { - const int oldValue = PlayerInfo::getStatBase( - static_cast<AttributesT>(type)); - const int points = PlayerInfo::getAttribute( - Attributes::PLAYER_CHAR_POINTS) + oldValue - value; - PlayerInfo::setAttribute(Attributes::PLAYER_CHAR_POINTS, points); - NotifyManager::notify(NotifyTypes::SKILL_RAISE_ERROR); - } - - playerHandler->setStat(msg, type, value, NoStat, Notify_true); - BLOCK_END("PlayerRecv::processPlayerStatUpdate4") -} - -void PlayerRecv::processPlayerStatUpdate6(Net::MessageIn &msg) -{ - BLOCK_START("PlayerRecv::processPlayerStatUpdate6") - const int type = msg.readInt16("type"); - const int value = msg.readUInt8("value"); - if (statusWindow != nullptr) - playerHandler->setStat(msg, type, value, NoStat, Notify_true); - BLOCK_END("PlayerRecv::processPlayerStatUpdate6") -} - -void PlayerRecv::processPlayerArrowMessage(Net::MessageIn &msg) -{ - BLOCK_START("PlayerRecv::processPlayerArrowMessage") - const int type = msg.readInt16("type"); - switch (type) - { - case 0: - NotifyManager::notify(NotifyTypes::ARROWS_EQUIP_NEEDED); - break; - case 3: - // arrows equiped - break; - default: - UNIMPLEMENTEDPACKETFIELD(type); - break; - } - BLOCK_END("PlayerRecv::processPlayerArrowMessage") -} - -void PlayerRecv::processMapMusic(Net::MessageIn &msg) -{ - const int size = msg.readInt16("len") - 4; - const std::string music = msg.readString(size, "name"); - soundManager.playMusic(music, - SkipError_false); - - Map *const map = viewport->getMap(); - if (map != nullptr) - map->setMusicFile(music); -} - -void PlayerRecv::processMapMask(Net::MessageIn &msg) -{ - const int mask = msg.readInt32("mask"); - msg.readInt32("unused"); - Map *const map = Game::instance()->getCurrentMap(); - if (map != nullptr) - map->setMask(mask); -} - -void PlayerRecv::processPlayerClientCommand(Net::MessageIn &msg) -{ - const int sz = msg.readInt16("len") - 4; - std::string command = msg.readString(sz, "command"); - std::string cmd; - std::string args; - - if (settings.awayMode || - settings.pseudoAwayMode || - !settings.enableRemoteCommands) - { - return; - } - - if (!parse2Str(command, cmd, args)) - { - cmd = STD_MOVE(command); - args.clear(); - } - inputManager.executeRemoteChatCommand(cmd, args, nullptr); -} - -} // namespace Ea diff --git a/src/net/ea/playerrecv.h b/src/net/ea/playerrecv.h deleted file mode 100644 index 8c0913b09..000000000 --- a/src/net/ea/playerrecv.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_PLAYERRECV_H -#define NET_EA_PLAYERRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace Ea -{ - namespace PlayerRecv - { - void processPlayerWarp(Net::MessageIn &msg); - void processPlayerStatUpdate1(Net::MessageIn &msg); - void processPlayerStatUpdate2(Net::MessageIn &msg); - void processPlayerStatUpdate3(Net::MessageIn &msg); - void processPlayerStatUpdate4(Net::MessageIn &msg); - void processPlayerStatUpdate6(Net::MessageIn &msg); - void processPlayerArrowMessage(Net::MessageIn &msg); - void processPlayerClientCommand(Net::MessageIn &msg); - void processMapMusic(Net::MessageIn &msg); - void processMapMask(Net::MessageIn &msg); - } // namespace PlayerRecv -} // namespace Ea - -#endif // NET_EA_PLAYERRECV_H diff --git a/src/net/ea/skillhandler.cpp b/src/net/ea/skillhandler.cpp deleted file mode 100644 index e44bc5609..000000000 --- a/src/net/ea/skillhandler.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/skillhandler.h" - -#include "debug.h" - -namespace Ea -{ - -SkillHandler::SkillHandler() -{ -} - -} // namespace Ea diff --git a/src/net/ea/skillhandler.h b/src/net/ea/skillhandler.h deleted file mode 100644 index acda5e7ad..000000000 --- a/src/net/ea/skillhandler.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_SKILLHANDLER_H -#define NET_EA_SKILLHANDLER_H - -#include "net/skillhandler.h" - -#include "localconsts.h" - -namespace Ea -{ - -class SkillHandler notfinal : public Net::SkillHandler -{ - public: - SkillHandler(); - - A_DELETE_COPY(SkillHandler) -}; - -} // namespace Ea - -#endif // NET_EA_SKILLHANDLER_H diff --git a/src/net/ea/skillrecv.cpp b/src/net/ea/skillrecv.cpp deleted file mode 100644 index 58a083478..000000000 --- a/src/net/ea/skillrecv.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/skillrecv.h" - -#include "being/playerinfo.h" - -#include "gui/windows/skilldialog.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace Ea -{ - -void SkillRecv::processPlayerSkillUp(Net::MessageIn &msg) -{ - const int skillId = msg.readInt16("skill id"); - const int level = msg.readInt16("skill level"); - const int sp = msg.readInt16("sp"); - const int range = msg.readInt16("range"); - const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); - - if (skillDialog != nullptr && PlayerInfo::getSkillLevel(skillId) != level) - skillDialog->playUpdateEffect(skillId); - PlayerInfo::setSkillLevel(skillId, level); - if (skillDialog != nullptr) - { - if (!skillDialog->updateSkill(skillId, range, - up, SkillType::Unknown, sp)) - { - skillDialog->addSkill(SkillOwner::Player, - skillId, "", level, - range, up, SkillType::Unknown, sp); - } - } -} - -} // namespace Ea diff --git a/src/net/ea/skillrecv.h b/src/net/ea/skillrecv.h deleted file mode 100644 index de4fe1112..000000000 --- a/src/net/ea/skillrecv.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_SKILLRECV_H -#define NET_EA_SKILLRECV_H - -#include "localconsts.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace Ea -{ - namespace SkillRecv - { - void processPlayerSkillUp(Net::MessageIn &msg); - } // namespace SkillRecv -} // namespace Ea - -#endif // NET_EA_SKILLRECV_H diff --git a/src/net/ea/token.h b/src/net/ea/token.h deleted file mode 100644 index 1e8f72c8d..000000000 --- a/src/net/ea/token.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_TOKEN_H -#define NET_EA_TOKEN_H - -#include "enums/simpletypes/beingid.h" -#include "enums/being/gender.h" - -struct Token final -{ - Token() : - account_ID(BeingId_zero), - session_ID1(0), - session_ID2(0), - sex(Gender::UNSPECIFIED) - { } - - A_DELETE_COPY(Token) - - BeingId account_ID; - int session_ID1; - int session_ID2; - GenderT sex; - - void clear() - { - account_ID = BeingId_zero; - session_ID1 = 0; - session_ID2 = 0; - sex = Gender::UNSPECIFIED; - } -}; - -#endif // NET_EA_TOKEN_H diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp deleted file mode 100644 index a56136b3d..000000000 --- a/src/net/ea/tradehandler.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/tradehandler.h" - -#include "listeners/requesttradelistener.h" - -#include "debug.h" - -/** - * Listener for request trade dialogs - */ -namespace -{ - RequestTradeListener listener; -} // namespace - -namespace Ea -{ - -TradeHandler::TradeHandler() : - Net::TradeHandler() -{ - confirmDlg = nullptr; -} - -void TradeHandler::removeItem(const int slotNum A_UNUSED, - const int amount A_UNUSED) const -{ -} - -} // namespace Ea diff --git a/src/net/ea/tradehandler.h b/src/net/ea/tradehandler.h deleted file mode 100644 index 0a350bd46..000000000 --- a/src/net/ea/tradehandler.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_TRADEHANDLER_H -#define NET_EA_TRADEHANDLER_H - -#include "net/tradehandler.h" - -namespace Ea -{ - -class TradeHandler notfinal : public Net::TradeHandler -{ - public: - TradeHandler(); - - A_DELETE_COPY(TradeHandler) - - void removeItem(const int slotNum, - const int amount) const override final A_CONST; -}; - -} // namespace Ea - -#endif // NET_EA_TRADEHANDLER_H diff --git a/src/net/ea/traderecv.cpp b/src/net/ea/traderecv.cpp deleted file mode 100644 index d47fc256b..000000000 --- a/src/net/ea/traderecv.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ea/traderecv.h" - -#include "notifymanager.h" - -#include "being/playerinfo.h" -#include "being/playerrelation.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/tradewindow.h" - -#include "gui/widgets/createwidget.h" - -#include "net/messagein.h" - -#include "utils/gettext.h" -#include "utils/stringutils.h" - -#include "listeners/requesttradelistener.h" - -#include "debug.h" - - -ConfirmDialog *confirmDlg = nullptr; - -/** - * Listener for request trade dialogs - */ -namespace -{ - RequestTradeListener listener; -} // namespace - -namespace Ea -{ - -void TradeRecv::processTradeResponseContinue(const uint8_t type) -{ - switch (type) - { - case 0: // Too far away - NotifyManager::notify(NotifyTypes::TRADE_FAIL_FAR_AWAY, - tradePartnerName); - break; - case 1: // Character doesn't exist - NotifyManager::notify(NotifyTypes::TRADE_FAIL_CHAR_NOT_EXISTS, - tradePartnerName); - break; - case 2: // Invite request check failed... - NotifyManager::notify(NotifyTypes::TRADE_CANCELLED_ERROR); - break; - case 3: // Trade accepted - if (tradeWindow != nullptr) - { - tradeWindow->reset(); - // TRANSLATORS: trade header - tradeWindow->setCaption(strprintf(_("Trade: You and %s"), - tradePartnerName.c_str())); - tradeWindow->initTrade(tradePartnerName); - tradeWindow->setVisible(Visible_true); - } - break; - case 4: // Trade cancelled - if (playerRelations.hasPermission(tradePartnerName, - PlayerRelation::SPEECH_LOG)) - { - NotifyManager::notify(NotifyTypes::TRADE_CANCELLED_NAME, - tradePartnerName); - } - // otherwise ignore silently - - if (tradeWindow != nullptr) - { - tradeWindow->setVisible(Visible_false); -// tradeWindow->clear(); - } - PlayerInfo::setTrading(Trading_false); - break; - case 5: - NotifyManager::notify(NotifyTypes::TRADE_CANCELLED_BUSY, - tradePartnerName); - break; - default: // Shouldn't happen as well, but to be sure - NotifyManager::notify(NotifyTypes::TRADE_ERROR_UNKNOWN, - tradePartnerName); - if (tradeWindow != nullptr) - tradeWindow->clear(); - break; - } -} - -void TradeRecv::processTradeOk(Net::MessageIn &msg) -{ - // 0 means ok from myself, 1 means ok from other; - if (tradeWindow != nullptr) - tradeWindow->receivedOk(msg.readUInt8("status") == 0U); - else - msg.readUInt8("status"); -} - -void TradeRecv::processTradeCancel(Net::MessageIn &msg A_UNUSED) -{ - NotifyManager::notify(NotifyTypes::TRADE_CANCELLED); - if (tradeWindow != nullptr) - { - tradeWindow->setVisible(Visible_false); - tradeWindow->reset(); - } - PlayerInfo::setTrading(Trading_false); -} - -void TradeRecv::processTradeComplete(Net::MessageIn &msg A_UNUSED) -{ - NotifyManager::notify(NotifyTypes::TRADE_COMPLETE); - if (tradeWindow != nullptr) - tradeWindow->completeTrade(); - PlayerInfo::setTrading(Trading_false); -} - -void TradeRecv::processTradeRequestContinue(const std::string &partner) -{ - if (playerRelations.hasPermission(partner, - PlayerRelation::TRADE)) - { - if (PlayerInfo::isTrading() == Trading_true || (confirmDlg != nullptr)) - { - tradeHandler->respond(false); - return; - } - - tradePartnerName = partner; - PlayerInfo::setTrading(Trading_true); - if (tradeWindow != nullptr) - { - if (tradePartnerName.empty() || tradeWindow->getAutoTradeNick() - != tradePartnerName) - { - tradeWindow->clear(); - CREATEWIDGETV(confirmDlg, ConfirmDialog, - // TRANSLATORS: trade message - _("Request for Trade"), - // TRANSLATORS: trade message - strprintf(_("%s wants to trade with you, do" - " you accept?"), tradePartnerName.c_str()), - SOUND_REQUEST, - true); - confirmDlg->addActionListener(&listener); - } - else - { - tradeHandler->respond(true); - } - } - } - else - { - tradeHandler->respond(false); - return; - } -} - -} // namespace Ea diff --git a/src/net/ea/traderecv.h b/src/net/ea/traderecv.h deleted file mode 100644 index ce8176bf3..000000000 --- a/src/net/ea/traderecv.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EA_TRADERECV_H -#define NET_EA_TRADERECV_H - -#if defined(__GXX_EXPERIMENTAL_CXX0X__) -#if defined(__APPLE__) -#include <tr1/cstdint> -#endif // defined(__APPLE__) -#else // defined(__GXX_EXPERIMENTAL_CXX0X__) -#include <stdint.h> -#endif // defined(__GXX_EXPERIMENTAL_CXX0X__) - -#include <string> - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace Ea -{ - namespace TradeRecv - { - void processTradeOk(Net::MessageIn &msg); - void processTradeCancel(Net::MessageIn &msg); - void processTradeComplete(Net::MessageIn &msg); - void processTradeRequestContinue(const std::string &partner); - void processTradeResponseContinue(const uint8_t type); - } // namespace TradeRecv -} // namespace Ea - -#endif // NET_EA_TRADERECV_H diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp deleted file mode 100644 index 45cfb9ed5..000000000 --- a/src/net/eathena/adminhandler.cpp +++ /dev/null @@ -1,379 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/adminhandler.h" - -#include "being/being.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "utils/gmfunctions.h" -#include "utils/stringutils.h" - -#include "debug.h" - -namespace EAthena -{ - -std::string AdminHandler::mStatsName; - -AdminHandler::AdminHandler() : - Ea::AdminHandler() -{ - adminHandler = this; -} - -AdminHandler::~AdminHandler() -{ - adminHandler = nullptr; -} - -void AdminHandler::announce(const std::string &text) const -{ - createOutPacket(CMSG_ADMIN_ANNOUNCE); - outMsg.writeInt16(CAST_S16(text.length() + 4), "len"); - outMsg.writeString(text, CAST_S32(text.length()), "message"); -} - -void AdminHandler::localAnnounce(const std::string &text) const -{ - createOutPacket(CMSG_ADMIN_LOCAL_ANNOUNCE); - outMsg.writeInt16(CAST_S16(text.length() + 4), "len"); - outMsg.writeString(text, CAST_S32(text.length()), "message"); -} - -void AdminHandler::hide(const bool h A_UNUSED) const -{ - createOutPacket(CMSG_ADMIN_HIDE); - outMsg.writeInt32(0, "unused"); -} - -void AdminHandler::kick(const BeingId playerId) const -{ - createOutPacket(CMSG_ADMIN_KICK); - outMsg.writeBeingId(playerId, "account id"); -} - -void AdminHandler::kickAll() const -{ - createOutPacket(CMSG_ADMIN_KICK_ALL); -} - -void AdminHandler::warp(const std::string &map, const int x, const int y) const -{ - createOutPacket(CMSG_PLAYER_MAPMOVE); - outMsg.writeString(map, 16, "map"); - outMsg.writeInt16(CAST_S16(x), "x"); - outMsg.writeInt16(CAST_S16(y), "y"); -} - -void AdminHandler::resetStats() const -{ - createOutPacket(CMSG_ADMIN_RESET_PLAYER); - outMsg.writeInt16(0, "flag"); -} - -void AdminHandler::resetSkills() const -{ - createOutPacket(CMSG_ADMIN_RESET_PLAYER); - outMsg.writeInt16(1, "flag"); -} - -void AdminHandler::gotoName(const std::string &name) const -{ - createOutPacket(CMSG_ADMIN_GOTO); - outMsg.writeString(name, 24, "name"); -} - -void AdminHandler::recallName(const std::string &name) const -{ - createOutPacket(CMSG_ADMIN_RECALL); - outMsg.writeString(name, 24, "name"); -} - -void AdminHandler::mute(const Being *const being, - const int type, - const int limit) const -{ - if (being == nullptr) - return; - - createOutPacket(CMSG_ADMIN_MUTE); - outMsg.writeBeingId(being->getId(), "account id"); - outMsg.writeInt8(CAST_S8(type), "type"); - outMsg.writeInt16(CAST_S16(limit), "value"); -} - -void AdminHandler::muteName(const std::string &name) const -{ - createOutPacket(CMSG_ADMIN_MUTE_NAME); - outMsg.writeString(name, 24, "name"); -} - -void AdminHandler::requestLogin(const Being *const being) const -{ - if (being == nullptr) - return; - - createOutPacket(CMSG_ADMIN_ID_TO_LOGIN); - outMsg.writeBeingId(being->getId(), "account id"); -} - -void AdminHandler::setTileType(const int x, const int y, - const int type) const -{ - createOutPacket(CMSG_ADMIN_SET_TILE_TYPE); - outMsg.writeInt16(CAST_S16(x), "x"); - outMsg.writeInt16(CAST_S16(y), "y"); - outMsg.writeInt16(CAST_S16(type), "type"); -} - -void AdminHandler::unequipAll(const Being *const being) const -{ - if (being == nullptr) - return; - - createOutPacket(CMSG_ADMIN_UNEQUIP_ALL); - outMsg.writeBeingId(being->getId(), "account id"); -} - -void AdminHandler::requestStats(const std::string &name) const -{ - mStatsName = name; - createOutPacket(CMSG_ADMIN_REQUEST_STATS); - outMsg.writeString(name, 24, "name"); -} - -void AdminHandler::monsterInfo(const std::string &name) const -{ - Gm::runCommand("monsterinfo", name); -} - -void AdminHandler::itemInfo(const std::string &name) const -{ - Gm::runCommand("iteminfo", name); -} - -void AdminHandler::whoDrops(const std::string &name) const -{ - Gm::runCommand("whodrops", name); -} - -void AdminHandler::mobSearch(const std::string &name) const -{ - Gm::runCommand("mobsearch", name); -} - -void AdminHandler::mobSpawnSearch(const std::string &name) const -{ - Gm::runCommand("whereis", name); -} - -void AdminHandler::playerGmCommands(const std::string &name) const -{ - Gm::runCharCommand("commands", name); -} - -void AdminHandler::playerCharGmCommands(const std::string &name) const -{ - Gm::runCharCommand("charcommands", name); -} - -void AdminHandler::showLevel(const std::string &name) const -{ - Gm::runCharCommand("exp", name); -} - -void AdminHandler::showStats(const std::string &name) const -{ - Gm::runCharCommand("stats", name); -} - -void AdminHandler::showStorageList(const std::string &name) const -{ - Gm::runCharCommand("storagelist", name); -} - -void AdminHandler::showCartList(const std::string &name) const -{ - Gm::runCharCommand("cartlist", name); -} - -void AdminHandler::showInventoryList(const std::string &name) const -{ - Gm::runCharCommand("itemlist", name); -} - -void AdminHandler::locatePlayer(const std::string &name) const -{ - Gm::runCommand("where", name); -} - -void AdminHandler::showAccountInfo(const std::string &name) const -{ - Gm::runCommand("accinfo", name); -} - -void AdminHandler::spawnSlave(const std::string &name) const -{ - Gm::runCommand("summon", name); -} - -void AdminHandler::spawnClone(const std::string &name) const -{ - Gm::runCommand("clone", name); -} - -void AdminHandler::spawnSlaveClone(const std::string &name) const -{ - Gm::runCommand("slaveclone", name); -} - -void AdminHandler::spawnEvilClone(const std::string &name) const -{ - Gm::runCommand("evilclone", name); -} - -void AdminHandler::savePosition(const std::string &name) const -{ - Gm::runCharCommand("save", name); -} - -void AdminHandler::loadPosition(const std::string &name) const -{ - Gm::runCharCommand("load", name); -} - -void AdminHandler::randomWarp(const std::string &name) const -{ - Gm::runCharCommand("jump", name); -} - -void AdminHandler::gotoNpc(const std::string &name) const -{ - Gm::runCommand("tonpc", name); -} - -void AdminHandler::killer(const std::string &name) const -{ - Gm::runCharCommand("killer", name); -} - -void AdminHandler::killable(const std::string &name) const -{ - Gm::runCharCommand("killable", name); -} - -void AdminHandler::heal(const std::string &name) const -{ - Gm::runCharCommand("heal", name); -} - -void AdminHandler::alive(const std::string &name) const -{ - Gm::runCharCommand("alive", name); -} - -void AdminHandler::disguise(const std::string &name) const -{ - Gm::runCommand("disguise", name); -} - -void AdminHandler::immortal(const std::string &name) const -{ - Gm::runCharCommand("monsterignore", name); -} - -void AdminHandler::hide(const std::string &name) const -{ - Gm::runCharCommand("hide", name); -} - -void AdminHandler::nuke(const std::string &name) const -{ - Gm::runCommand("nuke", name); -} - -void AdminHandler::kill(const std::string &name) const -{ - Gm::runCharCommand("kill", name); -} - -void AdminHandler::jail(const std::string &name) const -{ - Gm::runCommand("jail", name); -} - -void AdminHandler::unjail(const std::string &name) const -{ - Gm::runCommand("unjail", name); -} - -void AdminHandler::npcMove(const std::string &name, - const int x, - const int y) const -{ - Gm::runCommand("npcmove", - strprintf("%d %d %s", - x, - y, - name.c_str())); -} - -void AdminHandler::hideNpc(const std::string &name) const -{ - Gm::runCommand("hidenpc", name); -} - -void AdminHandler::showNpc(const std::string &name) const -{ - Gm::runCommand("shownpc", name); -} - -void AdminHandler::changePartyLeader(const std::string &name) const -{ - Gm::runCommand("changeleader", name); -} - -void AdminHandler::partyRecall(const std::string &name) const -{ - Gm::runCommand("partyrecall", name); -} - -void AdminHandler::breakGuild(const std::string &name) const -{ - Gm::runCharCommand("breakguild", name); -} - -void AdminHandler::guildRecall(const std::string &name) const -{ - Gm::runCommand("guildrecall", name); -} - -void AdminHandler::slide(const int x, const int y) const -{ - Gm::runCommand("slide", - strprintf("%d %d", x, y)); -} - -} // namespace EAthena diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h deleted file mode 100644 index 2cee9a354..000000000 --- a/src/net/eathena/adminhandler.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_ADMINHANDLER_H -#define NET_EATHENA_ADMINHANDLER_H - -#include "net/ea/adminhandler.h" - -namespace EAthena -{ - -class AdminHandler final : public Ea::AdminHandler -{ - public: - AdminHandler(); - - A_DELETE_COPY(AdminHandler) - - ~AdminHandler(); - - void announce(const std::string &text) const override final; - - void localAnnounce(const std::string &text) const override final; - - void hide(const bool h) const override final; - - void kick(const BeingId playerId) const override final; - - void kickAll() const override final; - - void warp(const std::string &map, - const int x, const int y) const override final; - - void resetStats() const override final; - - void resetSkills() const override final; - - void gotoName(const std::string &name) const override final; - - void recallName(const std::string &name) const override final; - - void mute(const Being *const being, - const int type, - const int limit) const override final; - - void muteName(const std::string &name) const override final; - - void requestLogin(const Being *const being) const override final; - - void setTileType(const int x, const int y, - const int type) const override final; - - void unequipAll(const Being *const being) const override final; - - void requestStats(const std::string &name) const override final; - - void monsterInfo(const std::string &name) const override final; - - void itemInfo(const std::string &name) const override final; - - void whoDrops(const std::string &name) const override final; - - void mobSearch(const std::string &name) const override final; - - void mobSpawnSearch(const std::string &name) const override final; - - void playerGmCommands(const std::string &name) const override final; - - void playerCharGmCommands(const std::string &name) const - override final; - - void showLevel(const std::string &name) const override final; - - void showStats(const std::string &name) const override final; - - void showStorageList(const std::string &name) const override final; - - void showCartList(const std::string &name) const override final; - - void showInventoryList(const std::string &name) const override final; - - void locatePlayer(const std::string &name) const override final; - - void showAccountInfo(const std::string &name) const override final; - - void spawnSlave(const std::string &name) const override final; - - void spawnClone(const std::string &name) const override final; - - void spawnSlaveClone(const std::string &name) const override final; - - void spawnEvilClone(const std::string &name) const override final; - - void savePosition(const std::string &name) const override final; - - void loadPosition(const std::string &name) const override final; - - void randomWarp(const std::string &name) const override final; - - void gotoNpc(const std::string &name) const override final; - - void killer(const std::string &name) const override final; - - void killable(const std::string &name) const override final; - - void heal(const std::string &name) const override final; - - void alive(const std::string &name) const override final; - - void disguise(const std::string &name) const override final; - - void immortal(const std::string &name) const override final; - - void hide(const std::string &name) const override final; - - void nuke(const std::string &name) const override final; - - void kill(const std::string &name) const override final; - - void jail(const std::string &name) const override final; - - void unjail(const std::string &name) const override final; - - void npcMove(const std::string &name, - const int x, - const int y) const override final; - - void hideNpc(const std::string &name) const override final; - - void showNpc(const std::string &name) const override final; - - void changePartyLeader(const std::string &name) const override final; - - void partyRecall(const std::string &name) const override final; - - void breakGuild(const std::string &name) const override final; - - void guildRecall(const std::string &name) const override final; - - void slide(const int x, const int y) const override final; - - protected: - static std::string mStatsName; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_ADMINHANDLER_H diff --git a/src/net/eathena/adminrecv.cpp b/src/net/eathena/adminrecv.cpp deleted file mode 100644 index a49776ba4..000000000 --- a/src/net/eathena/adminrecv.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/adminrecv.h" - -#include "logger.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace EAthena -{ - -void AdminRecv::processAdminGetLoginAck(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readBeingId("account id"); - msg.readString(24, "login"); -} - -void AdminRecv::processSetTileType(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // +++ here need set collision tile for map - msg.readInt16("x"); - msg.readInt16("y"); - msg.readInt16("type"); - msg.readString(16, "map name"); -} - -void AdminRecv::processAccountStats(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // +++ need show in other players stats window, nick in mStatsName - msg.readUInt8("str"); - msg.readUInt8("need str"); - msg.readUInt8("agi"); - msg.readUInt8("need agi"); - msg.readUInt8("vit"); - msg.readUInt8("need vit"); - msg.readUInt8("int"); - msg.readUInt8("need int"); - msg.readUInt8("dex"); - msg.readUInt8("need dex"); - msg.readUInt8("luk"); - msg.readUInt8("need luk"); - msg.readInt16("attack"); - msg.readInt16("refine"); - msg.readInt16("matk max"); - msg.readInt16("matk min"); - msg.readInt16("item def"); - msg.readInt16("plus def"); - msg.readInt16("mdef"); - msg.readInt16("plus mdef"); - msg.readInt16("hit"); - msg.readInt16("flee"); - msg.readInt16("flee2/10"); - msg.readInt16("cri/10"); - msg.readInt16("speed"); - msg.readInt16("zero"); -} - -} // namespace EAthena diff --git a/src/net/eathena/adminrecv.h b/src/net/eathena/adminrecv.h deleted file mode 100644 index 36453de0f..000000000 --- a/src/net/eathena/adminrecv.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_ADMINRECV_H -#define NET_EATHENA_ADMINRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace AdminRecv - { - void processAdminGetLoginAck(Net::MessageIn &msg); - void processSetTileType(Net::MessageIn &msg); - void processAccountStats(Net::MessageIn &msg); - } // namespace AdminRecv -} // namespace EAthena - -#endif // NET_EATHENA_ADMINRECV_H diff --git a/src/net/eathena/auctionhandler.cpp b/src/net/eathena/auctionhandler.cpp deleted file mode 100644 index 709e15138..000000000 --- a/src/net/eathena/auctionhandler.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/auctionhandler.h" - -#include "const/net/inventory.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "resources/item/item.h" - -#include "debug.h" - -namespace EAthena -{ - -AuctionHandler::AuctionHandler() -{ - auctionHandler = this; -} - -AuctionHandler::~AuctionHandler() -{ - auctionHandler = nullptr; -} - -void AuctionHandler::cancelReg() const -{ - createOutPacket(CMSG_AUCTION_CANCEL_REG); - outMsg.writeInt16(0, "type"); // unused -} - -void AuctionHandler::setItem(const Item *const item, - const int amount) const -{ - if (item == nullptr) - return; - createOutPacket(CMSG_AUCTION_SET_ITEM); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(amount, "amount"); // always 1 -} - -void AuctionHandler::reg(const int currentPrice, - const int maxPrice, - const int hours) const -{ - createOutPacket(CMSG_AUCTION_REGISTER); - outMsg.writeInt32(currentPrice, "now money"); - outMsg.writeInt32(maxPrice, "max money"); - outMsg.writeInt32(hours, "delete hour"); -} - -void AuctionHandler::cancel(const int auctionId) const -{ - createOutPacket(CMSG_AUCTION_CANCEL); - outMsg.writeInt32(auctionId, "auction id"); -} - -void AuctionHandler::close(const int auctionId) const -{ - createOutPacket(CMSG_AUCTION_CLOSE); - outMsg.writeInt32(auctionId, "auction id"); -} - -void AuctionHandler::bid(const int auctionId, - const int money) const -{ - createOutPacket(CMSG_AUCTION_BID); - outMsg.writeInt32(auctionId, "auction id"); - outMsg.writeInt32(money, "money"); -} - -void AuctionHandler::search(const AuctionSearchTypeT type, - const int auctionId, - const std::string &text, - const int page) const -{ - createOutPacket(CMSG_AUCTION_SEARCH); - outMsg.writeInt16(CAST_S16(type), "search type"); - outMsg.writeInt32(auctionId, "auction id"); - outMsg.writeString(text, 24, "search text"); - outMsg.writeInt16(CAST_S16(page), "page"); -} - -void AuctionHandler::buy() const -{ - createOutPacket(CMSG_AUCTION_BUY_SELL); - outMsg.writeInt16(1, "buy/sell type"); -} - -void AuctionHandler::sell() const -{ - createOutPacket(CMSG_AUCTION_BUY_SELL); - outMsg.writeInt16(0, "buy/sell type"); -} - -} // namespace EAthena diff --git a/src/net/eathena/auctionhandler.h b/src/net/eathena/auctionhandler.h deleted file mode 100644 index 097f4ca3b..000000000 --- a/src/net/eathena/auctionhandler.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_AUCTIONHANDLER_H -#define NET_EATHENA_AUCTIONHANDLER_H - -#include "net/auctionhandler.h" - -namespace EAthena -{ -class AuctionHandler final : public Net::AuctionHandler -{ - public: - AuctionHandler(); - - A_DELETE_COPY(AuctionHandler) - - ~AuctionHandler(); - - void cancelReg() const override final; - - void setItem(const Item *const item, - const int amount) const override final; - - void reg(const int currentPrice, - const int maxPrice, - const int hours) const override final; - - void cancel(const int auctionId) const override final; - - void close(const int auctionId) const override final; - - void bid(const int auctionId, - const int money) const override final; - - void search(const AuctionSearchTypeT type, - const int auctionId, - const std::string &text, - const int page) const override final; - - void buy() const override final; - - void sell() const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_AUCTIONHANDLER_H diff --git a/src/net/eathena/auctionrecv.cpp b/src/net/eathena/auctionrecv.cpp deleted file mode 100644 index 5b51dc9a9..000000000 --- a/src/net/eathena/auctionrecv.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/auctionrecv.h" - -#include "logger.h" - -#include "const/resources/item/cards.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace EAthena -{ - -void AuctionRecv::processOpenWindow(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("flag"); // 0 - open, 1 - close -} - -void AuctionRecv::processAuctionResults(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("len"); - msg.readInt32("pages"); - const int itemCount = msg.readInt32("items count"); - for (int f = 0; f < itemCount; f ++) - { - msg.readInt32("auction id"); - msg.readString(24, "seller name"); - msg.readInt32("item id"); - msg.readInt32("auction type"); - msg.readInt16("item amount"); // always 1 - msg.readUInt8("identify"); - msg.readUInt8("attribute"); - msg.readUInt8("refine"); - for (int d = 0; d < maxCards; d ++) - msg.readUInt16("card"); - msg.readInt32("price"); - msg.readInt32("buy now"); - msg.readString(24, "buyer name"); - msg.readInt32("timestamp"); - // +++ need use ItemColorManager for color - } -} - -void AuctionRecv::processAuctionSetItem(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("index"); - msg.readUInt8("flag"); -} - -void AuctionRecv::processAuctionMessage(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readUInt8("message"); -} - -void AuctionRecv::processAuctionClose(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("flag"); -} - -} // namespace EAthena diff --git a/src/net/eathena/auctionrecv.h b/src/net/eathena/auctionrecv.h deleted file mode 100644 index 25e91a848..000000000 --- a/src/net/eathena/auctionrecv.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_AUCTIONRECV_H -#define NET_EATHENA_AUCTIONRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace AuctionRecv - { - void processOpenWindow(Net::MessageIn &msg); - void processAuctionResults(Net::MessageIn &msg); - void processAuctionSetItem(Net::MessageIn &msg); - void processAuctionMessage(Net::MessageIn &msg); - void processAuctionClose(Net::MessageIn &msg); - } // namespace AuctionRecv -} // namespace EAthena - -#endif // NET_EATHENA_AUCTIONRECV_H diff --git a/src/net/eathena/bankhandler.cpp b/src/net/eathena/bankhandler.cpp deleted file mode 100644 index 19d600059..000000000 --- a/src/net/eathena/bankhandler.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/bankhandler.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -BankHandler::BankHandler() : - Net::BankHandler() -{ - bankHandler = this; -} - -BankHandler::~BankHandler() -{ - bankHandler = nullptr; -} - -void BankHandler::deposit(const int money) const -{ - if (packetVersion < 20130320) - return; - createOutPacket(CMSG_BANK_DEPOSIT); - outMsg.writeInt32(0, "account id"); - outMsg.writeInt32(money, "money"); -} - -void BankHandler::withdraw(const int money) const -{ - if (packetVersion < 20130320) - return; - createOutPacket(CMSG_BANK_WITHDRAW); - outMsg.writeInt32(0, "account id"); - outMsg.writeInt32(money, "money"); -} - -void BankHandler::check() const -{ - if (packetVersion < 20130320) - return; - createOutPacket(CMSG_BANK_CHECK); - outMsg.writeInt32(0, "account id"); -} - -void BankHandler::open() const -{ - if (packetVersion < 20130417) - return; - createOutPacket(CMSG_BANK_OPEN); - outMsg.writeInt32(0, "unused"); -} - -void BankHandler::close() const -{ - if (packetVersion < 20130417) - return; - createOutPacket(CMSG_BANK_CLOSE); - outMsg.writeInt32(0, "unused"); -} - -} // namespace EAthena diff --git a/src/net/eathena/bankhandler.h b/src/net/eathena/bankhandler.h deleted file mode 100644 index 0e890a61e..000000000 --- a/src/net/eathena/bankhandler.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_BANKHANDLER_H -#define NET_EATHENA_BANKHANDLER_H - -#include "net/bankhandler.h" - -namespace EAthena -{ -class BankHandler final : public Net::BankHandler -{ - public: - BankHandler(); - - A_DELETE_COPY(BankHandler) - - ~BankHandler(); - - void deposit(const int money) const override final; - - void withdraw(const int money) const override final; - - void check() const override final; - - void open() const override final; - - void close() const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_BANKHANDLER_H diff --git a/src/net/eathena/bankrecv.cpp b/src/net/eathena/bankrecv.cpp deleted file mode 100644 index 12b17727b..000000000 --- a/src/net/eathena/bankrecv.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/bankrecv.h" - -#include "notifymanager.h" - -#include "enums/resources/notifytypes.h" - -#include "listeners/banklistener.h" - -#include "net/messagein.h" - -#include "utils/cast.h" - -#include "debug.h" - -namespace EAthena -{ - -void BankRecv::processBankStatus(Net::MessageIn &msg) -{ - const int money = CAST_S32(msg.readInt64("money")); - msg.readInt16("reason"); - BankListener::distributeEvent(money); -} - -void BankRecv::processBankDeposit(Net::MessageIn &msg) -{ - const int reason = msg.readInt16("reason"); - const int money = CAST_S32(msg.readInt64("money")); - msg.readInt32("balance"); - BankListener::distributeEvent(money); - if (reason != 0) - NotifyManager::notify(NotifyTypes::BANK_DEPOSIT_FAILED); -} - -void BankRecv::processBankWithdraw(Net::MessageIn &msg) -{ - const int reason = msg.readInt16("reason"); - const int money = CAST_S32(msg.readInt64("money")); - msg.readInt32("balance"); - BankListener::distributeEvent(money); - if (reason != 0) - NotifyManager::notify(NotifyTypes::BANK_WITHDRAW_FAILED); -} - -} // namespace EAthena diff --git a/src/net/eathena/bankrecv.h b/src/net/eathena/bankrecv.h deleted file mode 100644 index 2d2755170..000000000 --- a/src/net/eathena/bankrecv.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_BANKRECV_H -#define NET_EATHENA_BANKRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace BankRecv - { - void processBankStatus(Net::MessageIn &msg); - void processBankDeposit(Net::MessageIn &msg); - void processBankWithdraw(Net::MessageIn &msg); - } // namespace BankRecv -} // namespace EAthena - -#endif // NET_EATHENA_BANKRECV_H diff --git a/src/net/eathena/battlegroundhandler.cpp b/src/net/eathena/battlegroundhandler.cpp deleted file mode 100644 index 09bc28a01..000000000 --- a/src/net/eathena/battlegroundhandler.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/battlegroundhandler.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -BattleGroundHandler::BattleGroundHandler() -{ - battleGroundHandler = this; -} - -BattleGroundHandler::~BattleGroundHandler() -{ - battleGroundHandler = nullptr; -} - -void BattleGroundHandler::registerBg(const BattleGroundTypeT &type, - const std::string &name) const -{ - if (packetVersion < 20111005) - return; - createOutPacket(CMSG_BATTLE_REGISTER); - outMsg.writeInt16(CAST_S16(type), "type"); - outMsg.writeString(name, 24, "bg name"); -} - -void BattleGroundHandler::rekoveRequest(const std::string &name) const -{ - if (packetVersion < 20111005) - return; - createOutPacket(CMSG_BATTLE_REVOKE); - outMsg.writeString(name, 24, "bg name"); -} - -void BattleGroundHandler::beginAck(const bool result, - const std::string &bgName, - const std::string &gameName) const -{ - if (packetVersion < 20111005) - return; - createOutPacket(CMSG_BATTLE_BEGIN_ACK); - outMsg.writeInt8(CAST_S8(result ? 1 : 0), "result"); - outMsg.writeString(bgName, 24, "bg name"); - outMsg.writeString(gameName, 24, "game name"); -} - -void BattleGroundHandler::checkState(const std::string &name) const -{ - if (packetVersion < 20111005) - return; - createOutPacket(CMSG_BATTLE_CHECK_STATE); - outMsg.writeString(name, 24, "bg name"); -} - -} // namespace EAthena diff --git a/src/net/eathena/battlegroundhandler.h b/src/net/eathena/battlegroundhandler.h deleted file mode 100644 index 230146963..000000000 --- a/src/net/eathena/battlegroundhandler.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_BATTLEGROUNDHANDLER_H -#define NET_EATHENA_BATTLEGROUNDHANDLER_H - -#include "net/battlegroundhandler.h" - -namespace EAthena -{ -class BattleGroundHandler final : public Net::BattleGroundHandler -{ - public: - BattleGroundHandler(); - - A_DELETE_COPY(BattleGroundHandler) - - ~BattleGroundHandler(); - - void registerBg(const BattleGroundTypeT &type, - const std::string &name) const override final; - - void rekoveRequest(const std::string &name) const override final; - - void beginAck(const bool result, - const std::string &bgName, - const std::string &gameName) const override final; - - void checkState(const std::string &name) const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_BATTLEGROUNDHANDLER_H diff --git a/src/net/eathena/battlegroundrecv.cpp b/src/net/eathena/battlegroundrecv.cpp deleted file mode 100644 index 2aaab9294..000000000 --- a/src/net/eathena/battlegroundrecv.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/battlegroundrecv.h" - -#include "actormanager.h" -#include "logger.h" - -#include "being/being.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace EAthena -{ - -void BattleGroundRecv::processBattleEmblem(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readBeingId("account id"); - msg.readString(24, "name"); - msg.readInt16("bg id"); -} - -void BattleGroundRecv::processBattleEmblem2(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("account id"); - msg.readString(24, "name"); - msg.readInt16("bg id"); - const int teamId = msg.readInt16("team id"); - - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing != nullptr) - dstBeing->setTeamId(CAST_U16(teamId)); -} - -void BattleGroundRecv::processBattleUpdateScore(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("camp a points"); - msg.readInt16("camp b points"); -} - -void BattleGroundRecv::processBattleUpdateCoords(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readBeingId("account id"); - msg.readString(24, "name"); - msg.readInt16("class"); - msg.readInt16("x"); - msg.readInt16("y"); -} - -void BattleGroundRecv::processBattlePlay(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readString(24, "battle ground name"); -} - -void BattleGroundRecv::processBattleQueueAck(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readUInt8("type"); - msg.readString(24, "bg name"); -} - -void BattleGroundRecv::processBattleBegins(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readString(24, "bg name"); - msg.readString(24, "game name"); -} - -void BattleGroundRecv::processBattleNoticeDelete(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readUInt8("type"); - msg.readString(24, "bg name"); -} - -void BattleGroundRecv::processBattleJoined(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readString(24, "name"); - msg.readInt32("position"); -} - -void BattleGroundRecv::processBattleUpdateHp(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readBeingId("account id"); - if (msg.getVersion() >= 20140613) - { - msg.readInt32("hp"); - msg.readInt32("max hp"); - } - else - { - msg.readString(24, "name"); - msg.readInt16("hp"); - msg.readInt16("max hp"); - } -} - -} // namespace EAthena diff --git a/src/net/eathena/battlegroundrecv.h b/src/net/eathena/battlegroundrecv.h deleted file mode 100644 index 7036fb31a..000000000 --- a/src/net/eathena/battlegroundrecv.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_BATTLEGROUNDRECV_H -#define NET_EATHENA_BATTLEGROUNDRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace BattleGroundRecv - { - void processBattleEmblem(Net::MessageIn &msg); - void processBattleEmblem2(Net::MessageIn &msg); - void processBattleUpdateScore(Net::MessageIn &msg); - void processBattleUpdateCoords(Net::MessageIn &msg); - void processBattlePlay(Net::MessageIn &msg); - void processBattleQueueAck(Net::MessageIn &msg); - void processBattleBegins(Net::MessageIn &msg); - void processBattleNoticeDelete(Net::MessageIn &msg); - void processBattleJoined(Net::MessageIn &msg); - void processBattleUpdateHp(Net::MessageIn &msg); - } // namespace BattleGroundRecv -} // namespace EAthena - -#endif // NET_EATHENA_BATTLEGROUNDRECV_H diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp deleted file mode 100644 index d53848654..000000000 --- a/src/net/eathena/beinghandler.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/beinghandler.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" -#include "net/eathena/sprite.h" - -#include "debug.h" - -extern int packetVersion; -extern int serverVersion; - -namespace EAthena -{ - -BeingHandler::BeingHandler(const bool enableSync) : - Ea::BeingHandler(enableSync) -{ - beingHandler = this; -} - -BeingHandler::~BeingHandler() -{ - beingHandler = nullptr; -} - -void BeingHandler::requestNameById(const BeingId id) const -{ - createOutPacket(CMSG_NAME_REQUEST); - if (packetVersion >= 20080827 && packetVersion < 20101124) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - } - outMsg.writeBeingId(id, "being id"); -} - -void BeingHandler::undress(Being *const being) const -{ - if (being == nullptr) - return; - being->unSetSprite(SPRITE_WEAPON); - being->unSetSprite(SPRITE_HEAD_BOTTOM); - being->unSetSprite(SPRITE_HEAD_TOP); - being->unSetSprite(SPRITE_HEAD_MID); - being->unSetSprite(SPRITE_CLOTHES_COLOR); - being->unSetSprite(SPRITE_SHIELD); - being->unSetSprite(SPRITE_FLOOR); - being->unSetSprite(SPRITE_ROBE); - being->unSetSprite(SPRITE_EVOL2); - being->unSetSprite(SPRITE_EVOL3); - being->unSetSprite(SPRITE_EVOL4); - being->unSetSprite(SPRITE_EVOL5); - being->unSetSprite(SPRITE_EVOL6); - being->unSetSprite(SPRITE_HAIR); - being->unSetSprite(SPRITE_SHOES); -} - -void BeingHandler::requestRanks(const RankT rank) const -{ - if (packetVersion < 20130605) - return; - - createOutPacket(CMSG_REQUEST_RANKS); - outMsg.writeInt16(CAST_S16(rank), "type"); -} - -void BeingHandler::viewPlayerEquipment(const Being *const being) const -{ - if (being == nullptr) - return; - - createOutPacket(CMSG_PLAYER_VIEW_EQUIPMENT); - outMsg.writeBeingId(being->getId(), "account id"); -} - -void BeingHandler::requestNameByCharId(const int id) const -{ - createOutPacket(CMSG_SOLVE_CHAR_NAME); - if (packetVersion >= 20080827 && packetVersion < 20101124) - { - outMsg.writeInt32(9, "unused"); - outMsg.writeInt32(9, "unused"); - } - outMsg.writeInt32(id, "character id"); -} - -} // namespace EAthena diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h deleted file mode 100644 index cb8f8c248..000000000 --- a/src/net/eathena/beinghandler.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_BEINGHANDLER_H -#define NET_EATHENA_BEINGHANDLER_H - -#include "net/ea/beinghandler.h" - -namespace EAthena -{ - -class BeingHandler final : public Ea::BeingHandler -{ - public: - explicit BeingHandler(const bool enableSync); - - A_DELETE_COPY(BeingHandler) - - ~BeingHandler(); - - void requestNameById(const BeingId id) const override final; - - void undress(Being *const being) const override final; - - void requestRanks(const RankT rank) const override final; - - void requestNameByCharId(const int id) const override final; - - void viewPlayerEquipment(const Being *const being) const - override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_BEINGHANDLER_H diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp deleted file mode 100644 index 8d986797b..000000000 --- a/src/net/eathena/beingrecv.cpp +++ /dev/null @@ -1,2191 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/beingrecv.h" - -#include "actormanager.h" -#include "effectmanager.h" -#include "game.h" -#include "notifymanager.h" -#include "party.h" - -#include "being/mercenaryinfo.h" - -#include "const/utils/timer.h" - -#include "enums/resources/notifytypes.h" - -#include "particle/particleengine.h" - -#include "input/keyboardconfig.h" - -#include "gui/viewport.h" - -#include "gui/windows/skilldialog.h" -#include "gui/windows/socialwindow.h" -#include "gui/windows/okdialog.h" -#include "gui/windows/outfitwindow.h" - -#include "net/character.h" -#include "net/charserverhandler.h" -#include "net/messagein.h" -#include "net/serverfeatures.h" - -#include "net/ea/beingrecv.h" - -#include "net/eathena/maptypeproperty2.h" -#include "net/eathena/sp.h" -#include "net/eathena/sprite.h" - -#include "resources/iteminfo.h" -#include "resources/db/itemdb.h" - -#include "resources/map/map.h" - -#include "utils/checkutils.h" -#include "utils/foreach.h" -#include "utils/timer.h" - -#include "debug.h" - -extern int serverVersion; -extern OkDialog *deathNotice; - -namespace EAthena -{ - -void BeingRecv::processBeingChangeLook2(Net::MessageIn &msg) -{ - if (actorManager == nullptr) - return; - - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - const uint8_t type = msg.readUInt8("type"); - - const int id = msg.readInt16("id1"); - unsigned int id2 = msg.readInt16("id2"); - if (type != 2) - id2 = 1; - - if ((localPlayer == nullptr) || (dstBeing == nullptr)) - return; - - processBeingChangeLookContinue(msg, dstBeing, type, id, id2, nullptr); -} - -void BeingRecv::processBeingChangeLookCards(Net::MessageIn &msg) -{ - Being *dstBeing = nullptr; - int cards[maxCards]; - - if (actorManager == nullptr) - { // here can be look from char server - Net::Characters &chars = Net::CharServerHandler::mCharacters; - const BeingId id = msg.readBeingId("being id"); - - FOR_EACH (Net::Characters::iterator, it, chars) - { - const Net::Character *const character = *it; - if (character->dummy != nullptr && - character->dummy->getId() == id) - { - dstBeing = character->dummy; - break; - } - } - } - else - { - dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - } - - const uint8_t type = msg.readUInt8("type"); - - const int id = msg.readInt16("id1"); - unsigned int id2 = msg.readInt16("id2"); - if (type != 2) - id2 = 1; - - for (int f = 0; f < maxCards; f ++) - cards[f] = msg.readUInt16("card"); - - if (dstBeing == nullptr) - return; - - processBeingChangeLookContinue(msg, dstBeing, type, id, id2, &cards[0]); -} - -void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, - Being *const dstBeing, - const uint8_t type, - const int id, - const int id2, - const int *const cards) -{ - if (dstBeing->getType() == ActorType::Player) - dstBeing->setOtherTime(); - - switch (type) - { - // here should be used SPRITE_* constants - // but for now they conflicting with sprites - // SPRITE_* is same with server LOOK_* - case 0: // change race - dstBeing->setSubtype(fromInt(id, BeingTypeId), - dstBeing->getLook()); - break; - case 1: // eAthena LOOK_HAIR - dstBeing->setHairColor(fromInt(id, ItemColor)); - dstBeing->setHairColorSpriteID(SPRITE_HAIR_COLOR, - id * -1); - break; - case 2: // LOOK_WEAPON Weapon ID in id, Shield ID in id2 - dstBeing->setSpriteCards(SPRITE_BODY, - id, - CardsList(cards)); - dstBeing->setWeaponId(id); - dstBeing->setSpriteId(SPRITE_FLOOR, - id2); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_FLOOR); - break; - case 3: // LOOK_HEAD_BOTTOM - dstBeing->setSpriteCards(SPRITE_WEAPON, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_WEAPON); - break; - case 4: // LOOK_HEAD_TOP Change upper headgear for eAthena, hat for us - dstBeing->setSpriteCards(SPRITE_CLOTHES_COLOR, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_CLOTHES_COLOR); - break; - case 5: // LOOK_HEAD_MID Change middle headgear for eathena, - // armor for us - dstBeing->setSpriteCards(SPRITE_HEAD_BOTTOM, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_HEAD_BOTTOM); - break; - case 6: // eAthena LOOK_HAIR_COLOR - dstBeing->setHairColor(fromInt(id, ItemColor)); - dstBeing->setSpriteColor(SPRITE_HAIR_COLOR, - ItemDB::get(dstBeing->getSpriteID( - SPRITE_HAIR_COLOR)).getDyeColorsString( - fromInt(id, ItemColor))); - break; - case 7: // Clothes color. Now used as look - dstBeing->setLook(CAST_U8(id)); - break; - case 8: // eAthena LOOK_SHIELD - dstBeing->setSpriteCards(SPRITE_FLOOR, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_FLOOR); - break; - case 9: // eAthena LOOK_SHOES - dstBeing->setSpriteCards(SPRITE_HAIR, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_HAIR); - break; - case 10: // LOOK_GLOVES - dstBeing->setSpriteCards(SPRITE_SHOES, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_SHOES); - break; - case 11: // LOOK_FLOOR - dstBeing->setSpriteCards(SPRITE_SHIELD, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_SHIELD); - break; - case 12: // LOOK_ROBE - dstBeing->setSpriteCards(SPRITE_HEAD_TOP, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_HEAD_TOP); - break; - case 13: // COSTUME_HEAD_TOP - dstBeing->setSpriteCards(SPRITE_HEAD_MID, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_HEAD_MID); - break; - case 14: // COSTUME_HEAD_MID - dstBeing->setSpriteCards(SPRITE_ROBE, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_ROBE); - break; - case 15: // COSTUME_HEAD_LOW - dstBeing->setSpriteCards(SPRITE_EVOL2, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL2); - break; - case 16: // COSTUME_GARMENT - dstBeing->setSpriteCards(SPRITE_EVOL3, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL3); - break; - case 17: // ARMOR - dstBeing->setSpriteCards(SPRITE_EVOL4, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL4); - break; - case 18: - dstBeing->setSpriteCards(SPRITE_EVOL5, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL5); - break; - case 19: - dstBeing->setSpriteCards(SPRITE_EVOL6, - id, - CardsList(cards)); - if (localPlayer != nullptr) - localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL6); - break; - default: - UNIMPLEMENTEDPACKETFIELD(type); - break; - } -} - -void BeingRecv::processBeingVisible(Net::MessageIn &msg) -{ - if (actorManager == nullptr) - return; - - // need set type based on id - BeingTypeT type = BeingType::MONSTER; - if (msg.getVersion() >= 20091103) - { - msg.readInt16("len"); - type = static_cast<BeingTypeT>( - msg.readUInt8("object type")); - } - - // Information about a being in range - const BeingId id = msg.readBeingId("being id"); - if (msg.getVersion() >= 20131223) - msg.readBeingId("char id"); - BeingId spawnId; - if (id == Ea::BeingRecv::mSpawnId) - spawnId = Ea::BeingRecv::mSpawnId; - else - spawnId = BeingId_zero; - Ea::BeingRecv::mSpawnId = BeingId_zero; - - int16_t speed = msg.readInt16("speed"); - const uint32_t opt1 = msg.readInt16("opt1"); - // probably wrong effect usage - const uint32_t opt2 = msg.readInt16("opt2"); - uint32_t option; - if (msg.getVersion() >= 20080102) - option = msg.readInt32("option"); - else - option = msg.readInt16("option"); - const int16_t job = msg.readInt16("class"); - - Being *dstBeing = actorManager->findBeing(id); - - if ((dstBeing != nullptr) && dstBeing->getType() == ActorType::Monster - && !dstBeing->isAlive()) - { - actorManager->destroy(dstBeing); - actorManager->erase(dstBeing); - dstBeing = nullptr; - } - - if (dstBeing == nullptr) - { - if (actorManager->isBlocked(id) == true) - return; - - dstBeing = createBeing2(msg, id, job, type); - if (dstBeing == nullptr) - return; - } - else - { - // undeleting marked for deletion being - if (dstBeing->getType() == ActorType::Npc) - actorManager->undelete(dstBeing); - } - - if (dstBeing->getType() == ActorType::Player) - dstBeing->setMoveTime(); - - if (spawnId != BeingId_zero) - { - dstBeing->setAction(BeingAction::SPAWN, 0); - } - else - { - dstBeing->clearPath(); - dstBeing->setActionTime(tick_time); - dstBeing->setAction(BeingAction::STAND, 0); - } - - // Prevent division by 0 when calculating frame - if (speed == 0) - speed = 150; - - dstBeing->setWalkSpeed(speed); - dstBeing->setSubtype(fromInt(job, BeingTypeId), 0); - if (dstBeing->getType() == ActorType::Monster && (localPlayer != nullptr)) - localPlayer->checkNewName(dstBeing); - - const int hairStyle = msg.readInt16("hair style"); - uint32_t weapon; - if (msg.getVersion() >= 7) - weapon = CAST_U32(msg.readInt32("weapon")); - else - weapon = CAST_U32(msg.readInt16("weapon")); - const uint16_t headBottom = msg.readInt16("head bottom"); - if (msg.getVersion() < 7) - msg.readInt16("shield"); - const uint16_t headTop = msg.readInt16("head top"); - const uint16_t headMid = msg.readInt16("head mid"); - const ItemColor hairColor = fromInt(msg.readInt16("hair color"), - ItemColor); - const uint16_t shoes = msg.readInt16("shoes or clothes color?"); - - const uint16_t gloves = msg.readInt16("head dir / gloves"); - // may be use robe as gloves? - if (msg.getVersion() >= 20101124) - msg.readInt16("robe"); - msg.readInt32("guild id"); - msg.readInt16("guild emblem"); - dstBeing->setManner(msg.readInt16("manner")); - uint32_t opt3; - if (msg.getVersion() >= 7) - opt3 = msg.readInt32("opt3"); - else - opt3 = msg.readInt16("opt3"); - dstBeing->setKarma(msg.readUInt8("karma")); - const uint8_t gender = CAST_U8(msg.readUInt8("gender") & 3); - - const ActorTypeT actorType = dstBeing->getType(); - switch (actorType) - { - case ActorType::Player: - dstBeing->setGender(Being::intToGender(gender)); - dstBeing->setHairColor(hairColor); - // Set these after the gender, as the sprites may be gender-specific - if (hairStyle == 0) - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, - 0, - std::string()); - } - else - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, - hairStyle * -1, - ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); - } - dstBeing->updateSprite(SPRITE_WEAPON, headBottom); - dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid); - dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop); - dstBeing->updateSprite(SPRITE_HAIR, shoes); - dstBeing->updateSprite(SPRITE_SHOES, gloves); - dstBeing->updateSprite(SPRITE_BODY, weapon); - dstBeing->setWeaponId(weapon); - break; - case ActorType::Npc: - if (serverFeatures->haveNpcGender()) - { - dstBeing->setGender(Being::intToGender(gender)); - } - break; - default: - case ActorType::Monster: - case ActorType::Portal: - case ActorType::Pet: - case ActorType::Mercenary: - case ActorType::Homunculus: - case ActorType::SkillUnit: - case ActorType::Elemental: - break; - case ActorType::FloorItem: - case ActorType::Avatar: - case ActorType::Unknown: - reportAlways("Wrong being type detected: %d", - CAST_S32(actorType)); - break; - } - - uint8_t dir; - uint16_t x, y; - msg.readCoordinates(x, y, dir, "position"); - msg.readInt8("xs"); - msg.readInt8("ys"); - applyPlayerAction(msg, dstBeing, msg.readUInt8("action type")); - dstBeing->setTileCoords(x, y); - - if (job == 45 && (socialWindow != nullptr) && (outfitWindow != nullptr)) - { - const int num = socialWindow->getPortalIndex(x, y); - if (num >= 0) - { - dstBeing->setName(KeyboardConfig::getKeyShortString( - OutfitWindow::keyName(num))); - } - else - { - dstBeing->setName(""); - } - } - - dstBeing->setDirection(dir); - - const int level = CAST_S32(msg.readInt16("level")); - if (level != 0) - dstBeing->setLevel(level); - if (msg.getVersion() >= 20080102) - msg.readInt16("font"); - - if (msg.getVersion() >= 20120221) - { - const int maxHP = msg.readInt32("max hp"); - const int hp = msg.readInt32("hp"); - dstBeing->setMaxHP(maxHP); - dstBeing->setHP(hp); - msg.readInt8("is boss"); - } - - if (serverVersion == 0 || - serverVersion >= 16) - { - if (msg.getVersion() >= 20150513) - { - msg.readInt16("body2"); - } - if (msg.getVersion() >= 20131223) - { - msg.readString(24, "name"); - } - } - else - { - if (msg.getVersion() >= 20150513) - { - msg.readInt16("body2"); - msg.readString(24, "name"); - } - } - - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2, - opt3); -} - -void BeingRecv::processBeingMove(Net::MessageIn &msg) -{ - if (actorManager == nullptr) - return; - - if (msg.getVersion() >= 20091103) - msg.readInt16("len"); - BeingTypeT type; - if (msg.getVersion() >= 20071106) - { - type = static_cast<BeingTypeT>( - msg.readUInt8("object type")); - } - else - { - // need detect type based on id - type = BeingType::MONSTER; - } - - // Information about a being in range - const BeingId id = msg.readBeingId("being id"); - if (msg.getVersion() >= 20131223) - msg.readBeingId("char id"); - BeingId spawnId; - if (id == Ea::BeingRecv::mSpawnId) - spawnId = Ea::BeingRecv::mSpawnId; - else - spawnId = BeingId_zero; - Ea::BeingRecv::mSpawnId = BeingId_zero; - int16_t speed = msg.readInt16("speed"); - const uint32_t opt1 = msg.readInt16("opt1"); - // probably wrong effect usage - const uint32_t opt2 = msg.readInt16("opt2"); - uint32_t option; - if (msg.getVersion() >= 7) - option = msg.readInt32("option"); - else - option = msg.readInt16("option"); - const int16_t job = msg.readInt16("class"); - - Being *dstBeing = actorManager->findBeing(id); - - if ((dstBeing != nullptr) && dstBeing->getType() == ActorType::Monster - && !dstBeing->isAlive()) - { - actorManager->destroy(dstBeing); - actorManager->erase(dstBeing); - dstBeing = nullptr; - } - - if (dstBeing == nullptr) - { - if (actorManager->isBlocked(id) == true) - return; - - dstBeing = createBeing2(msg, id, job, type); - if (dstBeing == nullptr) - return; - } - else - { - // undeleting marked for deletion being - if (dstBeing->getType() == ActorType::Npc) - actorManager->undelete(dstBeing); - } - - if (dstBeing->getType() == ActorType::Player) - dstBeing->setMoveTime(); - - if (spawnId != BeingId_zero) - dstBeing->setAction(BeingAction::SPAWN, 0); - - // Prevent division by 0 when calculating frame - if (speed == 0) - speed = 150; - - dstBeing->setWalkSpeed(speed); - dstBeing->setSubtype(fromInt(job, BeingTypeId), 0); - if (dstBeing->getType() == ActorType::Monster && (localPlayer != nullptr)) - localPlayer->checkNewName(dstBeing); - - const int hairStyle = msg.readInt16("hair style"); - uint32_t weapon; - if (msg.getVersion() >= 7) - weapon = CAST_U32(msg.readInt32("weapon")); - else - weapon = CAST_U32(msg.readInt16("weapon")); - const uint16_t headBottom = msg.readInt16("head bottom"); - msg.readInt32("tick"); - if (msg.getVersion() < 7) - msg.readInt16("shield"); - const uint16_t headTop = msg.readInt16("head top"); - const uint16_t headMid = msg.readInt16("head mid"); - const ItemColor hairColor = fromInt( - msg.readInt16("hair color"), ItemColor); - const uint16_t shoes = msg.readInt16("shoes or clothes color?"); - - const uint16_t gloves = msg.readInt16("head dir / gloves"); - // may be use robe as gloves? - if (msg.getVersion() >= 20101124) - msg.readInt16("robe"); - msg.readInt32("guild id"); - msg.readInt16("guild emblem"); - dstBeing->setManner(msg.readInt16("manner")); - uint32_t opt3; - if (msg.getVersion() >= 7) - opt3 = msg.readInt32("opt3"); - else - opt3 = msg.readInt16("opt3"); - dstBeing->setKarma(msg.readUInt8("karma")); - const uint8_t gender = CAST_U8(msg.readUInt8("gender") & 3); - - const ActorTypeT actorType = dstBeing->getType(); - switch (actorType) - { - case ActorType::Player: - dstBeing->setGender(Being::intToGender(gender)); - dstBeing->setHairColor(hairColor); - // Set these after the gender, as the sprites may be gender-specific - if (hairStyle == 0) - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, 0); - } - else - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, - hairStyle * -1, - ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); - } - if (!serverFeatures->haveMove3()) - { - dstBeing->updateSprite(SPRITE_WEAPON, headBottom); - dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid); - dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop); - dstBeing->updateSprite(SPRITE_HAIR, shoes); - dstBeing->updateSprite(SPRITE_SHOES, gloves); - dstBeing->updateSprite(SPRITE_BODY, weapon); - dstBeing->setWeaponId(weapon); - } - break; - case ActorType::Npc: - if (serverFeatures->haveNpcGender()) - { - dstBeing->setGender(Being::intToGender(gender)); - } - break; - default: - case ActorType::Monster: - case ActorType::Portal: - case ActorType::Pet: - case ActorType::Mercenary: - case ActorType::Homunculus: - case ActorType::SkillUnit: - case ActorType::Elemental: - break; - case ActorType::FloorItem: - case ActorType::Avatar: - case ActorType::Unknown: - reportAlways("Wrong being type detected: %d", - CAST_S32(actorType)); - break; - } - - uint16_t srcX, srcY, dstX, dstY; - msg.readCoordinatePair(srcX, srcY, dstX, dstY, "move path"); - msg.readUInt8("(sx<<4) | (sy&0x0f)"); - msg.readInt8("xs"); - msg.readInt8("ys"); - dstBeing->setAction(BeingAction::STAND, 0); - dstBeing->setTileCoords(srcX, srcY); - if (localPlayer != nullptr) - localPlayer->followMoveTo(dstBeing, srcX, srcY, dstX, dstY); - if (serverFeatures->haveMove3()) - dstBeing->setCachedDestination(dstX, dstY); - else - dstBeing->setDestination(dstX, dstY); - - // because server don't send direction in move packet, we fixing it - - uint8_t d = 0; - if (localPlayer != nullptr && - srcX == dstX && - srcY == dstY) - { // if player did one step from invisible area to visible, - // move path is broken - int x2 = localPlayer->getTileX(); - int y2 = localPlayer->getTileY(); - if (abs(x2 - srcX) > abs(y2 - srcY)) - y2 = srcY; - else - x2 = srcX; - d = dstBeing->calcDirection(x2, y2); - } - else - { - d = dstBeing->calcDirection(dstX, dstY); - } - if ((d != 0u) && dstBeing->getDirection() != d) - dstBeing->setDirection(d); - - const int level = CAST_S32(msg.readInt16("level")); - if (level != 0) - dstBeing->setLevel(level); - if (msg.getVersion() >= 20080102) - msg.readInt16("font"); - if (msg.getVersion() >= 20120221) - { - const int maxHP = msg.readInt32("max hp"); - const int hp = msg.readInt32("hp"); - dstBeing->setMaxHP(maxHP); - dstBeing->setHP(hp); - msg.readInt8("is boss"); - } - if (serverVersion == 0 || - serverVersion >= 16) - { - if (msg.getVersion() >= 20150513) - { - msg.readInt16("body2"); - } - if (msg.getVersion() >= 20131223) - { - msg.readString(24, "name"); - } - } - else - { - if (msg.getVersion() >= 20150513) - { - msg.readInt16("body2"); - msg.readString(24, "name"); - } - } - - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2, - opt3); -} - -void BeingRecv::processBeingSpawn(Net::MessageIn &msg) -{ - if (actorManager == nullptr) - return; - - // need get type from id - BeingTypeT type = BeingType::MONSTER; - if (msg.getVersion() >= 20091103) - { - msg.readInt16("len"); - type = static_cast<BeingTypeT>( - msg.readUInt8("object type")); - } - - // Information about a being in range - const BeingId id = msg.readBeingId("being id"); - if (msg.getVersion() >= 20131223) - { - msg.readBeingId("char id"); - } - Ea::BeingRecv::mSpawnId = id; - const BeingId spawnId = id; - int16_t speed = msg.readInt16("speed"); - const uint32_t opt1 = msg.readInt16("opt1"); - // probably wrong effect usage - const uint32_t opt2 = msg.readInt16("opt2"); - uint32_t option; - if (msg.getVersion() >= 20080102) - option = msg.readInt32("option"); - else - option = msg.readInt16("option"); - const int16_t job = msg.readInt16("class"); - - Being *dstBeing = actorManager->findBeing(id); - - if ((dstBeing != nullptr) && dstBeing->getType() == ActorType::Monster - && !dstBeing->isAlive()) - { - actorManager->destroy(dstBeing); - actorManager->erase(dstBeing); - dstBeing = nullptr; - } - - if (dstBeing == nullptr) - { - if (actorManager->isBlocked(id) == true) - return; - - dstBeing = createBeing2(msg, id, job, type); - if (dstBeing == nullptr) - return; - } - else - { - // undeleting marked for deletion being - if (dstBeing->getType() == ActorType::Npc) - actorManager->undelete(dstBeing); - } - - if (dstBeing->getType() == ActorType::Player) - dstBeing->setMoveTime(); - - if (spawnId != BeingId_zero) - dstBeing->setAction(BeingAction::SPAWN, 0); - - // Prevent division by 0 when calculating frame - if (speed == 0) - speed = 150; - - dstBeing->setWalkSpeed(speed); - dstBeing->setSubtype(fromInt(job, BeingTypeId), 0); - if (dstBeing->getType() == ActorType::Monster && (localPlayer != nullptr)) - localPlayer->checkNewName(dstBeing); - - const int hairStyle = msg.readInt16("hair style"); - uint32_t weapon; - if (msg.getVersion() >= 7) - weapon = CAST_U32(msg.readInt32("weapon")); - else - weapon = CAST_U32(msg.readInt16("weapon")); - const uint16_t headBottom = msg.readInt16("head bottom"); - if (msg.getVersion() < 7) - msg.readInt16("shield"); - const uint16_t headTop = msg.readInt16("head top"); - const uint16_t headMid = msg.readInt16("head mid"); - const ItemColor hairColor = fromInt( - msg.readInt16("hair color"), ItemColor); - const uint16_t shoes = msg.readInt16("shoes or clothes color?"); - const uint16_t gloves = msg.readInt16("head dir / gloves"); - // may be use robe as gloves? - if (msg.getVersion() >= 20101124) - msg.readInt16("robe"); - msg.readInt32("guild id"); - msg.readInt16("guild emblem"); - dstBeing->setManner(msg.readInt16("manner")); - uint32_t opt3; - if (msg.getVersion() >= 7) - opt3 = msg.readInt32("opt3"); - else - opt3 = msg.readInt16("opt3"); - - dstBeing->setKarma(msg.readUInt8("karma")); - const uint8_t gender = CAST_U8(msg.readUInt8("gender") & 3); - - const ActorTypeT actorType = dstBeing->getType(); - switch (actorType) - { - case ActorType::Player: - dstBeing->setGender(Being::intToGender(gender)); - dstBeing->setHairColor(hairColor); - // Set these after the gender, as the sprites may be gender-specific - if (hairStyle == 0) - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, 0); - } - else - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, - hairStyle * -1, - ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); - } - dstBeing->updateSprite(SPRITE_WEAPON, headBottom); - dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid); - dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop); - dstBeing->updateSprite(SPRITE_HAIR, shoes); - dstBeing->updateSprite(SPRITE_SHOES, gloves); - dstBeing->updateSprite(SPRITE_BODY, weapon); - dstBeing->setWeaponId(weapon); - break; - case ActorType::Npc: - if (serverFeatures->haveNpcGender()) - { - dstBeing->setGender(Being::intToGender(gender)); - } - break; - default: - case ActorType::Monster: - case ActorType::Portal: - case ActorType::Pet: - case ActorType::Mercenary: - case ActorType::Homunculus: - case ActorType::SkillUnit: - case ActorType::Elemental: - break; - case ActorType::FloorItem: - case ActorType::Avatar: - case ActorType::Unknown: - reportAlways("Wrong being type detected: %d", - CAST_S32(actorType)); - break; - } - - uint8_t dir; - uint16_t x, y; - msg.readCoordinates(x, y, dir, "position"); - msg.readInt8("xs"); - msg.readInt8("ys"); - dstBeing->setTileCoords(x, y); - - if (job == 45 && (socialWindow != nullptr) && (outfitWindow != nullptr)) - { - const int num = socialWindow->getPortalIndex(x, y); - if (num >= 0) - { - dstBeing->setName(KeyboardConfig::getKeyShortString( - OutfitWindow::keyName(num))); - } - else - { - dstBeing->setName(""); - } - } - - dstBeing->setDirection(dir); - - const int level = CAST_S32(msg.readInt16("level")); - if (level != 0) - dstBeing->setLevel(level); - if (msg.getVersion() >= 20080102) - msg.readInt16("font"); - if (msg.getVersion() >= 20120221) - { - const int maxHP = msg.readInt32("max hp"); - const int hp = msg.readInt32("hp"); - dstBeing->setMaxHP(maxHP); - dstBeing->setHP(hp); - msg.readInt8("is boss"); - } - if (serverVersion == 0 || - serverVersion >= 16) - { - if (msg.getVersion() >= 20150513) - { - msg.readInt16("body2"); - } - if (msg.getVersion() >= 20131223) - { - msg.readString(24, "name"); - } - } - else - { - if (msg.getVersion() >= 20150513) - { - msg.readInt16("body2"); - msg.readString(24, "name"); - } - } - - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2, - opt3); -} - -void BeingRecv::processMapTypeProperty(Net::MessageIn &msg) -{ - const int16_t type = msg.readInt16("type"); - const int flags = msg.readInt32("flags"); - if (type == 0x28) - { - // +++ need get other flags from here - MapTypeProperty2 props; - props.data = CAST_U32(flags); - const Game *const game = Game::instance(); - if (game == nullptr) - return; - Map *const map = game->getCurrentMap(); - if (map == nullptr) - return; - map->setPvpMode(props.bits.party | (props.bits.guild * 2)); - } -} - -void BeingRecv::processMapType(Net::MessageIn &msg) -{ - const int16_t type = msg.readInt16("type"); - if (type == 19) - NotifyManager::notify(NotifyTypes::MAP_TYPE_BATTLEFIELD); - else - UNIMPLEMENTEDPACKETFIELD(type); -} - -void BeingRecv::processSkillCasting(Net::MessageIn &msg) -{ - const BeingId srcId = msg.readBeingId("src id"); - const BeingId dstId = msg.readBeingId("dst id"); - const int dstX = msg.readInt16("dst x"); - const int dstY = msg.readInt16("dst y"); - const int skillId = msg.readInt16("skill id"); - msg.readInt32("property"); // can be used to trigger effect - const int castTime = msg.readInt32("cast time"); - if (msg.getVersion() >= 20091124) - msg.readInt8("dispossable"); - - processSkillCastingContinue(msg, - srcId, dstId, - dstX, dstY, - skillId, - 1, - 0, - SkillType2::Unknown, - castTime); -} - -void BeingRecv::processSkillCasting2(Net::MessageIn &msg) -{ - msg.readInt16("len"); // for now unused - const BeingId srcId = msg.readBeingId("src id"); - const BeingId dstId = msg.readBeingId("dst id"); - const int dstX = msg.readInt16("dst x"); - const int dstY = msg.readInt16("dst y"); - const int skillId = msg.readInt16("skill id"); - const int skillLevel = msg.readInt16("skill level"); - msg.readInt32("property"); // can be used to trigger effect - const int castTime = msg.readInt32("cast time"); - const int range = msg.readInt32("skill range"); - const SkillType2::SkillType2 inf2 = - static_cast<SkillType2::SkillType2>(msg.readInt32("inf2")); - - processSkillCastingContinue(msg, - srcId, dstId, - dstX, dstY, - skillId, - skillLevel, - range, - inf2, - castTime); -} - -void BeingRecv::processSkillCastingContinue(Net::MessageIn &msg, - const BeingId srcId, - const BeingId dstId, - const int dstX, - const int dstY, - const int skillId, - const int skillLevel, - const int range, - const SkillType2::SkillType2 inf2, - const int castTime) -{ - if (effectManager == nullptr) - return; - - if (srcId == BeingId_zero) - { - UNIMPLEMENTEDPACKETFIELD(0); - return; - } - Being *const srcBeing = actorManager->findBeing(srcId); - if (dstId != BeingId_zero) - { // being to being - Being *const dstBeing = actorManager->findBeing(dstId); - if (srcBeing != nullptr) - { - srcBeing->handleSkillCasting(dstBeing, skillId, skillLevel); - if (dstBeing != nullptr) - { - srcBeing->addCast(dstBeing->getTileX(), - dstBeing->getTileY(), - skillId, - skillLevel, - range, - castTime / MILLISECONDS_IN_A_TICK); - } - } - } - else if (dstX != 0 || dstY != 0) - { // being to position - if (srcBeing != nullptr) - srcBeing->setAction(BeingAction::CAST, skillId); - skillDialog->playCastingDstTileEffect(skillId, - skillLevel, - dstX, dstY, - castTime); - if (srcBeing != nullptr) - { - srcBeing->addCast(dstX, dstY, - skillId, - skillLevel, - range, - castTime / MILLISECONDS_IN_A_TICK); - } - } - if ((localPlayer != nullptr) && - srcBeing == localPlayer && - (inf2 & SkillType2::FreeCastAny) == 0) - { - localPlayer->freezeMoving(castTime / MILLISECONDS_IN_A_TICK); - } -} - -void BeingRecv::processBeingStatusChange(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingStatusChange") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processBeingStatusChange") - return; - } - - // Status change - const uint16_t status = msg.readInt16("status"); - const BeingId id = msg.readBeingId("being id"); - const Enable flag = fromBool( - msg.readUInt8("flag: 0: stop, 1: start"), Enable); - if (msg.getVersion() >= 20120618) - msg.readInt32("total"); - if (msg.getVersion() >= 20090121) - { - msg.readInt32("left"); - msg.readInt32("val1"); - msg.readInt32("val2"); - msg.readInt32("val3"); - } - - const IsStart start = msg.getVersion() == 20090121 ? - IsStart_false : IsStart_true; - - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing != nullptr) - dstBeing->setStatusEffect(status, flag, start); - BLOCK_END("BeingRecv::processBeingStatusChange") -} - -void BeingRecv::processBeingMove2(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingMove2") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processBeingMove2") - return; - } - - /* - * A simplified movement packet, used by the - * later versions of eAthena for both mobs and - * players - */ - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - - uint16_t srcX, srcY, dstX, dstY; - msg.readCoordinatePair(srcX, srcY, dstX, dstY, "move path"); - msg.readUInt8("(sx<<4) | (sy&0x0f)"); - msg.readInt32("tick"); - - /* - * This packet doesn't have enough info to actually - * create a new being, so if the being isn't found, - * we'll just pretend the packet didn't happen - */ - - if (dstBeing == nullptr) - { - BLOCK_END("BeingRecv::processBeingMove2") - return; - } - - dstBeing->setTileCoords(srcX, srcY); - if (localPlayer != nullptr) - localPlayer->followMoveTo(dstBeing, srcX, srcY, dstX, dstY); - if (serverFeatures->haveMove3()) - dstBeing->setCachedDestination(dstX, dstY); - else - dstBeing->setDestination(dstX, dstY); - if (dstBeing->getType() == ActorType::Player) - dstBeing->setMoveTime(); - BLOCK_END("BeingRecv::processBeingMove2") -} - -void BeingRecv::processBeingAction2(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingAction2") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processBeingAction2") - return; - } - - Being *const srcBeing = actorManager->findBeing( - msg.readBeingId("src being id")); - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("dst being id")); - - msg.readInt32("tick"); - const int srcSpeed = msg.readInt32("src speed"); - msg.readInt32("dst speed"); - int param1; - if (msg.getVersion() >= 20071113) - param1 = msg.readInt32("damage"); - else - param1 = msg.readInt16("damage"); - if (msg.getVersion() >= 20131223) - msg.readUInt8("is sp damaged"); - msg.readInt16("count"); - const AttackTypeT type = static_cast<AttackTypeT>( - msg.readUInt8("action")); - if (msg.getVersion() >= 20071113) - msg.readInt32("left damage"); - else - msg.readInt16("left damage"); - - switch (type) - { - case AttackType::HIT: // Damage - case AttackType::CRITICAL: // Critical Damage - case AttackType::MULTI: // Critical Damage - case AttackType::MULTI_REFLECT: - case AttackType::REFLECT: // Reflected Damage - case AttackType::FLEE: // Lucky Dodge - case AttackType::SPLASH: - case AttackType::SKILL: - case AttackType::REPEATE: - if (srcBeing != nullptr) - { - if (srcSpeed != 0 && srcBeing->getType() == ActorType::Player) - srcBeing->setAttackDelay(srcSpeed); - // attackid=1, type - srcBeing->handleAttack(dstBeing, param1, 1); - if (srcBeing->getType() == ActorType::Player) - srcBeing->setAttackTime(); - } - if (dstBeing != nullptr) - { - // level not present, using 1 - dstBeing->takeDamage(srcBeing, param1, - static_cast<AttackTypeT>(type), 1); - } - break; - - case AttackType::PICKUP: - break; - - case AttackType::TOUCH_SKILL: - break; - - case AttackType::SIT: - if (srcBeing != nullptr) - { - srcBeing->setAction(BeingAction::SIT, 0); - if (srcBeing->getType() == ActorType::Player) - { - srcBeing->setMoveTime(); - if (localPlayer != nullptr) - localPlayer->imitateAction(srcBeing, BeingAction::SIT); - } - } - break; - - case AttackType::STAND: - if (srcBeing != nullptr) - { - srcBeing->setAction(BeingAction::STAND, 0); - if (srcBeing->getType() == ActorType::Player) - { - srcBeing->setMoveTime(); - if (localPlayer != nullptr) - { - localPlayer->imitateAction(srcBeing, - BeingAction::STAND); - } - } - } - break; - default: - case AttackType::MISS: - case AttackType::SKILLMISS: - UNIMPLEMENTEDPACKETFIELD(CAST_S32(type)); - break; - } - BLOCK_END("BeingRecv::processBeingAction2") -} - -void BeingRecv::processBeingHp(Net::MessageIn &msg) -{ - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - int hp; - int maxHP; - if (msg.getVersion() >= 20100126) - { - hp = msg.readInt32("hp"); - maxHP = msg.readInt32("max hp"); - } - else - { - hp = msg.readInt16("hp"); - maxHP = msg.readInt16("max hp"); - } - if (dstBeing != nullptr) - { - dstBeing->setHP(hp); - dstBeing->setMaxHP(maxHP); - } -} - -void BeingRecv::processMonsterHp(Net::MessageIn &msg) -{ - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("monster id")); - const int hp = msg.readInt32("hp"); - const int maxHP = msg.readInt32("max hp"); - if (dstBeing != nullptr) - { - dstBeing->setHP(hp); - dstBeing->setMaxHP(maxHP); - } -} - -void BeingRecv::processSkillAutoCast(Net::MessageIn &msg) -{ - const int id = msg.readInt16("skill id"); - msg.readInt16("inf"); - msg.readInt16("unused"); - const int level = msg.readInt16("skill level"); - msg.readInt16("sp"); - msg.readInt16("range"); - msg.readString(24, "skill name"); - msg.readInt8("unused"); - - if (localPlayer != nullptr) - { - localPlayer->handleSkill(localPlayer, 0, id, level); - localPlayer->takeDamage(localPlayer, 0, AttackType::SKILL, id, level); - } -} - -void BeingRecv::processRanksList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // +++ here need window with rank tables. - msg.readInt16("rank type"); - for (int f = 0; f < 10; f ++) - msg.readString(24, "name"); - for (int f = 0; f < 10; f ++) - msg.readInt32("points"); - msg.readInt32("my points"); -} - -void BeingRecv::processBlacksmithRanksList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // +++ here need window with rank tables. - for (int f = 0; f < 10; f ++) - msg.readString(24, "name"); - for (int f = 0; f < 10; f ++) - msg.readInt32("points"); -} - -void BeingRecv::processAlchemistRanksList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // +++ here need window with rank tables. - for (int f = 0; f < 10; f ++) - msg.readString(24, "name"); - for (int f = 0; f < 10; f ++) - msg.readInt32("points"); -} - -void BeingRecv::processTaekwonRanksList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // +++ here need window with rank tables. - for (int f = 0; f < 10; f ++) - msg.readString(24, "name"); - for (int f = 0; f < 10; f ++) - msg.readInt32("points"); -} - -void BeingRecv::processPkRanksList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // +++ here need window with rank tables. - for (int f = 0; f < 10; f ++) - msg.readString(24, "name"); - for (int f = 0; f < 10; f ++) - msg.readInt32("points"); -} - -void BeingRecv::processBeingChangeDirection(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingChangeDirection") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processBeingChangeDirection") - return; - } - - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - - msg.readInt16("head direction"); - - const uint8_t dir = Net::MessageIn::fromServerDirection( - CAST_U8(msg.readUInt8("player direction") & 0x0FU)); - - if (dstBeing == nullptr) - { - BLOCK_END("BeingRecv::processBeingChangeDirection") - return; - } - - dstBeing->setDirection(dir); - if (localPlayer != nullptr) - localPlayer->imitateDirection(dstBeing, dir); - BLOCK_END("BeingRecv::processBeingChangeDirection") -} - -void BeingRecv::processBeingSpecialEffect(Net::MessageIn &msg) -{ - if ((effectManager == nullptr) || (actorManager == nullptr)) - return; - - const BeingId id = msg.readBeingId("being id"); - Being *const being = actorManager->findBeing(id); - if (being == nullptr) - return; - - const int effectType = msg.readInt32("effect type"); - - if (ParticleEngine::enabled) - effectManager->trigger(effectType, being); - - // +++ need dehard code effectType == 3 - if (effectType == 3 && being->getType() == ActorType::Player - && (socialWindow != nullptr)) - { // reset received damage - socialWindow->resetDamage(being->getName()); - } -} - -void BeingRecv::processBeingSpecialEffectNum(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // +++ need somhow show this effects. - // type is not same with self/misc effect. - msg.readBeingId("account id"); - msg.readInt32("effect type"); - msg.readInt32("num"); // effect variable -} - -void BeingRecv::processBeingSoundEffect(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // +++ need play this effect. - msg.readString(24, "sound effect name"); - msg.readUInt8("type"); - msg.readInt32("unused"); - msg.readInt32("source being id"); -} - -void BeingRecv::processSkillGroundNoDamage(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("skill id"); - msg.readInt32("src id"); - msg.readInt16("val"); - msg.readInt16("x"); - msg.readInt16("y"); - msg.readInt32("tick"); -} - -void BeingRecv::processSkillEntry(Net::MessageIn &msg) -{ - if (msg.getVersion() >= 20110718) - msg.readInt16("len"); - const BeingId id = msg.readBeingId("skill unit id"); - const BeingId creatorId = msg.readBeingId("creator accound id"); - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - int job = 0; - if (msg.getVersion() >= 20121212) - job = msg.readInt32("job"); - if (msg.getVersion() >= 20110718) - msg.readUInt8("radius"); - msg.readUInt8("visible"); - int level = 0; - if (msg.getVersion() >= 20130731) - level = msg.readUInt8("level"); - Being *const dstBeing = createBeing2(msg, - id, - job, - BeingType::SKILL); - if (dstBeing == nullptr) - return; - dstBeing->setAction(BeingAction::STAND, 0); - dstBeing->setTileCoords(x, y); - dstBeing->setLevel(level); - dstBeing->setCreatorId(creatorId); -} - -void BeingRecv::processPlayerStatusChange(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processPlayerStop") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processPlayerStop") - return; - } - - // Change in players' flags - const BeingId id = msg.readBeingId("account id"); - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing == nullptr) - { - msg.readInt16("opt1"); - msg.readInt16("opt2"); - if (msg.getVersion() >= 7) - msg.readInt32("option"); - else - msg.readInt16("option"); - msg.readUInt8("karma"); - return; - } - - const uint32_t opt1 = msg.readInt16("opt1"); - const uint32_t opt2 = msg.readInt16("opt2"); - uint32_t option; - if (msg.getVersion() >= 7) - option = msg.readInt32("option"); - else - option = msg.readInt16("option"); - dstBeing->setKarma(msg.readUInt8("karma")); - - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2); - BLOCK_END("BeingRecv::processPlayerStop") -} - -void BeingRecv::processPlayerStatusChange2(Net::MessageIn &msg) -{ - if (actorManager == nullptr) - return; - - // look like this function unused on server - - const BeingId id = msg.readBeingId("account id"); - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing == nullptr) - return; - - const uint32_t option = msg.readInt32("option"); - dstBeing->setLevel(msg.readInt32("level")); - msg.readInt32("showEFST"); - dstBeing->setStatusEffectOpiton0(option); -} - -void BeingRecv::processBeingResurrect(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingResurrect") - if (actorManager == nullptr || - localPlayer == nullptr) - { - BLOCK_END("BeingRecv::processBeingResurrect") - return; - } - - // A being changed mortality status - - const BeingId id = msg.readBeingId("being id"); - msg.readInt16("unused"); - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing == nullptr) - { - DEBUGLOGSTR("insible player?"); - BLOCK_END("BeingRecv::processBeingResurrect") - return; - } - - // If this is player's current target, clear it. - if (dstBeing == localPlayer->getTarget()) - localPlayer->stopAttack(); - if (dstBeing == localPlayer && - deathNotice != nullptr) - { - deathNotice->scheduleDelete(); - deathNotice = nullptr; - } - - dstBeing->setAction(BeingAction::STAND, 0); - BLOCK_END("BeingRecv::processBeingResurrect") -} - -void BeingRecv::processPlayerGuilPartyInfo(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processPlayerGuilPartyInfo") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processPlayerGuilPartyInfo") - return; - } - - const BeingId beingId = msg.readBeingId("being id"); - const std::string name = msg.readString(24, "char name"); - actorManager->updateNameId(name, beingId); - Being *const dstBeing = actorManager->findBeing(beingId); - if (dstBeing != nullptr) - { - if (beingId == localPlayer->getId()) - { - localPlayer->pingResponse(); - } - dstBeing->setName(name); - dstBeing->setPartyName(msg.readString(24, "party name")); - dstBeing->setGuildName(msg.readString(24, "guild name")); - dstBeing->setGuildPos(msg.readString(24, "guild pos")); - dstBeing->addToCache(); - } - else - { - msg.readString(24, "party name"); - msg.readString(24, "guild name"); - msg.readString(24, "guild pos"); - } - BLOCK_END("BeingRecv::processPlayerGuilPartyInfo") -} - -void BeingRecv::processBeingRemoveSkill(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("skill unit id"); - if (actorManager == nullptr) - return; - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing == nullptr) - return; - actorManager->destroy(dstBeing); -} - -void BeingRecv::processBeingFakeName(Net::MessageIn &msg) -{ - uint16_t x, y; - uint8_t dir; - if (msg.getVersion() < 20071106) - { - msg.readBeingId("npc id"); - msg.skip(8, "unused"); - msg.readInt16("class?"); // 111 - msg.skip(30, "unused"); - msg.readCoordinates(x, y, dir, "position"); - msg.readUInt8("sx"); - msg.readUInt8("sy"); - msg.skip(3, "unused"); - return; - } - const BeingTypeT type = static_cast<BeingTypeT>( - msg.readUInt8("object type")); - const BeingId id = msg.readBeingId("npc id"); - msg.skip(8, "unused"); - const uint16_t job = msg.readInt16("class?"); // 111 - msg.skip(30, "unused"); - msg.readCoordinates(x, y, dir, "position"); - msg.readUInt8("sx"); - msg.readUInt8("sy"); - msg.skip(3, "unused"); - - Being *const dstBeing = createBeing2(msg, id, job, type); - if (dstBeing == nullptr) - return; - dstBeing->setSubtype(fromInt(job, BeingTypeId), 0); - dstBeing->setTileCoords(x, y); - dstBeing->setDirection(dir); -} - -void BeingRecv::processBeingStatUpdate1(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("account id"); - const int type = msg.readInt16("type"); - const int value = msg.readInt32("value"); - - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing == nullptr) - return; - - if (type != Sp::MANNER) - { - UNIMPLEMENTEDPACKETFIELD(type); - return; - } - dstBeing->setManner(value); -} - -void BeingRecv::processBeingSelfEffect(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingSelfEffect") - if ((effectManager == nullptr) || (actorManager == nullptr)) - { - BLOCK_END("BeingRecv::processBeingSelfEffect") - return; - } - - const BeingId id = msg.readBeingId("being id"); - Being *const being = actorManager->findBeing(id); - if (being == nullptr) - { - DEBUGLOGSTR("insible player?"); - msg.readInt32("effect type"); - BLOCK_END("BeingRecv::processBeingSelfEffect") - return; - } - - const int effectType = msg.readInt32("effect type"); - if (ParticleEngine::enabled) - effectManager->trigger(effectType, being); - - BLOCK_END("BeingRecv::processBeingSelfEffect") -} - -void BeingRecv::processMobInfo(Net::MessageIn &msg) -{ - const int len = msg.readInt16("len"); - if (len < 12) - return; - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("monster id")); - const int attackRange = msg.readInt32("range"); - if (dstBeing != nullptr) - dstBeing->setAttackRange(attackRange); -} - -void BeingRecv::processBeingAttrs(Net::MessageIn &msg) -{ - const int len = msg.readInt16("len"); - if (len < 14) - return; - - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("player id")); - const int groupId = msg.readInt32("group id"); - uint16_t mount = 0; - mount = msg.readInt16("mount"); - int language = -1; - if (serverVersion >= 17 && len > 14) - language = msg.readInt16("language"); - if (dstBeing != nullptr) - { - if (serverVersion <= 17 || - dstBeing != localPlayer) - { - dstBeing->setGroupId(groupId); - if (groupId != 0) - dstBeing->setGM(true); - else - dstBeing->setGM(false); - } - dstBeing->setHorse(mount); - dstBeing->setLanguageId(language); - if (dstBeing == localPlayer) - PlayerInfo::setServerLanguage(language); - } -} - -void BeingRecv::processMonsterInfo(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readInt16("class"); - msg.readInt16("level"); - msg.readInt16("size"); - msg.readInt32("hp"); - msg.readInt16("def"); - msg.readInt16("race"); - msg.readInt16("mdef"); - msg.readInt16("ele"); -} - -void BeingRecv::processClassChange(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readBeingId("being id"); - msg.readUInt8("type"); - msg.readInt32("class"); -} - -void BeingRecv::processSpiritBalls(Net::MessageIn &msg) -{ - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - const int balls = msg.readInt16("spirits amount"); - if (dstBeing != nullptr) - dstBeing->setSpiritBalls(balls); -} - -void BeingRecv::processBladeStop(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readInt32("src being id"); - msg.readInt32("dst being id"); - msg.readInt32("flag"); -} - -void BeingRecv::processComboDelay(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readBeingId("being id"); - msg.readInt32("wait"); -} - -void BeingRecv::processWddingEffect(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readBeingId("being id"); -} - -void BeingRecv::processBeingSlide(Net::MessageIn &msg) -{ - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - if (dstBeing == nullptr) - return; - if (localPlayer == dstBeing) - { - localPlayer->stopAttack(); - localPlayer->navigateClean(); - if (viewport != nullptr) - viewport->returnCamera(); - } - - dstBeing->setAction(BeingAction::STAND, 0); - dstBeing->setTileCoords(x, y); -} - -void BeingRecv::processStarsKill(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readString(24, "map name"); - msg.readInt32("monster id"); - msg.readUInt8("start"); - msg.readUInt8("result"); -} - -void BeingRecv::processGladiatorFeelRequest(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readUInt8("which"); -} - -void BeingRecv::processBossMapInfo(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readUInt8("info type"); - msg.readInt32("x"); - msg.readInt32("y"); - msg.readInt16("min hours"); - msg.readInt16("min minutes"); - msg.readInt16("max hours"); - msg.readInt16("max minutes"); - msg.readString(24, "monster name"); // really can be used 51 byte? -} - -void BeingRecv::processBeingFont(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readBeingId("account id"); - msg.readInt16("font"); -} - -void BeingRecv::processBeingMilleniumShield(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readBeingId("account id"); - msg.readInt16("shields"); - msg.readInt16("unused"); -} - -void BeingRecv::processBeingCharm(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readBeingId("account id"); - msg.readInt16("charm type"); - msg.readInt16("charm count"); -} - -void BeingRecv::processBeingViewEquipment(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - const int count = (msg.readInt16("len") - 45) / 31; - msg.readString(24, "name"); - msg.readInt16("job"); - msg.readInt16("head"); - msg.readInt16("accessory"); - msg.readInt16("accessory2"); - msg.readInt16("accessory3"); - if (msg.getVersion() >= 20101124) - msg.readInt16("robe"); - msg.readInt16("hair color"); - msg.readInt16("body color"); - msg.readUInt8("gender"); - for (int f = 0; f < count; f ++) - { - msg.readInt16("index"); - msg.readInt16("item id"); - msg.readUInt8("item type"); - msg.readInt32("location"); - msg.readInt32("wear state"); - msg.readInt8("refine"); - for (int d = 0; d < maxCards; d ++) - msg.readUInt16("card"); - msg.readInt32("hire expire date (?)"); - msg.readInt16("equip type"); - msg.readInt16("item sprite number"); - msg.readUInt8("flags"); - } -} - -void BeingRecv::processPvpSet(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processPvpSet") - const BeingId id = msg.readBeingId("being id"); - const int rank = msg.readInt32("rank"); - msg.readInt32("num"); - if (actorManager != nullptr) - { - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing != nullptr) - dstBeing->setPvpRank(rank); - } - BLOCK_END("BeingRecv::processPvpSet") -} - -void BeingRecv::processNameResponse2(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processNameResponse2") - if ((actorManager == nullptr) || (localPlayer == nullptr)) - { - BLOCK_END("BeingRecv::processNameResponse2") - return; - } - - const int len = msg.readInt16("len"); - const BeingId beingId = msg.readBeingId("account id"); - const std::string str = msg.readString(len - 8, "name"); - actorManager->updateNameId(str, beingId); - Being *const dstBeing = actorManager->findBeing(beingId); - if (dstBeing != nullptr) - { - if (beingId == localPlayer->getId()) - { - localPlayer->pingResponse(); - } - else - { - dstBeing->setName(str); - dstBeing->updateGuild(); - dstBeing->addToCache(); - - if (dstBeing->getType() == ActorType::Player) - dstBeing->updateColors(); - - if (localPlayer != nullptr) - { - const Party *const party = localPlayer->getParty(); - if (party != nullptr && party->isMember(dstBeing->getId())) - { - PartyMember *const member = party->getMember( - dstBeing->getId()); - - if (member != nullptr) - member->setName(dstBeing->getName()); - } - localPlayer->checkNewName(dstBeing); - } - } - } - BLOCK_END("BeingRecv::processNameResponse2") -} - -Being *BeingRecv::createBeing2(Net::MessageIn &msg, - const BeingId id, - const int32_t job, - const BeingTypeT beingType) -{ - if (actorManager == nullptr) - return nullptr; - - ActorTypeT type = ActorType::Unknown; - switch (beingType) - { - case BeingType::PC: - type = ActorType::Player; - break; - case BeingType::NPC: - case BeingType::NPC_EVENT: - type = ActorType::Npc; - break; - case BeingType::MONSTER: - type = ActorType::Monster; - break; - case BeingType::MERSOL: - type = ActorType::Mercenary; - break; - case BeingType::PET: - type = ActorType::Pet; - break; - case BeingType::HOMUN: - type = ActorType::Homunculus; - break; - case BeingType::SKILL: - type = ActorType::SkillUnit; - break; - case BeingType::ELEMENTAL: - type = ActorType::Elemental; - break; - case BeingType::ITEM: - logger->log("not supported object type: %d, job: %d", - CAST_S32(beingType), CAST_S32(job)); - break; - case BeingType::CHAT: - default: - UNIMPLEMENTEDPACKETFIELD(CAST_S32(beingType)); - type = ActorType::Monster; - logger->log("not supported object type: %d, job: %d", - CAST_S32(beingType), CAST_S32(job)); - break; - } - if (job == 45 && beingType == BeingType::NPC_EVENT) - type = ActorType::Portal; - - Being *const being = actorManager->createBeing( - id, type, fromInt(job, BeingTypeId)); - if (beingType == BeingType::MERSOL) - { - const MercenaryInfo *const info = PlayerInfo::getMercenary(); - if ((info != nullptr) && info->id == id) - PlayerInfo::setMercenaryBeing(being); - } - else if (beingType == BeingType::PET) - { - if (PlayerInfo::getPetBeingId() == id) - PlayerInfo::setPetBeing(being); - } - return being; -} - -void BeingRecv::processSkillCancel(Net::MessageIn &msg) -{ - msg.readInt32("id?"); -} - -void BeingRecv::processSolveCharName(Net::MessageIn &msg) -{ - const int id = msg.readInt32("char id"); - if (actorManager == nullptr) - { - msg.readString(24, "name"); - return; - } - actorManager->addChar(id, msg.readString(24, "name")); -} - -void BeingRecv::processGraffiti(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("graffiti id"); - const BeingId creatorId = msg.readBeingId("creator id"); - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - const int job = msg.readUInt8("job"); - msg.readUInt8("visible"); - msg.readUInt8("is content"); - const std::string text = msg.readString(80, "text"); - - Being *const dstBeing = createBeing2(msg, id, job, BeingType::SKILL); - if (dstBeing == nullptr) - return; - - dstBeing->setAction(BeingAction::STAND, 0); - dstBeing->setTileCoords(x, y); - dstBeing->setShowName(true); - dstBeing->setName(text); - dstBeing->setCreatorId(creatorId); -} - -void BeingRecv::processSkillDamage(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processSkillDamage") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processSkillDamage") - return; - } - - const int id = msg.readInt16("skill id"); - Being *const srcBeing = actorManager->findBeing( - msg.readBeingId("src being id")); - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("dst being id")); - msg.readInt32("tick"); - msg.readInt32("src speed"); - msg.readInt32("dst speed"); - int param1; - if (msg.getVersion() >= 3) - param1 = msg.readInt32("damage"); - else - param1 = msg.readInt16("damage"); - const int level = msg.readInt16("skill level"); - msg.readInt16("div"); - msg.readUInt8("skill hit/type?"); - if (srcBeing != nullptr) - srcBeing->handleSkill(dstBeing, param1, id, level); - if (dstBeing != nullptr) - dstBeing->takeDamage(srcBeing, param1, AttackType::SKILL, id, level); - BLOCK_END("BeingRecv::processSkillDamage") -} - -void BeingRecv::processNavigateTo(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // 0 position - // 1 no position - // 3 monster - msg.readUInt8("navigate type"); - msg.readUInt8("transportation flag"); - msg.readUInt8("hide window"); - msg.readString(16, "map name"); - msg.readInt16("x"); - msg.readInt16("y"); - msg.readInt16("mob id"); -} - -void BeingRecv::applyPlayerAction(Net::MessageIn &msg, - Being *const being, - const uint8_t type) -{ - if (being == nullptr) - return; - switch (type) - { - case 0: - being->setAction(BeingAction::STAND, 0); - localPlayer->imitateAction(being, BeingAction::STAND); - break; - - case 1: - if (being->getCurrentAction() != BeingAction::DEAD) - { - being->setAction(BeingAction::DEAD, 0); - being->recalcSpritesOrder(); - } - break; - - case 2: - being->setAction(BeingAction::SIT, 0); - localPlayer->imitateAction(being, BeingAction::SIT); - break; - - default: - UNIMPLEMENTEDPACKETFIELD(type); - break; - } -} - -} // namespace EAthena diff --git a/src/net/eathena/beingrecv.h b/src/net/eathena/beingrecv.h deleted file mode 100644 index b70d1f7fb..000000000 --- a/src/net/eathena/beingrecv.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_BEINGRECV_H -#define NET_EATHENA_BEINGRECV_H - -#include "enums/net/beingtype.h" - -#include "enums/resources/skill/skilltype2.h" - -#include "enums/simpletypes/beingid.h" - -#if defined(__GXX_EXPERIMENTAL_CXX0X__) -#if defined(__APPLE__) -#include <tr1/cstdint> -#endif // defined(__APPLE__) -#endif // defined(__GXX_EXPERIMENTAL_CXX0X__) - -#include "localconsts.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -class Being; - -namespace EAthena -{ - namespace BeingRecv - { - void processBeingChangeLook2(Net::MessageIn &msg); - void processBeingChangeLookCards(Net::MessageIn &msg); - void processBeingVisible(Net::MessageIn &msg); - void processBeingMove(Net::MessageIn &msg); - void processBeingSpawn(Net::MessageIn &msg); - void processMapTypeProperty(Net::MessageIn &msg); - void processMapType(Net::MessageIn &msg); - void processSkillCasting(Net::MessageIn &msg); - void processSkillCasting2(Net::MessageIn &msg); - void processBeingStatusChange(Net::MessageIn &msg); - void processBeingMove2(Net::MessageIn &msg); - void processBeingAction2(Net::MessageIn &msg); - void processMonsterHp(Net::MessageIn &msg); - void processBeingHp(Net::MessageIn &msg); - void processSkillAutoCast(Net::MessageIn &msg); - void processRanksList(Net::MessageIn &msg); - void processBeingChangeDirection(Net::MessageIn &msg); - void processBeingChangeLookContinue(const Net::MessageIn &msg, - Being *const dstBeing, - const uint8_t type, - const int id, - const int id2, - const int *const cards) - A_NONNULL(2); - void processBeingSpecialEffect(Net::MessageIn &msg); - void processBeingSpecialEffectNum(Net::MessageIn &msg); - void processBeingSoundEffect(Net::MessageIn &msg); - void processSkillGroundNoDamage(Net::MessageIn &msg); - void processSkillEntry(Net::MessageIn &msg); - void processPlayerStatusChange(Net::MessageIn &msg); - void processBeingResurrect(Net::MessageIn &msg); - void processPlayerGuilPartyInfo(Net::MessageIn &msg); - void processBeingRemoveSkill(Net::MessageIn &msg); - void processBeingFakeName(Net::MessageIn &msg); - void processBeingStatUpdate1(Net::MessageIn &msg); - void processPlayerStatusChange2(Net::MessageIn &msg); - void processBeingSelfEffect(Net::MessageIn &msg); - void processMobInfo(Net::MessageIn &msg); - void processBeingAttrs(Net::MessageIn &msg); - void processMonsterInfo(Net::MessageIn &msg); - void processClassChange(Net::MessageIn &msg); - void processSpiritBalls(Net::MessageIn &msg); - void processBladeStop(Net::MessageIn &msg); - void processComboDelay(Net::MessageIn &msg); - void processWddingEffect(Net::MessageIn &msg); - void processBeingSlide(Net::MessageIn &msg); - void processStarsKill(Net::MessageIn &msg); - void processBlacksmithRanksList(Net::MessageIn &msg); - void processAlchemistRanksList(Net::MessageIn &msg); - void processTaekwonRanksList(Net::MessageIn &msg); - void processPkRanksList(Net::MessageIn &msg); - void processGladiatorFeelRequest(Net::MessageIn &msg); - void processBossMapInfo(Net::MessageIn &msg); - void processBeingFont(Net::MessageIn &msg); - void processBeingMilleniumShield(Net::MessageIn &msg); - void processBeingCharm(Net::MessageIn &msg); - void processBeingViewEquipment(Net::MessageIn &msg); - void processPvpSet(Net::MessageIn &msg); - void processNameResponse2(Net::MessageIn &msg); - void processSkillCancel(Net::MessageIn &msg); - void processSolveCharName(Net::MessageIn &msg); - void processGraffiti(Net::MessageIn &msg); - void processSkillDamage(Net::MessageIn &msg); - void processNavigateTo(Net::MessageIn &msg); - - Being *createBeing2(Net::MessageIn &msg, - const BeingId id, - const int32_t job, - const BeingTypeT beingType); - void applyPlayerAction(Net::MessageIn &msg, - Being *const being, - const uint8_t type); - void processSkillCastingContinue(Net::MessageIn &msg, - const BeingId srcId, - const BeingId dstId, - const int dstX, - const int dstY, - const int skillId, - const int skillLevel, - const int range, - const SkillType2::SkillType2 inf2, - const int castTime); - } // namespace BeingRecv -} // namespace EAthena - -#endif // NET_EATHENA_BEINGRECV_H diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp deleted file mode 100644 index c4d172b89..000000000 --- a/src/net/eathena/buyingstorehandler.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/buyingstorehandler.h" - -#include "being/being.h" -#include "being/playerinfo.h" - -#include "const/net/inventory.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "utils/foreach.h" - -#include "resources/item/shopitem.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -BuyingStoreHandler::BuyingStoreHandler() -{ - buyingStoreHandler = this; -} - -BuyingStoreHandler::~BuyingStoreHandler() -{ - buyingStoreHandler = nullptr; -} - -void BuyingStoreHandler::create(const std::string &name, - const int maxMoney, - const bool flag, - const STD_VECTOR<ShopItem*> &items) const -{ - if (packetVersion < 20100303) - return; - createOutPacket(CMSG_BUYINGSTORE_CREATE); - outMsg.writeInt16(CAST_S16(89 + items.size() * 8), "len"); - outMsg.writeInt32(maxMoney, "limit money"); - outMsg.writeInt8(static_cast<int8_t>(flag), "flag"); - outMsg.writeString(name, 80, "store name"); - FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) - { - const ShopItem *const item = *it; - outMsg.writeInt16(CAST_S16(item->getId()), "item id"); - outMsg.writeInt16(CAST_S16(item->getQuantity()), "amount"); - outMsg.writeInt32(item->getPrice(), "price"); - } -} - -void BuyingStoreHandler::close() const -{ - if (packetVersion < 20100420) - return; - createOutPacket(CMSG_BUYINGSTORE_CLOSE); - PlayerInfo::enableVending(false); -} - -void BuyingStoreHandler::open(const Being *const being) const -{ - if (being == nullptr) - return; - if (packetVersion < 20100420) - return; - createOutPacket(CMSG_BUYINGSTORE_OPEN); - outMsg.writeBeingId(being->getId(), "account id"); -} - -void BuyingStoreHandler::sell(const Being *const being, - const int storeId, - const Item *const item, - const int amount) const -{ - if ((being == nullptr) || (item == nullptr)) - return; - if (packetVersion < 20100420) - return; - - createOutPacket(CMSG_BUYINGSTORE_SELL); - outMsg.writeInt16(18, "len"); - outMsg.writeBeingId(being->getId(), "account id"); - outMsg.writeInt32(storeId, "store id"); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), - "index"); - outMsg.writeInt16(CAST_S16(item->getId()), "item id"); - outMsg.writeInt16(CAST_S16(amount), "amount"); -} - -} // namespace EAthena diff --git a/src/net/eathena/buyingstorehandler.h b/src/net/eathena/buyingstorehandler.h deleted file mode 100644 index 8aed152c9..000000000 --- a/src/net/eathena/buyingstorehandler.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_BUYINGSTOREHANDLER_H -#define NET_EATHENA_BUYINGSTOREHANDLER_H - -#include "net/buyingstorehandler.h" - -namespace EAthena -{ -class BuyingStoreHandler final : public Net::BuyingStoreHandler -{ - public: - BuyingStoreHandler(); - - A_DELETE_COPY(BuyingStoreHandler) - - ~BuyingStoreHandler(); - - void create(const std::string &name, - const int maxMoney, - const bool flag, - const STD_VECTOR<ShopItem*> &items) const override final; - - void close() const override final; - - void open(const Being *const being) const override final; - - void sell(const Being *const being, - const int storeId, - const Item *const item, - const int amount) const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_BUYINGSTOREHANDLER_H diff --git a/src/net/eathena/buyingstorerecv.cpp b/src/net/eathena/buyingstorerecv.cpp deleted file mode 100644 index bf5d2032b..000000000 --- a/src/net/eathena/buyingstorerecv.cpp +++ /dev/null @@ -1,238 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/buyingstorerecv.h" - -#include "actormanager.h" -#include "notifymanager.h" - -#include "being/localplayer.h" -#include "being/playerinfo.h" - -#include "const/net/inventory.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/buyingstoreselldialog.h" - -#include "gui/widgets/createwidget.h" - -#include "listeners/arrowslistener.h" -#include "listeners/buyingstoremodelistener.h" -#include "listeners/buyingstoreslotslistener.h" - -#include "net/messagein.h" - -#include "resources/inventory/inventory.h" - -#include "resources/item/item.h" - -#include "debug.h" - -namespace EAthena -{ - -void BuyingStoreRecv::processBuyingStoreOpen(Net::MessageIn &msg) -{ - BuyingStoreSlotsListener::distributeEvent(msg.readUInt8("slots")); -} - -void BuyingStoreRecv::processBuyingStoreCreateFailed(Net::MessageIn &msg) -{ - const int16_t result = msg.readInt16("result"); - const int weight = msg.readInt32("weight"); - switch (result) - { - case 1: - default: - NotifyManager::notify(NotifyTypes::BUYING_STORE_CREATE_FAILED); - break; - case 2: - NotifyManager::notify( - NotifyTypes::BUYING_STORE_CREATE_FAILED_WEIGHT, - weight); - break; - case 8: - NotifyManager::notify(NotifyTypes::BUYING_STORE_CREATE_EMPTY); - break; - } -} - -void BuyingStoreRecv::processBuyingStoreOwnItems(Net::MessageIn &msg) -{ - const int count = (msg.readInt16("len") - 12) / 9; - msg.readBeingId("account id"); - msg.readInt32("money limit"); - for (int f = 0; f < count; f ++) - { - msg.readInt32("price"); - msg.readInt16("amount"); - msg.readUInt8("item type"); - msg.readInt16("item id"); - } - PlayerInfo::enableVending(true); - BuyingStoreModeListener::distributeEvent(true); -} - -void BuyingStoreRecv::processBuyingStoreShowBoard(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("owner id"); - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing != nullptr) - { - dstBeing->setBuyBoard(msg.readString(80, "shop name")); - } - else - { - msg.readString(80, "shop name"); - } -} - -void BuyingStoreRecv::processBuyingStoreHideBoard(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("owner id"); - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing != nullptr) - dstBeing->setBuyBoard(std::string()); - if (dstBeing == localPlayer) - { - PlayerInfo::enableVending(false); - BuyingStoreModeListener::distributeEvent(false); - } -} - -void BuyingStoreRecv::processBuyingStoreItemsList(Net::MessageIn &msg) -{ - const int count = (msg.readInt16("len") - 16) / 9; - const BeingId id = msg.readBeingId("account id"); - const int storeId = msg.readInt32("store id"); - // +++ in future need use it too - msg.readInt32("money limit"); - - const Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing == nullptr) - return; - - SellDialog *const dialog = CREATEWIDGETR(BuyingStoreSellDialog, - dstBeing->getId(), - storeId); - dialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY)); - const Inventory *const inv = PlayerInfo::getInventory(); - for (int f = 0; f < count; f ++) - { - const int price = msg.readInt32("price"); - const int amount = msg.readInt16("amount"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - const int itemId = msg.readInt16("item id"); - - if (inv == nullptr) - continue; - const Item *const item = inv->findItem(itemId, ItemColor_one); - if (item == nullptr) - continue; - // +++ need add colors support - dialog->addItem(itemId, itemType, ItemColor_one, amount, price); - } -} - -void BuyingStoreRecv::processBuyingStoreSellFailed(Net::MessageIn &msg) -{ - const int16_t result = msg.readInt16("result"); - switch (result) - { - case 3: - NotifyManager::notify( - NotifyTypes::BUYING_STORE_SELL_FAILED_MONEY_LIMIT); - break; - case 4: - NotifyManager::notify(NotifyTypes::BUYING_STORE_SELL_FAILED_EMPTY); - break; - default: - NotifyManager::notify(NotifyTypes::BUYING_STORE_SELL_FAILED); - break; - } -} - -void BuyingStoreRecv::processBuyingStoreSellerSellFailed(Net::MessageIn &msg) -{ - const int16_t result = msg.readInt16("result"); - msg.readInt16("item id"); - switch (result) - { - case 5: - NotifyManager::notify( - NotifyTypes::BUYING_STORE_SELLER_SELL_FAILED_DEAL); - break; - case 6: - NotifyManager::notify( - NotifyTypes::BUYING_STORE_SELLER_SELL_FAILED_AMOUNT); - break; - case 7: - NotifyManager::notify( - NotifyTypes::BUYING_STORE_SELLER_SELL_FAILED_BALANCE); - break; - default: - NotifyManager::notify( - NotifyTypes::BUYING_STORE_SELLER_SELL_FAILED); - break; - } -} - -void BuyingStoreRecv::processBuyingStoreReport(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("item id"); - msg.readInt16("amount"); - if (msg.getVersion() >= 20141016) - { - msg.readInt32("money"); - msg.readInt32("money limit"); - msg.readInt32("char id"); - msg.readInt32("date"); - } - else - { - msg.readInt32("money limit"); - } -} - -void BuyingStoreRecv::processBuyingStoreDeleteItem(Net::MessageIn &msg) -{ - Inventory *const inventory = localPlayer != nullptr - ? PlayerInfo::getInventory() : nullptr; - - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int amount = msg.readInt16("amount"); - msg.readInt32("price"); - - if (inventory != nullptr) - { - if (Item *const item = inventory->getItem(index)) - { - item->increaseQuantity(-amount); - if (item->getQuantity() == 0) - inventory->removeItemAt(index); - ArrowsListener::distributeEvent(); - } - } -} - -} // namespace EAthena diff --git a/src/net/eathena/buyingstorerecv.h b/src/net/eathena/buyingstorerecv.h deleted file mode 100644 index 15935c3b8..000000000 --- a/src/net/eathena/buyingstorerecv.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_BUYINGSTORERECV_H -#define NET_EATHENA_BUYINGSTORERECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace BuyingStoreRecv - { - void processBuyingStoreOpen(Net::MessageIn &msg); - - void processBuyingStoreCreateFailed(Net::MessageIn &msg); - - void processBuyingStoreOwnItems(Net::MessageIn &msg); - - void processBuyingStoreShowBoard(Net::MessageIn &msg); - - void processBuyingStoreHideBoard(Net::MessageIn &msg); - - void processBuyingStoreItemsList(Net::MessageIn &msg); - - void processBuyingStoreSellFailed(Net::MessageIn &msg); - - void processBuyingStoreReport(Net::MessageIn &msg); - - void processBuyingStoreDeleteItem(Net::MessageIn &msg); - - void processBuyingStoreSellerSellFailed(Net::MessageIn &msg); - } // namespace BuyingStoreRecv -} // namespace EAthena - -#endif // NET_EATHENA_BUYINGSTORERECV_H diff --git a/src/net/eathena/buysellhandler.cpp b/src/net/eathena/buysellhandler.cpp deleted file mode 100644 index 6858f0808..000000000 --- a/src/net/eathena/buysellhandler.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/buysellhandler.h" - -#include "net/ea/buysellrecv.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -BuySellHandler::BuySellHandler() : - Ea::BuySellHandler() -{ - buySellHandler = this; - Ea::BuySellRecv::mBuyDialog = nullptr; -} - -BuySellHandler::~BuySellHandler() -{ - buySellHandler = nullptr; -} - -void BuySellHandler::requestSellList(const std::string &nick A_UNUSED) const -{ -} - -void BuySellHandler::requestBuyList(const std::string &nick A_UNUSED) const -{ -} - -void BuySellHandler::sendBuyRequest(const std::string &nick A_UNUSED, - const ShopItem *const item A_UNUSED, - const int amount A_UNUSED) const -{ -} - -void BuySellHandler::sendSellRequest(const std::string &nick A_UNUSED, - const ShopItem *const item A_UNUSED, - const int amount A_UNUSED) const -{ -} - -void BuySellHandler::close() const -{ - if (packetVersion < 20131218) - return; - - createOutPacket(CMSG_NPC_SHOP_CLOSE); -} - -} // namespace EAthena diff --git a/src/net/eathena/buysellhandler.h b/src/net/eathena/buysellhandler.h deleted file mode 100644 index b7aea35c7..000000000 --- a/src/net/eathena/buysellhandler.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_BUYSELLHANDLER_H -#define NET_EATHENA_BUYSELLHANDLER_H - -#include "net/ea/buysellhandler.h" - -namespace EAthena -{ - -class BuySellHandler final : public Ea::BuySellHandler -{ - public: - BuySellHandler(); - - A_DELETE_COPY(BuySellHandler) - - ~BuySellHandler(); - - void requestSellList(const std::string &nick) - const override final A_CONST; - - void requestBuyList(const std::string &nick) - const override final A_CONST; - - void sendBuyRequest(const std::string &nick, - const ShopItem *const item, - const int amount) const override final A_CONST; - - void sendSellRequest(const std::string &nick, - const ShopItem *const item, - const int amount) const override final A_CONST; - - void close() const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_BUYSELLHANDLER_H diff --git a/src/net/eathena/buysellrecv.cpp b/src/net/eathena/buysellrecv.cpp deleted file mode 100644 index db2b6a607..000000000 --- a/src/net/eathena/buysellrecv.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/buysellrecv.h" - -#include "notifymanager.h" - -#include "being/playerinfo.h" - -#include "const/resources/currency.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/buydialog.h" - -#include "gui/widgets/createwidget.h" - -#include "net/messagein.h" - -#include "net/ea/buysellrecv.h" - -#include "net/eathena/npcrecv.h" - -#include "resources/beinginfo.h" - -#include "resources/db/npcdb.h" - -#include "debug.h" - -namespace EAthena -{ - -void BuySellRecv::processNpcBuy(Net::MessageIn &msg) -{ - msg.readInt16("len"); - const int sz = 11; - const int n_items = (msg.getLength() - 4) / sz; - - const BeingTypeId npcId = NpcRecv::mNpcTypeId; - std::string currency; - - if (npcId != BeingTypeId_zero) - { - const BeingInfo *const info = NPCDB::get(npcId); - if (info != nullptr) - currency = info->getCurrency(); - else - currency = DEFAULT_CURRENCY; - } - else - { - currency = DEFAULT_CURRENCY; - } - - CREATEWIDGETV(Ea::BuySellRecv::mBuyDialog, BuyDialog, - Ea::BuySellRecv::mNpcId, - currency); - Ea::BuySellRecv::mBuyDialog->setMoney( - PlayerInfo::getAttribute(Attributes::MONEY)); - - for (int k = 0; k < n_items; k++) - { - const int value = msg.readInt32("price"); - msg.readInt32("dc value?"); - const ItemTypeT type = static_cast<ItemTypeT>( - msg.readUInt8("type")); - const int itemId = msg.readInt16("item id"); - const ItemColor color = ItemColor_one; - Ea::BuySellRecv::mBuyDialog->addItem(itemId, type, color, 0, value); - } - Ea::BuySellRecv::mBuyDialog->sort(); -} - -void BuySellRecv::processNpcSellResponse(Net::MessageIn &msg) -{ - switch (msg.readUInt8("result")) - { - case 0: - NotifyManager::notify(NotifyTypes::SOLD); - break; - case 1: - default: - NotifyManager::notify(NotifyTypes::SELL_FAILED); - break; - case 2: - NotifyManager::notify(NotifyTypes::SELL_TRADE_FAILED); - break; - case 3: - NotifyManager::notify(NotifyTypes::SELL_UNSELLABLE_FAILED); - break; - } -} - -void BuySellRecv::processNpcBuyResponse(Net::MessageIn &msg) -{ - const uint8_t response = msg.readUInt8("response"); - if (response == 0U) - { - NotifyManager::notify(NotifyTypes::BUY_DONE); - return; - } - switch (response) - { - case 1: - NotifyManager::notify(NotifyTypes::BUY_FAILED_NO_MONEY); - break; - - case 2: - NotifyManager::notify(NotifyTypes::BUY_FAILED_OVERWEIGHT); - break; - - case 3: - NotifyManager::notify(NotifyTypes::BUY_FAILED_TOO_MANY_ITEMS); - break; - - default: - NotifyManager::notify(NotifyTypes::BUY_FAILED); - break; - }; -} - -} // namespace EAthena diff --git a/src/net/eathena/buysellrecv.h b/src/net/eathena/buysellrecv.h deleted file mode 100644 index 445fe35c6..000000000 --- a/src/net/eathena/buysellrecv.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_BUYSELLRECV_H -#define NET_EATHENA_BUYSELLRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace BuySellRecv - { - void processNpcBuy(Net::MessageIn &msg); - void processNpcSellResponse(Net::MessageIn &msg); - void processNpcBuyResponse(Net::MessageIn &msg); - } // namespace BuySellRecv -} // namespace EAthena - -#endif // NET_EATHENA_BUYSELLRECV_H diff --git a/src/net/eathena/cashshophandler.cpp b/src/net/eathena/cashshophandler.cpp deleted file mode 100644 index 2e1e9cde4..000000000 --- a/src/net/eathena/cashshophandler.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/cashshophandler.h" - -#include "net/eathena/cashshoprecv.h" -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "utils/foreach.h" - -#include "resources/item/shopitem.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -CashShopHandler::CashShopHandler() : - Net::CashShopHandler() -{ - cashShopHandler = this; - CashShopRecv::mBuyDialog = nullptr; -} - -CashShopHandler::~CashShopHandler() -{ - cashShopHandler = nullptr; -} - -void CashShopHandler::buyItem(const int points, - const int itemId, - const ItemColor color A_UNUSED, - const int amount) const -{ - if (packetVersion < 20101124) - return; - createOutPacket(CMSG_NPC_CASH_SHOP_BUY); - outMsg.writeInt16(10 + 4, "len"); - outMsg.writeInt32(points, "points"); - outMsg.writeInt16(1, "count"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - outMsg.writeInt16(CAST_S16(itemId), "item id"); -} - -void CashShopHandler::buyItems(const int points, - const STD_VECTOR<ShopItem*> &items) const -{ - if (packetVersion < 20101124) - return; - - int cnt = 0; - const int pairSize = 4; - - FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) - { - const ShopItem *const item = *it; - const int usedQuantity = item->getUsedQuantity(); - const ItemTypeT type = item->getType(); - if (usedQuantity == 0) - continue; - if (type == ItemType::Weapon || - type == ItemType::Armor || - type == ItemType::PetEgg || - type == ItemType::PetArmor) - { - cnt += item->getUsedQuantity(); - } - else - { - cnt ++; - } - } - - if (cnt > 100) - return; - - createOutPacket(CMSG_NPC_CASH_SHOP_BUY); - outMsg.writeInt16(CAST_S16(10 + pairSize * cnt), "len"); - outMsg.writeInt32(points, "points"); - outMsg.writeInt16(CAST_S16(cnt), "count"); - FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) - { - ShopItem *const item = *it; - const int usedQuantity = item->getUsedQuantity(); - if (usedQuantity == 0) - continue; - item->increaseQuantity(usedQuantity); - item->increaseUsedQuantity(-usedQuantity); - item->update(); - const ItemTypeT type = item->getType(); - if (type == ItemType::Weapon || - type == ItemType::Armor || - type == ItemType::PetEgg || - type == ItemType::PetArmor) - { - for (int f = 0; f < usedQuantity; f ++) - { - outMsg.writeInt16(CAST_S16(1), "amount"); - outMsg.writeInt16(CAST_S16(item->getId()), - "item id"); - } - } - else - { - outMsg.writeInt16(CAST_S16(usedQuantity), "amount"); - outMsg.writeInt16(CAST_S16(item->getId()), "item id"); - } - } -} - -void CashShopHandler::close() const -{ - if (packetVersion < 20110718) - return; - createOutPacket(CMSG_NPC_CASH_SHOP_CLOSE); -} - -void CashShopHandler::requestPoints() const -{ - if (packetVersion < 20110718) - return; - createOutPacket(CMSG_NPC_CASH_SHOP_OPEN); -} - -void CashShopHandler::requestTab(const int tab) const -{ - if (packetVersion < 20110718) - return; - createOutPacket(CMSG_NPC_CASH_SHOP_REQUEST_TAB); - outMsg.writeInt16(CAST_S16(tab), "tab"); -} - -void CashShopHandler::schedule() const -{ - if (packetVersion < 20110614) - return; - createOutPacket(CMSG_NPC_CASH_SHOP_SCHEDULE); -} - -} // namespace EAthena diff --git a/src/net/eathena/cashshophandler.h b/src/net/eathena/cashshophandler.h deleted file mode 100644 index 7294b5cae..000000000 --- a/src/net/eathena/cashshophandler.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_CASHSHOPHANDLER_H -#define NET_EATHENA_CASHSHOPHANDLER_H - -#include "net/cashshophandler.h" - -namespace EAthena -{ -class CashShopHandler final : public Net::CashShopHandler -{ - public: - CashShopHandler(); - - A_DELETE_COPY(CashShopHandler) - - ~CashShopHandler(); - - void buyItem(const int points, - const int itemId, - const ItemColor color, - const int amount) const override final; - - void buyItems(const int points, - const STD_VECTOR<ShopItem*> &items) const override final - A_CONST; - - void close() const override final; - - void requestPoints() const override final; - - void requestTab(const int tab) const override final; - - void schedule() const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_CASHSHOPHANDLER_H diff --git a/src/net/eathena/cashshoprecv.cpp b/src/net/eathena/cashshoprecv.cpp deleted file mode 100644 index 421631ab6..000000000 --- a/src/net/eathena/cashshoprecv.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/cashshoprecv.h" - -#include "notifymanager.h" - -#include "const/resources/currency.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/buydialog.h" - -#include "gui/widgets/createwidget.h" - -#include "net/messagein.h" - -#include "net/eathena/npcrecv.h" - -#include "resources/beinginfo.h" - -#include "resources/db/npcdb.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -namespace CashShopRecv -{ - BuyDialog *mBuyDialog; -} // namespace CashShopRecv - -void CashShopRecv::processCashShopOpen(Net::MessageIn &msg) -{ - int count; - if (packetVersion >= 20070711) - count = (msg.readInt16("len") - 12) / 11; - else - count = (msg.readInt16("len") - 8) / 11; - - const BeingTypeId npcId = NpcRecv::mNpcTypeId; - std::string currency; - - if (npcId != BeingTypeId_zero) - { - const BeingInfo *const info = NPCDB::get(npcId); - if (info != nullptr) - currency = info->getCurrency(); - else - currency = DEFAULT_CURRENCY; - } - else - { - currency = DEFAULT_CURRENCY; - } - CREATEWIDGETV(mBuyDialog, BuyDialog, - fromInt(BuyDialog::Cash, BeingId), - currency); - const int points = msg.readInt32("cash points"); - - mBuyDialog->setMoney(points); - - if (packetVersion >= 20070711) - msg.readInt32("kafra points"); - for (int f = 0; f < count; f ++) - { - msg.readInt32("price"); - const int value = msg.readInt32("discount price"); - const ItemTypeT type = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - const int itemId = msg.readInt16("item id"); - const ItemColor color = ItemColor_one; - mBuyDialog->addItem(itemId, type, color, 0, value); - } - mBuyDialog->sort(); -} - -void CashShopRecv::processCashShopBuyAck(Net::MessageIn &msg) -{ - msg.readInt32("cash points"); - if (packetVersion >= 20070711) - msg.readInt32("kafra points"); - const uint16_t res = msg.readInt16("error"); - switch (res) - { - case 0: - NotifyManager::notify(NotifyTypes::BUY_DONE); - break; - case 1: - NotifyManager::notify(NotifyTypes::BUY_FAILED_NPC_NOT_FOUND); - break; - case 2: - NotifyManager::notify(NotifyTypes::BUY_FAILED_SYSTEM_ERROR); - break; - case 3: - NotifyManager::notify(NotifyTypes::BUY_FAILED_OVERWEIGHT); - break; - case 4: - NotifyManager::notify(NotifyTypes::BUY_TRADE_FAILED); - break; - case 5: - NotifyManager::notify(NotifyTypes::BUY_FAILED_WRONG_ITEM); - break; - case 6: - NotifyManager::notify(NotifyTypes::BUY_FAILED_NO_MONEY); - break; - default: - UNIMPLEMENTEDPACKETFIELD(res); - break; - } -} - -void CashShopRecv::processCashShopPoints(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("cash points"); - msg.readInt32("kafra points"); -} - -void CashShopRecv::processCashShopBuy(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("id"); - msg.readInt16("result"); - msg.readInt32("cash points"); - msg.readInt32("kafra points"); -} - -void CashShopRecv::processCashShopTabPriceList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - const int count = (msg.readInt16("len") - 10) / 6; - msg.readInt32("tab"); - const int itemsCount = msg.readInt16("count"); - if (count != itemsCount) - logger->log("error: wrong list count"); - - for (int f = 0; f < count; f ++) - { - msg.readInt16("item id"); - msg.readInt32("price"); - } -} - -void CashShopRecv::processCashShopSchedule(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - const int count = (msg.readInt16("len") - 8) / 6; - const int itemsCount = msg.readInt16("count"); - msg.readInt16("tab"); - if (count != itemsCount) - logger->log("error: wrong list count"); - - for (int f = 0; f < count; f ++) - { - msg.readInt16("item id"); - msg.readInt32("price"); - } -} - -} // namespace EAthena diff --git a/src/net/eathena/cashshoprecv.h b/src/net/eathena/cashshoprecv.h deleted file mode 100644 index 619474a6c..000000000 --- a/src/net/eathena/cashshoprecv.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_CASHSHOPRECV_H -#define NET_EATHENA_CASHSHOPRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -class BuyDialog; - -namespace EAthena -{ - namespace CashShopRecv - { - extern BuyDialog *mBuyDialog; - void processCashShopOpen(Net::MessageIn &msg); - void processCashShopBuyAck(Net::MessageIn &msg); - void processCashShopPoints(Net::MessageIn &msg); - void processCashShopBuy(Net::MessageIn &msg); - void processCashShopTabPriceList(Net::MessageIn &msg); - void processCashShopSchedule(Net::MessageIn &msg); - } // namespace CashShopRecv -} // namespace EAthena - -#endif // NET_EATHENA_CASHSHOPRECV_H diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp deleted file mode 100644 index 18273de0a..000000000 --- a/src/net/eathena/charserverhandler.cpp +++ /dev/null @@ -1,248 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/charserverhandler.h" - -#include "gui/windows/charcreatedialog.h" - -#include "net/character.h" -#include "net/serverfeatures.h" - -#include "net/ea/token.h" - -#include "net/eathena/charserverrecv.h" -#include "net/eathena/loginhandler.h" -#include "net/eathena/messageout.h" -#include "net/eathena/network.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -extern int packetVersion; -extern int serverVersion; - -namespace EAthena -{ - -extern ServerInfo charServer; -extern ServerInfo mapServer; - -CharServerHandler::CharServerHandler() : - Ea::CharServerHandler() -{ - CharServerRecv::mNewName.clear(); - CharServerRecv::mPinSeed = 0; - CharServerRecv::mPinAccountId = BeingId_zero; - CharServerRecv::mRenameId = BeingId_zero; - CharServerRecv::mNeedCreatePin = false; - - charServerHandler = this; -} - -CharServerHandler::~CharServerHandler() -{ - charServerHandler = nullptr; -} - -void CharServerHandler::chooseCharacter(Net::Character *const character) const -{ - if (character == nullptr) - return; - - mSelectedCharacter = character; - mCharSelectDialog = nullptr; - - createOutPacket(CMSG_CHAR_SELECT); - outMsg.writeInt8(CAST_U8( - mSelectedCharacter->slot), "slot"); -} - -void CharServerHandler::newCharacter(const std::string &name, const int slot, - const GenderT gender, - const int hairstyle, const int hairColor, - const unsigned char race, - const uint16_t look, - const STD_VECTOR<int> &stats A_UNUSED) - const -{ - createOutPacket(CMSG_CHAR_CREATE); - outMsg.writeString(name, 24, "login"); - if (serverVersion > 0) - { - outMsg.writeInt8(CAST_U8(slot), "slot"); - outMsg.writeInt16(CAST_S16(hairColor), "hair color"); - outMsg.writeInt16(CAST_S16(hairstyle), "hair style"); - if (serverFeatures->haveRaceSelection()) - outMsg.writeInt16(CAST_S16(race), "race"); - if (serverFeatures->haveCreateCharGender()) - { - uint8_t sex = 0; - if (gender == Gender::UNSPECIFIED) - sex = 99; - else - sex = Being::genderToInt(gender); - outMsg.writeInt8(sex, "gender"); - } - if (serverFeatures->haveLookSelection()) - outMsg.writeInt16(CAST_S16(look), "look"); - } - else - { - if (packetVersion >= 20151001) - { - outMsg.writeInt8(CAST_U8(slot), "slot"); - outMsg.writeInt16(CAST_S16(hairColor), "hair color"); - outMsg.writeInt16(CAST_S16(hairstyle), "hair style"); - outMsg.writeInt16(CAST_S16(0), "starting job id"); - outMsg.writeInt16(0, "unknown"); - uint8_t sex = 0; - if (gender == Gender::UNSPECIFIED) - sex = 99; - else - sex = Being::genderToInt(gender); - outMsg.writeInt8(sex, "gender"); - } - else if (packetVersion >= 20120307) - { - outMsg.writeInt8(CAST_U8(slot), "slot"); - outMsg.writeInt16(CAST_S16(hairColor), "hair color"); - outMsg.writeInt16(CAST_S16(hairstyle), "hair style"); - } - else - { // < 20120307 - // +++ here need send stat points - // sending 5 for each stat for now - for (int i = 0; i < 6; i++) - outMsg.writeInt8(CAST_U8(5), "stat"); - - outMsg.writeInt8(CAST_U8(slot), "slot"); - outMsg.writeInt16(CAST_S16(hairColor), "hair color"); - outMsg.writeInt16(CAST_S16(hairstyle), "hair style"); - } - } -} - -void CharServerHandler::deleteCharacter(Net::Character *const character, - const std::string &email) const -{ - if (character == nullptr) - return; - - mSelectedCharacter = character; - - createOutPacket(CMSG_CHAR_DELETE); - outMsg.writeBeingId(mSelectedCharacter->dummy->getId(), "id?"); - if (email.empty()) - outMsg.writeString("a@a.com", 40, "email"); - else - outMsg.writeString(email, 40, "email"); -} - -void CharServerHandler::switchCharacter() const -{ - // This is really a map-server packet - createOutPacket(CMSG_PLAYER_RESTART); - outMsg.writeInt8(1, "flag"); -} - -void CharServerHandler::connect() const -{ - const Token &token = - static_cast<LoginHandler*>(loginHandler)->getToken(); - - if (Network::mInstance == nullptr) - return; - - Network::mInstance->disconnect(); - Network::mInstance->connect(charServer); - createOutPacket(CMSG_CHAR_SERVER_CONNECT); - outMsg.writeBeingId(token.account_ID, "account id"); - outMsg.writeInt32(token.session_ID1, "session id1"); - outMsg.writeInt32(token.session_ID2, "session id2"); - outMsg.writeInt16(CLIENT_PROTOCOL_VERSION, "client protocol version"); - outMsg.writeInt8(Being::genderToInt(token.sex), "gender"); - - // We get 4 useless bytes before the real answer comes in (what are these?) - Network::mInstance->skip(4); -} - -void CharServerHandler::setCharCreateDialog(CharCreateDialog *const window) - const -{ - mCharCreateDialog = window; - - if (mCharCreateDialog == nullptr) - return; - - StringVect attributes; - - const Token &token = static_cast<LoginHandler*>(loginHandler)->getToken(); - - mCharCreateDialog->setAttributes(attributes, 0, 0, 0); - mCharCreateDialog->setDefaultGender(token.sex); -} - -void CharServerHandler::setNewPincode(const std::string &pin A_UNUSED) const -{ -// here need ecript pin with mPinSeed and pin values. - -// createOutPacket(CMSG_CHAR_CREATE_PIN); -// outMsg.writeBeingId(mPinAccountId, "account id"); -// outMsg.writeString(pin, 4, "encrypted pin"); -} - -void CharServerHandler::renameCharacter(const BeingId id, - const std::string &newName) const -{ - createOutPacket(CMSG_CHAR_CHECK_RENAME); - CharServerRecv::mRenameId = id; - CharServerRecv::mNewName = newName; - outMsg.writeBeingId(id, "char id"); - outMsg.writeString(newName, 24, "name"); -} - -void CharServerHandler::changeSlot(const int oldSlot, - const int newSlot) const -{ - createOutPacket(CMSG_CHAR_CHANGE_SLOT); - outMsg.writeInt16(CAST_S16(oldSlot), "old slot"); - outMsg.writeInt16(CAST_S16(newSlot), "new slot"); - outMsg.writeInt16(0, "unused"); -} - -void CharServerHandler::ping() const -{ - createOutPacket(CMSG_CHAR_PING); - outMsg.writeInt32(0, "unused"); -} - -unsigned int CharServerHandler::hatSprite() const -{ - return 7; -} - -bool CharServerHandler::isNeedCreatePin() const -{ - return CharServerRecv::mNeedCreatePin; -} - -} // namespace EAthena diff --git a/src/net/eathena/charserverhandler.h b/src/net/eathena/charserverhandler.h deleted file mode 100644 index cef8f868e..000000000 --- a/src/net/eathena/charserverhandler.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_CHARSERVERHANDLER_H -#define NET_EATHENA_CHARSERVERHANDLER_H - -#include "net/ea/charserverhandler.h" - -namespace EAthena -{ - -/** - * Deals with incoming messages from the character server. - */ -class CharServerHandler final : public Ea::CharServerHandler -{ - public: - CharServerHandler(); - - A_DELETE_COPY(CharServerHandler) - - ~CharServerHandler(); - - void chooseCharacter(Net::Character *const character) const - override final; - - void newCharacter(const std::string &name, - const int slot, - const GenderT gender, - const int hairstyle, - const int hairColor, - const unsigned char race, - const uint16_t look, - const STD_VECTOR<int> &stats) const override final; - - void renameCharacter(const BeingId id, - const std::string &newName) const override final; - - void deleteCharacter(Net::Character *const character, - const std::string &email) const override final; - - void switchCharacter() const override final; - - void connect() const override final; - - bool isNeedCreatePin() const override final A_WARN_UNUSED; - - void setNewPincode(const std::string &pin) const override final - A_CONST; - - /** - * Sets the character create dialog. The handler will clean up this - * dialog when a new character is successfully created, and will unlock - * the dialog when a new character failed to be created. - */ - void setCharCreateDialog(CharCreateDialog *const window) const - override final; - - void changeSlot(const int oldSlot, - const int newSlot) const override final; - - void ping() const override final; - - unsigned int hatSprite() const override final A_CONST A_WARN_UNUSED; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_CHARSERVERHANDLER_H diff --git a/src/net/eathena/charserverrecv.cpp b/src/net/eathena/charserverrecv.cpp deleted file mode 100644 index ec906f081..000000000 --- a/src/net/eathena/charserverrecv.cpp +++ /dev/null @@ -1,570 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/charserverrecv.h" - -#include "client.h" -#include "configuration.h" -#include "settings.h" - -#include "gui/windows/charcreatedialog.h" -#include "gui/windows/charselectdialog.h" -#include "gui/windows/okdialog.h" - -#include "gui/widgets/createwidget.h" - -#include "net/character.h" -#include "net/charserverhandler.h" -#include "net/playerhandler.h" - -#include "net/ea/token.h" - -#include "net/eathena/gamehandler.h" -#include "net/eathena/loginhandler.h" -#include "net/eathena/messageout.h" -#include "net/eathena/network.h" -#include "net/eathena/protocolout.h" -#include "net/eathena/sprite.h" - -#include "resources/iteminfo.h" - -#include "resources/db/itemdb.h" - -#include "utils/dtor.h" -#include "utils/gettext.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -extern ServerInfo charServer; -extern ServerInfo mapServer; - -namespace CharServerRecv -{ - std::string mNewName; - uint32_t mPinSeed = 0; - BeingId mPinAccountId = BeingId_zero; - BeingId mRenameId = BeingId_zero; - bool mNeedCreatePin = false; -} // namespace CharServerRecv - -// callers must count each packet size by self -void CharServerRecv::readPlayerData(Net::MessageIn &msg, - Net::Character *const character) -{ - if (character == nullptr) - return; - - const Token &token = - static_cast<LoginHandler*>(loginHandler)->getToken(); - - LocalPlayer *const tempPlayer = new LocalPlayer( - msg.readBeingId("player id"), BeingTypeId_zero); - tempPlayer->setGender(token.sex); - - PlayerInfoBackend &data = character->data; - if (packetVersion >= 20170830) - data.mAttributes[Attributes::PLAYER_EXP] = msg.readInt64("exp"); - else - data.mAttributes[Attributes::PLAYER_EXP] = msg.readInt32("exp"); - data.mAttributes[Attributes::MONEY] = msg.readInt32("money"); - if (packetVersion >= 20170830) - { - data.mAttributes[Attributes::PLAYER_JOB_EXP] = - msg.readInt64("job exp"); - } - else - { - data.mAttributes[Attributes::PLAYER_JOB_EXP] = - msg.readInt32("job exp"); - } - data.mAttributes[Attributes::PLAYER_JOB_LEVEL] = - msg.readInt32("job level"); - - msg.readInt16("shoes?"); - const int gloves = msg.readInt16("gloves"); - const int cape = msg.readInt16("cape"); - const int misc1 = msg.readInt16("misc1"); - - msg.readInt32("option"); - tempPlayer->setKarma(msg.readInt32("karma")); - tempPlayer->setManner(msg.readInt32("manner")); - msg.readInt16("left points"); - - if (packetVersion >= 20081217) - { - data.mAttributes[Attributes::PLAYER_HP] = msg.readInt32("hp"); - data.mAttributes[Attributes::PLAYER_MAX_HP] = msg.readInt32("max hp"); - } - else - { - data.mAttributes[Attributes::PLAYER_HP] = msg.readInt16("hp"); - data.mAttributes[Attributes::PLAYER_MAX_HP] = msg.readInt16("max hp"); - } - data.mAttributes[Attributes::PLAYER_MP] = msg.readInt16("mp/sp"); - data.mAttributes[Attributes::PLAYER_MAX_MP] = msg.readInt16("max mp/sp"); - - msg.readInt16("speed"); - const uint16_t race = msg.readInt16("class"); -// tempPlayer->setSubtype(race, 0); - const int hairStyle = msg.readInt16("hair style"); - if (packetVersion >= 20141022) - msg.readInt16("body"); - const int option A_UNUSED = (msg.readInt16("weapon") | 1) ^ 1; - const int weapon = 0; - - tempPlayer->setSpriteId(SPRITE_BODY, - weapon); - tempPlayer->setWeaponId(weapon); - - data.mAttributes[Attributes::PLAYER_BASE_LEVEL] = msg.readInt16("level"); - - msg.readInt16("skill points"); - const int bottomClothes = msg.readInt16("head bottom"); - const int shield = msg.readInt16("shild"); - const int hat = msg.readInt16("head top"); - const int topClothes = msg.readInt16("head mid"); - - const ItemColor color = fromInt(msg.readInt16("hair color"), ItemColor); - tempPlayer->setHairColor(color); - if (hairStyle == 0) - { - tempPlayer->unSetSprite(SPRITE_HAIR_COLOR); - } - else - { - tempPlayer->setSpriteColor(SPRITE_HAIR_COLOR, - hairStyle * -1, - ItemDB::get(-hairStyle).getDyeColorsString( - color)); - } - - const uint16_t look = msg.readInt16("clothes color"); - tempPlayer->setSubtype(fromInt(race, BeingTypeId), look); - tempPlayer->setName(msg.readString(24, "name")); - - character->dummy = tempPlayer; - - character->data.mStats[Attributes::PLAYER_STR].base = msg.readUInt8("str"); - character->data.mStats[Attributes::PLAYER_AGI].base = msg.readUInt8("agi"); - character->data.mStats[Attributes::PLAYER_VIT].base = msg.readUInt8("vit"); - character->data.mStats[Attributes::PLAYER_INT].base = msg.readUInt8("int"); - character->data.mStats[Attributes::PLAYER_DEX].base = msg.readUInt8("dex"); - character->data.mStats[Attributes::PLAYER_LUK].base = msg.readUInt8("luk"); - - character->slot = msg.readInt16("character slot id"); - if (packetVersion >= 20061023) - msg.readInt16("rename"); - if (packetVersion >= 20100803) - { - msg.readString(16, "map name"); - msg.readInt32("delete date"); - } - int shoes = 0; - if (packetVersion >= 20110111) - shoes = msg.readInt32("robe"); - if (serverVersion == 0) - { - tempPlayer->setSpriteId(SPRITE_HAIR, - shoes); - tempPlayer->setSpriteId(SPRITE_SHOES, - gloves); - tempPlayer->setSpriteId(SPRITE_SHIELD, - cape); - tempPlayer->setSpriteId(SPRITE_HEAD_TOP, - misc1); - tempPlayer->setSpriteId(SPRITE_WEAPON, - bottomClothes); - tempPlayer->setSpriteId(SPRITE_FLOOR, - shield); - tempPlayer->setSpriteId(SPRITE_CLOTHES_COLOR, - hat); - tempPlayer->setSpriteId(SPRITE_HEAD_BOTTOM, - topClothes); -// tempPlayer->setSprite(SPRITE_HEAD_MID, misc2); - } - if (packetVersion >= 20110928) - msg.readInt32("slot change"); - if (packetVersion >= 20111025) - tempPlayer->setRename(msg.readInt32("rename (inverse)") != 0); - uint8_t gender = 99U; - if (packetVersion >= 20141016) - gender = CAST_U8(msg.readUInt8("gender")); - if (gender != 99) - tempPlayer->setGender(Being::intToGender(gender)); -} - -void CharServerRecv::processCharLogin(Net::MessageIn &msg) -{ - msg.skip(2, "packet len"); - int slots = 9; - int offset = 0; - if (packetVersion >= 20100413) - { - slots = msg.readInt8("MAX_CHARS"); - msg.readInt8("sd->char_slots"); - msg.readInt8("MAX_CHARS"); - offset = 3; - } - loginData.characterSlots = CAST_U16(slots); - - msg.skip(20, "unused 0"); - - delete_all(Net::CharServerHandler::mCharacters); - Net::CharServerHandler::mCharacters.clear(); - - // Derive number of characters from message length - const int count = (msg.getLength() - 24 - offset) - / (106 + 4 + 2 + 16 + 4 + 4 + 4 + 4); - - for (int i = 0; i < count; ++i) - { - Net::Character *const character = new Net::Character; - readPlayerData(msg, character); - Net::CharServerHandler::mCharacters.push_back(character); - if (character->dummy != nullptr) - { - logger->log("CharServer: Player: %s (%d)", - character->dummy->getName().c_str(), character->slot); - } - } - - client->setState(State::CHAR_SELECT); -} - -void CharServerRecv::processCharLogin2(Net::MessageIn &msg) -{ - // ignored - msg.readInt16("len"); - msg.readUInt8("char slots"); - msg.readUInt8("left slots"); - msg.readUInt8("left slots"); - msg.readUInt8("char slots"); - msg.readUInt8("char slots"); - msg.skip(20, "unused"); -} - -void CharServerRecv::processCharMapInfo(Net::MessageIn &restrict msg) -{ - Network *const network = Network::mInstance; - ServerInfo &server = mapServer; - BLOCK_START("CharServerRecv::processCharMapInfo") - PlayerInfo::setCharId(msg.readInt32("char id")); - GameHandler::setMap(msg.readString(16, "map name")); - if (config.getBoolValue("usePersistentIP") || settings.persistentIp) - { - msg.readInt32("map ip address"); - server.hostname = settings.serverName; - } - else - { - server.hostname = ipToString(msg.readInt32("map ip address")); - } - server.port = msg.readInt16("map ip port"); - if (msg.getVersion() >= 20170329) - { - for (int f = 0; f < 32; f ++) - msg.readInt32("unused"); - } - - // Prevent the selected local player from being deleted - localPlayer = Net::CharServerHandler::mSelectedCharacter->dummy; - PlayerInfo::setBackend(Net::CharServerHandler::mSelectedCharacter->data); - PlayerInfo::setStatBase(Attributes::PLAYER_WALK_SPEED, - playerHandler->getDefaultWalkSpeed()); - - Net::CharServerHandler::mSelectedCharacter->dummy = nullptr; - - charServerHandler->clear(); - Net::CharServerHandler::updateCharSelectDialog(); - - if (network != nullptr) - network->disconnect(); - client->setState(State::CONNECT_GAME); - BLOCK_END("CharServerRecv::processCharMapInfo") -} - -void CharServerRecv::processChangeMapServer(Net::MessageIn &msg) -{ - Network *const network = Network::mInstance; - ServerInfo &server = mapServer; - BLOCK_START("CharServerRecv::processChangeMapServer") - if (network == nullptr) - { - BLOCK_END("CharServerRecv::processChangeMapServer") - return; - } - GameHandler::setMap(msg.readString(16, "map name")); - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - if (config.getBoolValue("usePersistentIP") || settings.persistentIp) - { - msg.readInt32("host"); - server.hostname = settings.serverName; - } - else - { - server.hostname = ipToString(msg.readInt32("host")); - } - server.port = msg.readInt16("port"); - - network->disconnect(); - client->setState(State::CHANGE_MAP); - if (localPlayer != nullptr) - { - localPlayer->setTileCoords(x, y); - localPlayer->setMap(nullptr); - } - BLOCK_END("CharServerRecv::processChangeMapServer") -} - -void CharServerRecv::processPincodeStatus(Net::MessageIn &msg) -{ - mPinSeed = msg.readInt32("pincode seed"); - mPinAccountId = msg.readBeingId("account id"); - const uint16_t state = CAST_U16(msg.readInt16("state")); - switch (state) - { - case 0: // pin ok - break; - case 1: // ask for pin - break; - case 2: // create new pin - case 4: // create new pin? - { - mNeedCreatePin = true; - break; - } - case 3: // pin must be changed - break; - case 5: // client show error? - break; - case 6: // Unable to use your KSSN number - break; - case 7: // char select window shows a button - break; - case 8: // pincode was incorrect - break; - default: - UNIMPLEMENTEDPACKET; - break; - } -} - -void CharServerRecv::processCharCreate(Net::MessageIn &msg) -{ - BLOCK_START("CharServerRecv::processCharCreate") - Net::Character *const character = new Net::Character; - readPlayerData(msg, character); - Net::CharServerHandler::mCharacters.push_back(character); - - Net::CharServerHandler::updateCharSelectDialog(); - - // Close the character create dialog - Net::CharServerHandler::mCharCreateDialog->scheduleDelete(); - Net::CharServerHandler::mCharCreateDialog = nullptr; - BLOCK_END("CharServerRecv::processCharCreate") -} - -void CharServerRecv::processCharCheckRename(Net::MessageIn &msg) -{ - if (msg.readInt16("flag") != 0) - { - createOutPacket(CMSG_CHAR_RENAME); - outMsg.writeBeingId(mRenameId, "char id"); - } - else - { - CREATEWIDGET(OkDialog, - // TRANSLATORS: error header - _("Error"), - // TRANSLATORS: error message - _("Character rename error."), - // TRANSLATORS: ok dialog button - _("Error"), - DialogType::ERROR, - Modal_true, - ShowCenter_true, - nullptr, - 260); - } -} - -void CharServerRecv::processCharRename(Net::MessageIn &msg) -{ - const int flag = msg.readInt16("flag"); - if (flag == 0) - { - Net::CharServerHandler::mCharSelectDialog->setName( - mRenameId, - mNewName); - CREATEWIDGET(OkDialog, - // TRANSLATORS: info header - _("Info"), - // TRANSLATORS: info message - _("Character renamed."), - // TRANSLATORS: ok dialog button - _("OK"), - DialogType::OK, - Modal_true, - ShowCenter_true, - nullptr, - 260); - } - else - { - std::string message; - switch (flag) - { - case 1: - // TRANSLATORS: char rename error - message = _("Rename not allowed."); - break; - case 2: - // TRANSLATORS: char rename error - message = _("New name is not set."); - break; - case 3: - default: - // TRANSLATORS: char rename error - message = _("Character rename error."); - break; - case 4: - // TRANSLATORS: char rename error - message = _("Character not found."); - break; - } - CREATEWIDGET(OkDialog, - // TRANSLATORS: info message - _("Info"), - message, - // TRANSLATORS: ok dialog button - _("OK"), - DialogType::OK, - Modal_true, - ShowCenter_true, - nullptr, - 260); - } -} - -void CharServerRecv::processCharChangeSlot(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("len"); - msg.readInt16("flag"); // 0 - ok, 1 - error - msg.readInt16("unused"); -} - -void CharServerRecv::processCharDeleteFailed(Net::MessageIn &msg) -{ - BLOCK_START("CharServerRecv::processCharDeleteFailed") - Net::CharServerHandler::unlockCharSelectDialog(); - msg.readUInt8("error"); - CREATEWIDGET(OkDialog, - // TRANSLATORS: error header - _("Error"), - // TRANSLATORS: error message - _("Failed to delete character."), - // TRANSLATORS: ok dialog button - _("OK"), - DialogType::ERROR, - Modal_true, - ShowCenter_true, - nullptr, - 260); - BLOCK_END("CharServerRecv::processCharDeleteFailed") -} - -void CharServerRecv::processCharCaptchaNotSupported(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("5"); - msg.readUInt8("1"); -} - -void CharServerRecv::processCharDelete2Ack(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("char id"); - msg.readInt32("result"); - // for packets before 20130000, this is raw time - // in other case raw time - time(NULL) - msg.readInt32("time"); -} - -void CharServerRecv::processCharDelete2AcceptActual(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("char id"); - msg.readInt32("result"); -} - -void CharServerRecv::processCharDelete2CancelAck(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("char id"); - msg.readInt32("result"); -} - -void CharServerRecv::processCharCharacters(Net::MessageIn &msg) -{ - msg.skip(2, "packet len"); - - delete_all(Net::CharServerHandler::mCharacters); - Net::CharServerHandler::mCharacters.clear(); - - // Derive number of characters from message length - const int count = (msg.getLength() - 4) - / (106 + 4 + 2 + 16 + 4 + 4 + 4 + 4); - - for (int i = 0; i < count; ++i) - { - Net::Character *const character = new Net::Character; - readPlayerData(msg, character); - Net::CharServerHandler::mCharacters.push_back(character); - if (character->dummy != nullptr) - { - logger->log("CharServer: Player: %s (%d)", - character->dummy->getName().c_str(), character->slot); - } - } - - client->setState(State::CHAR_SELECT); -} - -void CharServerRecv::processCharBanCharList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - const int count = (msg.readInt16("len") - 4) / 24; - for (int f = 0; f < count; f ++) - { - msg.readInt32("char id"); - msg.readString(20, "unbun time"); - } -} - -} // namespace EAthena diff --git a/src/net/eathena/charserverrecv.h b/src/net/eathena/charserverrecv.h deleted file mode 100644 index df37ed363..000000000 --- a/src/net/eathena/charserverrecv.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_CHARSERVERRECV_H -#define NET_EATHENA_CHARSERVERRECV_H - -#include "enums/simpletypes/beingid.h" - -#include <string> - -namespace Net -{ - class MessageIn; - - struct Character; -} // namespace Net - -namespace EAthena -{ - namespace CharServerRecv - { - extern std::string mNewName; - extern uint32_t mPinSeed; - extern BeingId mPinAccountId; - extern BeingId mRenameId; - extern bool mNeedCreatePin; - - void readPlayerData(Net::MessageIn &msg, - Net::Character *const character); - void processPincodeStatus(Net::MessageIn &msg); - void processCharLogin2(Net::MessageIn &msg); - void processCharCreate(Net::MessageIn &msg); - void processCharCheckRename(Net::MessageIn &msg); - void processCharRename(Net::MessageIn &msg); - void processCharChangeSlot(Net::MessageIn &msg); - void processCharDeleteFailed(Net::MessageIn &msg); - void processCharCaptchaNotSupported(Net::MessageIn &msg); - void processCharDelete2Ack(Net::MessageIn &msg); - void processCharDelete2AcceptActual(Net::MessageIn &msg); - void processCharDelete2CancelAck(Net::MessageIn &msg); - void processCharCharacters(Net::MessageIn &msg); - void processCharBanCharList(Net::MessageIn &msg); - void processCharLogin(Net::MessageIn &msg); - void processCharMapInfo(Net::MessageIn &msg); - void processChangeMapServer(Net::MessageIn &msg); - } // namespace CharServerRecv -} // namespace EAthena - -#endif // NET_EATHENA_CHARSERVERRECV_H diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp deleted file mode 100644 index 6b8e0517b..000000000 --- a/src/net/eathena/chathandler.cpp +++ /dev/null @@ -1,338 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/chathandler.h" - -#include "being/localplayer.h" - -#include "net/serverfeatures.h" - -#include "net/ea/chatrecv.h" - -#include "net/eathena/chatrecv.h" -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "resources/chatobject.h" - -#include "utils/stringutils.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -ChatHandler::ChatHandler() : - Ea::ChatHandler() -{ - chatHandler = this; -} - -ChatHandler::~ChatHandler() -{ - chatHandler = nullptr; -} - -void ChatHandler::talk(const std::string &restrict text, - const std::string &restrict channel A_UNUSED) const -{ - if (localPlayer == nullptr) - return; - - const std::string mes = std::string(localPlayer->getName()).append( - " : ").append(text); - - createOutPacket(CMSG_CHAT_MESSAGE); - if (packetVersion >= 20151001) - { - outMsg.writeInt16(CAST_S16(mes.length() + 4), "len"); - outMsg.writeString(mes, CAST_S32(mes.length()), "message"); - } - else - { - // Added + 1 in order to let eAthena parse admin commands correctly - outMsg.writeInt16(CAST_S16(mes.length() + 4 + 1), "len"); - outMsg.writeString(mes, CAST_S32(mes.length() + 1), "message"); - } -} - -void ChatHandler::talkRaw(const std::string &mes) const -{ - createOutPacket(CMSG_CHAT_MESSAGE); - outMsg.writeInt16(CAST_S16(mes.length() + 4), "len"); - outMsg.writeString(mes, CAST_S32(mes.length()), "message"); -} - -void ChatHandler::privateMessage(const std::string &restrict recipient, - const std::string &restrict text) const -{ - createOutPacket(CMSG_CHAT_WHISPER); - if (packetVersion >= 20151001) - { - outMsg.writeInt16(CAST_S16(text.length() + 28), "len"); - outMsg.writeString(recipient, 24, "recipient nick"); - outMsg.writeString(text, CAST_S32(text.length()), "message"); - } - else - { - outMsg.writeInt16(CAST_S16(text.length() + 28 + 1), "len"); - outMsg.writeString(recipient, 24, "recipient nick"); - outMsg.writeString(text, CAST_S32(text.length()), "message"); - outMsg.writeInt8(0, "null char"); - } - Ea::ChatRecv::mSentWhispers.push(recipient); -} - -void ChatHandler::channelMessage(const std::string &restrict channel, - const std::string &restrict text) const -{ - privateMessage(channel, text); -} - -void ChatHandler::who() const -{ - createOutPacket(CMSG_WHO_REQUEST); -} - -void ChatHandler::sendRaw(const std::string &args) const -{ - std::string line = args; - std::string str; - MessageOut *outMsg = nullptr; - - if (line.empty()) - return; - - size_t pos = line.find(' '); - if (pos != std::string::npos) - { - str = line.substr(0, pos); - - const int16_t id = CAST_S16(parseNumber(str)); - outMsg = new MessageOut(id); - outMsg->writeInt16(id, "packet id"); - line = line.substr(pos + 1); - pos = line.find(' '); - } - else - { - const int16_t id = CAST_S16(parseNumber(line)); - outMsg = new MessageOut(id); - outMsg->writeInt16(id, "packet id"); - delete outMsg; - return; - } - - while (pos != std::string::npos) - { - str = line.substr(0, pos); - processRaw(*outMsg, str); - line = line.substr(pos + 1); - pos = line.find(' '); - } - if (!line.empty()) - processRaw(*outMsg, line); - delete outMsg; -} - -void ChatHandler::processRaw(MessageOut &restrict outMsg, - const std::string &restrict line) -{ - if (line.size() < 2) - return; - - const uint32_t i = parseNumber(line.substr(1)); - switch (tolower(line[0])) - { - case 'b': - { - outMsg.writeInt8(CAST_U8(i), "raw"); - break; - } - case 'w': - { - outMsg.writeInt16(CAST_S16(i), "raw"); - break; - } - case 'l': - { - outMsg.writeInt32(CAST_S32(i), "raw"); - break; - } - default: - break; - } -} - -void ChatHandler::ignoreAll() const -{ - createOutPacket(CMSG_IGNORE_ALL); - outMsg.writeInt8(0, "flag"); -} - -void ChatHandler::unIgnoreAll() const -{ - createOutPacket(CMSG_IGNORE_ALL); - outMsg.writeInt8(1, "flag"); -} - - -void ChatHandler::ignore(const std::string &nick) const -{ - createOutPacket(CMSG_IGNORE_NICK); - outMsg.writeString(nick, 24, "nick"); - outMsg.writeInt8(0, "flag"); -} - -void ChatHandler::unIgnore(const std::string &nick) const -{ - createOutPacket(CMSG_IGNORE_NICK); - outMsg.writeString(nick, 24, "nick"); - outMsg.writeInt8(1, "flag"); -} - -void ChatHandler::requestIgnoreList() const -{ - createOutPacket(CMSG_REQUEST_IGNORE_LIST); -} - -void ChatHandler::createChatRoom(const std::string &title, - const std::string &password, - const int limit, - const bool isPublic) const -{ - createOutPacket(CMSG_CREAYE_CHAT_ROOM); - outMsg.writeInt16(CAST_S16( - 7 + 8 + 36), "len"); - outMsg.writeInt16(CAST_S16(limit), "limit"); - outMsg.writeInt8(CAST_S8(isPublic ? 1 : 0), "public"); - outMsg.writeString(password, 8, "password"); - outMsg.writeString(title, 36, "title"); - ChatRecv::mChatRoom = title; -} - -void ChatHandler::battleTalk(const std::string &text) const -{ - if (localPlayer == nullptr) - return; - - const std::string mes = std::string(localPlayer->getName()).append( - " : ").append(text); - - createOutPacket(CMSG_BATTLE_CHAT_MESSAGE); - if (packetVersion >= 20151001) - { - outMsg.writeInt16(CAST_S16(mes.length() + 4), "len"); - outMsg.writeString(mes, CAST_S32(mes.length()), "message"); - } - else - { - // Added + 1 in order to let eAthena parse admin commands correctly - outMsg.writeInt16(CAST_S16(mes.length() + 4 + 1), "len"); - outMsg.writeString(mes, CAST_S32(mes.length() + 1), "message"); - } -} - -void ChatHandler::joinChat(const ChatObject *const chat, - const std::string &password) const -{ - if (chat == nullptr) - return; - - createOutPacket(CMSG_CHAT_ROOM_JOIN); - outMsg.writeInt32(chat->chatId, "chat id"); - outMsg.writeString(password, 8, "password"); -} - -void ChatHandler::joinChannel(const std::string &channel) const -{ - if (serverFeatures->haveJoinChannel()) - { - createOutPacket(CMSG_CHAT_JOIN_CHANNEL); - outMsg.writeString(channel, 24, "channel name"); - } - else - { - channelMessage(channel, "\302\202\302"); - } -} - -void ChatHandler::partChannel(const std::string &channel) const -{ - if (serverFeatures->haveJoinChannel()) - { - createOutPacket(CMSG_CHAT_PART_CHANNEL); - outMsg.writeString(channel, 24, "channel name"); - } -} - -void ChatHandler::talkPet(const std::string &restrict text, - const std::string &restrict channel A_UNUSED) const -{ - if (text.empty()) - return; - std::string msg = text; - if (msg.size() > 500) - msg = msg.substr(0, 500); - const size_t sz = msg.size(); - - createOutPacket(CMSG_PET_TALK); - outMsg.writeInt16(CAST_S16(sz + 4 + 1), "len"); - outMsg.writeString(msg, CAST_S32(sz), "message"); - outMsg.writeInt8(0, "zero byte"); -} - -void ChatHandler::leaveChatRoom() const -{ - createOutPacket(CMSG_LEAVE_CHAT_ROOM); -} - -void ChatHandler::setChatRoomOptions(const int limit, - const bool isPublic, - const std::string &password, - const std::string &title) const -{ - createOutPacket(CMSG_SET_CHAT_ROOM_OPTIONS); - const int sz = CAST_S32(title.size()); - outMsg.writeInt16(CAST_S16(15 + sz), "len"); - outMsg.writeInt16(CAST_S16(limit), "limit"); - outMsg.writeInt8(CAST_S8(isPublic ? 1 : 0), "type"); - outMsg.writeString(password, 8, "password"); - outMsg.writeString(title, sz, "title"); -} - -void ChatHandler::setChatRoomOwner(const std::string &nick) const -{ - createOutPacket(CMSG_SET_CHAT_ROOM_OWNER); - outMsg.writeInt32(0, "role (unused)"); - outMsg.writeString(nick, 24, "nick"); -} - -void ChatHandler::kickFromChatRoom(const std::string &nick) const -{ - createOutPacket(CMSG_KICK_FROM_CHAT_ROOM); - outMsg.writeString(nick, 24, "nick"); -} - -} // namespace EAthena diff --git a/src/net/eathena/chathandler.h b/src/net/eathena/chathandler.h deleted file mode 100644 index 685327cd3..000000000 --- a/src/net/eathena/chathandler.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_CHATHANDLER_H -#define NET_EATHENA_CHATHANDLER_H - -#include "net/ea/chathandler.h" - -namespace EAthena -{ -class MessageOut; - -class ChatHandler final : public Ea::ChatHandler -{ - public: - ChatHandler(); - - A_DELETE_COPY(ChatHandler) - - ~ChatHandler(); - - void talk(const std::string &restrict text, - const std::string &restrict channel) const override final; - - void talkRaw(const std::string &text) const override final; - - void privateMessage(const std::string &restrict recipient, - const std::string &restrict text) const - override final; - - void channelMessage(const std::string &restrict channel, - const std::string &restrict text) const - override final; - - void joinChannel(const std::string &channel) const override final; - - void who() const override final; - - void sendRaw(const std::string &args) const override final; - - void ignoreAll() const override final; - - void unIgnoreAll() const override final; - - void createChatRoom(const std::string &title, - const std::string &password, - const int limit, - const bool isPublic) const override final; - - void ignore(const std::string &nick) const override final; - - void unIgnore(const std::string &nick) const override final; - - void requestIgnoreList() const override final; - - void battleTalk(const std::string &text) const override final; - - void joinChat(const ChatObject *const chat, - const std::string &password) const override final; - - void partChannel(const std::string &channel) const override final; - - void talkPet(const std::string &restrict text, - const std::string &restrict channel) const override final; - - void leaveChatRoom() const override final; - - void setChatRoomOptions(const int limit, - const bool isPublic, - const std::string &password, - const std::string &title) const override final; - - void setChatRoomOwner(const std::string &nick) const override final; - - void kickFromChatRoom(const std::string &nick) const override final; - - protected: - static void processRaw(MessageOut &restrict outMsg, - const std::string &restrict line); -}; - -} // namespace EAthena - -#endif // NET_EATHENA_CHATHANDLER_H diff --git a/src/net/eathena/chatrecv.cpp b/src/net/eathena/chatrecv.cpp deleted file mode 100644 index 97f0de803..000000000 --- a/src/net/eathena/chatrecv.cpp +++ /dev/null @@ -1,768 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/chatrecv.h" - -#include "actormanager.h" -#include "notifymanager.h" - -#include "being/localplayer.h" -#include "being/playerinfo.h" -#include "being/playerrelation.h" -#include "being/playerrelations.h" - -#include "const/gui/chat.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/chatwindow.h" - -#include "gui/widgets/tabs/chat/chattab.h" - -#include "net/messagein.h" - -#include "net/ea/chatrecv.h" - -#include "net/eathena/mercenaryrecv.h" - -#include "resources/chatobject.h" -#include "utils/gettext.h" -#include "utils/stringutils.h" - -#include "debug.h" - -namespace EAthena -{ - -namespace ChatRecv -{ - std::string mChatRoom; -} // namespace ChatRecv - -void ChatRecv::processIgnoreNickAck(Net::MessageIn &msg) -{ - const int type = msg.readUInt8("type"); - const int flag = msg.readUInt8("flag"); - switch (type) - { - case 0: - switch (flag) - { - case 0: - NotifyManager::notify(NotifyTypes::IGNORE_PLAYER_SUCCESS); - break; - case 1: - NotifyManager::notify(NotifyTypes::IGNORE_PLAYER_FAILURE); - break; - case 2: - NotifyManager::notify(NotifyTypes::IGNORE_PLAYER_TOO_MANY); - break; - default: - NotifyManager::notify(NotifyTypes::IGNORE_PLAYER_UNKNOWN); - break; - } - break; - case 1: - switch (flag) - { - case 0: - NotifyManager::notify( - NotifyTypes::UNIGNORE_PLAYER_SUCCESS); - break; - case 1: - NotifyManager::notify( - NotifyTypes::UNIGNORE_PLAYER_FAILURE); - break; - default: - NotifyManager::notify( - NotifyTypes::UNIGNORE_PLAYER_UNKNOWN); - break; - } - break; - - default: - NotifyManager::notify(NotifyTypes::IGNORE_PLAYER_TYPE_UNKNOWN); - break; - } -} - -void ChatRecv::processChat(Net::MessageIn &msg) -{ - BLOCK_START("ChatRecv::processChat") - const int chatMsgLength = msg.readInt16("len") - 4; - if (chatMsgLength <= 0) - { - BLOCK_END("ChatRecv::processChat") - return; - } - - processChatContinue(msg.readRawString(chatMsgLength, "message"), - ChatMsgType::BY_PLAYER); -} - -void ChatRecv::processFormatMessage(Net::MessageIn &msg) -{ - const int msgId = msg.readInt16("msg id"); - // +++ here need load message from configuration file - std::string chatMsg; - if (msgId >= 1266 && msgId <= 1269) - { - MercenaryRecv::handleMercenaryMessage(msgId - 1266); - return; - } - switch (msgId) - { - case 1334: - // TRANSLATORS: error message - chatMsg = _("Can't cast skill in this area."); - break; - case 1335: - // TRANSLATORS: error message - chatMsg = _("Can't use item in this area."); - break; - case 1773: - // TRANSLATORS: error message - chatMsg = _("Can't equip. Wrong level."); - break; - case 1774: - // TRANSLATORS: error message - chatMsg = _("Can't use. Wrong level."); - break; - case 1923: - // TRANSLATORS: error message - chatMsg = _("Work in progress."); // busy with npc - break; - default: - chatMsg = strprintf("Message #%d", msgId); - break; - } - processChatContinue(chatMsg, ChatMsgType::BY_SERVER); -} - -void ChatRecv::processFormatMessageNumber(Net::MessageIn &msg) -{ - const int msgId = msg.readInt16("msg id"); - const int value = msg.readInt32("value"); - if (msgId == 1862) - { - NotifyManager::notify(NotifyTypes::USE_ITEM_WAIT, value); - return; - } - // +++ here need load message from configuration file - const std::string chatMsg = strprintf( - "Message #%d, value: %d", msgId, value); - processChatContinue(chatMsg, ChatMsgType::BY_SERVER); -} - -void ChatRecv::processFormatMessageSkill(Net::MessageIn &msg) -{ - const int skillId = msg.readInt16("skill id"); - const int msgId = msg.readInt32("msg id"); - // +++ here need load message from configuration file - const std::string chatMsg = strprintf( - "Message #%d, skill: %d", msgId, skillId); - processChatContinue(chatMsg, ChatMsgType::BY_SERVER); -} - -void ChatRecv::processColorChat(Net::MessageIn &msg) -{ - BLOCK_START("ChatRecv::processChat") - int chatMsgLength = msg.readInt16("len") - 4; - msg.readInt32("unused"); - msg.readInt32("chat color"); - chatMsgLength -= 8; - if (chatMsgLength <= 0) - { - BLOCK_END("ChatRecv::processChat") - return; - } - - std::string message = msg.readRawString(chatMsgLength, "message"); - std::string msg2 = message; - if (findCutFirst(msg2, "You're now in the '#") && findCutLast(msg2, "'")) - { - const size_t idx = msg2.find("' channel for '"); - if (idx != std::string::npos && (chatWindow != nullptr)) - { - chatWindow->addChannelTab(std::string("#").append( - msg2.substr(0, idx)), false); - return; - } - } - else - { - const std::string nick = Ea::ChatRecv::getLastWhisperNick(); - if (nick.size() > 1 && nick[0] == '#') - { - if (message == strprintf("[ %s ] %s : \302\202\302", - nick.c_str(), localPlayer->getName().c_str())) - { - Ea::ChatRecv::mSentWhispers.pop(); - } - } - } - processChatContinue(message, ChatMsgType::BY_UNKNOWN); -} - -std::string ChatRecv::extractChannelFromMessage(std::string &chatMsg) -{ - std::string msg = chatMsg; - std::string channel(GENERAL_CHANNEL); - if (findCutFirst(msg, "[ #")) - { // found channel message - const size_t idx = msg.find(" ] "); - if (idx != std::string::npos) - { - channel = std::string("#").append(msg.substr(0, idx)); - chatMsg = msg.substr(idx + 3); - } - } - return channel; -} - -void ChatRecv::processChatContinue(std::string chatMsg, - const ChatMsgTypeT own) -{ - const std::string channel = extractChannelFromMessage(chatMsg); - bool allow(true); - if (chatWindow != nullptr) - { - allow = chatWindow->resortChatLog(chatMsg, - own, - channel, - IgnoreRecord_false, - TryRemoveColors_true); - } - - const size_t pos = chatMsg.find(" : ", 0); - if (pos != std::string::npos) - chatMsg.erase(0, pos + 3); - - trim(chatMsg); - - if (localPlayer != nullptr) - { - if (((chatWindow != nullptr) || Ea::ChatRecv::mShowMotd) && allow) - localPlayer->setSpeech(chatMsg, GENERAL_CHANNEL); - } - BLOCK_END("ChatRecv::processChat") -} - -void ChatRecv::processGmChat(Net::MessageIn &msg) -{ - BLOCK_START("ChatRecv::processChat") - const int chatMsgLength = msg.readInt16("len") - 4; - if (chatMsgLength <= 0) - { - BLOCK_END("ChatRecv::processChat") - return; - } - - std::string chatMsg = msg.readRawString(chatMsgLength, "message"); - // remove non persistend "colors" from server. - if (!findCutFirst(chatMsg, "ssss")) - findCutFirst(chatMsg, "eulb"); - - if (chatWindow != nullptr) - chatWindow->addGlobalMessage(chatMsg); - BLOCK_END("ChatRecv::processChat") -} - -void ChatRecv::processGmChat2(Net::MessageIn &msg) -{ - const int chatMsgLength = msg.readInt16("len") - 16; - msg.readInt32("font color"); - msg.readInt16("font type"); - msg.readInt16("font size"); - msg.readInt16("font align"); - msg.readInt16("font y"); - if (chatWindow != nullptr) - { - const std::string chatMsg = msg.readRawString(chatMsgLength, - "message"); - chatWindow->addGlobalMessage(chatMsg); - } - else - { - msg.readRawString(chatMsgLength, "message"); - } -} - -void ChatRecv::processWhisper(Net::MessageIn &msg) -{ - BLOCK_START("ChatRecv::processWhisper") - int packetLen = 28; - if (msg.getVersion() >= 20091104) - packetLen += 4; - const int chatMsgLength = msg.readInt16("len") - packetLen; - std::string nick = msg.readString(24, "nick"); - if (msg.getVersion() >= 20091104) - msg.readInt32("admin flag"); - - if (chatMsgLength <= 0) - { - BLOCK_END("ChatRecv::processWhisper") - return; - } - - processWhisperContinue(nick, msg.readString(chatMsgLength, "message")); -} - -void ChatRecv::processWhisperResponse(Net::MessageIn &msg) -{ - BLOCK_START("ChatRecv::processWhisperResponse") - - const uint8_t type = msg.readUInt8("response"); - if (msg.getVersion() >= 20131223) - msg.readInt32("unknown"); - if (type == 1 && (chatWindow != nullptr)) - { - const std::string nick = Ea::ChatRecv::getLastWhisperNick(); - if (nick.size() > 1 && nick[0] == '#') - { - chatWindow->channelChatLog(nick, - // TRANSLATORS: chat message - strprintf(_("Message could not be sent, channel " - "%s is not exists."), nick.c_str()), - ChatMsgType::BY_SERVER, - IgnoreRecord_false, - TryRemoveColors_false); - if (!Ea::ChatRecv::mSentWhispers.empty()) - Ea::ChatRecv::mSentWhispers.pop(); - return; - } - } - Ea::ChatRecv::processWhisperResponseContinue(msg, type); -} - -void ChatRecv::processChatIgnoreList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // +++ need put it in some object or window - const int count = (msg.readInt16("len") - 4) / 24; - for (int f = 0; f < count; f ++) - msg.readString(24, "nick"); -} - -void ChatRecv::processChatDisplay(Net::MessageIn &msg) -{ - const int len = msg.readInt16("len") - 17; - ChatObject *const obj = new ChatObject; - obj->ownerId = msg.readBeingId("owner account id"); - obj->chatId = msg.readInt32("chat id"); - obj->maxUsers = msg.readInt16("max users"); - obj->currentUsers = msg.readInt16("current users"); - obj->type = msg.readUInt8("type"); - obj->title = msg.readString(len, "title"); - obj->update(); - - Being *const dstBeing = actorManager->findBeing(obj->ownerId); - if (dstBeing != nullptr) - dstBeing->setChat(obj); -} - -void ChatRecv::processChatRoomJoinAck(Net::MessageIn &msg) -{ - const int count = (msg.readInt16("len") - 8) / 28; - const int id = msg.readInt32("chat id"); - - // +++ ignore chat members for now - for (int f = 0; f < count; f ++) - { - msg.readInt32("role"); - msg.readString(24, "name"); - } - - const ChatObject *const oldChat = ChatObject::findById(id); - - if (oldChat != nullptr) - PlayerInfo::setRoomName(oldChat->title); - else - PlayerInfo::setRoomName(std::string()); - chatWindow->joinRoom(true); - ChatObject *const obj = new ChatObject; - if (oldChat != nullptr) - { - obj->ownerId = oldChat->ownerId; - obj->chatId = oldChat->chatId; - obj->maxUsers = oldChat->maxUsers; - obj->currentUsers = oldChat->currentUsers; - obj->type = oldChat->type; - obj->title = oldChat->title; -// obj->update(); - } - localPlayer->setChat(obj); -} - -void ChatRecv::processChatRoomLeave(Net::MessageIn &msg) -{ - msg.readInt16("users"); - const std::string name = msg.readString(24, "name"); - const int status = msg.readUInt8("flag"); // 0 - left, 1 - kicked - switch (status) - { - case 0: - NotifyManager::notify(NotifyTypes::ROOM_LEAVE, name); - break; - case 1: - NotifyManager::notify(NotifyTypes::ROOM_KICKED, name); - break; - default: - UNIMPLEMENTEDPACKETFIELD(status); - break; - } - if ((localPlayer != nullptr) && name == localPlayer->getName()) - { - if (chatWindow != nullptr) - chatWindow->joinRoom(false); - PlayerInfo::setRoomName(std::string()); - if (localPlayer != nullptr) - localPlayer->setChat(nullptr); - } - else - { - Being *const being = actorManager->findBeingByName( - name, ActorType::Player); - if (being != nullptr) - being->setChat(nullptr); - } -} - -void ChatRecv::processJoinChannel(Net::MessageIn &msg) -{ - if (chatWindow == nullptr) - return; - - const std::string channel = msg.readString(24, "channel name"); - const int flag = msg.readUInt8("flag"); - - if (channel.size() < 2) - return; - switch (flag) - { - case 0: - default: - chatWindow->channelChatLog(channel, - // TRANSLATORS: chat message - strprintf(_("Can't open channel. Channel " - "%s is not exists."), channel.c_str()), - ChatMsgType::BY_SERVER, - IgnoreRecord_false, - TryRemoveColors_false); - break; - - case 1: - case 2: - chatWindow->addChannelTab(std::string("#").append( - channel.substr(1)), false); - break; - } -} - -void ChatRecv::processWhisperContinue(const std::string &nick, - std::string chatMsg) -{ - // ignoring future whisper messages - if (chatMsg.find("\302\202G") == 0 || chatMsg.find("\302\202A") == 0) - { - BLOCK_END("ChatRecv::processWhisper") - return; - } - // remove first unicode space if this is may be whisper command. - if (chatMsg.find("\302\202!") == 0) - chatMsg = chatMsg.substr(2); - - if (nick != "Server") - { - if (playerRelations.hasPermission(nick, PlayerRelation::WHISPER)) - chatWindow->addWhisper(nick, chatMsg); - } - else if (localChatTab != nullptr) - { - localChatTab->chatLog(chatMsg, ChatMsgType::BY_SERVER); - } - BLOCK_END("ChatRecv::processWhisper") -} - -void ChatRecv::processBeingChat(Net::MessageIn &msg) -{ - if (actorManager == nullptr) - return; - - BLOCK_START("ChatRecv::processBeingChat") - const int chatMsgLength = msg.readInt16("len") - 8; - Being *const being = actorManager->findBeing(msg.readBeingId("being id")); - - if (chatMsgLength <= 0) - { - BLOCK_END("ChatRecv::processBeingChat") - return; - } - - std::string chatMsg = msg.readRawString(chatMsgLength, "message"); - - if ((being != nullptr) && being->getType() == ActorType::Player) - being->setTalkTime(); - - const size_t pos = chatMsg.find(" : ", 0); - std::string sender_name = ((pos == std::string::npos) - ? "" : chatMsg.substr(0, pos)); - - if ((being != nullptr) && sender_name != being->getName() - && being->getType() == ActorType::Player) - { - if (!being->getName().empty()) - sender_name = being->getName(); - } - else - { - chatMsg.erase(0, pos + 3); - } - - trim(chatMsg); - - bool allow(true); - // We use getIgnorePlayer instead of ignoringPlayer here - // because ignorePlayer' side effects are triggered - // right below for Being::IGNORE_SPEECH_FLOAT. - if ((playerRelations.checkPermissionSilently(sender_name, - PlayerRelation::SPEECH_LOG) != 0u) && (chatWindow != nullptr)) - { - allow = chatWindow->resortChatLog( - removeColors(sender_name).append(" : ").append(chatMsg), - ChatMsgType::BY_OTHER, - GENERAL_CHANNEL, - IgnoreRecord_false, - TryRemoveColors_true); - } - - if (allow && - being != nullptr && - playerRelations.hasPermission(sender_name, - PlayerRelation::SPEECH_FLOAT)) - { - being->setSpeech(chatMsg, GENERAL_CHANNEL); - } - BLOCK_END("ChatRecv::processBeingChat") -} - -void ChatRecv::processChatRoomCreateAck(Net::MessageIn &msg) -{ - const int result = msg.readUInt8("flag"); - switch (result) - { - case 0: - { - PlayerInfo::setRoomName(mChatRoom); - chatWindow->joinRoom(true); - ChatObject *const obj = new ChatObject; - obj->ownerId = localPlayer->getId(); - obj->chatId = 0; - obj->maxUsers = 1000; - obj->currentUsers = 1; - obj->type = 1; - obj->title = mChatRoom; - obj->update(); - localPlayer->setChat(obj); - break; - } - case 1: - NotifyManager::notify(NotifyTypes::ROOM_LIMIT_EXCEEDED); - break; - case 2: - NotifyManager::notify(NotifyTypes::ROOM_ALREADY_EXISTS); - break; - default: - UNIMPLEMENTEDPACKETFIELD(result); - break; - } - mChatRoom.clear(); -} - -void ChatRecv::processChatRoomDestroy(Net::MessageIn &msg) -{ - const int chatId = msg.readInt32("chat id"); - actorManager->removeRoom(chatId); -} - -void ChatRecv::processChatRoomJoinFailed(Net::MessageIn &msg) -{ - const int result = msg.readUInt8("flag"); - switch (result) - { - case 0: - NotifyManager::notify(NotifyTypes::ROOM_ERROR_FULL); - break; - case 1: - NotifyManager::notify(NotifyTypes::ROOM_ERROR_WRONG_PASSWORD); - break; - case 2: - NotifyManager::notify(NotifyTypes::ROOM_ERROR_KICKED); - break; - case 3: - break; - case 4: - NotifyManager::notify(NotifyTypes::ROOM_ERROR_ZENY); - break; - case 5: - NotifyManager::notify(NotifyTypes::ROOM_ERROR_LOW_LEVEL); - break; - case 6: - NotifyManager::notify(NotifyTypes::ROOM_ERROR_HIGH_LEVEL); - break; - case 7: - NotifyManager::notify(NotifyTypes::ROOM_ERROR_RACE); - break; - default: - UNIMPLEMENTEDPACKETFIELD(result); - break; - } -} - -void ChatRecv::processChatRoomAddMember(Net::MessageIn &msg) -{ - msg.readInt16("users"); - const std::string name = msg.readString(24, "name"); - if (localChatTab == nullptr) - return; - NotifyManager::notify(NotifyTypes::ROOM_JOINED, name); -} - -void ChatRecv::processChatRoomSettings(Net::MessageIn &msg) -{ - const int sz = msg.readInt16("len") - 17; - const BeingId ownerId = msg.readBeingId("owner id"); - const int chatId = msg.readInt32("chat id"); - const uint16_t limit = msg.readInt16("limit"); - msg.readInt16("users"); - const uint8_t type = msg.readUInt8("type"); - const std::string &title = msg.readString(sz, "title"); - ChatObject *const chat = localPlayer->getChat(); - if ((chat != nullptr) && chat->chatId == chatId) - { - chat->ownerId = ownerId; - chat->maxUsers = limit; - chat->type = type; - if (chat->title != title) - { - chat->title = title; - actorManager->updateRoom(chat); - chatWindow->joinRoom(true); - } - } -} - -void ChatRecv::processChatRoomRoleChange(Net::MessageIn &msg) -{ - const int role = msg.readInt32("role"); - const std::string name = msg.readString(24, "name"); - switch (role) - { - case 0: - NotifyManager::notify(NotifyTypes::ROOM_ROLE_OWNER, name); - break; - case 1: - // dont show normal role - break; - default: - UNIMPLEMENTEDPACKETFIELD(role); - break; - } -} - -void ChatRecv::processMVPItem(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("item id"); -} - -void ChatRecv::processMVPExp(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("exo"); -} - -void ChatRecv::processMVPNoItem(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; -} - -void ChatRecv::processMannerMessage(Net::MessageIn &msg) -{ - const int result = msg.readInt32("type"); - switch (result) - { - case 0: - NotifyManager::notify(NotifyTypes::MANNER_CHANGED); - break; - case 5: - break; - default: - UNIMPLEMENTEDPACKETFIELD(result); - break; - } -} - -void ChatRecv::processChatSilence(Net::MessageIn &msg) -{ - const int result = msg.readUInt8("type"); - const std::string name = msg.readString(24, "gm name"); - - switch (result) - { - case 0: - NotifyManager::notify(NotifyTypes::MANNER_POSITIVE_POINTS, name); - break; - case 1: - NotifyManager::notify(NotifyTypes::MANNER_NEGATIVE_POINTS, name); - break; - default: - UNIMPLEMENTEDPACKETFIELD(result); - break; - } -} - -void ChatRecv::processChatTalkieBox(Net::MessageIn &msg) -{ - msg.readBeingId("being id"); - const std::string message = msg.readString(80, "message"); - localChatTab->chatLog(message, ChatMsgType::BY_SERVER); -} - -void ChatRecv::processBattleChatMessage(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - const int sz = msg.readInt16("len") - 24 - 8; - msg.readBeingId("account id"); - msg.readString(24, "nick"); - msg.readString(sz, "message"); -} - -void ChatRecv::processScriptMessage(Net::MessageIn &msg) -{ - const int sz = msg.readInt16("len") - 8; - msg.readBeingId("being id"); - const std::string message = msg.readString(sz, "message"); - localChatTab->chatLog(message, ChatMsgType::BY_SERVER); -} - -} // namespace EAthena diff --git a/src/net/eathena/chatrecv.h b/src/net/eathena/chatrecv.h deleted file mode 100644 index 0f072bee6..000000000 --- a/src/net/eathena/chatrecv.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_CHATRECV_H -#define NET_EATHENA_CHATRECV_H - -#include "enums/gui/chatmsgtype.h" - -#include <string> - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace ChatRecv - { - std::string extractChannelFromMessage(std::string &chatMsg); - void processChat(Net::MessageIn &msg); - void processColorChat(Net::MessageIn &msg); - void processChatContinue(std::string chatMsg, - const ChatMsgTypeT own); - void processWhisper(Net::MessageIn &msg); - void processWhisperResponse(Net::MessageIn &msg); - void processGmChat(Net::MessageIn &msg); - void processGmChat2(Net::MessageIn &msg); - void processChatIgnoreList(Net::MessageIn &msg); - void processFormatMessage(Net::MessageIn &msg); - void processFormatMessageNumber(Net::MessageIn &msg); - void processFormatMessageSkill(Net::MessageIn &msg); - void processChatDisplay(Net::MessageIn &msg); - void processChatRoomJoinAck(Net::MessageIn &msg); - void processChatRoomLeave(Net::MessageIn &msg); - void processJoinChannel(Net::MessageIn &msg); - void processWhisperContinue(const std::string &nick, - std::string chatMsg); - void processBeingChat(Net::MessageIn &msg); - void processIgnoreNickAck(Net::MessageIn &msg); - void processChatRoomCreateAck(Net::MessageIn &msg); - void processChatRoomDestroy(Net::MessageIn &msg); - void processChatRoomJoinFailed(Net::MessageIn &msg); - void processChatRoomAddMember(Net::MessageIn &msg); - void processChatRoomSettings(Net::MessageIn &msg); - void processChatRoomRoleChange(Net::MessageIn &msg); - void processMVPItem(Net::MessageIn &msg); - void processMVPExp(Net::MessageIn &msg); - void processMVPNoItem(Net::MessageIn &msg); - void processMannerMessage(Net::MessageIn &msg); - void processChatSilence(Net::MessageIn &msg); - void processChatTalkieBox(Net::MessageIn &msg); - void processBattleChatMessage(Net::MessageIn &msg); - void processScriptMessage(Net::MessageIn &msg); - extern std::string mChatRoom; - } // namespace ChatRecv -} // namespace EAthena - -#endif // NET_EATHENA_CHATRECV_H diff --git a/src/net/eathena/elementalhandler.cpp b/src/net/eathena/elementalhandler.cpp deleted file mode 100644 index 8a8fa56bb..000000000 --- a/src/net/eathena/elementalhandler.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/elementalhandler.h" - -#include "debug.h" - -namespace EAthena -{ - -ElementalHandler::ElementalHandler() : - Net::ElementalHandler() -{ - elementalHandler = this; -} - -ElementalHandler::~ElementalHandler() -{ - elementalHandler = nullptr; -} - -} // namespace EAthena diff --git a/src/net/eathena/elementalhandler.h b/src/net/eathena/elementalhandler.h deleted file mode 100644 index 517b74a30..000000000 --- a/src/net/eathena/elementalhandler.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_ELEMENTALHANDLER_H -#define NET_EATHENA_ELEMENTALHANDLER_H - -#include "net/elementalhandler.h" - -namespace EAthena -{ -class ElementalHandler final : public Net::ElementalHandler -{ - public: - ElementalHandler(); - - A_DELETE_COPY(ElementalHandler) - - ~ElementalHandler(); -}; - -} // namespace EAthena - -#endif // NET_EATHENA_ELEMENTALHANDLER_H diff --git a/src/net/eathena/elementalrecv.cpp b/src/net/eathena/elementalrecv.cpp deleted file mode 100644 index d5e0c6d18..000000000 --- a/src/net/eathena/elementalrecv.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/elementalrecv.h" - -#include "being/playerinfo.h" - -#include "net/messagein.h" - -#include "net/eathena/sp.h" - -#include "utils/checkutils.h" - -#include "debug.h" - -namespace EAthena -{ - -#define setElementalStat(sp, stat) \ - case sp: \ - PlayerInfo::setStatBase(stat, \ - val); \ - break; - -void ElementalRecv::processElementalUpdateStatus(Net::MessageIn &msg) -{ - const int sp = msg.readInt16("type"); - const int val = msg.readInt32("value"); - switch (sp) - { - setElementalStat(Sp::HP, Attributes::ELEMENTAL_HP); - setElementalStat(Sp::MAXHP, Attributes::ELEMENTAL_MAX_HP); - setElementalStat(Sp::SP, Attributes::ELEMENTAL_MP); - setElementalStat(Sp::MAXSP, Attributes::ELEMENTAL_MAX_MP); - default: - reportAlways("Unknown elemental stat %d", - sp); - break; - } -} - -void ElementalRecv::processElementalInfo(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("elemental id"); - PlayerInfo::setStatBase(Attributes::ELEMENTAL_HP, - msg.readInt32("hp")); - PlayerInfo::setStatBase(Attributes::ELEMENTAL_MAX_HP, - msg.readInt32("max hp")); - PlayerInfo::setStatBase(Attributes::ELEMENTAL_MP, - msg.readInt32("sp")); - PlayerInfo::setStatBase(Attributes::ELEMENTAL_MAX_MP, - msg.readInt32("max sp")); - PlayerInfo::setElemental(id); -} - -} // namespace EAthena diff --git a/src/net/eathena/elementalrecv.h b/src/net/eathena/elementalrecv.h deleted file mode 100644 index f99c8e1a3..000000000 --- a/src/net/eathena/elementalrecv.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_ELEMENTALRECV_H -#define NET_EATHENA_ELEMENTALRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace ElementalRecv - { - void processElementalUpdateStatus(Net::MessageIn &msg); - void processElementalInfo(Net::MessageIn &msg); - } // namespace ElementalRecv -} // namespace EAthena - -#endif // NET_EATHENA_ELEMENTALRECV_H diff --git a/src/net/eathena/familyhandler.cpp b/src/net/eathena/familyhandler.cpp deleted file mode 100644 index 5ec423ce5..000000000 --- a/src/net/eathena/familyhandler.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/familyhandler.h" - -#include "being/being.h" - -#include "net/eathena/familyrecv.h" -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -namespace EAthena -{ - -FamilyHandler::FamilyHandler() : - Net::FamilyHandler() -{ - FamilyRecv::mParent1 = BeingId_zero; - FamilyRecv::mParent2 = BeingId_zero; - - familyHandler = this; -} - -FamilyHandler::~FamilyHandler() -{ - familyHandler = nullptr; -} - -void FamilyHandler::askForChild(const Being *const being) const -{ - if (being == nullptr) - return; - - createOutPacket(CMSG_FAMILY_ASK_FOR_CHILD); - outMsg.writeBeingId(being->getId(), "account id"); -} - -void FamilyHandler::askForChildReply(const bool accept) const -{ - createOutPacket(CMSG_FAMILY_ASK_FOR_CHILD_REPLY); - outMsg.writeBeingId(FamilyRecv::mParent1, "parent1"); - outMsg.writeBeingId(FamilyRecv::mParent2, "parent2"); - outMsg.writeInt32(accept ? 1 : 0, "result"); - FamilyRecv::mParent1 = BeingId_zero; - FamilyRecv::mParent2 = BeingId_zero; -} - -} // namespace EAthena diff --git a/src/net/eathena/familyhandler.h b/src/net/eathena/familyhandler.h deleted file mode 100644 index 91531fb2d..000000000 --- a/src/net/eathena/familyhandler.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_FAMILYHANDLER_H -#define NET_EATHENA_FAMILYHANDLER_H - -#include "net/familyhandler.h" - -namespace EAthena -{ -class FamilyHandler final : public Net::FamilyHandler -{ - public: - FamilyHandler(); - - A_DELETE_COPY(FamilyHandler) - - ~FamilyHandler(); - - void askForChild(const Being *const being) const override final; - - void askForChildReply(const bool accept) const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_FAMILYHANDLER_H diff --git a/src/net/eathena/familyrecv.cpp b/src/net/eathena/familyrecv.cpp deleted file mode 100644 index f9f7b2fd8..000000000 --- a/src/net/eathena/familyrecv.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/familyrecv.h" - -#include "notifymanager.h" -#include "party.h" - -#include "being/localplayer.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/widgets/createwidget.h" - -#include "utils/gettext.h" -#include "utils/stringutils.h" - -#include "listeners/requestadoptchildlistener.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace EAthena -{ - -namespace FamilyRecv -{ - ConfirmDialog *confirmDlg = nullptr; - RequestAdoptChildListener listener; - BeingId mParent1 = BeingId_zero; - BeingId mParent2 = BeingId_zero; -} // namespace FamilyRecv - -void FamilyRecv::processAskForChild(Net::MessageIn &msg) -{ - if (localPlayer == nullptr) - { - mParent1 = msg.readBeingId("account id who ask"); - mParent2 = msg.readBeingId("acoount id for other parent"); - msg.readString(24, "name who ask"); - return; - } - mParent1 = msg.readBeingId("account id who ask"); - mParent2 = msg.readBeingId("acoount id for other parent"); - const std::string name1 = msg.readString(24, "name who ask"); - const Party *const party = localPlayer->getParty(); - if (party != nullptr) - { - const PartyMember *const member = party->getMember(mParent2); - if (member != nullptr) - { - const std::string name2 = member->getName(); - CREATEWIDGETV(confirmDlg, ConfirmDialog, - // TRANSLATORS: adopt child message - _("Request parents"), - // TRANSLATORS: adopt child message - strprintf(_("Do you accept %s and %s as parents?"), - name1.c_str(), name2.c_str()), - SOUND_REQUEST, - false); - confirmDlg->addActionListener(&listener); - } - } -} - -void FamilyRecv::processCallPartner(Net::MessageIn &msg) -{ - const std::string name = msg.readString(24, "name"); - if ((localPlayer != nullptr) && name == localPlayer->getName()) - { - NotifyManager::notify(NotifyTypes::CALLED_PARTNER); - } - else - { - NotifyManager::notify(NotifyTypes::CALLING_PARTNER, name.c_str()); - } -} - -void FamilyRecv::processDivorced(Net::MessageIn &msg) -{ - const std::string name = msg.readString(24, "name"); - NotifyManager::notify(NotifyTypes::DIVORCED, name.c_str()); -} - -void FamilyRecv::processAskForChildReply(Net::MessageIn &msg) -{ - const int type = msg.readInt32("type"); - switch (type) - { - case 0: - NotifyManager::notify(NotifyTypes::ADOPT_CHILD_ERROR_HAVE_BABY); - break; - case 1: - NotifyManager::notify(NotifyTypes::ADOPT_CHILD_ERROR_LEVEL); - break; - case 2: - NotifyManager::notify(NotifyTypes::ADOPT_CHILD_ERROR_BABY_MARRIED); - break; - default: - UNIMPLEMENTEDPACKETFIELD(type); - break; - } -} - -} // namespace EAthena diff --git a/src/net/eathena/familyrecv.h b/src/net/eathena/familyrecv.h deleted file mode 100644 index f069851aa..000000000 --- a/src/net/eathena/familyrecv.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_FAMILYRECV_H -#define NET_EATHENA_FAMILYRECV_H - -#include "enums/simpletypes/beingid.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace FamilyRecv - { - extern BeingId mParent1; - extern BeingId mParent2; - - void processAskForChild(Net::MessageIn &msg); - void processCallPartner(Net::MessageIn &msg); - void processDivorced(Net::MessageIn &msg); - void processAskForChildReply(Net::MessageIn &msg); - } // namespace FamilyRecv -} // namespace EAthena - -#endif // NET_EATHENA_FAMILYRECV_H diff --git a/src/net/eathena/friendshandler.cpp b/src/net/eathena/friendshandler.cpp deleted file mode 100644 index 000ea909d..000000000 --- a/src/net/eathena/friendshandler.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/friendshandler.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -namespace EAthena -{ - -FriendsHandler::FriendsHandler() -{ - friendsHandler = this; -} - -FriendsHandler::~FriendsHandler() -{ - friendsHandler = nullptr; -} - -void FriendsHandler::invite(const std::string &name) const -{ - createOutPacket(CMSG_FRIENDS_ADD_PLAYER); - outMsg.writeString(name, 24, "name"); -} - -void FriendsHandler::inviteResponse(const int accountId, - const int charId, - const bool accept) const -{ - createOutPacket(CMSG_FRIENDS_REQUEST_ACK); - outMsg.writeInt32(accountId, "account id"); - outMsg.writeInt32(charId, "char id"); - outMsg.writeInt32(accept ? 1 : 0, "result"); -} - -void FriendsHandler::remove(const int accountId, const int charId) const -{ - createOutPacket(CMSG_FRIENDS_DELETE_PLAYER); - outMsg.writeInt32(accountId, "account id"); - outMsg.writeInt32(charId, "char id"); -} - -} // namespace EAthena diff --git a/src/net/eathena/friendshandler.h b/src/net/eathena/friendshandler.h deleted file mode 100644 index 7b985e0ca..000000000 --- a/src/net/eathena/friendshandler.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_FRIENDSHANDLER_H -#define NET_EATHENA_FRIENDSHANDLER_H - -#include "net/friendshandler.h" - -namespace EAthena -{ -class FriendsHandler final : public Net::FriendsHandler -{ - public: - FriendsHandler(); - - A_DELETE_COPY(FriendsHandler) - - ~FriendsHandler(); - - void invite(const std::string &name) const override final; - - void inviteResponse(const int accountId, - const int charId, - const bool accept) const override final; - - void remove(const int accountId, - const int charId) const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_FRIENDSHANDLER_H diff --git a/src/net/eathena/friendsrecv.cpp b/src/net/eathena/friendsrecv.cpp deleted file mode 100644 index cf0f6f66a..000000000 --- a/src/net/eathena/friendsrecv.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/friendsrecv.h" - -#include "logger.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace EAthena -{ - -void FriendsRecv::processPlayerOnline(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readBeingId("account id"); - msg.readInt32("char id"); - msg.readUInt8("flag"); // 0 - online, 1 - offline -} - -void FriendsRecv::processFriendsList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - const int count = (msg.readInt16("size") - 4) / 32; - for (int f = 0; f < count; f ++) - { - msg.readBeingId("account id"); - msg.readInt32("char id"); - msg.readString(24, "name"); - } -} - -void FriendsRecv::processRequestAck(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("type"); - msg.readBeingId("account id"); - msg.readInt32("char id"); - msg.readString(24, "name"); -} - -void FriendsRecv::processRequest(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readBeingId("account id"); - msg.readInt32("char id"); - msg.readString(24, "name"); -} - -void FriendsRecv::processDeletePlayer(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readBeingId("account id"); - msg.readInt32("char id"); -} - -} // namespace EAthena diff --git a/src/net/eathena/friendsrecv.h b/src/net/eathena/friendsrecv.h deleted file mode 100644 index c6dbb5841..000000000 --- a/src/net/eathena/friendsrecv.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_FRIENDSRECV_H -#define NET_EATHENA_FRIENDSRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace FriendsRecv - { - void processPlayerOnline(Net::MessageIn &msg); - void processFriendsList(Net::MessageIn &msg); - void processRequestAck(Net::MessageIn &msg); - void processRequest(Net::MessageIn &msg); - void processDeletePlayer(Net::MessageIn &msg); - } // namespace FriendsRecv -} // namespace EAthena - -#endif // NET_EATHENA_FRIENDSRECV_H diff --git a/src/net/eathena/gamehandler.cpp b/src/net/eathena/gamehandler.cpp deleted file mode 100644 index 274c04c0d..000000000 --- a/src/net/eathena/gamehandler.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/gamehandler.h" - -#include "client.h" - -#include "being/localplayer.h" - -#include "net/serverfeatures.h" - -#include "net/ea/token.h" - -#include "net/ea/gamerecv.h" - -#include "net/eathena/loginhandler.h" -#include "net/eathena/messageout.h" -#include "net/eathena/network.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -extern ServerInfo mapServer; - -GameHandler::GameHandler() : - Ea::GameHandler() -{ - gameHandler = this; -} - -GameHandler::~GameHandler() -{ - gameHandler = nullptr; -} - -void GameHandler::mapLoadedEvent() const -{ - createOutPacket(CMSG_MAP_LOADED); -} - -void GameHandler::connect() const -{ - if (Network::mInstance == nullptr) - return; - - Network::mInstance->connect(mapServer); - - const Token &token = static_cast<LoginHandler*>(loginHandler)->getToken(); - - - if (client->getState() == State::CONNECT_GAME) - { - // Change the player's ID to the account ID to match what eAthena uses - if (localPlayer != nullptr) - { - Ea::GameRecv::mCharID = localPlayer->getId(); - localPlayer->setId(token.account_ID); - } - else - { - Ea::GameRecv::mCharID = BeingId_zero; - } - } - - // Send login infos - createOutPacket(CMSG_MAP_SERVER_CONNECT); - outMsg.writeBeingId(token.account_ID, "account id"); - outMsg.writeBeingId(Ea::GameRecv::mCharID, "char id"); - outMsg.writeInt32(token.session_ID1, "session key1"); - outMsg.writeInt32(0, "tick"); - outMsg.writeInt8(Being::genderToInt(token.sex), "sex"); - if (serverFeatures->haveMapServerVersion()) - loginHandler->sendVersion(); - - // We get 4 useless bytes before the real answer comes in (what are these?) -// Network::mInstance->skip(4); -} - -bool GameHandler::isConnected() const -{ - if (Network::mInstance == nullptr) - return false; - return Network::mInstance->isConnected(); -} - -void GameHandler::disconnect() const -{ - if (Network::mInstance != nullptr) - Network::mInstance->disconnect(); -} - -void GameHandler::quit() const -{ - createOutPacket(CMSG_CLIENT_QUIT); -} - -void GameHandler::ping(const int tick) const -{ - createOutPacket(CMSG_MAP_PING); - if (packetVersion >= 20101124) - { - // nothing here - } - else if (packetVersion >= 20080827) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - } - else if (packetVersion >= 20070212) - { - outMsg.writeInt16(0, "unknown"); - } - else if (packetVersion >= 20070108) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - } - else if (packetVersion >= 20050719) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - } - else if (packetVersion >= 20050718) - { - outMsg.writeInt8(0, "unknown"); - } - else if (packetVersion >= 20050628) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - } - else if (packetVersion >= 20050509) - { - outMsg.writeInt16(0, "unknown"); - } - else if (packetVersion >= 20050110) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - } - else if (packetVersion >= 20041129) - { - outMsg.writeInt8(0, "unknown"); - } - else if (packetVersion >= 20041025) - { - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - } - else if (packetVersion >= 20041005) - { - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - } - else if (packetVersion >= 20040920) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - } - else if (packetVersion >= 20040906) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - } - else if (packetVersion >= 20040809) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - } - else if (packetVersion >= 20040726) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - } - outMsg.writeInt32(tick, "tick"); -} - -void GameHandler::disconnect2() const -{ - createOutPacket(CMSG_CLIENT_QUIT); -} - -} // namespace EAthena diff --git a/src/net/eathena/gamehandler.h b/src/net/eathena/gamehandler.h deleted file mode 100644 index 4b2725a2f..000000000 --- a/src/net/eathena/gamehandler.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_GAMEHANDLER_H -#define NET_EATHENA_GAMEHANDLER_H - -#include "net/ea/gamehandler.h" - -namespace EAthena -{ - -class GameHandler final : public Ea::GameHandler -{ - public: - GameHandler(); - - A_DELETE_COPY(GameHandler) - - ~GameHandler(); - - void connect() const override final; - - bool isConnected() const override final A_WARN_UNUSED; - - void disconnect() const override final; - - void quit() const override final; - - void ping(const int tick) const override final; - - void disconnect2() const override final A_CONST; - - void mapLoadedEvent() const override final; - - bool mustPing() const override final A_WARN_UNUSED - { return true; } -}; - -} // namespace EAthena - -#endif // NET_EATHENA_GAMEHANDLER_H diff --git a/src/net/eathena/gamerecv.cpp b/src/net/eathena/gamerecv.cpp deleted file mode 100644 index 00d2c4f9d..000000000 --- a/src/net/eathena/gamerecv.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/gamerecv.h" - -#include "client.h" -#include "logger.h" - -#include "being/localplayer.h" - -#include "net/messagein.h" - -#include "net/eathena/network.h" - -#include "debug.h" - -namespace EAthena -{ - -extern ServerInfo mapServer; - -void GameRecv::processMapAccountId(Net::MessageIn &msg) -{ - // ignored, because we already know local player account id. - msg.readBeingId("account id"); -} - -void GameRecv::processMapLogin(Net::MessageIn &msg) -{ - unsigned char direction; - uint16_t x, y; - msg.readInt32("start time"); - msg.readCoordinates(x, y, direction, "position"); - msg.readInt8("x size"); - msg.readInt8("y size"); - logger->log("Protocol: Player start position: " - "(%d, %d), Direction: %d", - x, y, direction); - if (msg.getVersion() >= 20080102) - msg.readInt16("font"); - if (msg.getVersion() >= 20141022 && msg.getVersion() < 20160330) - msg.readUInt8("sex"); - - mLastHost &= 0xffffff; - - Network *const network = Network::mInstance; - if (network != nullptr) - network->pauseDispatch(); - - // Switch now or we'll have problems - client->setState(State::GAME); - if (localPlayer != nullptr) - localPlayer->setTileCoords(x, y); -} - -void GameRecv::processServerTick(Net::MessageIn &msg) -{ - // ignoring - msg.readInt32("tick"); -} - -void GameRecv::processMapAuthRefuse(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readUInt8("error"); -} -} // namespace EAthena diff --git a/src/net/eathena/gamerecv.h b/src/net/eathena/gamerecv.h deleted file mode 100644 index 3d2dbe590..000000000 --- a/src/net/eathena/gamerecv.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_GAMERECV_H -#define NET_EATHENA_GAMERECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace GameRecv - { - void processMapAccountId(Net::MessageIn &msg); - void processMapLogin(Net::MessageIn &msg); - void processServerTick(Net::MessageIn &msg); - void processMapAuthRefuse(Net::MessageIn &msg); - } // namespace GameRecv -} // namespace EAthena - -#endif // NET_EATHENA_GAMERECV_H diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp deleted file mode 100644 index c2aac194b..000000000 --- a/src/net/eathena/generalhandler.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/generalhandler.h" - -#include "client.h" -#include "configuration.h" - -#include "gui/windows/skilldialog.h" -#include "gui/windows/socialwindow.h" - -#include "gui/widgets/tabs/chat/guildtab.h" -#include "gui/widgets/tabs/chat/partytab.h" - -#include "net/eathena/adminhandler.h" -#include "net/eathena/auctionhandler.h" -#include "net/eathena/bankhandler.h" -#include "net/eathena/battlegroundhandler.h" -#include "net/eathena/beinghandler.h" -#include "net/eathena/buyingstorehandler.h" -#include "net/eathena/buysellhandler.h" -#include "net/eathena/cashshophandler.h" -#include "net/eathena/chathandler.h" -#include "net/eathena/charserverhandler.h" -#include "net/eathena/elementalhandler.h" -#include "net/eathena/familyhandler.h" -#include "net/eathena/friendshandler.h" -#include "net/eathena/gamehandler.h" -#include "net/eathena/guildhandler.h" -#include "net/eathena/homunculushandler.h" -#include "net/eathena/inventoryhandler.h" -#include "net/eathena/itemhandler.h" -#include "net/eathena/loginhandler.h" -#include "net/eathena/maphandler.h" -#include "net/eathena/mail2handler.h" -#include "net/eathena/mailhandler.h" -#include "net/eathena/markethandler.h" -#include "net/eathena/mercenaryhandler.h" -#include "net/eathena/network.h" -#include "net/eathena/npchandler.h" -#include "net/eathena/partyhandler.h" -#include "net/eathena/pethandler.h" -#include "net/eathena/playerhandler.h" -#include "net/eathena/roulettehandler.h" -#include "net/eathena/searchstorehandler.h" -#include "net/eathena/serverfeatures.h" -#include "net/eathena/tradehandler.h" -#include "net/eathena/skillhandler.h" -#include "net/eathena/questhandler.h" -#include "net/eathena/vendinghandler.h" - -#include "utils/delete2.h" -#include "utils/gettext.h" - -#include "debug.h" - -namespace EAthena -{ - -GeneralHandler::GeneralHandler() : - mAdminHandler(new AdminHandler), - mBeingHandler(new BeingHandler(config.getBoolValue("EnableSync"))), - mBuySellHandler(new BuySellHandler), - mCharServerHandler(new CharServerHandler), - mChatHandler(new ChatHandler), - mGameHandler(new GameHandler), - mGuildHandler(new GuildHandler), - mInventoryHandler(new InventoryHandler), - mItemHandler(new ItemHandler), - mLoginHandler(new LoginHandler), - mNpcHandler(new NpcHandler), - mPartyHandler(new PartyHandler), - mPetHandler(new PetHandler), - mPlayerHandler(new PlayerHandler), - mSkillHandler(new SkillHandler), - mTradeHandler(new TradeHandler), - mQuestHandler(new QuestHandler), - mServerFeatures(new ServerFeatures), - mMail2Handler(new Mail2Handler), - mMailHandler(new MailHandler), - mAuctionHandler(new AuctionHandler), - mCashShopHandler(new CashShopHandler), - mFamilyHandler(new FamilyHandler), - mBankHandler(new BankHandler), - mBattleGroundHandler(new BattleGroundHandler), - mMercenaryHandler(new MercenaryHandler), - mBuyingStoreHandler(new BuyingStoreHandler), - mHomunculusHandler(new HomunculusHandler), - mFriendsHandler(new FriendsHandler), - mElementalHandler(new ElementalHandler), - mMapHandler(new MapHandler), - mMarketHandler(new MarketHandler), - mVendingHandler(new VendingHandler), - mRouletteHandler(new RouletteHandler), - mSearchStoreHandler(new SearchStoreHandler) -{ - generalHandler = this; -} - -GeneralHandler::~GeneralHandler() -{ - delete2(Network::mInstance); - - delete2(mAdminHandler); - delete2(mBeingHandler); - delete2(mBuySellHandler); - delete2(mCharServerHandler); - delete2(mChatHandler); - delete2(mGameHandler); - delete2(mGuildHandler); - delete2(mInventoryHandler); - delete2(mItemHandler); - delete2(mLoginHandler); - delete2(mNpcHandler); - delete2(mPartyHandler); - delete2(mPetHandler); - delete2(mPlayerHandler); - delete2(mSkillHandler); - delete2(mTradeHandler); - delete2(mQuestHandler); - delete2(mServerFeatures); - delete2(mMail2Handler); - delete2(mMailHandler); - delete2(mAuctionHandler); - delete2(mCashShopHandler); - delete2(mFamilyHandler); - delete2(mBankHandler); - delete2(mBattleGroundHandler); - delete2(mMercenaryHandler); - delete2(mBuyingStoreHandler); - delete2(mHomunculusHandler); - delete2(mFriendsHandler); - delete2(mElementalHandler); - delete2(mMapHandler); - delete2(mMarketHandler); - delete2(mVendingHandler); - delete2(mRouletteHandler); - delete2(mSearchStoreHandler); -} - -void GeneralHandler::load() const -{ - new Network; - Network::mInstance->registerHandlers(); -} - -void GeneralHandler::reload() const -{ - if (Network::mInstance != nullptr) - Network::mInstance->disconnect(); - - static_cast<LoginHandler*>(mLoginHandler)->clearWorlds(); - const CharServerHandler *const charHandler = - static_cast<CharServerHandler*>(mCharServerHandler); - charHandler->setCharCreateDialog(nullptr); - charHandler->setCharSelectDialog(nullptr); - PartyHandler::reload(); -} - -void GeneralHandler::reloadPartially() const -{ - PartyHandler::reload(); -} - -void GeneralHandler::unload() const -{ - clearHandlers(); -} - -void GeneralHandler::flushSend() const -{ - if (Network::mInstance == nullptr) - return; - - Network::mInstance->flush(); -} - -void GeneralHandler::flushNetwork() const -{ - if (Network::mInstance == nullptr) - return; - - Network::mInstance->flush(); - Network::mInstance->dispatchMessages(); - - if (Network::mInstance->getState() == Network::NET_ERROR) - { - if (!Network::mInstance->getError().empty()) - { - errorMessage = Network::mInstance->getError(); - } - else - { - // TRANSLATORS: error message - errorMessage = _("Got disconnected from server!"); - } - - client->setState(State::ERROR); - } -} - -void GeneralHandler::clearHandlers() const -{ - if (Network::mInstance != nullptr) - Network::mInstance->clearHandlers(); -} - -void GeneralHandler::gameStarted() const -{ - if (skillDialog != nullptr) - skillDialog->loadSkills(); -} - -void GeneralHandler::gameEnded() const -{ - if (socialWindow != nullptr) - { - socialWindow->removeTab(taGuild); - socialWindow->removeTab(Ea::taParty); - } - - delete2(guildTab); - delete2(partyTab); -} - -} // namespace EAthena diff --git a/src/net/eathena/generalhandler.h b/src/net/eathena/generalhandler.h deleted file mode 100644 index c4ff43402..000000000 --- a/src/net/eathena/generalhandler.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_GENERALHANDLER_H -#define NET_EATHENA_GENERALHANDLER_H - -#include "net/generalhandler.h" - -namespace EAthena -{ - -class AdminHandler; -class BeingHandler; -class BuySellHandler; -class CharServerHandler; -class ChatHandler; -class GameHandler; -class GuildHandler; -class InventoryHandler; -class ItemHandler; -class LoginHandler; -class NpcHandler; -class PartyHandler; -class PetHandler; -class PlayerHandler; -class SkillHandler; -class TradeHandler; -class QuestHandler; -class ServerFeatures; -class AuctionHandler; -class BankHandler; -class BattleGroundHandler; -class BuyingStoreHandler; -class CashShopHandler; -class ElementalHandler; -class FamilyHandler; -class FriendsHandler; -class HomunculusHandler; -class MailHandler; -class Mail2Handler; -class MapHandler; -class MarketHandler; -class MercenaryHandler; -class RouletteHandler; -class SearchStoreHandler; -class VendingHandler; - -class GeneralHandler final : public Net::GeneralHandler -{ - public: - GeneralHandler(); - - A_DELETE_COPY(GeneralHandler) - - ~GeneralHandler(); - - void load() const override final; - - void reload() const override final; - - void unload() const override final; - - void flushNetwork() const override final; - - void flushSend() const override final; - - void clearHandlers() const override final; - - void reloadPartially() const override final; - - void gameStarted() const override final; - - void gameEnded() const override final; - - protected: - AdminHandler *mAdminHandler; - BeingHandler *mBeingHandler; - BuySellHandler *mBuySellHandler; - CharServerHandler *mCharServerHandler; - ChatHandler *mChatHandler; - GameHandler *mGameHandler; - GuildHandler *mGuildHandler; - InventoryHandler *mInventoryHandler; - ItemHandler *mItemHandler; - LoginHandler *mLoginHandler; - NpcHandler *mNpcHandler; - PartyHandler *mPartyHandler; - PetHandler *mPetHandler; - PlayerHandler *mPlayerHandler; - SkillHandler *mSkillHandler; - TradeHandler *mTradeHandler; - QuestHandler *mQuestHandler; - ServerFeatures *mServerFeatures; - Mail2Handler *mMail2Handler; - MailHandler *mMailHandler; - AuctionHandler *mAuctionHandler; - CashShopHandler *mCashShopHandler; - FamilyHandler *mFamilyHandler; - BankHandler *mBankHandler; - BattleGroundHandler *mBattleGroundHandler; - MercenaryHandler *mMercenaryHandler; - BuyingStoreHandler *mBuyingStoreHandler; - HomunculusHandler *mHomunculusHandler; - FriendsHandler *mFriendsHandler; - ElementalHandler *mElementalHandler; - MapHandler *mMapHandler; - MarketHandler *mMarketHandler; - VendingHandler *mVendingHandler; - RouletteHandler *mRouletteHandler; - SearchStoreHandler *mSearchStoreHandler; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_GENERALHANDLER_H diff --git a/src/net/eathena/generalrecv.cpp b/src/net/eathena/generalrecv.cpp deleted file mode 100644 index 2074fe31e..000000000 --- a/src/net/eathena/generalrecv.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/generalrecv.h" - -#include "client.h" -#include "logger.h" - -#include "net/messagein.h" - -#include "utils/cast.h" -#include "utils/gettext.h" - -#include "debug.h" - -namespace EAthena -{ - -ServerInfo charServer; -ServerInfo mapServer; - -void GeneralRecv::processConnectionProblem(Net::MessageIn &msg) -{ - const uint8_t code = msg.readUInt8("flag"); - logger->log("Connection problem: %u", CAST_U32(code)); - - switch (code) - { - case 0: - // TRANSLATORS: error message - errorMessage = _("Authentication failed."); - break; - case 1: - // TRANSLATORS: error message - errorMessage = _("No servers available."); - break; - case 2: - if (client->getState() == State::GAME) - { - // TRANSLATORS: error message - errorMessage = _("Someone else is trying to use " - "this account."); - } - else - { - // TRANSLATORS: error message - errorMessage = _("This account is already logged in."); - } - break; - case 3: - // TRANSLATORS: error message - errorMessage = _("Speed hack detected."); - break; - case 4: - // TRANSLATORS: error message - errorMessage = _("Server full."); - break; - case 5: - // TRANSLATORS: error message - errorMessage = _("Sorry, you are underaged."); - break; - case 8: - // TRANSLATORS: error message - errorMessage = _("Duplicated login."); - break; - case 9: - // TRANSLATORS: error message - errorMessage = _("To many connections from same ip."); - break; - case 10: - // TRANSLATORS: error message - errorMessage = _("Not paid for this time."); - break; - case 11: - // TRANSLATORS: error message - errorMessage = _("Pay suspended."); - break; - case 12: - // TRANSLATORS: error message - errorMessage = _("Pay changed."); - break; - case 13: - // TRANSLATORS: error message - errorMessage = _("Pay wrong ip."); - break; - case 14: - // TRANSLATORS: error message - errorMessage = _("Pay game room."); - break; - case 15: - // TRANSLATORS: error message - errorMessage = _("Disconnect forced by GM."); - break; - case 16: - case 17: - // TRANSLATORS: error message - errorMessage = _("Ban japan refuse."); - break; - case 18: - // TRANSLATORS: error message - errorMessage = _("Remained other account."); - break; - case 100: - // TRANSLATORS: error message - errorMessage = _("Ip unfair."); - break; - case 101: - // TRANSLATORS: error message - errorMessage = _("Ip count all."); - break; - case 102: - // TRANSLATORS: error message - errorMessage = _("Ip count."); - break; - case 103: - case 104: - // TRANSLATORS: error message - errorMessage = _("Memory."); - break; - case 105: - // TRANSLATORS: error message - errorMessage = _("Han valid."); - break; - case 106: - // TRANSLATORS: error message - errorMessage = _("Ip limited access."); - break; - case 107: - // TRANSLATORS: error message - errorMessage = _("Over characters list."); - break; - case 108: - // TRANSLATORS: error message - errorMessage = _("Ip blocked."); - break; - case 109: - // TRANSLATORS: error message - errorMessage = _("Invalid password count."); - break; - case 110: - // TRANSLATORS: error message - errorMessage = _("Not allowed race."); - break; - default: - // TRANSLATORS: error message - errorMessage = _("Unknown connection error."); - break; - } - client->setState(State::ERROR); -} - -void GeneralRecv::processMapNotFound(Net::MessageIn &msg) -{ - const int sz = msg.readInt16("len") - 4; - msg.readString(sz, "map name?"); - // TRANSLATORS: error message - errorMessage = _("Map not found"); - client->setState(State::ERROR); -} - -} // namespace EAthena diff --git a/src/net/eathena/generalrecv.h b/src/net/eathena/generalrecv.h deleted file mode 100644 index fa5088c3d..000000000 --- a/src/net/eathena/generalrecv.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_GENERALRECV_H -#define NET_EATHENA_GENERALRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace GeneralRecv - { - void processConnectionProblem(Net::MessageIn &msg); - void processMapNotFound(Net::MessageIn &msg); - } // namespace GeneralRecv -} // namespace EAthena - -#endif // NET_EATHENA_GENERALRECV_H diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp deleted file mode 100644 index b55918f85..000000000 --- a/src/net/eathena/guildhandler.cpp +++ /dev/null @@ -1,291 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/guildhandler.h" - -#include "actormanager.h" - -#include "being/localplayer.h" -#include "being/playerinfo.h" - -#include "gui/widgets/tabs/chat/guildtab.h" - -#include "net/eathena/guildrecv.h" -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "utils/delete2.h" - -#include "debug.h" - -GuildTab *guildTab = nullptr; - -extern int packetVersion; - -namespace EAthena -{ - -GuildHandler::GuildHandler() : - Net::GuildHandler() -{ - guildHandler = this; - GuildRecv::showBasicInfo = false; -} - -GuildHandler::~GuildHandler() -{ - delete2(guildTab); - guildHandler = nullptr; - taGuild = nullptr; -} - -void GuildHandler::clear() const -{ - taGuild = nullptr; -} - -ChatTab *GuildHandler::getTab() const -{ - return guildTab; -} - -void GuildHandler::create(const std::string &name) const -{ - createOutPacket(CMSG_GUILD_CREATE); - outMsg.writeInt32(0, "unused"); - outMsg.writeString(name, 24, "guild name"); -} - -void GuildHandler::invite(const std::string &name) const -{ - if (actorManager == nullptr) - return; - - const Being *const being = actorManager->findBeingByName( - name, ActorType::Player); - if (being != nullptr) - { - createOutPacket(CMSG_GUILD_INVITE); - outMsg.writeBeingId(being->getId(), "account id"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - } - else if (packetVersion >= 20120418) - { - createOutPacket(CMSG_GUILD_INVITE2); - outMsg.writeString(name, 24, "name"); - } -} - -void GuildHandler::invite(const Being *const being) const -{ - if (being == nullptr) - return; - - createOutPacket(CMSG_GUILD_INVITE); - outMsg.writeBeingId(being->getId(), "account id"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); -} - -void GuildHandler::inviteResponse(const int guildId, - const bool response) const -{ - createOutPacket(CMSG_GUILD_INVITE_REPLY); - outMsg.writeInt32(guildId, "guild id"); - outMsg.writeInt8(static_cast<int8_t>(response), "response"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt16(0, "unused"); -} - -void GuildHandler::leave(const int guildId) const -{ - if (localPlayer == nullptr) - return; - - createOutPacket(CMSG_GUILD_LEAVE); - outMsg.writeInt32(guildId, "guild id"); - outMsg.writeBeingId(localPlayer->getId(), "account id"); - outMsg.writeInt32(PlayerInfo::getCharId(), "char id"); - outMsg.writeString("", 40, "message"); -} - -void GuildHandler::kick(const GuildMember *restrict const member, - const std::string &restrict reason) const -{ - if ((member == nullptr) || (member->getGuild() == nullptr)) - return; - - createOutPacket(CMSG_GUILD_EXPULSION); - outMsg.writeInt32(member->getGuild()->getId(), "guild id"); - outMsg.writeBeingId(member->getID(), "account id"); - outMsg.writeInt32(member->getCharId(), "char id"); - outMsg.writeString(reason, 40, "message"); -} - -void GuildHandler::chat(const std::string &text) const -{ - if (localPlayer == nullptr) - return; - - const std::string str = std::string(localPlayer->getName()).append( - " : ").append(text); - createOutPacket(CMSG_GUILD_MESSAGE); - if (packetVersion >= 20151001) - { - outMsg.writeInt16(CAST_U16(str.size() + 4), "len"); - outMsg.writeString(str, CAST_S32(str.length()), "message"); - } - else - { - outMsg.writeInt16(CAST_U16(str.size() + 4 + 1), "len"); - outMsg.writeString(str, CAST_S32(str.length()), "message"); - outMsg.writeInt8(0, "zero byte"); - } -} - -void GuildHandler::memberList() const -{ - // 0 = basic info + alliance info - // 1 = position name list + member list - // 2 = position name list + position info list - // 3 = skill info - // 4 = expulsion list - - createOutPacket(CMSG_GUILD_REQUEST_INFO); - outMsg.writeInt32(1, "action"); // Request member list -} - -void GuildHandler::info() const -{ - // 0 = basic info + alliance info - // 1 = position name list + member list - // 2 = position name list + position info list - // 3 = skill info - // 4 = expulsion list - - GuildRecv::showBasicInfo = true; - createOutPacket(CMSG_GUILD_REQUEST_INFO); - outMsg.writeInt32(0, "action"); // Request basic info -} - -void GuildHandler::changeMemberPostion(const GuildMember *const member, - const int level) const -{ - if ((member == nullptr) || (member->getGuild() == nullptr)) - return; - - createOutPacket(CMSG_GUILD_CHANGE_MEMBER_POS); - outMsg.writeInt16(16, "len"); - outMsg.writeBeingId(member->getID(), "account id"); - outMsg.writeInt32(member->getCharId(), "char id"); - outMsg.writeInt32(level, "pos"); -} - -void GuildHandler::changeNotice(const int guildId, - const std::string &restrict msg1, - const std::string &restrict msg2) const -{ - createOutPacket(CMSG_GUILD_CHANGE_NOTICE); - outMsg.writeInt32(guildId, "guild id"); - outMsg.writeString(msg1, 60, "msg1"); - outMsg.writeString(msg2, 120, "msg2"); -} - -void GuildHandler::checkMaster() const -{ - createOutPacket(CMSG_GUILD_CHECK_MASTER); -} - -void GuildHandler::requestAlliance(const Being *const being) const -{ - if (being == nullptr) - return; - - createOutPacket(CMSG_GUILD_ALLIANCE_REQUEST); - outMsg.writeBeingId(being->getId(), "account id"); - outMsg.writeInt32(0, "inviter account id"); - outMsg.writeInt32(0, "inviter char id"); -} - -void GuildHandler::requestAllianceResponse(const int beingId, - const bool accept) const -{ - createOutPacket(CMSG_GUILD_ALLIANCE_REPLY); - outMsg.writeInt32(beingId, "account id"); - outMsg.writeInt32(static_cast<int32_t>(accept), "accept flag"); -} - -void GuildHandler::endAlliance(const int guildId, - const int flag) const -{ - createOutPacket(CMSG_GUILD_ALLIANCE_DELETE); - outMsg.writeInt32(guildId, "guild id"); - outMsg.writeInt32(flag, "flag"); -} - -void GuildHandler::changePostionInfo(const int posId, - const int mode, - const int ranking, - const int payRate, - const std::string &name) const -{ - createOutPacket(CMSG_GUILD_CHANGE_POS_INFO); - outMsg.writeInt16(44, "len"); - outMsg.writeInt32(posId, "position id"); - outMsg.writeInt32(mode, "mode"); - outMsg.writeInt32(ranking, "ranking"); - outMsg.writeInt32(payRate, "pay rate"); - outMsg.writeString(name, 24, "name"); -} - -void GuildHandler::requestOpposition(const Being *const being) const -{ - if (being == nullptr) - return; - - createOutPacket(CMSG_GUILD_OPPOSITION); - outMsg.writeBeingId(being->getId(), "account id"); -} - -void GuildHandler::breakGuild(const std::string &name) const -{ - createOutPacket(CMSG_GUILD_BREAK); - outMsg.writeString(name, 40, "name"); -} - -void GuildHandler::changeEmblem(std::string emblem) const -{ - createOutPacket(CMSG_GUILD_CHANGE_EMBLEM); - if (emblem.size() > 200) - emblem = emblem.substr(0, 200); - const int sz = CAST_S32(emblem.size()); - outMsg.writeInt16(CAST_S16(sz + 4), "len"); - outMsg.writeString(emblem, sz, "emblem"); -} - -void GuildHandler::requestEmblem(const int guildId) const -{ - createOutPacket(CMSG_GUILD_REQUEST_EMBLEM); - outMsg.writeInt32(guildId, "guild id"); -} - -} // namespace EAthena diff --git a/src/net/eathena/guildhandler.h b/src/net/eathena/guildhandler.h deleted file mode 100644 index b9475f1b8..000000000 --- a/src/net/eathena/guildhandler.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_GUILDHANDLER_H -#define NET_EATHENA_GUILDHANDLER_H - -#include "net/guildhandler.h" - -class GuildTab; - -namespace EAthena -{ - -class GuildHandler final : public Net::GuildHandler -{ - public: - GuildHandler(); - - A_DELETE_COPY(GuildHandler) - - ~GuildHandler(); - - void clear() const override final; - - ChatTab *getTab() const override final; - - void create(const std::string &name) const override final; - - void invite(const std::string &name) const override final; - - void invite(const Being *const being) const override final; - - void inviteResponse(const int guildId, - const bool response) const override final; - - void leave(const int guildId) const override final; - - void kick(const GuildMember *restrict const member, - const std::string &restrict reason) const override final; - - void chat(const std::string &text) const override final; - - void memberList() const override final; - - void info() const override final; - - void changeMemberPostion(const GuildMember *const member, - const int level) const override final; - - void changeNotice(const int guildId, - const std::string &restrict msg1, - const std::string &restrict msg2) - const override final; - - void checkMaster() const override final; - - void requestAlliance(const Being *const being) const override final; - - void requestAllianceResponse(const int beingId, - const bool accept) const override final; - - void endAlliance(const int guildId, - const int flag) const override final; - - void changePostionInfo(const int posId, - const int mode, - const int ranking, - const int payRate, - const std::string &name) const override final; - - void requestOpposition(const Being *const being) const override final; - - void breakGuild(const std::string &name) const override final; - - void changeEmblem(std::string emblem) const override final; - - void requestEmblem(const int guildId) const override final; -}; - -extern Guild *taGuild; - -} // namespace EAthena - -extern GuildTab *guildTab; - -#endif // NET_EATHENA_GUILDHANDLER_H diff --git a/src/net/eathena/guildrecv.cpp b/src/net/eathena/guildrecv.cpp deleted file mode 100644 index d235c23bb..000000000 --- a/src/net/eathena/guildrecv.cpp +++ /dev/null @@ -1,717 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/guildrecv.h" - -#include "actormanager.h" -#include "configuration.h" -#include "notifymanager.h" - -#include "being/localplayer.h" -#include "being/playerinfo.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/chatwindow.h" -#include "gui/windows/skilldialog.h" -#include "gui/windows/socialwindow.h" - -#include "gui/widgets/tabs/chat/guildtab.h" - -#include "net/messagein.h" - -#include "net/eathena/guildhandler.h" - -#include "utils/delete2.h" -#include "utils/checkutils.h" -#include "utils/gettext.h" - -#include "debug.h" - -namespace EAthena -{ - -Guild *taGuild = nullptr; - -namespace GuildRecv -{ - bool showBasicInfo = false; -} // namespace GuildRecv - -void GuildRecv::processGuildCreateResponse(Net::MessageIn &msg) -{ - const uint8_t flag = msg.readUInt8("flag"); - - switch (flag) - { - case 0: - // Success - NotifyManager::notify(NotifyTypes::GUILD_CREATED); - break; - - case 1: - // Already in a guild - NotifyManager::notify(NotifyTypes::GUILD_ALREADY); - break; - - case 2: - // Unable to make (likely name already in use) - NotifyManager::notify(NotifyTypes::GUILD_ALREADY); - break; - - case 3: - // Emperium check failed - NotifyManager::notify(NotifyTypes::GUILD_EMPERIUM_CHECK_FAILED); - break; - - default: - // Unknown response - NotifyManager::notify(NotifyTypes::GUILD_ERROR); - break; - } -} - -void GuildRecv::processGuildMasterOrMember(Net::MessageIn &msg) -{ - msg.readInt32("type"); // Type (0x57 for member, 0xd7 for master) -} - -void GuildRecv::processGuildBasicInfo(Net::MessageIn &msg) -{ - const int guildId = msg.readInt32("guild id"); - const int level = msg.readInt32("guild level"); - const int members = msg.readInt32("connect member"); - const int maxMembers = msg.readInt32("max member"); - const int avgLevel = msg.readInt32("average level"); - const int exp = msg.readInt32("exp"); - const int nextExp = msg.readInt32("next exp"); - msg.skip(12, "unused"); - const int emblem = msg.readInt32("emblem id"); - std::string name = msg.readString(24, "guild name"); - std::string castle; - std::string master; - if (msg.getVersion() >= 20160622) - { - castle = msg.readString(16, "castles"); - msg.readInt32("money, unused"); - msg.readBeingId("leader char id"); - } - else - { - master = msg.readString(24, "master name"); - castle = msg.readString(16, "castles"); - msg.readInt32("money, unused"); - } - - if (guildTab != nullptr && - showBasicInfo) - { - showBasicInfo = false; - // TRANSLATORS: guild info message - guildTab->chatLog(strprintf(_("Guild name: %s"), - name.c_str()), ChatMsgType::BY_SERVER); - if (!master.empty()) - { - // TRANSLATORS: guild info message - guildTab->chatLog(strprintf(_("Guild master: %s"), - master.c_str()), ChatMsgType::BY_SERVER); - } - // TRANSLATORS: guild info message - guildTab->chatLog(strprintf(_("Guild level: %d"), level), - ChatMsgType::BY_SERVER); - // TRANSLATORS: guild info message - guildTab->chatLog(strprintf(_("Online members: %d"), - members), ChatMsgType::BY_SERVER); - // TRANSLATORS: guild info message - guildTab->chatLog(strprintf(_("Max members: %d"), - maxMembers), ChatMsgType::BY_SERVER); - // TRANSLATORS: guild info message - guildTab->chatLog(strprintf(_("Average level: %d"), - avgLevel), ChatMsgType::BY_SERVER); - // TRANSLATORS: guild info message - guildTab->chatLog(strprintf(_("Guild exp: %d"), exp), - ChatMsgType::BY_SERVER); - // TRANSLATORS: guild info message - guildTab->chatLog(strprintf(_("Guild next exp: %d"), - nextExp), ChatMsgType::BY_SERVER); - // TRANSLATORS: guild info message - guildTab->chatLog(strprintf(_("Guild castle: %s"), - castle.c_str()), ChatMsgType::BY_SERVER); - } - - Guild *const g = Guild::getGuild(CAST_S16(guildId)); - if (g == nullptr) - return; - g->setName(name); - g->setEmblemId(emblem); -} - -void GuildRecv::processGuildAlianceInfo(Net::MessageIn &msg) -{ - const int length = msg.readInt16("len"); - if (length < 4) - return; - const int count = (length - 4) / 32; - - for (int i = 0; i < count; i++) - { - msg.readInt32("opposition"); - msg.readInt32("guild id"); - msg.readString(24, "guild name"); - } -} - -void GuildRecv::processGuildMemberList(Net::MessageIn &msg) -{ - const int length = msg.readInt16("len"); - if (length < 4) - return; - int guildSize = 0; - if (msg.getVersion() >= 20161026) - { - guildSize = 34; - reportAlways("missing guild member names"); - } - else - { - guildSize = 104; - } - - const int count = (length - 4) / guildSize; - if (taGuild == nullptr) - { - logger->log1("!taGuild"); - return; - } - - taGuild->clearMembers(); - - int onlineNum = 0; - int totalNum = 0; - for (int i = 0; i < count; i++) - { - const BeingId id = msg.readBeingId("account id"); - const int charId = msg.readInt32("char id"); - msg.readInt16("hair"); - msg.readInt16("hair color"); - const int gender = msg.readInt16("gender"); - const int race = msg.readInt16("class"); - const int level = msg.readInt16("level"); - const int exp = msg.readInt32("exp"); - const int online = msg.readInt32("online"); - const int pos = msg.readInt32("position"); - std::string name; - if (msg.getVersion() < 20161026) - { - msg.skip(50, "unused"); - name = msg.readString(24, "name"); - } - else - { - msg.readInt32("last login"); // for now unused - continue; - } - - GuildMember *const m = taGuild->addMember(id, charId, name); - if (m != nullptr) - { - m->setOnline(online != 0); - m->setID(id); - m->setCharId(charId); - m->setGender(Being::intToGender(CAST_U8(gender))); - m->setLevel(level); - m->setExp(exp); - m->setPos(pos); - m->setRace(race); - if (actorManager != nullptr) - { - Being *const being = actorManager->findBeingByName( - name, ActorType::Player); - if (being != nullptr) - { - being->setGuildName(taGuild->getName()); - if (being->getLevel() != level) - { - being->setLevel(level); - being->updateName(); - } - } - } - if (online != 0) - onlineNum ++; - totalNum ++; - } - } - taGuild->sort(); - if (actorManager != nullptr) - { - actorManager->updatePlayerGuild(); - actorManager->updatePlayerColors(); - } - if (socialWindow != nullptr) - socialWindow->updateGuildCounter(onlineNum, totalNum); -} - -void GuildRecv::processGuildPosNameList(Net::MessageIn &msg) -{ - if (taGuild == nullptr) - { - logger->log1("!taGuild"); - return; - } - - const int length = msg.readInt16("len"); - if (length < 4) - return; - const int count = (length - 4) / 28; - - for (int i = 0; i < count; i++) - { - const int id = msg.readInt32("position id"); - const std::string name = msg.readString(24, "position name"); - taGuild->addPos(id, name); - } -} - -void GuildRecv::processGuildPosInfoList(Net::MessageIn &msg) -{ - const int length = msg.readInt16("len"); - if (length < 4) - return; - const int count = (length - 4) / 16; - - for (int i = 0; i < count; i++) - { - msg.readInt32("id"); - msg.readInt32("mode"); - msg.readInt32("same id"); - msg.readInt32("exp mode"); - } -} - -void GuildRecv::processGuildPositionChanged(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("len"); - msg.readInt32("id"); - msg.readInt32("mode"); - msg.readInt32("same ip"); - msg.readInt32("exp mode"); - msg.readString(24, "name"); -} - -void GuildRecv::processGuildMemberPosChange(Net::MessageIn &msg) -{ - msg.readInt16("len"); - const BeingId accountId = msg.readBeingId("account id"); - const int charId = msg.readInt32("char id"); - const int pos = msg.readInt32("position"); - if (taGuild != nullptr) - { - GuildMember *const m = taGuild->getMember(accountId, charId); - if (m != nullptr) - m->setPos(pos); - } -} - -void GuildRecv::processGuildEmblemData(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - const int length = msg.readInt16("len"); - - msg.readInt32("guild id"); - msg.readInt32("emblem id"); - if (length < 12) - return; - msg.skip(length - 12, "emblem data"); -} - -void GuildRecv::processGuildSkillInfo(Net::MessageIn &msg) -{ - const int count = (msg.readInt16("len") - 6) / 37; - msg.readInt16("skill points"); - - if (skillDialog != nullptr) - skillDialog->hideSkills(SkillOwner::Guild); - for (int i = 0; i < count; i++) - { - const int skillId = msg.readInt16("skill id"); - const SkillType::SkillType inf = static_cast<SkillType::SkillType>( - msg.readInt32("inf")); - const int level = msg.readInt16("skill level"); - const int sp = msg.readInt16("sp"); - const int range = msg.readInt16("range"); - const std::string name = msg.readString(24, "skill name"); - const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); - PlayerInfo::setSkillLevel(skillId, level); - if (skillDialog != nullptr) - { - if (!skillDialog->updateSkill(skillId, range, up, inf, sp)) - { - skillDialog->addSkill(SkillOwner::Guild, - skillId, name, level, range, up, inf, sp); - } - } - } - if (skillDialog != nullptr) - skillDialog->updateModels(); -} - -void GuildRecv::processGuildNotice(Net::MessageIn &msg) -{ - if (guildTab != nullptr) - { - const std::string msg1 = msg.readString(60, "msg1"); - const std::string msg2 = msg.readString(120, "msg2"); - guildTab->chatLog(msg1, ChatMsgType::BY_SERVER); - guildTab->chatLog(msg2, ChatMsgType::BY_SERVER); - } - else - { - msg.readString(60, "msg1"); - msg.readString(120, "msg2"); - } -} - -void GuildRecv::processGuildInvite(Net::MessageIn &msg) -{ - const int guildId = msg.readInt32("guild id"); - - if (socialWindow != nullptr) - { - const std::string guildName = msg.readString(24, "guild name"); - socialWindow->showGuildInvite(guildName, guildId, ""); - } - else - { - msg.readString(24, "guild name"); - } -} - -void GuildRecv::processGuildInviteAck(Net::MessageIn &msg) -{ - const uint8_t flag = msg.readUInt8("flag"); - if (guildTab == nullptr) - return; - - switch (flag) - { - case 0: - NotifyManager::notify(NotifyTypes::GUILD_INVITE_FAILED); - break; - - case 1: - NotifyManager::notify(NotifyTypes::GUILD_INVITE_REJECTED); - break; - - case 2: - NotifyManager::notify(NotifyTypes::GUILD_INVITE_JOINED); - break; - - case 3: - NotifyManager::notify(NotifyTypes::GUILD_INVITE_FULL); - break; - - default: - NotifyManager::notify(NotifyTypes::GUILD_INVITE_ERROR); - break; - } -} - -void GuildRecv::processGuildLeave(Net::MessageIn &msg) -{ - const std::string nick = msg.readString(24, "nick"); - msg.readString(40, "message"); - - if (taGuild != nullptr) - taGuild->removeMember(nick); - - if (localPlayer == nullptr) - return; - - if (nick == localPlayer->getName()) - { - if (taGuild != nullptr) - { - taGuild->removeFromMembers(); - taGuild->clearMembers(); - localPlayer->removeGuild(taGuild->getId()); - } - NotifyManager::notify(NotifyTypes::GUILD_LEFT); - delete2(guildTab) - - if ((socialWindow != nullptr) && (taGuild != nullptr)) - socialWindow->removeTab(taGuild); - if (actorManager != nullptr) - actorManager->updatePlayerColors(); - } - else - { - NotifyManager::notify(NotifyTypes::GUILD_USER_LEFT, nick); - if (actorManager != nullptr) - { - Being *const b = actorManager->findBeingByName( - nick, ActorType::Player); - - if (b != nullptr) - b->clearGuilds(); - if (taGuild != nullptr) - taGuild->removeMember(nick); - } - } -} - -void GuildRecv::processGuildMessage(Net::MessageIn &msg) -{ - const int msgLength = msg.readInt16("len") - 4; - - if (msgLength <= 0) - return; - if (guildTab != nullptr) - { - std::string chatMsg = msg.readString(msgLength, "message"); - const size_t pos = chatMsg.find(" : ", 0); - if (pos != std::string::npos) - { - const std::string sender_name = chatMsg.substr(0, pos); - chatMsg.erase(0, pos + 3); - trim(chatMsg); - guildTab->chatLog(sender_name, chatMsg); - } - else - { - guildTab->chatLog(chatMsg, ChatMsgType::BY_SERVER); - } - } - else - { - DEBUGLOGSTR("invisible guild?"); - msg.readString(msgLength, "message"); - } -} - -void GuildRecv::processGuildSkillUp(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("skill id"); - msg.readInt16("level"); - msg.readInt16("sp"); - msg.readInt16("range"); - msg.readUInt8("unused?"); -} - -void GuildRecv::processGuildReqAlliance(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("id"); - msg.readString(24, "name"); -} - -void GuildRecv::processGuildReqAllianceAck(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("flag"); -} - -void GuildRecv::processGuildDelAlliance(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("guild id"); - msg.readInt32("flag"); -} - -void GuildRecv::processGuildOppositionAck(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readUInt8("flag"); -} - -void GuildRecv::processGuildBroken(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("flag"); -} - -void GuildRecv::processGuildExpulsionContinue(const std::string &nick) -{ - if (taGuild != nullptr) - taGuild->removeMember(nick); - - if (localPlayer == nullptr) - return; - - if (nick == localPlayer->getName()) - { - if (taGuild != nullptr) - { - taGuild->removeFromMembers(); - taGuild->clearMembers(); - } - NotifyManager::notify(NotifyTypes::GUILD_KICKED); - delete2(guildTab) - - if ((socialWindow != nullptr) && (taGuild != nullptr)) - socialWindow->removeTab(taGuild); - if (actorManager != nullptr) - actorManager->updatePlayerColors(); - } - else - { - NotifyManager::notify(NotifyTypes::GUILD_USER_KICKED, nick); - if (actorManager != nullptr) - { - Being *const b = actorManager->findBeingByName( - nick, ActorType::Player); - - if (b != nullptr) - b->clearGuilds(); - if (taGuild != nullptr) - taGuild->removeMember(nick); - } - } -} - -void GuildRecv::processGuildUpdateCoords(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("account id"); - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - if (taGuild != nullptr) - { - GuildMember *const m = taGuild->getMember(id); - if (m != nullptr) - { - m->setX(x); - m->setY(y); - } - } -} - -void GuildRecv::processGuildPositionInfo(Net::MessageIn &msg) -{ - const int guildId = msg.readInt32("guild id"); - const int emblem = msg.readInt32("elblem id"); - PlayerInfo::setGuildPositionFlags( - static_cast<GuildPositionFlags::Type>(msg.readInt32("mode"))); - msg.readUInt8("guild master"); - msg.readInt32("unused"); - std::string guildName = msg.readString(24, "guild name"); - - Guild *const g = Guild::getGuild(CAST_S16(guildId)); - if (g == nullptr) - return; - - g->setName(guildName); - g->setEmblemId(emblem); - if (taGuild == nullptr) - taGuild = g; - if ((guildTab == nullptr) && (chatWindow != nullptr)) - { - guildTab = new GuildTab(chatWindow); - if (config.getBoolValue("showChatHistory")) - guildTab->loadFromLogFile("#Guild"); - if (localPlayer != nullptr) - localPlayer->addGuild(taGuild); - guildHandler->memberList(); - } - - if (localPlayer != nullptr) - { - localPlayer->setGuild(g); - localPlayer->setGuildName(g->getName()); - } -} - -void GuildRecv::processGuildMemberLogin(Net::MessageIn &msg) -{ - const BeingId accountId = msg.readBeingId("account id"); - const int charId = msg.readInt32("char id"); - const int online = msg.readInt32("flag"); - const GenderT gender = Being::intToGender(CAST_U8( - msg.readInt16("sex"))); - msg.readInt16("hair"); - msg.readInt16("hair color"); - if (taGuild != nullptr) - { - GuildMember *const m = taGuild->getMember(accountId, charId); - if (m != nullptr) - { - m->setOnline(online != 0); - if (online != 0) - m->setGender(gender); - if (guildTab != nullptr) - guildTab->showOnline(m->getName(), fromBool(online, Online)); - if (socialWindow != nullptr) - socialWindow->updateGuildCounter(); - } - } -} - -void GuildRecv::processGuildExpulsion(Net::MessageIn &msg) -{ - const std::string nick = msg.readString(24, "name"); - msg.readString(40, "message"); - - GuildRecv::processGuildExpulsionContinue(nick); -} - -void GuildRecv::processGuildExpulsionList(Net::MessageIn &msg) -{ - const int length = msg.readInt16("len"); - if (length < 4) - return; - - int count; - if (msg.getVersion() < 20100803) - { - count = (length - 4) / 64; - for (int i = 0; i < count; i++) - { - msg.readString(24, "name"); - msg.readString(40, "message"); - } - } - else - { - count = (length - 4) / 40; - for (int i = 0; i < count; i++) - msg.readString(40, "message"); - } -} - -void GuildRecv::processGuildEmblem(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readBeingId("being id"); - msg.readInt32("guild id"); - msg.readInt16("emblem id"); -} - -void GuildRecv::processOnlineInfo(Net::MessageIn &msg) -{ - // look like unused packet - UNIMPLEMENTEDPACKET; - msg.readBeingId("being id"); - msg.readInt32("char id"); - msg.readInt32("online"); -} - -} // namespace EAthena diff --git a/src/net/eathena/guildrecv.h b/src/net/eathena/guildrecv.h deleted file mode 100644 index f449480bf..000000000 --- a/src/net/eathena/guildrecv.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_GUILDRECV_H -#define NET_EATHENA_GUILDRECV_H - -#include <string> - -namespace Net -{ - class MessageIn; -} // namespace Net - -class Guild; -class GuildTab; - -namespace EAthena -{ - namespace GuildRecv - { - extern bool showBasicInfo; - - void processGuildCreateResponse(Net::MessageIn &msg); - void processGuildMasterOrMember(Net::MessageIn &msg); - void processGuildBasicInfo(Net::MessageIn &msg); - void processGuildAlianceInfo(Net::MessageIn &msg); - void processGuildMemberList(Net::MessageIn &msg); - void processGuildPosNameList(Net::MessageIn &msg); - void processGuildPosInfoList(Net::MessageIn &msg); - void processGuildPositionChanged(Net::MessageIn &msg); - void processGuildMemberPosChange(Net::MessageIn &msg); - void processGuildEmblemData(Net::MessageIn &msg); - void processGuildSkillInfo(Net::MessageIn &msg); - void processGuildNotice(Net::MessageIn &msg); - void processGuildInvite(Net::MessageIn &msg); - void processGuildInviteAck(Net::MessageIn &msg); - void processGuildLeave(Net::MessageIn &msg); - void processGuildMessage(Net::MessageIn &msg); - void processGuildSkillUp(Net::MessageIn &msg); - void processGuildReqAlliance(Net::MessageIn &msg); - void processGuildReqAllianceAck(Net::MessageIn &msg); - void processGuildDelAlliance(Net::MessageIn &msg); - void processGuildOppositionAck(Net::MessageIn &msg); - void processGuildBroken(Net::MessageIn &msg); - void processGuildExpulsionContinue(const std::string &nick); - void processGuildUpdateCoords(Net::MessageIn &msg); - void processGuildPositionInfo(Net::MessageIn &msg); - void processGuildMemberLogin(Net::MessageIn &msg); - void processGuildExpulsion(Net::MessageIn &msg); - void processGuildExpulsionList(Net::MessageIn &msg); - void processGuildEmblem(Net::MessageIn &msg); - void processOnlineInfo(Net::MessageIn &msg); - } // namespace GuildRecv - extern Guild *taGuild; -} // namespace EAthena - -extern GuildTab *guildTab; - -#endif // NET_EATHENA_GUILDRECV_H diff --git a/src/net/eathena/homunculushandler.cpp b/src/net/eathena/homunculushandler.cpp deleted file mode 100644 index 3a3021387..000000000 --- a/src/net/eathena/homunculushandler.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/homunculushandler.h" - -#include "being/playerinfo.h" - -#include "net/serverfeatures.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -HomunculusHandler::HomunculusHandler() -{ - homunculusHandler = this; -} - -HomunculusHandler::~HomunculusHandler() -{ - homunculusHandler = nullptr; -} - -void HomunculusHandler::setName(const std::string &name) const -{ - createOutPacket(CMSG_HOMUNCULUS_SET_NAME); - outMsg.writeString(name, 24, "name"); -} - -void HomunculusHandler::moveToMaster() const -{ - const BeingId id = PlayerInfo::getHomunculusId(); - if (id == BeingId_zero) - return; - createOutPacket(CMSG_HOMMERC_MOVE_TO_MASTER); - outMsg.writeBeingId(id, "homunculus id"); -} - -void HomunculusHandler::move(const int x, const int y) const -{ - const BeingId id = PlayerInfo::getHomunculusId(); - if (id == BeingId_zero) - return; - createOutPacket(CMSG_HOMMERC_MOVE_TO); - outMsg.writeBeingId(id, "homunculus id"); - outMsg.writeCoordinates(CAST_U16(x), - CAST_U16(y), - 1U, "position"); -} - -void HomunculusHandler::attack(const BeingId targetId, - const Keep keep) const -{ - const BeingId id = PlayerInfo::getHomunculusId(); - if (id == BeingId_zero) - return; - createOutPacket(CMSG_HOMMERC_ATTACK); - outMsg.writeBeingId(id, "homunculus id"); - outMsg.writeBeingId(targetId, "target id"); - outMsg.writeInt8(CAST_S8(keep == Keep_true ? 1 : 0), "keep"); -} - -void HomunculusHandler::feed() const -{ - if (packetVersion < 20050425) - return; - createOutPacket(CMSG_HOMUNCULUS_MENU); - outMsg.writeInt16(0, "type"); - outMsg.writeInt8(1, "command"); // feed -} - -void HomunculusHandler::fire() const -{ - if (packetVersion < 20050425) - return; - createOutPacket(CMSG_HOMUNCULUS_MENU); - outMsg.writeInt16(0, "type"); - outMsg.writeInt8(2, "command"); // delete -} - -void HomunculusHandler::talk(const std::string &restrict text) const -{ - if (!serverFeatures->haveMovePet()) - return; - if (text.empty()) - return; - std::string msg = text; - if (msg.size() > 500) - msg = msg.substr(0, 500); - const size_t sz = msg.size(); - - createOutPacket(CMSG_HOMMERC_TALK); - outMsg.writeInt16(CAST_S16(sz + 4 + 1), "len"); - outMsg.writeString(msg, CAST_S32(sz), "message"); - outMsg.writeInt8(0, "zero byte"); -} - -void HomunculusHandler::emote(const uint8_t emoteId) const -{ - if (!serverFeatures->haveMovePet()) - return; - createOutPacket(CMSG_HOMMERC_EMOTE); - outMsg.writeInt8(emoteId, "emote id"); -} - -void HomunculusHandler::setDirection(const unsigned char type) const -{ - if (!serverFeatures->haveMovePet()) - return; - createOutPacket(CMSG_HOMMERC_DIRECTION); - outMsg.writeInt32(0, "pet id"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(type), - "pet direction"); -} - -} // namespace EAthena diff --git a/src/net/eathena/homunculushandler.h b/src/net/eathena/homunculushandler.h deleted file mode 100644 index 817c6ee75..000000000 --- a/src/net/eathena/homunculushandler.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_HOMUNCULUSHANDLER_H -#define NET_EATHENA_HOMUNCULUSHANDLER_H - -#include "net/homunculushandler.h" - -namespace EAthena -{ -class HomunculusHandler final : public Net::HomunculusHandler -{ - public: - HomunculusHandler(); - - A_DELETE_COPY(HomunculusHandler) - - ~HomunculusHandler(); - - void setName(const std::string &name) const override final; - - void moveToMaster() const override final; - - void move(const int x, const int y) const override final; - - void attack(const BeingId targetId, - const Keep keep) const override final; - - void feed() const override final; - - void fire() const override final; - - void talk(const std::string &restrict text) const override final; - - void emote(const uint8_t emoteId) const override final; - - void setDirection(const unsigned char type) const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_HOMUNCULUSHANDLER_H diff --git a/src/net/eathena/homunculusrecv.cpp b/src/net/eathena/homunculusrecv.cpp deleted file mode 100644 index 204b618a7..000000000 --- a/src/net/eathena/homunculusrecv.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/homunculusrecv.h" - -#include "actormanager.h" -#include "notifymanager.h" - -#include "being/homunculusinfo.h" -#include "being/playerinfo.h" -#include "being/localplayer.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/skilldialog.h" - -#include "resources/iteminfo.h" - -#include "resources/db/itemdb.h" - -#include "net/messagein.h" - -#include "utils/stringutils.h" - -#include "debug.h" - -namespace EAthena -{ - -void HomunculusRecv::processHomunculusSkills(Net::MessageIn &msg) -{ - if (skillDialog != nullptr) - skillDialog->hideSkills(SkillOwner::Homunculus); - - const int count = (msg.readInt16("len") - 4) / 37; - for (int f = 0; f < count; f ++) - { - const int skillId = msg.readInt16("skill id"); - const SkillType::SkillType inf = static_cast<SkillType::SkillType>( - msg.readInt16("inf")); - msg.readInt16("unused"); - const int level = msg.readInt16("skill level"); - const int sp = msg.readInt16("sp"); - const int range = msg.readInt16("range"); - const std::string name = msg.readString(24, "skill name"); - const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); - PlayerInfo::setSkillLevel(skillId, level); - if (skillDialog != nullptr) - { - if (!skillDialog->updateSkill(skillId, range, up, inf, sp)) - { - skillDialog->addSkill(SkillOwner::Homunculus, - skillId, name, level, range, up, inf, sp); - } - } - } - if (skillDialog != nullptr) - skillDialog->updateModels(); -} - -void HomunculusRecv::processHomunculusData(Net::MessageIn &msg) -{ - msg.readUInt8("unused"); - const int cmd = msg.readUInt8("state"); - const BeingId id = msg.readBeingId("homunculus id"); - Being *const dstBeing = actorManager->findBeing(id); - const int data = msg.readInt32("data"); - if (cmd == 0) // pre init - { - HomunculusInfo *const info = new HomunculusInfo; - info->id = id; - PlayerInfo::setHomunculus(info); - PlayerInfo::setHomunculusBeing(dstBeing); - return; - } - HomunculusInfo *const info = PlayerInfo::getHomunculus(); - if (info == nullptr) - return; - switch (cmd) - { - case 1: // intimacy - info->intimacy = data; - break; - case 2: // hunger - info->hungry = data; - break; - case 3: // accesory - info->equip = data; - break; - default: - break; - } -} - -void HomunculusRecv::processHomunculusInfo(Net::MessageIn &msg) -{ - const std::string name = msg.readString(24, "name"); - msg.readUInt8("flags"); // 0x01 - renamed, 0x02 - vaporize, 0x04 - alive - const int level = msg.readInt16("level"); - PlayerInfo::setStatBase(Attributes::HOMUN_LEVEL, level); - const int hungry = msg.readInt16("hungry"); - const int intimacy = msg.readInt16("intimacy"); - const int equip = msg.readInt16("equip"); - PlayerInfo::setStatBase(Attributes::HOMUN_ATK, - msg.readInt16("atk")); - PlayerInfo::setStatBase(Attributes::HOMUN_MATK, - msg.readInt16("matk")); - PlayerInfo::setStatBase(Attributes::HOMUN_HIT, - msg.readInt16("hit")); - PlayerInfo::setStatBase(Attributes::HOMUN_CRIT, - msg.readInt16("luk/3 or crit/10")); - PlayerInfo::setStatBase(Attributes::HOMUN_DEF, - msg.readInt16("def")); - PlayerInfo::setStatBase(Attributes::HOMUN_MDEF, - msg.readInt16("mdef")); - PlayerInfo::setStatBase(Attributes::HOMUN_FLEE, - msg.readInt16("flee")); - PlayerInfo::setStatBase(Attributes::HOMUN_ATTACK_DELAY, - msg.readInt16("attack speed")); - if (msg.getVersion() >= 20150513) - { - PlayerInfo::setStatBase(Attributes::HOMUN_HP, - msg.readInt32("hp")); - PlayerInfo::setStatBase(Attributes::HOMUN_MAX_HP, - msg.readInt32("max hp")); - } - else - { - PlayerInfo::setStatBase(Attributes::HOMUN_HP, - msg.readInt16("hp")); - PlayerInfo::setStatBase(Attributes::HOMUN_MAX_HP, - msg.readInt16("max hp")); - } - PlayerInfo::setStatBase(Attributes::HOMUN_MP, - msg.readInt16("sp")); - PlayerInfo::setStatBase(Attributes::HOMUN_MAX_MP, - msg.readInt16("max sp")); - PlayerInfo::setStatBase(Attributes::HOMUN_EXP, - msg.readInt32("exp")); - PlayerInfo::setStatBase(Attributes::HOMUN_EXP_NEEDED, - msg.readInt32("next exp")); - PlayerInfo::setStatBase(Attributes::HOMUN_SKILL_POINTS, - msg.readInt16("skill points")); - const int range = msg.readInt16("attack range"); - PlayerInfo::setStatBase(Attributes::HOMUN_ATTACK_RANGE, - range); - - PlayerInfo::updateAttrs(); - HomunculusInfo *const info = PlayerInfo::getHomunculus(); - if (info == nullptr) - return; - Being *const dstBeing = actorManager->findBeing(info->id); - - info->name = name; - info->level = level; - info->range = range; - info->hungry = hungry; - info->intimacy = intimacy; - info->equip = equip; - PlayerInfo::setHomunculusBeing(dstBeing); -} - -void HomunculusRecv::processHomunculusSkillUp(Net::MessageIn &msg) -{ - const int skillId = msg.readInt16("skill id"); - const int level = msg.readInt16("level"); - const int sp = msg.readInt16("sp"); - const int range = msg.readInt16("range"); - const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); - - if (skillDialog != nullptr && PlayerInfo::getSkillLevel(skillId) != level) - skillDialog->playUpdateEffect(skillId); - PlayerInfo::setSkillLevel(skillId, level); - if (skillDialog != nullptr) - { - if (!skillDialog->updateSkill(skillId, range, - up, SkillType::Unknown, sp)) - { - skillDialog->addSkill(SkillOwner::Homunculus, - skillId, "", level, - range, up, SkillType::Unknown, sp); - } - } -} - -void HomunculusRecv::processHomunculusFood(Net::MessageIn &msg) -{ - const int flag = msg.readUInt8("fail"); - const int itemId = msg.readInt16("food id"); - if (flag != 0) - { - NotifyManager::notify(NotifyTypes::HOMUNCULUS_FEED_OK); - } - else - { - const std::string name = strprintf("[@@%d|%s@@]", itemId, - ItemDB::get(itemId).getName().c_str()); - NotifyManager::notify(NotifyTypes::HOMUNCULUS_FEED_FAIL, name); - } -} - -void HomunculusRecv::processHomunculusExp(Net::MessageIn &msg) -{ - const int exp = msg.readInt32("exp"); - msg.readInt32("unused"); - if (localPlayer != nullptr) - localPlayer->addHomunXpMessage(exp); -} - -} // namespace EAthena diff --git a/src/net/eathena/homunculusrecv.h b/src/net/eathena/homunculusrecv.h deleted file mode 100644 index d53a6fcda..000000000 --- a/src/net/eathena/homunculusrecv.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_HOMUNCULUSRECV_H -#define NET_EATHENA_HOMUNCULUSRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace HomunculusRecv - { - void processHomunculusSkills(Net::MessageIn &msg); - void processHomunculusData(Net::MessageIn &msg); - void processHomunculusInfo(Net::MessageIn &msg); - void processHomunculusSkillUp(Net::MessageIn &msg); - void processHomunculusFood(Net::MessageIn &msg); - void processHomunculusExp(Net::MessageIn &msg); - } // namespace HomunculusRecv -} // namespace EAthena - -#endif // NET_EATHENA_HOMUNCULUSRECV_H diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp deleted file mode 100644 index 40ae67d5d..000000000 --- a/src/net/eathena/inventoryhandler.cpp +++ /dev/null @@ -1,603 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/inventoryhandler.h" - -#include "const/net/inventory.h" - -#include "enums/equipslot.h" - -#include "net/eathena/inventoryrecv.h" -#include "net/eathena/menu.h" -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "utils/foreach.h" - -#include "resources/item/item.h" - -#include "debug.h" - -extern int packetVersion; -extern int serverVersion; - -// this conversion from bit corrupted LOOK_* to EquipSlot -// for how it corrupted, see BeingRecv::processBeingChangeLookContinue -const EquipSlot::Type EQUIP_CONVERT[] = -{ - EquipSlot::PROJECTILE_SLOT, // 0 SPRITE_BASE - EquipSlot::FEET_SLOT, // 1 SPRITE_HAIR - EquipSlot::LEGS_SLOT, // 2 SPRITE_WEAPON - EquipSlot::TORSO_SLOT, // 3 SPRITE_HEAD_BOTTOM - EquipSlot::GLOVES_SLOT, // 4 SPRITE_HEAD_TOP - EquipSlot::EVOL_RING1_SLOT, // 5 SPRITE_HEAD_MID - EquipSlot::PROJECTILE_SLOT, // 6 SPRITE_HAIR_COLOR - EquipSlot::HEAD_SLOT, // 7 SPRITE_CLOTHES_COLOR - EquipSlot::RING2_SLOT, // 8 SPRITE_SHIELD - EquipSlot::PROJECTILE_SLOT, // 9 SPRITE_SHOES - EquipSlot::FIGHT1_SLOT, // 10 SPRITE_BODY - EquipSlot::FIGHT2_SLOT, // 11 SPRITE_FLOOR - EquipSlot::EVOL_RING2_SLOT, // 12 SPRITE_ROBE - EquipSlot::PROJECTILE_SLOT, // 13 SPRITE_EVOL2 - EquipSlot::COSTUME_ROBE_SLOT, // 14 SPRITE_EVOL3 - EquipSlot::RING1_SLOT, // 15 SPRITE_EVOL4 - EquipSlot::NECK_SLOT, // 16 SPRITE_EVOL5 - EquipSlot::RING2_SLOT, // 17 SPRITE_EVOL6 -}; - -namespace EAthena -{ - -InventoryHandler::InventoryHandler() : - Ea::InventoryHandler(), - mItemIndex(0) -{ - inventoryHandler = this; - - InventoryRecv::mCartItems.clear(); -} - -InventoryHandler::~InventoryHandler() -{ - inventoryHandler = nullptr; -} - -void InventoryHandler::equipItem(const Item *const item) const -{ - if (item == nullptr) - return; - - createOutPacket(CMSG_PLAYER_EQUIP); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); - // here we set flag for any slots, - // probably better set to slot from item properties - if (packetVersion >= 20130320) - outMsg.writeInt32(0xFFFFFFFFU, "wear location"); - else - outMsg.writeInt16(0x7FFFU, "wear location"); -} - -void InventoryHandler::unequipItem(const Item *const item) const -{ - if (item == nullptr) - return; - - createOutPacket(CMSG_PLAYER_UNEQUIP); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); -} - -void InventoryHandler::useItem(const Item *const item) const -{ - if (item == nullptr) - return; - - createOutPacket(CMSG_PLAYER_INVENTORY_USE); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(item->getId(), "unused"); -} - -void InventoryHandler::useItem(const Item *const item, - const int16_t useType) const -{ - if (item == nullptr) - return; - - if (serverVersion >= 19) - { - createOutPacket(CMSG_PLAYER_INVENTORY_USE2); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); - outMsg.writeInt16(useType, "use type"); - } - else - { - createOutPacket(CMSG_PLAYER_INVENTORY_USE); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(item->getId(), "unused"); - } -} - -void InventoryHandler::dropItem(const Item *const item, const int amount) const -{ - if (item == nullptr) - return; - - createOutPacket(CMSG_PLAYER_INVENTORY_DROP); - const int16_t index = CAST_S16(item->getInvIndex() + INVENTORY_OFFSET); - if (packetVersion >= 20101124) - { - outMsg.writeInt16(index, "index"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20080827) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20070212) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20070108) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20060327) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20050719) - { - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20050718) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20050628) - { - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20050509) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20050110) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20041129) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20041025) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20041005) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20040920) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20040906) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20040809) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else if (packetVersion >= 20040726) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(index, "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } - else - { - outMsg.writeInt16(index, "index"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - } -} - -void InventoryHandler::closeStorage() const -{ - createOutPacket(CMSG_CLOSE_STORAGE); -} - -void InventoryHandler::moveItemInventoryToStorage(const int slot, - const int amount) const -{ - createOutPacket(CMSG_MOVE_TO_STORAGE); - if (packetVersion >= 20101124) - { - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20080827) - { - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20070212) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20070108) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20060327) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20050719) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20050718) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20050628) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20050509) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20050110) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20041129) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20041025) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20041005) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20040920) - { - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20040906) - { - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20040809) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else if (packetVersion >= 20040726) - { - outMsg.writeInt16(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(0, "unknown"); - outMsg.writeInt8(0, "unknown"); - outMsg.writeInt32(amount, "amount"); - } - else - { - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(amount, "amount"); - } -} - -void InventoryHandler::moveItem2(const InventoryTypeT source, - const int slot, - const int amount, - const InventoryTypeT destination) const -{ - int packet = 0; - int offset = INVENTORY_OFFSET; - if (source == InventoryType::Inventory) - { - if (destination == InventoryType::Storage) - { - moveItemInventoryToStorage(slot, amount); - return; - } - else if (destination == InventoryType::Cart) - { - packet = CMSG_MOVE_TO_CART; - } - } - else if (source == InventoryType::Storage) - { - offset = STORAGE_OFFSET; - if (destination == InventoryType::Inventory) - packet = CMSG_MOVE_FROM_STORAGE; - else if (destination == InventoryType::Cart) - packet = CMSG_MOVE_FROM_STORAGE_TO_CART; - } - else if (source == InventoryType::Cart) - { - if (destination == InventoryType::Inventory) - packet = CMSG_MOVE_FROM_CART; - else if (destination == InventoryType::Storage) - packet = CMSG_MOVE_FROM_CART_TO_STORAGE; - } - - // for packetVersion < 20101124 need use other packet offset - if (packet != 0) - { - createOutPacket(packet); - outMsg.writeInt16(CAST_S16(slot + offset), "index"); - outMsg.writeInt32(amount, "amount"); - } -} - -void InventoryHandler::useCard(const Item *const item) -{ - if (item == nullptr) - return; - - mItemIndex = item->getInvIndex(); - createOutPacket(CMSG_PLAYER_USE_CARD); - outMsg.writeInt16(CAST_S16( - mItemIndex + INVENTORY_OFFSET), "index"); -} - -void InventoryHandler::insertCard(const int cardIndex, - const int itemIndex) const -{ - createOutPacket(CMSG_PLAYER_INSERT_CARD); - outMsg.writeInt16(CAST_S16(cardIndex + INVENTORY_OFFSET), - "card index"); - outMsg.writeInt16(CAST_S16(itemIndex + INVENTORY_OFFSET), - "item index"); -} - -void InventoryHandler::favoriteItem(const Item *const item, - const bool favorite) const -{ - if (item == nullptr) - return; - if (packetVersion < 20120410) - return; - createOutPacket(CMSG_PLAYER_FAVORITE_ITEM); - outMsg.writeInt16(CAST_S16(item->getInvIndex() - + INVENTORY_OFFSET), - "item index"); - outMsg.writeInt8(static_cast<int8_t>(favorite), "favorite flag"); -} - -void InventoryHandler::selectEgg(const Item *const item) const -{ - if (item == nullptr) - return; - createOutPacket(CMSG_PET_SELECT_EGG); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); - menu = MenuType::Unknown; -} - -int InventoryHandler::convertFromServerSlot(const int serverSlot) const -{ - if (serverSlot < 0 || serverSlot >= 17) - return 0; - - return CAST_S32(EQUIP_CONVERT[serverSlot]); -} - -void InventoryHandler::selectCart(const BeingId accountId, - const int type) const -{ - if (packetVersion < 20150805) - return; - createOutPacket(CMSG_SELECT_CART); - outMsg.writeBeingId(accountId, "account id"); - outMsg.writeInt8(CAST_S8(type), "type"); -} - -void InventoryHandler::identifyItem(const Item *const item) const -{ - if (packetVersion < 20150513) - return; - createOutPacket(CMSG_QUICK_IDENTIFY_ITEM); - outMsg.writeInt16(CAST_S16(item->getInvIndex()), - "item index"); -} - -void InventoryHandler::mergeItemsAck(const STD_VECTOR<Item*> &items) const -{ - createOutPacket(CMSG_MERGE_ITEM_ACK); - const size_t sz = items.size(); - outMsg.writeInt16(CAST_S16(sz * 2 + 4), - "len"); - FOR_EACH (STD_VECTOR<Item*>::const_iterator, it, items) - { - outMsg.writeInt16(CAST_S16((*it)->getInvIndex() + 2), - "item index"); - } -} - -void InventoryHandler::mergetItemsCancel() const -{ - createOutPacket(CMSG_MERGE_ITEM_CANCEL); -} - -} // namespace EAthena diff --git a/src/net/eathena/inventoryhandler.h b/src/net/eathena/inventoryhandler.h deleted file mode 100644 index 79155ddaa..000000000 --- a/src/net/eathena/inventoryhandler.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_INVENTORYHANDLER_H -#define NET_EATHENA_INVENTORYHANDLER_H - -#include "net/ea/inventoryhandler.h" - -namespace EAthena -{ - -class InventoryHandler final : public Ea::InventoryHandler -{ - public: - InventoryHandler(); - - A_DELETE_COPY(InventoryHandler) - - ~InventoryHandler(); - - void equipItem(const Item *const item) const override final; - - void unequipItem(const Item *const item) const override final; - - void useItem(const Item *const item) const override final; - - void useItem(const Item *const item, - const int16_t useType) const override final; - - void dropItem(const Item *const item, - const int amount) const override final; - - void closeStorage() const override final; - - void moveItem2(const InventoryTypeT source, - const int slot, - const int amount, - const InventoryTypeT destination) const override final; - - void moveItemInventoryToStorage(const int slot, - const int amount) const; - - void useCard(const Item *const item) override final; - - void insertCard(const int cardIndex, - const int itemIndex) const override final; - - void favoriteItem(const Item *const item, - const bool favorite) const override final; - - void selectEgg(const Item *const item) const override final; - - int convertFromServerSlot(const int serverSlot) - const override final A_WARN_UNUSED; - - void selectCart(const BeingId accountId, - const int type) const override final; - - void identifyItem(const Item *const item) const override final; - - void mergeItemsAck(const STD_VECTOR<Item*> &items) const - override final; - - void mergetItemsCancel() const override final; - - int getProjectileSlot() const override final - { return 10; } - - int getItemIndex() const override final A_WARN_UNUSED - { return mItemIndex; } - - private: - int mItemIndex; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_INVENTORYHANDLER_H diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp deleted file mode 100644 index ead74ad63..000000000 --- a/src/net/eathena/inventoryrecv.cpp +++ /dev/null @@ -1,1441 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/inventoryrecv.h" - -#include "notifymanager.h" -#include "itemcolormanager.h" - -#include "being/localplayer.h" - -#include "const/net/inventory.h" - -#include "enums/equipslot.h" - -#include "enums/resources/notifytypes.h" - -#include "enums/net/deleteitemreason.h" - -#include "gui/popups/itempopup.h" - -#include "gui/widgets/createwidget.h" - -#include "gui/windows/insertcarddialog.h" - -#include "listeners/arrowslistener.h" - -#include "net/inventoryhandler.h" -#include "net/messagein.h" - -#include "net/eathena/itemflags.h" -#include "net/eathena/menu.h" - -#include "net/ea/equipbackend.h" -#include "net/ea/inventoryrecv.h" - -#include "resources/iteminfo.h" - -#include "utils/gettext.h" -#include "utils/foreach.h" -#include "utils/stringutils.h" - -#include "debug.h" - -extern int serverVersion; -extern int packetVersion; - -namespace EAthena -{ - -namespace InventoryRecv -{ - // EQP_* to EquipSlot - const EquipSlot::Type EQUIP_POINTS[EquipSlot::VECTOREND] = - { - EquipSlot::LEGS_SLOT, // 0 1 EQP_HEAD_LOW - EquipSlot::FIGHT1_SLOT, // 1 2 EQP_HAND_R - EquipSlot::GLOVES_SLOT, // 2 4 EQP_GARMENT - EquipSlot::RING2_SLOT, // 3 8 EQP_ACC_L - EquipSlot::RING1_SLOT, // 4 16 EQP_ARMOR - EquipSlot::FIGHT2_SLOT, // 5 32 EQP_HAND_L - EquipSlot::FEET_SLOT, // 6 64 EQP_SHOES - EquipSlot::NECK_SLOT, // 7 128 EQP_ACC_R - EquipSlot::HEAD_SLOT, // 8 256 EQP_HEAD_TOP - EquipSlot::TORSO_SLOT, // 9 512 EQP_HEAD_MID - EquipSlot::EVOL_RING1_SLOT, // 10 1024 EQP_COSTUME_HEAD_TOP - EquipSlot::EVOL_RING2_SLOT, // 11 2048 EQP_COSTUME_HEAD_MID - EquipSlot::PROJECTILE_SLOT, // 12 4096 EQP_COSTUME_HEAD_LOW - EquipSlot::COSTUME_ROBE_SLOT, // 13 8192 EQP_COSTUME_GARMENT - EquipSlot::PROJECTILE_SLOT, // 14 16384 UNUSED_COSTUME_FLOOR - EquipSlot::PROJECTILE_SLOT, // 15 32768 EQP_AMMO - EquipSlot::SHADOW_ARMOR_SLOT, // 16 65536 EQP_SHADOW_ARMOR - EquipSlot::SHADOW_WEAPON_SLOT, // 17 131072 EQP_SHADOW_WEAPON - EquipSlot::SHADOW_SHIELD_SLOT, // 18 262144 EQP_SHADOW_SHIELD - EquipSlot::SHADOW_SHOES_SLOT, // 19 524288 EQP_SHADOW_SHOES - EquipSlot::SHADOW_ACCESSORY2_SLOT, // 20 1048576 EQP_SHADOW_ACC_R - EquipSlot::SHADOW_ACCESSORY1_SLOT, // 21 2097152 EQP_SHADOW_ACC_L - }; - - Ea::InventoryItems mCartItems; -} // namespace InventoryRecv - -void InventoryRecv::processPlayerEquipment(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerEquipment") - Inventory *const inventory = localPlayer != nullptr - ? PlayerInfo::getInventory() : nullptr; - - msg.readInt16("len"); - Equipment *const equipment = PlayerInfo::getEquipment(); - if ((equipment != nullptr) && (equipment->getBackend() == nullptr)) - { // look like SMSG_PLAYER_INVENTORY was not received - Ea::InventoryRecv::mEquips.clear(); - equipment->setBackend(&Ea::InventoryRecv::mEquips); - } - - int packetLen = 2 + 2 + 1 + 1 + 8; - if (msg.getVersion() >= 20120925) - packetLen += 4 + 4 + 1; - else - packetLen += 1 + 2 + 2 + 1; - if (msg.getVersion() >= 20071002) - packetLen += 4; - if (msg.getVersion() >= 20080102) - packetLen += 2; - if (msg.getVersion() >= 20100629) - packetLen += 2; - if (msg.getVersion() >= 20150226) - packetLen += 26; - - const int number = (msg.getLength() - 4) / packetLen; - - for (int loop = 0; loop < number; loop++) - { - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - int equipType; - if (msg.getVersion() >= 20120925) - { - msg.readInt32("location"); - equipType = msg.readInt32("wear state"); - } - else - { - msg.readUInt8("identified"); - msg.readInt16("location"); - equipType = msg.readInt16("wear state"); - msg.readUInt8("is damaged"); - } - const uint8_t refine = CAST_U8(msg.readInt8("refine")); - int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - if (msg.getVersion() >= 20071002) - msg.readInt32("hire expire date (?)"); - if (msg.getVersion() >= 20080102) - msg.readInt16("equip type"); - if (msg.getVersion() >= 20100629) - msg.readInt16("item sprite number"); - ItemOptionsList *options = nullptr; - if (msg.getVersion() >= 20150226) - { - options = new ItemOptionsList(msg.readUInt8("option count")); - for (int f = 0; f < 5; f ++) - { - const uint16_t idx = msg.readInt16("option index"); - const uint16_t val = msg.readInt16("option value"); - msg.readUInt8("option param"); - options->add(idx, val); - } - } - ItemFlags flags; - if (msg.getVersion() >= 20120925) - flags.byte = msg.readUInt8("flags"); - else - flags.byte = 0; - if (inventory != nullptr) - { - inventory->setItem(index, - itemId, - itemType, - 1, - refine, - ItemColorManager::getColorFromCards(&cards[0]), - fromBool(flags.bits.isIdentified, Identified), - fromBool(flags.bits.isDamaged, Damaged), - fromBool(flags.bits.isFavorite, Favorite), - Equipm_true, - Equipped_false); - inventory->setCards(index, cards, maxCards); - inventory->setOptions(index, options); - } - delete options; - - if (equipType != 0) - { - Ea::InventoryRecv::mEquips.setEquipment( - InventoryRecv::getSlot(equipType), - index); - } - } - BLOCK_END("InventoryRecv::processPlayerEquipment") -} - -void InventoryRecv::processPlayerInventoryAdd(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerInventoryAdd") - Inventory *const inventory = localPlayer != nullptr - ? PlayerInfo::getInventory() : nullptr; - - if ((PlayerInfo::getEquipment() != nullptr) - && (PlayerInfo::getEquipment()->getBackend() == nullptr)) - { // look like SMSG_PLAYER_INVENTORY was not received - Ea::InventoryRecv::mEquips.clear(); - PlayerInfo::getEquipment()->setBackend(&Ea::InventoryRecv::mEquips); - } - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - int amount = msg.readInt16("count"); - const int itemId = msg.readInt16("item id"); - const uint8_t identified = msg.readUInt8("identified"); - const uint8_t damaged = msg.readUInt8("is damaged"); - const uint8_t refine = msg.readUInt8("refine"); - Favorite favorite = Favorite_false; - int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - int equipType; - if (msg.getVersion() >= 20120925) - equipType = msg.readInt32("location"); - else - equipType = msg.readInt16("location"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - const unsigned char err = msg.readUInt8("result"); - if (msg.getVersion() >= 20061218) - msg.readInt32("hire expire date"); - if (msg.getVersion() >= 20071002) - msg.readInt16("bind on equip"); - ItemOptionsList *options = nullptr; - if (msg.getVersion() >= 20150226) - { - options = new ItemOptionsList; - for (int f = 0; f < 5; f ++) - { - const uint16_t idx = msg.readInt16("option index"); - const uint16_t val = msg.readInt16("option value"); - msg.readUInt8("option param"); - options->add(idx, val); - } - } - if (msg.getVersion() >= 20160921) - { - favorite = fromBool(msg.readUInt8("favorite"), Favorite); - msg.readInt16("look"); - } - - const ItemColor color = ItemColorManager::getColorFromCards(&cards[0]); - BeingId floorId; - if (Ea::InventoryRecv::mSentPickups.empty()) - { - floorId = BeingId_zero; - } - else - { - floorId = Ea::InventoryRecv::mSentPickups.front(); - Ea::InventoryRecv::mSentPickups.pop(); - } - - if (err != 0u) - { - PickupT pickup; - switch (err) - { - case 1: - pickup = Pickup::BAD_ITEM; - break; - case 2: - pickup = Pickup::TOO_HEAVY; - break; - case 4: - pickup = Pickup::INV_FULL; - break; - case 5: - pickup = Pickup::MAX_AMOUNT; - break; - case 6: - pickup = Pickup::TOO_FAR; - break; - case 7: - pickup = Pickup::STACK_AMOUNT; - break; - default: - pickup = Pickup::UNKNOWN; - UNIMPLEMENTEDPACKETFIELD(err); - break; - } - if (localPlayer != nullptr) - { - if (itemId == 0) - { - localPlayer->pickedUp(ItemDB::getEmpty(), - 0, - color, - floorId, - pickup); - } - else - { - localPlayer->pickedUp(ItemDB::get(itemId), - 0, - color, - floorId, - pickup); - } - } - } - else - { - if (localPlayer != nullptr) - { - if (itemId == 0) - { - localPlayer->pickedUp(ItemDB::getEmpty(), - amount, - color, - floorId, - Pickup::OKAY); - } - else - { - localPlayer->pickedUp(ItemDB::get(itemId), - amount, - color, - floorId, - Pickup::OKAY); - } - } - - if (inventory != nullptr) - { - const Item *const item = inventory->getItem(index); - - if ((item != nullptr) && item->getId() == itemId) - amount += item->getQuantity(); - - inventory->setItem(index, - itemId, - itemType, - amount, - refine, - color, - fromBool(identified, Identified), - fromBool(damaged, Damaged), - favorite, - fromBool(equipType, Equipm), - Equipped_false); - inventory->setCards(index, cards, maxCards); - inventory->setOptions(index, options); - } - ArrowsListener::distributeEvent(); - } - delete options; - BLOCK_END("InventoryRecv::processPlayerInventoryAdd") -} - -void InventoryRecv::processPlayerInventory(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerInventory") - Inventory *const inventory = localPlayer != nullptr - ? PlayerInfo::getInventory() : nullptr; - if (PlayerInfo::getEquipment() != nullptr) - { - // Clear inventory - this will be a complete refresh - Ea::InventoryRecv::mEquips.clear(); - PlayerInfo::getEquipment()->setBackend(&Ea::InventoryRecv::mEquips); - } - - if (inventory != nullptr) - inventory->clear(); - - msg.readInt16("len"); - - int packetLen = 7; - if (msg.getVersion() >= 20120925) - packetLen += 4 + 1; - else - packetLen += 1 + 2; - if (packetVersion >= 5) - packetLen += 8; - if (msg.getVersion() >= 20080102) - packetLen += 4; - - const int number = (msg.getLength() - 4) / packetLen; - - for (int loop = 0; loop < number; loop++) - { - const int index = msg.readInt16("item index") - INVENTORY_OFFSET; - const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - if (msg.getVersion() < 20120925) - msg.readUInt8("identified"); - const int amount = msg.readInt16("count"); - if (msg.getVersion() >= 20120925) - msg.readInt32("wear state / equip"); - else - msg.readInt16("wear state / equip"); - int cards[maxCards]; - if (packetVersion >= 5) - { - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - } - else - { - for (int f = 0; f < maxCards; f++) - cards[f] = 0; - } - if (msg.getVersion() >= 20080102) - msg.readInt32("hire expire date (?)"); - ItemFlags flags; - if (msg.getVersion() >= 20120925) - flags.byte = msg.readUInt8("flags"); - else - flags.byte = 0; - - if (inventory != nullptr) - { - inventory->setItem(index, - itemId, - itemType, - amount, - 0, - ItemColorManager::getColorFromCards(&cards[0]), - fromBool(flags.bits.isIdentified, Identified), - fromBool(flags.bits.isDamaged, Damaged), - fromBool(flags.bits.isFavorite, Favorite), - Equipm_false, - Equipped_false); - inventory->setCards(index, cards, maxCards); - } - } - BLOCK_END("InventoryRecv::processPlayerInventory") -} - -void InventoryRecv::processPlayerStorage(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerInventory") - Ea::InventoryRecv::mInventoryItems.clear(); - - msg.readInt16("len"); - - int packetLen = 7; - if (msg.getVersion() >= 20120925) - packetLen += 4 + 1; - else - packetLen += 1 + 2; - if (packetVersion >= 5) - packetLen += 8; - if (msg.getVersion() >= 20080102) - packetLen += 4; - - int number; - if (msg.getVersion() >= 20120925) - { - msg.readString(24, "storage name"); - number = (msg.getLength() - 4 - 24) / packetLen; - } - else - { - number = (msg.getLength() - 4) / packetLen; - } - - for (int loop = 0; loop < number; loop++) - { - const int index = msg.readInt16("item index") - STORAGE_OFFSET; - const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - if (msg.getVersion() < 20120925) - msg.readUInt8("identified"); - const int amount = msg.readInt16("count"); - if (msg.getVersion() >= 20120925) - msg.readInt32("wear state / equip"); - else - msg.readInt16("wear state / equip"); - int cards[maxCards]; - if (msg.getVersion() >= 5) - { - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - } - else - { - for (int f = 0; f < maxCards; f++) - cards[f] = 0; - } - if (msg.getVersion() >= 20080102) - msg.readInt32("hire expire date (?)"); - ItemFlags flags; - if (msg.getVersion() >= 20120925) - flags.byte = msg.readUInt8("flags"); - else - flags.byte = 0; - - Ea::InventoryRecv::mInventoryItems.push_back(Ea::InventoryItem( - index, - itemId, - itemType, - cards, - nullptr, - amount, - 0, - ItemColorManager::getColorFromCards(&cards[0]), - fromBool(flags.bits.isIdentified, Identified), - fromBool(flags.bits.isDamaged, Damaged), - fromBool(flags.bits.isFavorite, Favorite), - Equipm_false)); - } - BLOCK_END("InventoryRecv::processPlayerInventory") -} - -void InventoryRecv::processPlayerEquip(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerEquip") - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - int equipType; - if (msg.getVersion() >= 20120925) - equipType = msg.readInt32("wear location"); - else - equipType = msg.readInt16("wear location"); - if (msg.getVersion() >= 20100629) - msg.readInt16("sprite"); - const uint8_t flag = msg.readUInt8("result"); - - switch (flag) - { - case 0: - Ea::InventoryRecv::mEquips.setEquipment( - InventoryRecv::getSlot(equipType), - index); - break; - case 1: - NotifyManager::notify(NotifyTypes::EQUIP_FAILED_LEVEL); - break; - - case 2: - default: - NotifyManager::notify(NotifyTypes::EQUIP_FAILED); - break; - } - BLOCK_END("InventoryRecv::processPlayerEquip") -} - -void InventoryRecv::processPlayerUnEquip(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerUnEquip") - msg.readInt16("index"); - int equipType; - if (msg.getVersion() >= 20120925) - equipType = msg.readInt32("wear location"); - else - equipType = msg.readInt16("wear location"); - const uint8_t flag = msg.readUInt8("result"); - - if (flag != 0u) - { - NotifyManager::notify(NotifyTypes::UNEQUIP_FAILED); - } - else - { - Ea::InventoryRecv::mEquips.setEquipment( - InventoryRecv::getSlot(equipType), - -1); - } - if ((equipType & 0x8000) != 0) - ArrowsListener::distributeEvent(); - BLOCK_END("InventoryRecv::processPlayerUnEquip") -} - -void InventoryRecv::processPlayerInventoryRemove2(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerInventoryRemove2") - Inventory *const inventory = localPlayer != nullptr - ? PlayerInfo::getInventory() : nullptr; - - const DeleteItemReasonT reason = static_cast<DeleteItemReasonT>( - msg.readInt16("reason")); - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int amount = msg.readInt16("amount"); - - if (inventory != nullptr) - { - if (Item *const item = inventory->getItem(index)) - { - switch (reason) - { - case DeleteItemReason::Normal: - NotifyManager::notify(NotifyTypes::DELETE_ITEM_NORMAL, - item->getName()); - break; - case DeleteItemReason::SkillUse: - NotifyManager::notify(NotifyTypes::DELETE_ITEM_SKILL_USE, - item->getName()); - break; - case DeleteItemReason::FailRefine: - NotifyManager::notify(NotifyTypes::DELETE_ITEM_FAIL_REFINE, - item->getName()); - break; - case DeleteItemReason::MaterialChange: - NotifyManager::notify( - NotifyTypes::DELETE_ITEM_MATERIAL_CHANGE, - item->getName()); - break; - case DeleteItemReason::ToStorage: - NotifyManager::notify(NotifyTypes::DELETE_ITEM_TO_STORAGE, - item->getName()); - break; - case DeleteItemReason::ToCart: - NotifyManager::notify(NotifyTypes::DELETE_ITEM_TO_CART, - item->getName()); - break; - case DeleteItemReason::Sold: - NotifyManager::notify(NotifyTypes::DELETE_ITEM_SOLD, - item->getName()); - break; - case DeleteItemReason::Analysis: - NotifyManager::notify(NotifyTypes::DELETE_ITEM_ANALYSIS, - item->getName()); - break; - default: - NotifyManager::notify(NotifyTypes::DELETE_ITEM_UNKNOWN, - item->getName()); - break; - } - - item->increaseQuantity(-amount); - if (item->getQuantity() == 0) - inventory->removeItemAt(index); - ArrowsListener::distributeEvent(); - } - } - BLOCK_END("InventoryRecv::processPlayerInventoryRemove2") -} - -void InventoryRecv::processPlayerStorageEquip(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerStorageEquip") - msg.readInt16("len"); - - int packetLen = 2 + 2 + 1 + 1 + 8; - if (msg.getVersion() >= 20120925) - packetLen += 4 + 4 + 1; - else - packetLen += 1 + 2 + 2 + 1; - if (msg.getVersion() >= 20071002) - packetLen += 4; - if (msg.getVersion() >= 20080102) - packetLen += 2; - if (msg.getVersion() >= 20100629) - packetLen += 2; - if (msg.getVersion() >= 20150226) - packetLen += 26; - - int number; - if (msg.getVersion() >= 20120925) - { - msg.readString(24, "storage name"); - number = (msg.getLength() - 4 - 24) / packetLen; - } - else - { - number = (msg.getLength() - 4) / packetLen; - } - - for (int loop = 0; loop < number; loop++) - { - const int index = msg.readInt16("index") - STORAGE_OFFSET; - const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - const int amount = 1; - if (msg.getVersion() >= 20120925) - { - msg.readInt32("location"); - msg.readInt32("wear state"); - } - else - { - msg.readUInt8("identified"); - msg.readInt16("location"); - msg.readInt16("wear state"); - msg.readUInt8("is damaged"); - } - const uint8_t refine = msg.readUInt8("refine level"); - int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - if (msg.getVersion() >= 20071002) - msg.readInt32("hire expire date"); - if (msg.getVersion() >= 20080102) - msg.readInt16("bind on equip"); - if (msg.getVersion() >= 20100629) - msg.readInt16("sprite"); - ItemOptionsList *options = nullptr; - if (msg.getVersion() >= 20150226) - { - options = new ItemOptionsList(msg.readUInt8("option count")); - for (int f = 0; f < 5; f ++) - { - const uint16_t idx = msg.readInt16("option index"); - const uint16_t val = msg.readInt16("option value"); - msg.readUInt8("option param"); - options->add(idx, val); - } - } - - ItemFlags flags; - if (msg.getVersion() >= 20120925) - flags.byte = msg.readUInt8("flags"); - else - flags.byte = 0; - - Ea::InventoryRecv::mInventoryItems.push_back(Ea::InventoryItem( - index, - itemId, - itemType, - cards, - options, - amount, - refine, - ItemColorManager::getColorFromCards(&cards[0]), - fromBool(flags.bits.isIdentified, Identified), - fromBool(flags.bits.isDamaged, Damaged), - fromBool(flags.bits.isFavorite, Favorite), - Equipm_false)); - delete options; - } - BLOCK_END("InventoryRecv::processPlayerStorageEquip") -} - -void InventoryRecv::processPlayerStorageAdd(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerStorageAdd") - // Move an item into storage - const int index = msg.readInt16("index") - STORAGE_OFFSET; - const int amount = msg.readInt32("amount"); - const int itemId = msg.readInt16("item id"); - ItemTypeT itemType; - if (msg.getVersion() >= 5) - itemType = static_cast<ItemTypeT>(msg.readUInt8("type")); - else - itemType = ItemType::Unknown; - const unsigned char identified = msg.readUInt8("identify"); - const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); - const uint8_t refine = msg.readUInt8("refine"); - int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - ItemOptionsList *options = nullptr; - if (msg.getVersion() >= 20150226) - { - options = new ItemOptionsList; - for (int f = 0; f < 5; f ++) - { - const uint16_t idx = msg.readInt16("option index"); - const uint16_t val = msg.readInt16("option value"); - msg.readUInt8("option param"); - options->add(idx, val); - } - } - - const ItemColor color = ItemColorManager::getColorFromCards(&cards[0]); - if (Item *const item = Ea::InventoryRecv::mStorage->getItem(index)) - { - item->setId(itemId, color); - item->increaseQuantity(amount); - } - else - { - if (Ea::InventoryRecv::mStorage != nullptr) - { - Ea::InventoryRecv::mStorage->setItem(index, - itemId, - itemType, - amount, - refine, - color, - fromBool(identified, Identified), - damaged, - Favorite_false, - Equipm_false, - Equipped_false); - Ea::InventoryRecv::mStorage->setCards(index, cards, maxCards); - Ea::InventoryRecv::mStorage->setOptions(index, options); - } - } - delete options; - BLOCK_END("InventoryRecv::processPlayerStorageAdd") -} - -void InventoryRecv::processPlayerUseCard(Net::MessageIn &msg) -{ - const Inventory *const inv = PlayerInfo::getInventory(); - const int index = inventoryHandler->getItemIndex(); - const Item *item1 = nullptr; - if (inv != nullptr) - item1 = inv->getItem(index); - SellDialog *const dialog = CREATEWIDGETR(InsertCardDialog, - index, item1); - - const int count = (msg.readInt16("len") - 4) / 2; - for (int f = 0; f < count; f ++) - { - const int itemIndex = msg.readInt16("item index") - INVENTORY_OFFSET; - if (inv == nullptr) - continue; - const Item *const item = inv->getItem(itemIndex); - if (item == nullptr) - continue; - dialog->addItem(item, 0); - } -} - -void InventoryRecv::processPlayerInsertCard(Net::MessageIn &msg) -{ - const int itemIndex = msg.readInt16("item index") - INVENTORY_OFFSET; - const int cardIndex = msg.readInt16("card index") - INVENTORY_OFFSET; - if (msg.readUInt8("flag") != 0u) - { - NotifyManager::notify(NotifyTypes::CARD_INSERT_FAILED); - } - else - { - NotifyManager::notify(NotifyTypes::CARD_INSERT_SUCCESS); - Inventory *const inv = PlayerInfo::getInventory(); - if (inv == nullptr) - return; - Item *const card = inv->getItem(cardIndex); - int cardId = 0; - if (card != nullptr) - { - cardId = card->getId(); - card->increaseQuantity(-1); - if (card->getQuantity() == 0) - inv->removeItemAt(cardIndex); - } - Item *const item = inv->getItem(itemIndex); - if (item != nullptr) - { - item->addCard(cardId); - item->updateColor(); - itemPopup->resetPopup(); - } - } -} - -void InventoryRecv::processPlayerItemRentalTime(Net::MessageIn &msg) -{ - const int id = msg.readInt16("item id"); - const int seconds = msg.readInt32("seconds"); - const ItemInfo &info = ItemDB::get(id); - const std::string timeStr = timeDiffToString(seconds); - NotifyManager::notify(NotifyTypes::RENTAL_TIME_LEFT, - // TRANSLATORS: notification message - strprintf(_("Left %s rental time for item %s."), - timeStr.c_str(), info.getName().c_str())); -} - -void InventoryRecv::processPlayerItemRentalExpired(Net::MessageIn &msg) -{ - Inventory *const inventory = localPlayer != nullptr - ? PlayerInfo::getInventory() : nullptr; - - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int id = msg.readInt16("item id"); - const ItemInfo &info = ItemDB::get(id); - - NotifyManager::notify(NotifyTypes::RENTAL_TIME_EXPIRED, - info.getName()); - if (inventory != nullptr) - { - if (Item *const item = inventory->getItem(index)) - { - item->increaseQuantity(-item->getQuantity()); - inventory->removeItemAt(index); - ArrowsListener::distributeEvent(); - } - } -} - -void InventoryRecv::processPlayerStorageRemove(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerStorageRemove") - // Move an item out of storage - const int index = msg.readInt16("index") - STORAGE_OFFSET; - const int amount = msg.readInt32("amount"); - if (Ea::InventoryRecv::mStorage != nullptr) - { - if (Item *const item = Ea::InventoryRecv::mStorage->getItem(index)) - { - item->increaseQuantity(-amount); - if (item->getQuantity() == 0) - Ea::InventoryRecv::mStorage->removeItemAt(index); - } - } - BLOCK_END("InventoryRecv::processPlayerStorageRemove") -} - -void InventoryRecv::processCartInfo(Net::MessageIn &msg) -{ - msg.readInt16("cart items used"); - const int size = msg.readInt16("max cart items"); - PlayerInfo::setAttribute(Attributes::CART_TOTAL_WEIGHT, - msg.readInt32("cart weight")); - PlayerInfo::setAttribute(Attributes::CART_MAX_WEIGHT, - msg.readInt32("max cart weight")); - if (mCartItems.empty()) - return; - - Inventory *const inv = PlayerInfo::getCartInventory(); - if (inv == nullptr) - return; - - inv->resize(size); - - FOR_EACH (Ea::InventoryItems::const_iterator, it, mCartItems) - { - inv->setItem((*it).slot, - (*it).id, - (*it).type, - (*it).quantity, - (*it).refine, - (*it).color, - (*it).identified, - (*it).damaged, - (*it).favorite, - (*it).equip, - Equipped_false); - } - mCartItems.clear(); -} - -void InventoryRecv::processCartRemove(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // +++ need close or clear cart? -} - -void InventoryRecv::processPlayerCartAdd(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerCartAdd") - Inventory *const inventory = localPlayer != nullptr - ? PlayerInfo::getCartInventory() : nullptr; - - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - int amount = msg.readInt32("count"); - const int itemId = msg.readInt16("item id"); - ItemTypeT itemType = ItemType::Unknown; - if (msg.getVersion() >= 5) - { - itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - } - const uint8_t identified = msg.readUInt8("identified"); - const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); - const uint8_t refine = msg.readUInt8("refine"); - int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - ItemOptionsList *options = nullptr; - if (msg.getVersion() >= 20150226) - { - options = new ItemOptionsList; - for (int f = 0; f < 5; f ++) - { - const uint16_t idx = msg.readInt16("option index"); - const uint16_t val = msg.readInt16("option value"); - msg.readUInt8("option param"); - options->add(idx, val); - } - } - - // check what cart was created, if not add delayed items - if ((inventory != nullptr) && inventory->getSize() > 0) - { - const Item *const item = inventory->getItem(index); - - if ((item != nullptr) && item->getId() == itemId) - amount += item->getQuantity(); - - inventory->setItem(index, - itemId, - itemType, - amount, - refine, - ItemColorManager::getColorFromCards(&cards[0]), - fromBool(identified, Identified), - damaged, - Favorite_false, - Equipm_false, - Equipped_false); - inventory->setCards(index, cards, maxCards); - inventory->setOptions(index, options); - } - else - { - mCartItems.push_back(Ea::InventoryItem(index, - itemId, - itemType, - cards, - options, - amount, - refine, - ItemColorManager::getColorFromCards(&cards[0]), - fromBool(identified, Identified), - damaged, - Favorite_false, - Equipm_false)); - } - delete options; - BLOCK_END("InventoryRecv::processPlayerCartAdd") -} - -void InventoryRecv::processPlayerCartEquip(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerCartEquip") - msg.readInt16("len"); - - int packetLen = 2 + 2 + 1 + 1 + 8; - if (msg.getVersion() >= 20120925) - packetLen += 4 + 4 + 1; - else - packetLen += 1 + 2 + 2 + 1; - if (msg.getVersion() >= 20071002) - packetLen += 4; - if (msg.getVersion() >= 20080102) - packetLen += 2; - if (msg.getVersion() >= 20100629) - packetLen += 2; - if (msg.getVersion() >= 20150226) - packetLen += 26; - - const int number = (msg.getLength() - 4) / packetLen; - for (int loop = 0; loop < number; loop++) - { - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - const int amount = 1; - if (msg.getVersion() >= 20120925) - { - msg.readInt32("location"); - msg.readInt32("wear state"); - } - else - { - msg.readUInt8("identified"); - msg.readInt16("location"); - msg.readInt16("wear state"); - msg.readUInt8("is damaged"); - } - const uint8_t refine = msg.readUInt8("refine level"); - int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - if (msg.getVersion() >= 20071002) - msg.readInt32("hire expire date"); - if (msg.getVersion() >= 20080102) - msg.readInt16("bind on equip"); - if (msg.getVersion() >= 20100629) - msg.readInt16("sprite"); - ItemOptionsList *options = nullptr; - if (msg.getVersion() >= 20150226) - { - options = new ItemOptionsList(msg.readUInt8("option count")); - for (int f = 0; f < 5; f ++) - { - const uint16_t idx = msg.readInt16("option index"); - const uint16_t val = msg.readInt16("option value"); - msg.readUInt8("option param"); - options->add(idx, val); - } - } - ItemFlags flags; - if (msg.getVersion() >= 20120925) - flags.byte = msg.readUInt8("flags"); - else - flags.byte = 0; - - mCartItems.push_back(Ea::InventoryItem(index, - itemId, - itemType, - cards, - options, - amount, - refine, - ItemColorManager::getColorFromCards(&cards[0]), - fromBool(flags.bits.isIdentified, Identified), - fromBool(flags.bits.isDamaged, Damaged), - fromBool(flags.bits.isFavorite, Favorite), - Equipm_false)); - delete options; - } - BLOCK_END("InventoryRecv::processPlayerCartEquip") -} - -void InventoryRecv::processPlayerCartItems(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerCartItems") - Ea::InventoryRecv::mInventoryItems.clear(); - - msg.readInt16("len"); - - int packetLen = 7; - if (msg.getVersion() >= 20120925) - packetLen += 4 + 1; - else - packetLen += 1 + 2; - if (packetVersion >= 5) - packetLen += 8; - if (msg.getVersion() >= 20080102) - packetLen += 4; - - const int number = (msg.getLength() - 4) / packetLen; - for (int loop = 0; loop < number; loop++) - { - const int index = msg.readInt16("item index") - INVENTORY_OFFSET; - const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - if (msg.getVersion() < 20120925) - msg.readUInt8("identified"); - const int amount = msg.readInt16("count"); - if (msg.getVersion() >= 20120925) - msg.readInt32("wear state / equip"); - int cards[maxCards]; - if (msg.getVersion() >= 5) - { - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - } - else - { - for (int f = 0; f < maxCards; f++) - cards[f] = 0; - } - if (msg.getVersion() >= 20080102) - msg.readInt32("hire expire date (?)"); - ItemFlags flags; - if (msg.getVersion() >= 20120925) - flags.byte = msg.readUInt8("flags"); - else - flags.byte = 0; - - mCartItems.push_back(Ea::InventoryItem(index, - itemId, - itemType, - cards, - nullptr, - amount, - 0, - ItemColorManager::getColorFromCards(&cards[0]), - fromBool(flags.bits.isIdentified, Identified), - fromBool(flags.bits.isDamaged, Damaged), - fromBool(flags.bits.isFavorite, Favorite), - Equipm_false)); - } - BLOCK_END("InventoryRecv::processPlayerCartItems") -} - -void InventoryRecv::processPlayerCartRemove(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerCartRemove") - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int amount = msg.readInt32("amount"); - - Inventory *const inv = PlayerInfo::getCartInventory(); - if (inv == nullptr) - return; - - if (Item *const item = inv->getItem(index)) - { - item->increaseQuantity(-amount); - if (item->getQuantity() == 0) - inv->removeItemAt(index); - } - BLOCK_END("InventoryRecv::processPlayerCartRemove") -} - -void InventoryRecv::processPlayerIdentifyList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - menu = MenuType::Identify; - const int count = msg.readInt16("len") - 4; - for (int f = 0; f < count; f ++) - msg.readInt16("inv index"); -} - -void InventoryRecv::processPlayerIdentified(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readInt16("inv index"); - msg.readUInt8("flag"); -} - -void InventoryRecv::processPlayerRefine(Net::MessageIn &msg) -{ - const int flag = msg.readInt16("flag"); - const int index = msg.readInt16("inv index") - INVENTORY_OFFSET; - msg.readInt16("refine"); - const Inventory *const inv = PlayerInfo::getInventory(); - const Item *item = nullptr; - int notifyType; - std::string itemName; - if (inv != nullptr) - item = inv->getItem(index); - if (item != nullptr) - { - itemName = item->getName(); - } - else - { - // TRANSLATORS: unknown item - itemName = _("Unknown item"); - } - switch (flag) - { - case 0: - notifyType = NotifyTypes::REFINE_SUCCESS; - break; - case 1: - notifyType = NotifyTypes::REFINE_FAILURE; - break; - case 2: - notifyType = NotifyTypes::REFINE_DOWNGRADE; - break; - default: - UNIMPLEMENTEDPACKETFIELD(flag); - notifyType = NotifyTypes::REFINE_UNKNOWN; - break; - } - NotifyManager::notify(notifyType, itemName); -} - -void InventoryRecv::processPlayerRepairList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - const int count = (msg.readInt16("len") - 4) / 13; - for (int f = 0; f < count; f ++) - { - msg.readInt16("index"); - msg.readInt16("item id"); - msg.readUInt8("refine"); - for (int d = 0; d < maxCards; d ++) - msg.readUInt16("card"); - } - menu = MenuType::RepairWespon; -} - -void InventoryRecv::processPlayerRepairEffect(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readInt16("item index"); - msg.readUInt8("flag"); -} - -void InventoryRecv::processPlayerRefineList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - const int count = (msg.readInt16("len") - 4) / 13; - - for (int f = 0; f < count; f ++) - { - msg.readInt16("item index"); - msg.readInt16("item id"); - msg.readUInt8("refine"); - for (int d = 0; d < maxCards; d ++) - msg.readUInt16("card"); - } - menu = MenuType::WeaponeRefine; -} - -void InventoryRecv::processPlayerStoragePassword(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readInt16("info"); -} - -void InventoryRecv::processPlayerStoragePasswordResult(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readInt16("result"); - msg.readInt16("error count"); -} - -void InventoryRecv::processPlayerCookingList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - const int count = (msg.readInt16("len") - 6) / 2; - msg.readInt16("list type"); - for (int f = 0; f < count; f ++) - msg.readInt16("item id"); -} - -void InventoryRecv::processItemDamaged(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readInt16("position"); - msg.readBeingId("account id"); -} - -void InventoryRecv::processFavoriteItem(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readInt16("item index"); - msg.readUInt8("favorite (0 - favorite)"); -} - -void InventoryRecv::processCartAddError(Net::MessageIn &msg) -{ - switch (msg.readUInt8("flag")) - { - case 0: - NotifyManager::notify(NotifyTypes::CART_ADD_WEIGHT_ERROR); - break; - case 1: - NotifyManager::notify(NotifyTypes::CART_ADD_COUNT_ERROR); - break; - default: - break; - } -} - -void InventoryRecv::processBindItem(Net::MessageIn &msg) -{ - const int index = msg.readInt16("item index") - INVENTORY_OFFSET; - const Inventory *const inv = PlayerInfo::getInventory(); - if (inv != nullptr) - { - std::string itemName; - const Item *const item = inv->getItem(index); - if (item != nullptr) - { - itemName = item->getName(); - } - else - { - // TRANSLATORS: unknown item message - itemName = _("Unknown item"); - } - NotifyManager::notify(NotifyTypes::BOUND_ITEM, itemName); - } -} - -void InventoryRecv::processPlayerInventoryRemove(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerInventoryRemove") - Inventory *const inventory = localPlayer != nullptr - ? PlayerInfo::getInventory() : nullptr; - - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int amount = msg.readInt16("amount"); - if (inventory != nullptr) - { - if (Item *const item = inventory->getItem(index)) - { - if (amount != 0) - { - NotifyManager::notify(NotifyTypes::DELETE_ITEM_DROPPED, - item->getName()); - } - item->increaseQuantity(-amount); - if (item->getQuantity() == 0) - inventory->removeItemAt(index); - ArrowsListener::distributeEvent(); - } - } - BLOCK_END("InventoryRecv::processPlayerInventoryRemove") -} - -void InventoryRecv::processSelectCart(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - const int count = msg.readInt16("len") - 8; - msg.readBeingId("account id"); - for (int f = 0; f < count; f ++) - msg.readUInt8("cart type"); -} - -int InventoryRecv::getSlot(const int eAthenaSlot) -{ - if (eAthenaSlot == 0) - return EquipSlot::VECTOREND; - - if ((eAthenaSlot & 0x8000) != 0) - return inventoryHandler->getProjectileSlot(); - - unsigned int mask = 1; - int position = 0; - while ((eAthenaSlot & mask) == 0u) - { - mask <<= 1; - position++; - } - if (position >= EquipSlot::VECTOREND) - return EquipSlot::VECTOREND; - return CAST_S32(EQUIP_POINTS[position]); -} - -void InventoryRecv::processMergeItem(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - const int count = (msg.readInt16("len") - 4) / 2; - for (int f = 0; f < count; f ++) - msg.readInt16("inv index"); -} - -void InventoryRecv::processMergeItemResponse(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readInt16("inv index"); - msg.readInt16("amount"); - msg.readUInt8("result"); -} - -} // namespace EAthena diff --git a/src/net/eathena/inventoryrecv.h b/src/net/eathena/inventoryrecv.h deleted file mode 100644 index 09d868f21..000000000 --- a/src/net/eathena/inventoryrecv.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_INVENTORYRECV_H -#define NET_EATHENA_INVENTORYRECV_H - -#include "net/ea/inventoryitem.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace InventoryRecv - { - extern Ea::InventoryItems mCartItems; - - void processPlayerEquipment(Net::MessageIn &msg); - void processPlayerInventoryAdd(Net::MessageIn &msg); - void processPlayerInventory(Net::MessageIn &msg); - void processPlayerStorage(Net::MessageIn &msg); - void processPlayerEquip(Net::MessageIn &msg); - void processPlayerUnEquip(Net::MessageIn &msg); - void processPlayerInventoryRemove2(Net::MessageIn &msg); - void processPlayerStorageEquip(Net::MessageIn &msg); - void processPlayerStorageAdd(Net::MessageIn &msg); - void processPlayerUseCard(Net::MessageIn &msg); - void processPlayerInsertCard(Net::MessageIn &msg); - void processPlayerItemRentalTime(Net::MessageIn &msg); - void processPlayerItemRentalExpired(Net::MessageIn &msg); - void processPlayerStorageRemove(Net::MessageIn &msg); - void processCartInfo(Net::MessageIn &msg); - void processCartRemove(Net::MessageIn &msg); - void processPlayerCartAdd(Net::MessageIn &msg); - void processPlayerCartEquip(Net::MessageIn &msg); - void processPlayerCartItems(Net::MessageIn &msg); - void processPlayerCartRemove(Net::MessageIn &msg); - void processPlayerIdentifyList(Net::MessageIn &msg); - void processPlayerIdentified(Net::MessageIn &msg); - void processPlayerRefine(Net::MessageIn &msg); - void processPlayerRepairList(Net::MessageIn &msg); - void processPlayerRepairEffect(Net::MessageIn &msg); - void processPlayerRefineList(Net::MessageIn &msg); - void processPlayerStoragePassword(Net::MessageIn &msg); - void processPlayerStoragePasswordResult(Net::MessageIn &msg); - void processPlayerCookingList(Net::MessageIn &msg); - void processItemDamaged(Net::MessageIn &msg); - void processFavoriteItem(Net::MessageIn &msg); - void processCartAddError(Net::MessageIn &msg); - void processBindItem(Net::MessageIn &msg); - void processPlayerInventoryRemove(Net::MessageIn &msg); - void processSelectCart(Net::MessageIn &msg); - void processMergeItem(Net::MessageIn &msg); - void processMergeItemResponse(Net::MessageIn &msg); - - int getSlot(const int eAthenaSlot) A_WARN_UNUSED; - } // namespace InventoryRecv -} // namespace EAthena - -#endif // NET_EATHENA_INVENTORYRECV_H diff --git a/src/net/eathena/itemflags.h b/src/net/eathena/itemflags.h deleted file mode 100644 index a36099f60..000000000 --- a/src/net/eathena/itemflags.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_ITEMFLAGS_H -#define NET_EATHENA_ITEMFLAGS_H - -#include "localconsts.h" - -namespace EAthena -{ - struct ItemFlagBits final - { - A_DEFAULT_COPY(ItemFlagBits) - - unsigned char isIdentified : 1; - unsigned char isDamaged : 1; - unsigned char isFavorite : 1; - unsigned char spareBits : 5; - }; - - union ItemFlags final - { - ItemFlagBits bits; - uint8_t byte; - } __attribute__((packed)); -} // namespace EAthena - -#endif // NET_EATHENA_ITEMFLAGS_H diff --git a/src/net/eathena/itemhandler.cpp b/src/net/eathena/itemhandler.cpp deleted file mode 100644 index 02ad723bb..000000000 --- a/src/net/eathena/itemhandler.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/itemhandler.h" - -#include "debug.h" - -namespace EAthena -{ - -ItemHandler::ItemHandler() : - Ea::ItemHandler() -{ -} - -} // namespace EAthena diff --git a/src/net/eathena/itemhandler.h b/src/net/eathena/itemhandler.h deleted file mode 100644 index 8543fbeac..000000000 --- a/src/net/eathena/itemhandler.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_ITEMHANDLER_H -#define NET_EATHENA_ITEMHANDLER_H - -#include "net/ea/itemhandler.h" - -namespace EAthena -{ - -class ItemHandler final : public Ea::ItemHandler -{ - public: - ItemHandler(); - - A_DELETE_COPY(ItemHandler) -}; - -} // namespace EAthena - -#endif // NET_EATHENA_ITEMHANDLER_H diff --git a/src/net/eathena/itemrecv.cpp b/src/net/eathena/itemrecv.cpp deleted file mode 100644 index f0a6bd585..000000000 --- a/src/net/eathena/itemrecv.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/itemrecv.h" - -#include "actormanager.h" -#include "itemcolormanager.h" -#include "logger.h" - -#include "const/resources/item/cards.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace EAthena -{ - -void ItemRecv::processItemDropped(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("id"); - const int itemId = msg.readInt16("item id"); - ItemTypeT itemType = ItemType::Unknown; - if (msg.getVersion() >= 20130000) - itemType = static_cast<ItemTypeT>(msg.readInt16("type")); - const Identified identified = fromInt( - msg.readUInt8("identify"), Identified); - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - const int subX = CAST_S32(msg.readInt8("subx")); - const int subY = CAST_S32(msg.readInt8("suby")); - const int amount = msg.readInt16("count"); - - if (actorManager != nullptr) - { - actorManager->createItem(id, - itemId, - x, y, - itemType, - amount, - 0, - ItemColor_one, - identified, - Damaged_false, - subX, subY, - nullptr); - } -} - -void ItemRecv::processItemDropped2(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("id"); - const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>(msg.readUInt8("type")); - const Identified identified = fromInt( - msg.readUInt8("identify"), Identified); - const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); - const uint8_t refine = msg.readUInt8("refine"); - int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - const int amount = msg.readInt16("amount"); - const int subX = CAST_S32(msg.readInt8("subx")); - const int subY = CAST_S32(msg.readInt8("suby")); - - if (actorManager != nullptr) - { - actorManager->createItem(id, - itemId, - x, y, - itemType, - amount, - refine, - ItemColorManager::getColorFromCards(&cards[0]), - identified, - damaged, - subX, subY, - &cards[0]); - } -} - -void ItemRecv::processItemMvpDropped(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("len"); - msg.readUInt8("type"); - msg.readInt16("item id"); - msg.readUInt8("len"); - msg.readString(24, "name"); - msg.readUInt8("monster name len"); - msg.readString(24, "monster name"); -} - -void ItemRecv::processItemVisible(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("item object id"); - const int itemId = msg.readInt16("item id"); - const Identified identified = fromInt( - msg.readUInt8("identify"), Identified); - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - const int amount = msg.readInt16("amount"); - const int subX = CAST_S32(msg.readInt8("sub x")); - const int subY = CAST_S32(msg.readInt8("sub y")); - - if (actorManager != nullptr) - { - actorManager->createItem(id, - itemId, - x, y, - ItemType::Unknown, - amount, - 0, - ItemColor_one, - identified, - Damaged_false, - subX, subY, - nullptr); - } -} - -void ItemRecv::processItemVisible2(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("item object id"); - const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("type")); - const Identified identified = fromInt( - msg.readUInt8("identify"), Identified); - const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); - const uint8_t refine = msg.readUInt8("refine"); - int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - const int amount = msg.readInt16("amount"); - const int subX = CAST_S32(msg.readInt8("sub x")); - const int subY = CAST_S32(msg.readInt8("sub y")); - - if (actorManager != nullptr) - { - actorManager->createItem(id, - itemId, - x, y, - itemType, - amount, - refine, - ItemColorManager::getColorFromCards(&cards[0]), - identified, - damaged, - subX, subY, - &cards[0]); - } -} - -} // namespace EAthena diff --git a/src/net/eathena/itemrecv.h b/src/net/eathena/itemrecv.h deleted file mode 100644 index d4eb2df34..000000000 --- a/src/net/eathena/itemrecv.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_ITEMRECV_H -#define NET_EATHENA_ITEMRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace ItemRecv - { - void processItemDropped(Net::MessageIn &msg); - void processItemDropped2(Net::MessageIn &msg); - void processItemMvpDropped(Net::MessageIn &msg); - void processItemVisible(Net::MessageIn &msg); - void processItemVisible2(Net::MessageIn &msg); - } // namespace ItemRecv -} // namespace EAthena - -#endif // NET_EATHENA_ITEMRECV_H diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp deleted file mode 100644 index 35a8cf77f..000000000 --- a/src/net/eathena/loginhandler.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/loginhandler.h" - -#include "client.h" - -#include "net/generalhandler.h" -#include "net/net.h" -#include "net/serverfeatures.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/network.h" -#include "net/eathena/updateprotocol.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -namespace EAthena -{ - -extern ServerInfo charServer; - -LoginHandler::LoginHandler() : - Ea::LoginHandler() -{ - loginHandler = this; -} - -LoginHandler::~LoginHandler() -{ - loginHandler = nullptr; -} - -void LoginHandler::connect() const -{ - if (Network::mInstance == nullptr) - return; - - Network::mInstance->connect(mServer); - if (serverFeatures->haveServerVersion()) - { - sendVersion(); - } - else - { - if (client->getState() != State::LOGIN) - client->setState(State::LOGIN); - } -} - -bool LoginHandler::isConnected() const -{ - if (Network::mInstance == nullptr) - return false; - - return Network::mInstance->isConnected(); -} - -void LoginHandler::disconnect() const -{ - if (Network::mInstance != nullptr && - Network::mInstance->getServer() == mServer) - { - Network::mInstance->disconnect(); - } -} - -void LoginHandler::changePassword(const std::string &restrict oldPassword, - const std::string &restrict newPassword) - const -{ - if (serverVersion == 0) - return; - createOutPacket(CMSG_CHAR_PASSWORD_CHANGE); - outMsg.writeStringNoLog(oldPassword, 24, "old password"); - outMsg.writeStringNoLog(newPassword, 24, "new password"); -} - -void LoginHandler::sendLoginRegister(const std::string &restrict username, - const std::string &restrict password, - const std::string &restrict email) const -{ - if (email.empty()) - { - if (Net::getNetworkType() == ServerType::EATHENA) - { - createOutPacket(CMSG_LOGIN_REGISTER_HAN); - outMsg.writeInt32(20, "client version"); - outMsg.writeString(username, 24, "login"); - outMsg.writeStringNoLog(password, 24, "password"); - outMsg.writeInt8(0x03, "client type"); - outMsg.writeString("127.0.0.1", 16, "ip address"); - outMsg.writeString("001122334455", 13, "mac address"); - outMsg.writeInt8(0, "is gravity id"); - } - else - { - createOutPacket(CMSG_LOGIN_REGISTER); - outMsg.writeInt32(20, "client version"); - outMsg.writeString(username, 24, "login"); - outMsg.writeStringNoLog(password, 24, "password"); - outMsg.writeInt8(0x03, "client type"); - } - } - else - { - createOutPacket(CMSG_LOGIN_REGISTER4); - outMsg.writeString(username, 24, "login"); - outMsg.writeStringNoLog(password, 24, "password"); - outMsg.writeInt8(0x03, "client type"); - outMsg.writeString(email, 40, "email"); - } -} - -ServerInfo *LoginHandler::getCharServer() const -{ - return &charServer; -} - -void LoginHandler::sendVersion() const -{ - createOutPacket(CMSG_SERVER_VERSION_REQUEST); - outMsg.writeInt32(CLIENT_PROTOCOL_VERSION, "protocol version"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - generalHandler->flushSend(); -} - -void LoginHandler::ping() const -{ - createOutPacket(CMSG_LOGIN_PING); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); -} - -void LoginHandler::updatePacketVersion() const -{ - updateProtocol(); -} - -} // namespace EAthena diff --git a/src/net/eathena/loginhandler.h b/src/net/eathena/loginhandler.h deleted file mode 100644 index f9201e8fd..000000000 --- a/src/net/eathena/loginhandler.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_LOGINHANDLER_H -#define NET_EATHENA_LOGINHANDLER_H - -#include "net/ea/loginhandler.h" - -namespace EAthena -{ - -class LoginHandler final : public Ea::LoginHandler -{ - public: - LoginHandler(); - - A_DELETE_COPY(LoginHandler) - - ~LoginHandler(); - - void connect() const override final; - - bool isConnected() const override final A_WARN_UNUSED; - - void disconnect() const override final; - - unsigned int getMaxPasswordLength() const override final A_WARN_UNUSED - { return 24; } - - void changePassword(const std::string &restrict oldPassword, - const std::string &restrict newPassword) - const override final; - - void sendVersion() const override final; - - ServerInfo *getCharServer() const override final A_WARN_UNUSED; - - void ping() const override final; - - void updatePacketVersion() const override final; - - private: - void sendLoginRegister(const std::string &restrict username, - const std::string &restrict password, - const std::string &restrict email) - const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_LOGINHANDLER_H diff --git a/src/net/eathena/loginrecv.cpp b/src/net/eathena/loginrecv.cpp deleted file mode 100644 index 555d1a2c1..000000000 --- a/src/net/eathena/loginrecv.cpp +++ /dev/null @@ -1,294 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/loginrecv.h" - -#include "client.h" -#include "configuration.h" - -#include "being/being.h" - -#include "fs/paths.h" - -#include "gui/windows/logindialog.h" - -#include "net/logindata.h" -#include "net/loginhandler.h" -#include "net/messagein.h" - -#include "net/ea/loginrecv.h" - -#include "net/eathena/updateprotocol.h" - -#include "utils/gettext.h" -#include "utils/foreach.h" - -#include "debug.h" - -extern int packetVersion; -extern int evolPacketOffset; - -namespace EAthena -{ - -extern ServerInfo charServer; - -void LoginRecv::processLoginError2(Net::MessageIn &msg) -{ - const uint32_t code = msg.readInt32("error"); - msg.readString(20, "error message"); - logger->log("Login::error code: %u", code); - - switch (code) - { - case 0: - // TRANSLATORS: error message - errorMessage = _("Unregistered ID."); - break; - case 1: - // TRANSLATORS: error message - errorMessage = _("Wrong password."); - LoginDialog::savedPassword.clear(); - break; - case 2: - // TRANSLATORS: error message - errorMessage = _("Account expired."); - break; - case 3: - // TRANSLATORS: error message - errorMessage = _("Rejected from server."); - break; - case 4: - // TRANSLATORS: error message - errorMessage = _("You have been permanently banned from " - "the game. Please contact the GM team."); - break; - case 5: - // TRANSLATORS: error message - errorMessage = _("Client too old or wrong server type.\n" - "Please update client on http://manaplus.org"); - break; - case 6: - // TRANSLATORS: error message - errorMessage = strprintf(_("You have been temporarily " - "banned from the game until " - "%s.\nPlease contact the GM " - "team via the forums."), - msg.readString(20, "date").c_str()); - break; - case 7: - // look like unused - // TRANSLATORS: error message - errorMessage = _("Server overpopulated."); - break; - case 9: - // look like unused - // TRANSLATORS: error message - errorMessage = _("This user name is already taken."); - break; - case 10: - // look like unused - // TRANSLATORS: error message - errorMessage = _("Wrong name."); - break; - case 11: - // look like unused - // TRANSLATORS: error message - errorMessage = _("Incorrect email."); - break; - case 99: - // look like unused - // TRANSLATORS: error message - errorMessage = _("Username permanently erased."); - break; - default: - // TRANSLATORS: error message - errorMessage = _("Unknown error."); - UNIMPLEMENTEDPACKETFIELD(code); - break; - } - client->setState(State::ERROR); -} - -void LoginRecv::processUpdateHost2(Net::MessageIn &msg) -{ - const int len = msg.readInt16("len") - 4; - const std::string updateHost = msg.readString(len, "host"); - - splitToStringVector(loginData.updateHosts, updateHost, '|'); - FOR_EACH (StringVectIter, it, loginData.updateHosts) - { - if (!checkPath(*it)) - { - logger->log1("Warning: incorrect update server name"); - loginData.updateHosts.clear(); - break; - } - } - - logger->log("Received update hosts \"%s\" from login server.", - updateHost.c_str()); - - if (client->getState() == State::PRE_LOGIN) - client->setState(State::LOGIN); -} - -void LoginRecv::processServerVersion(Net::MessageIn &msg) -{ - const int len = msg.readInt16("len"); - msg.readInt32("unused"); - serverVersion = msg.readInt32("server version"); - if (serverVersion > 0) - { - logger->log("Evol2 server version: %d", serverVersion); - packetVersion = msg.readInt32("packet version"); - logger->log("Hercules packet version: %d", packetVersion); - if (packetVersion == 20150000) - { - packetVersion = 20141022; - logger->log("autofix Hercules packet version to: %d", - packetVersion); - } - if (serverVersion >= 16 && len >= 18) - { - evolPacketOffset = msg.readInt16("evol packet offset"); - } - } - else - { - logger->log("Hercules without version"); - } - updateProtocol(); - client->setState(State::LOGIN); -} - -void LoginRecv::processCondingKey(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - const int sz = msg.readInt16("len") - 4; - msg.readString(sz, "coding key"); -} - -void LoginRecv::processCharPasswordResponse(Net::MessageIn &msg) -{ - // 0: acc not found, 1: success, 2: password mismatch, 3: pass too short - const uint8_t errMsg = msg.readUInt8("result code"); - // Successful pass change - if (errMsg == 1) - { - client->setState(State::CHANGEPASSWORD_SUCCESS); - } - // pass change failed - else - { - switch (errMsg) - { - case 0: - errorMessage = - // TRANSLATORS: error message - _("Account was not found. Please re-login."); - break; - case 2: - // TRANSLATORS: error message - errorMessage = _("Old password incorrect."); - break; - case 3: - // TRANSLATORS: error message - errorMessage = _("New password too short."); - break; - default: - // TRANSLATORS: error message - errorMessage = _("Unknown error."); - break; - } - client->setState(State::ACCOUNTCHANGE_ERROR); - } -} - -void LoginRecv::processLoginData(Net::MessageIn &msg) -{ - msg.readInt16("len"); - - loginHandler->clearWorlds(); - - int offset = 0; - int serverLen = 0; - if (msg.getVersion() >= 20170315) - { - offset = 47 + 17; - serverLen = 32 + 128; - } - else - { - offset = 47; - serverLen = 32; - } - - const int worldCount = (msg.getLength() - offset) / serverLen; - - Ea::LoginRecv::mToken.session_ID1 = msg.readInt32("session id1"); - Ea::LoginRecv::mToken.account_ID = msg.readBeingId("accound id"); - Ea::LoginRecv::mToken.session_ID2 = msg.readInt32("session id2"); - msg.readInt32("old ip"); - loginData.lastLogin = msg.readString(24, "last login"); - msg.readInt16("unused"); - - // reserve bits for future usage - Ea::LoginRecv::mToken.sex = Being::intToGender(CAST_U8( - msg.readUInt8("gender") & 3U)); - - if (msg.getVersion() >= 20170315) - { - msg.readInt32("unused1"); - msg.readInt32("unused1"); - msg.readInt32("unused1"); - msg.readInt32("unused1"); - msg.readUInt8("unused1"); - } - - for (int i = 0; i < worldCount; i++) - { - WorldInfo *const world = new WorldInfo; - - world->address = msg.readInt32("ip address"); - world->port = msg.readInt16("port"); - world->name = msg.readString(20, "name"); - world->online_users = msg.readInt16("online number"); - config.setValue("updatehost", Ea::LoginRecv::mUpdateHost); - world->updateHost = Ea::LoginRecv::mUpdateHost; - msg.readInt16("maintenance"); - msg.readInt16("new"); - if (msg.getVersion() >= 20170315) - { - for (int f = 0; f < 32; f ++) - msg.readInt32("unused2"); - } - - logger->log("Network: Server: %s (%s:%d)", world->name.c_str(), - ipToString(world->address), world->port); - - Ea::LoginRecv::mWorlds.push_back(world); - } - client->setState(State::WORLD_SELECT); -} - -} // namespace EAthena diff --git a/src/net/eathena/loginrecv.h b/src/net/eathena/loginrecv.h deleted file mode 100644 index ca2da52bf..000000000 --- a/src/net/eathena/loginrecv.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_LOGINRECV_H -#define NET_EATHENA_LOGINRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace LoginRecv - { - void processLoginError2(Net::MessageIn &msg); - void processUpdateHost2(Net::MessageIn &msg); - void processServerVersion(Net::MessageIn &msg); - void processCondingKey(Net::MessageIn &msg); - void processCharPasswordResponse(Net::MessageIn &msg); - void processLoginData(Net::MessageIn &msg); - } // namespace LoginRecv -} // namespace EAthena - -#endif // NET_EATHENA_LOGINRECV_H diff --git a/src/net/eathena/mail2handler.cpp b/src/net/eathena/mail2handler.cpp deleted file mode 100644 index 2b4de04ab..000000000 --- a/src/net/eathena/mail2handler.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/mail2handler.h" - -#include "const/net/inventory.h" - -#include "being/localplayer.h" - -#include "net/eathena/mail2recv.h" -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "utils/checkutils.h" - -#include "resources/mailqueue.h" - -#include "resources/item/item.h" - -#include "debug.h" - -extern int packetVersion; -extern int serverVersion; - -namespace EAthena -{ - -Mail2Handler::Mail2Handler() -{ - mail2Handler = this; -} - -Mail2Handler::~Mail2Handler() -{ - mail2Handler = nullptr; - Mail2Recv::mCheckedName.clear(); - while (!Mail2Recv::mMailQueue.empty()) - { - MailQueue *const mail = Mail2Recv::mMailQueue.front(); - delete mail; - Mail2Recv::mMailQueue.pop(); - } -} - -void Mail2Handler::openWriteMail(const std::string &receiver) const -{ - if (packetVersion < 20140416 || - (serverVersion < 19 && serverVersion != 0)) - { - return; - } - createOutPacket(CMSG_MAIL2_OPEN_WRITE_MAIL); - outMsg.writeString(receiver, 24, "receiver name"); -} - -void Mail2Handler::addItem(const Item *const item, - const int amount) const -{ - if (item == nullptr) - return; - if (packetVersion < 20140416 || - (serverVersion < 19 && serverVersion != 0)) - { - return; - } - - createOutPacket(CMSG_MAIL2_ADD_ITEM_TO_MAIL); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); - outMsg.writeInt16(CAST_S16(amount), "amount"); -} - -void Mail2Handler::removeItem(const int index, - const int amount) const -{ - if (packetVersion < 20140416 || - (serverVersion < 19 && serverVersion != 0)) - { - return; - } - - createOutPacket(CMSG_MAIL2_REMOVE_ITEM_MAIL); - outMsg.writeInt16(CAST_S16(index + INVENTORY_OFFSET), "index"); - outMsg.writeInt16(CAST_S16(amount), "amount"); -} - -void Mail2Handler::sendMail(const std::string &to, - const std::string &title, - const std::string &body, - const int64_t &money) const -{ - if (packetVersion < 20131230 || - (serverVersion < 19 && serverVersion != 0)) - { - return; - } - if (localPlayer == nullptr) - return; - - const std::string from = localPlayer->getName(); - const int titleSz = CAST_S32(title.size()) + 1; - const int bodySz = CAST_S32(body.size()) + 1; - int32_t sz = 2 + 2 + 24 + 24 + 8 + 2 + 2 + titleSz + bodySz; - if (sz > 32767 - 4) - { - reportAlways("Mail message too big"); - return; - } - if (packetVersion >= 20160600) - sz += 4; - - createOutPacket(CMSG_MAIL2_SEND_MAIL); - outMsg.writeInt16(CAST_S16(sz), "len"); - outMsg.writeString(to, 24, "to"); - outMsg.writeString(from, 24, "from"); - outMsg.writeInt64(money, "money"); - outMsg.writeInt16(CAST_S16(titleSz), "title len"); - outMsg.writeInt16(CAST_S16(bodySz), "body len"); - if (packetVersion >= 20160600) - outMsg.writeInt32(0, "to char id"); - outMsg.writeString(title, titleSz, "title"); - outMsg.writeString(body, bodySz, "body"); - Mail2Recv::mCheckedName.clear(); -} - -void Mail2Handler::queueCheckName(const MailQueueTypeT type, - const std::string &to, - const std::string &title, - const std::string &body, - const int64_t &money) const -{ - MailQueue *const mail = new MailQueue; - mail->to = to; - mail->title = title; - mail->body = body; - mail->money = money; - mail->type = type; - Mail2Recv::mMailQueue.push(mail); - requestCheckName(to); -} - -void Mail2Handler::nextPage(const MailOpenTypeT openType, - const int64_t mailId) const -{ - if (packetVersion < 20131218 || - (serverVersion < 19 && serverVersion != 0)) - { - return; - } - createOutPacket(CMSG_MAIL2_NEXT_PAGE); - outMsg.writeInt8(toInt(openType, int8_t), "open type"); - outMsg.writeInt64(mailId, "mail id"); -} - -void Mail2Handler::readMail(const MailOpenTypeT openType, - const int64_t mailId) const -{ - if (packetVersion < 20131223 || - (serverVersion < 19 && serverVersion != 0)) - { - return; - } - createOutPacket(CMSG_MAIL2_READ_MAIL); - outMsg.writeInt8(toInt(openType, int8_t), "open type"); - outMsg.writeInt64(mailId, "mail id"); -} - -void Mail2Handler::deleteMail(const MailOpenTypeT openType, - const int64_t mailId) const -{ - if (packetVersion < 20131218 || - (serverVersion < 19 && serverVersion != 0)) - { - return; - } - createOutPacket(CMSG_MAIL2_DELETE_MAIL); - outMsg.writeInt8(toInt(openType, int8_t), "open type"); - outMsg.writeInt64(mailId, "mail id"); -} - -void Mail2Handler::requestMoney(const MailOpenTypeT openType, - const int64_t mailId) const -{ - if (packetVersion < 20140326 || - (serverVersion < 19 && serverVersion != 0)) - { - return; - } - createOutPacket(CMSG_MAIL2_REQUEST_MONEY); - outMsg.writeInt64(mailId, "mail id"); - outMsg.writeInt8(toInt(openType, int8_t), "open type"); -} - -void Mail2Handler::requestItems(const MailOpenTypeT openType, - const int64_t mailId) const -{ - if (packetVersion < 20140326 || - (serverVersion < 19 && serverVersion != 0)) - { - return; - } - createOutPacket(CMSG_MAIL2_REQUEST_ITEMS); - outMsg.writeInt64(mailId, "mail id"); - outMsg.writeInt8(toInt(openType, int8_t), "open type"); -} - -void Mail2Handler::refreshMailList(const MailOpenTypeT openType, - const int64_t mailId) const -{ - if (packetVersion < 20131218 || - (serverVersion < 19 && serverVersion != 0)) - { - return; - } - createOutPacket(CMSG_MAIL2_REFRESH_MAIL_LIST); - outMsg.writeInt8(toInt(openType, int8_t), "open type"); - outMsg.writeInt64(mailId, "mail id"); -} - -void Mail2Handler::openMailBox(const MailOpenTypeT openType) const -{ - if (packetVersion < 20140212 || - (serverVersion < 19 && serverVersion != 0)) - { - return; - } - createOutPacket(CMSG_MAIL2_OPEN_MAILBOX); - outMsg.writeInt8(toInt(openType, int8_t), "open type"); - outMsg.writeInt64(0, "mail id"); -} - -void Mail2Handler::closeMailBox() const -{ - if (packetVersion < 20131211 || - (serverVersion < 19 && serverVersion != 0)) - { - return; - } - createOutPacket(CMSG_MAIL2_CLOSE_MAILBOX); -} - -void Mail2Handler::cancelWriteMail() const -{ - if (packetVersion < 20140326 || - (serverVersion < 19 && serverVersion != 0)) - { - return; - } - createOutPacket(CMSG_MAIL2_CANCEL_WRITE_MAIL); -} - -void Mail2Handler::requestCheckName(const std::string &name) const -{ - if (packetVersion < 20140423 || - serverVersion < 19) - { - return; - } - createOutPacket(CMSG_MAIL2_CHECK_NAME); - outMsg.writeString(name, 24, "name"); -} - -std::string Mail2Handler::getCheckedName() const -{ - return Mail2Recv::mCheckedName; -} - -} // namespace EAthena diff --git a/src/net/eathena/mail2handler.h b/src/net/eathena/mail2handler.h deleted file mode 100644 index c7d15dc78..000000000 --- a/src/net/eathena/mail2handler.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_MAIL2HANDLER_H -#define NET_EATHENA_MAIL2HANDLER_H - -#include "net/mail2handler.h" - -namespace EAthena -{ - -class Mail2Handler final : public Net::Mail2Handler -{ - public: - Mail2Handler(); - - A_DELETE_COPY(Mail2Handler) - - ~Mail2Handler(); - - void openWriteMail(const std::string &receiver) const override final; - - void addItem(const Item *const item, - const int amount) const override final; - - void removeItem(const int index, - const int amount) const override final; - - void sendMail(const std::string &to, - const std::string &title, - const std::string &body, - const int64_t &money) const override final; - - void queueCheckName(const MailQueueTypeT type, - const std::string &to, - const std::string &title, - const std::string &body, - const int64_t &money) const override final; - - void nextPage(const MailOpenTypeT openType, - const int64_t mailId) const override final; - - void readMail(const MailOpenTypeT openType, - const int64_t mailId) const override final; - - void deleteMail(const MailOpenTypeT openType, - const int64_t mailId) const override final; - - void requestMoney(const MailOpenTypeT openType, - const int64_t mailId) const override final; - - void requestItems(const MailOpenTypeT openType, - const int64_t mailId) const override final; - - void refreshMailList(const MailOpenTypeT openType, - const int64_t mailId) const override final; - - void openMailBox(const MailOpenTypeT openType) const override final; - - void closeMailBox() const override final; - - void cancelWriteMail() const override final; - - void requestCheckName(const std::string &name) const override final; - - std::string getCheckedName() const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_MAIL2HANDLER_H diff --git a/src/net/eathena/mail2recv.cpp b/src/net/eathena/mail2recv.cpp deleted file mode 100644 index 1afb69d16..000000000 --- a/src/net/eathena/mail2recv.cpp +++ /dev/null @@ -1,526 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/mail2recv.h" - -#include "itemcolormanager.h" -#include "notifymanager.h" - -#include "const/net/inventory.h" - -#include "being/playerinfo.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/mailmessage.h" - -#include "gui/windows/maileditwindow.h" -#include "gui/windows/mailviewwindow.h" -#include "gui/windows/mailwindow.h" - -#include "net/mail2handler.h" -#include "net/messagein.h" - -#include "resources/mailqueue.h" - -#include "resources/inventory/inventory.h" - -#include "resources/item/item.h" -#include "resources/item/itemoptionslist.h" - -#include "utils/checkutils.h" -#include "utils/gettext.h" -#include "utils/stringutils.h" -#include "utils/timer.h" - -#include "debug.h" - -namespace EAthena -{ - -namespace Mail2Recv -{ - std::queue<MailQueue*> mMailQueue; - std::string mCheckedName; -} // namespace Mail2Recv - -void Mail2Recv::processMailIcon(Net::MessageIn &msg) -{ - // ignored, because if has new mail, server send chat message already. - msg.readUInt8("has new mail"); -} - -void Mail2Recv::processOpenNewMailWindow(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readString(24, "receiver"); - msg.readUInt8("result"); -} - -void Mail2Recv::processAddItemResult(Net::MessageIn &msg) -{ - const int res = msg.readUInt8("result"); - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int amount = msg.readInt16("amount"); - const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - const uint8_t identify = msg.readUInt8("identify"); - const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); - const uint8_t refine = msg.readUInt8("refine"); - int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - ItemOptionsList *options = new ItemOptionsList(5); - for (int f = 0; f < 5; f ++) - { - const uint16_t idx = msg.readInt16("option index"); - const uint16_t val = msg.readInt16("option value"); - msg.readUInt8("option param"); - options->add(idx, val); - } - msg.readInt16("weight"); - msg.readUInt8("unknown 1"); - msg.readUInt8("unknown 2"); - msg.readUInt8("unknown 3"); - msg.readUInt8("unknown 4"); - msg.readUInt8("unknown 5"); - - if (mailEditWindow == nullptr) - { - reportAlways("Mail edit window not created"); - delete options; - return; - } - Inventory *const inventory = mailEditWindow->getInventory(); - if (inventory == nullptr) - { - reportAlways("Mail edit window inventory not exists"); - delete options; - return; - } - - if (res != 0) - { - switch (res) - { - case 1: - NotifyManager::notify( - NotifyTypes::MAIL_ATTACH_ITEM_WEIGHT_ERROR); - break; - case 2: - NotifyManager::notify( - NotifyTypes::MAIL_ATTACH_ITEM_FATAL_ERROR); - break; - case 3: - NotifyManager::notify( - NotifyTypes::MAIL_ATTACH_ITEM_NO_SPACE); - break; - case 4: - NotifyManager::notify( - NotifyTypes::MAIL_ATTACH_ITEM_NOT_TRADEABLE); - break; - default: - NotifyManager::notify( - NotifyTypes::MAIL_ATTACH_ITEM_UNKNOWN_ERROR); - UNIMPLEMENTEDPACKETFIELD(res); - break; - } - delete options; - return; - } - - Item *const item = inventory->findItemByTag(index); - if (item == nullptr) - { - const int slot = inventory->addItem(itemId, - itemType, - amount, - refine, - ItemColorManager::getColorFromCards(&cards[0]), - fromBool(identify, Identified), - damaged, - Favorite_false, - Equipm_false, - Equipped_false); - if (slot == -1) - { - delete options; - return; - } - inventory->setCards(slot, cards, maxCards); - inventory->setOptions(slot, options); - inventory->setTag(slot, index); - } - else - { - item->increaseQuantity(amount); - } - - mailEditWindow->updateItems(); - delete options; -} - -void Mail2Recv::processRemoveItemResult(Net::MessageIn &msg) -{ - const int result = msg.readUInt8("result"); - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int amount = msg.readInt16("count"); - msg.readInt16("weight"); - - if (result == 0) - { - const Inventory *const inv = PlayerInfo::getInventory(); - if (inv == nullptr) - { - reportAlways("Player inventory not exists"); - return; - } - std::string itemName; - const Item *const item = inv->getItem(index); - if (item != nullptr) - { - itemName = item->getName(); - } - else - { - // TRANSLATORS: unknown item name - itemName = _("Unknown item"); - } - - NotifyManager::notify( - NotifyTypes::MAIL_REMOVE_ITEM_ERROR, - itemName); - return; - } - if (mailEditWindow == nullptr) - { - reportAlways("Mail edit window not created"); - return; - } - Inventory *const inventory = mailEditWindow->getInventory(); - if (inventory == nullptr) - { - reportAlways("Mail edit window inventory not exists"); - return; - } - const int index2 = inventory->findIndexByTag(index); - if (index2 == -1) - { - reportAlways("Item not exists in mail edit window."); - return; - } - Item *const item = inventory->getItem(index2); - if (item == nullptr) - { - reportAlways("Item not exists."); - return; - } - - item->increaseQuantity(-amount); - mailEditWindow->updateItems(); -} - -void Mail2Recv::processCheckNameResult(Net::MessageIn &msg) -{ - const int charId = msg.readInt32("char id"); - msg.readInt16("class"); - msg.readInt16("level"); - if (msg.getVersion() >= 20160316) - msg.readString(24, "name"); - // +++ in future if name received, need use it in map - if (mMailQueue.empty()) - { - reportAlways("Mail2Recv::processCheckNameResult no names in queue." - "Char id: %d", charId); - return; - } - MailQueue *const mail = mMailQueue.front(); - mMailQueue.pop(); - if (charId == 0) - { - NotifyManager::notify(NotifyTypes::MAIL_NAME_VALIDATION_ERROR, - mail->to); - delete mail; - return; - } - mCheckedName = mail->to; - switch (mail->type) - { - case MailQueueType::SendMail: - mail2Handler->sendMail(mail->to, - mail->title, - mail->body, - mail->money); - break; - case MailQueueType::EditMail: - if (mailWindow == nullptr) - { - reportAlways("Mail window not created"); - } - else - { - mailWindow->createMail(mail->to); - } - break; - case MailQueueType::ValidateTo: - if (mailEditWindow == nullptr) - { - reportAlways("Mail edit window not created"); - } - else - { - mailEditWindow->validatedTo(); - } - break; - case MailQueueType::Unknown: - default: - reportAlways("Not implemented yet."); - break; - } - delete mail; -} - -void Mail2Recv::processSendResult(Net::MessageIn &msg) -{ - const int res = msg.readUInt8("result"); - switch (res) - { - case 0: - NotifyManager::notify(NotifyTypes::MAIL_SEND_OK); - if (mailEditWindow != nullptr) - mailEditWindow->close(); - break; - case 1: - NotifyManager::notify(NotifyTypes::MAIL_SEND_FATAL_ERROR); - break; - case 2: - NotifyManager::notify(NotifyTypes::MAIL_SEND_COUNT_ERROR); - break; - case 3: - NotifyManager::notify(NotifyTypes::MAIL_SEND_ITEM_ERROR); - break; - case 4: - NotifyManager::notify(NotifyTypes::MAIL_SEND_RECEIVER_ERROR); - break; - default: - NotifyManager::notify(NotifyTypes::MAIL_SEND_ERROR); - break; - } -} - -void Mail2Recv::processMailListPage(Net::MessageIn &msg) -{ - if (mailWindow == nullptr) - { - reportAlways("mail window not created"); - return; - } - msg.readInt16("len"); - mailWindow->setOpenType(fromInt(msg.readUInt8("open type"), - MailOpenTypeT)); - const int cnt = msg.readUInt8("cnt"); - const bool isEnd = msg.readUInt8("isEnd") != 0; - for (int f = 0; f < cnt; f ++) - { - MailMessage *const mail = new MailMessage; - mail->id = msg.readInt64("mail id"); - mail->read = msg.readUInt8("is read") != 0U ? true : false; - mail->type = static_cast<MailMessageType::Type>( - msg.readUInt8("type")); - mail->sender = msg.readString(24, "sender name"); - mail->time = CAST_S32(cur_time - msg.readInt32("reg time")); - mail->strTime = timeToStr(mail->time); - mail->expireTime = msg.readInt32("expire time"); - mail->title = msg.readString(-1, "title"); - mailWindow->addMail(mail); - } - if (isEnd) - mailWindow->setLastPage(); -} - -void Mail2Recv::processReadMail(Net::MessageIn &msg) -{ - msg.readInt16("len"); - const MailOpenTypeT openType = static_cast<MailOpenTypeT>( - msg.readUInt8("open type")); - const int64_t mailId = msg.readInt64("mail id"); - const int textLen = msg.readInt16("text len"); - const int64_t money = msg.readInt64("money"); - const int itemsCount = msg.readUInt8("item count"); - const std::string text = msg.readString(textLen, "text message"); - MailMessage *mail = nullptr; - - if (mailWindow != nullptr && - openType == mailWindow->getOpenType()) - { - mail = mailWindow->findMail(mailId); - } - - if (mail == nullptr) - { - reportAlways("Mail message not found"); - for (int f = 0; f < itemsCount; f ++) - { - msg.readInt16("amount"); - msg.readInt16("item id"); - msg.readUInt8("identify"); - msg.readUInt8("damaged"); - msg.readUInt8("refine"); - for (int d = 0; d < maxCards; d ++) - msg.readUInt16("card"); - msg.readInt32("unknown"); - msg.readUInt8("type"); - msg.readInt32("unknown"); - for (int d = 0; d < 5; d ++) - { - msg.readInt16("option index"); - msg.readInt16("option value"); - msg.readUInt8("option param"); - } - } - return; - } - - mail->money = money; - mail->text = text; - mailWindow->showMessage(mail, itemsCount); - - Inventory *const inventory = mailViewWindow->getInventory(); - - for (int f = 0; f < itemsCount; f ++) - { - // server may send wrong items count, if items was removed from mail - if (msg.getUnreadLength() == 0) - break; - const int amount = msg.readInt16("amount"); - const int itemId = msg.readInt16("item id"); - const uint8_t identify = msg.readUInt8("identify"); - const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); - const uint8_t refine = msg.readUInt8("refine"); - int cards[maxCards]; - for (int d = 0; d < maxCards; d ++) - cards[d] = msg.readUInt16("card"); - msg.readInt32("unknown"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - msg.readInt32("unknown"); - ItemOptionsList *options = new ItemOptionsList(5); - for (int d = 0; d < 5; d ++) - { - const uint16_t idx = msg.readInt16("option index"); - const uint16_t val = msg.readInt16("option value"); - msg.readUInt8("option param"); - options->add(idx, val); - } - - const int slot = inventory->addItem(itemId, - itemType, - amount, - refine, - ItemColorManager::getColorFromCards(&cards[0]), - fromBool(identify, Identified), - damaged, - Favorite_false, - Equipm_false, - Equipped_false); - if (slot == -1) - { - delete options; - continue; - } - inventory->setCards(slot, cards, maxCards); - inventory->setOptions(slot, options); - delete options; - } - mailViewWindow->updateItems(); -} - -void Mail2Recv::processMailDelete(Net::MessageIn &msg) -{ - msg.readUInt8("open type"); - const int64_t mailId = msg.readInt64("mail id"); - if (mailWindow == nullptr) - { - reportAlways("Mail window not created."); - return; - } - mailWindow->removeMail(mailId); -} - -void Mail2Recv::processRequestMoney(Net::MessageIn &msg) -{ - const int64_t mailId = msg.readInt64("mail id"); - msg.readUInt8("open type"); - const int res = msg.readUInt8("result"); - switch (res) - { - case 0: - NotifyManager::notify( - NotifyTypes::MAIL_GET_MONEY_OK); - if (mailViewWindow != nullptr) - mailViewWindow->removeMoney(mailId); - break; - case 1: - NotifyManager::notify( - NotifyTypes::MAIL_GET_MONEY_ERROR); - break; - case 2: - NotifyManager::notify( - NotifyTypes::MAIL_GET_MONEY_LIMIT_ERROR); - break; - default: - UNIMPLEMENTEDPACKETFIELD(res); - NotifyManager::notify( - NotifyTypes::MAIL_GET_MONEY_ERROR); - break; - } -} - -void Mail2Recv::processRequestItems(Net::MessageIn &msg) -{ - const int64_t mailId = msg.readInt64("mail id"); - msg.readUInt8("open type"); - const int res = msg.readUInt8("result"); - switch (res) - { - case 0: - NotifyManager::notify( - NotifyTypes::MAIL_GET_ATTACH_OK); - if (mailViewWindow != nullptr) - mailViewWindow->removeItems(mailId); - break; - case 1: - NotifyManager::notify( - NotifyTypes::MAIL_GET_ATTACH_ERROR); - break; - case 2: - NotifyManager::notify( - NotifyTypes::MAIL_GET_ATTACH_FULL_ERROR); - break; - default: - UNIMPLEMENTEDPACKETFIELD(res); - NotifyManager::notify( - NotifyTypes::MAIL_GET_ATTACH_ERROR); - break; - } -} - -} // namespace EAthena diff --git a/src/net/eathena/mail2recv.h b/src/net/eathena/mail2recv.h deleted file mode 100644 index e23603b8c..000000000 --- a/src/net/eathena/mail2recv.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_MAIL2RECV_H -#define NET_EATHENA_MAIL2RECV_H - -#include <string> -#include <queue> - -struct MailQueue; - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace Mail2Recv - { - extern std::queue<MailQueue*> mMailQueue; - extern std::string mCheckedName; - - void processMailIcon(Net::MessageIn &msg); - void processOpenNewMailWindow(Net::MessageIn &msg); - void processAddItemResult(Net::MessageIn &msg); - void processRemoveItemResult(Net::MessageIn &msg); - void processCheckNameResult(Net::MessageIn &msg); - void processSendResult(Net::MessageIn &msg); - void processMailListPage(Net::MessageIn &msg); - void processReadMail(Net::MessageIn &msg); - void processMailDelete(Net::MessageIn &msg); - void processRequestMoney(Net::MessageIn &msg); - void processRequestItems(Net::MessageIn &msg); - } // namespace Mail2Recv -} // namespace EAthena - -#endif // NET_EATHENA_MAIL2RECV_H diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp deleted file mode 100644 index 44edeb5bd..000000000 --- a/src/net/eathena/mailhandler.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/mailhandler.h" - -#include "const/net/inventory.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -namespace EAthena -{ - -MailHandler::MailHandler() -{ - mailHandler = this; -} - -MailHandler::~MailHandler() -{ - mailHandler = nullptr; -} - -void MailHandler::refresh() const -{ - createOutPacket(CMSG_MAIL_REFRESH_INBOX); -} - -void MailHandler::readMessage(const int msgId) const -{ - createOutPacket(CMSG_MAIL_READ_MESSAGE); - outMsg.writeInt32(msgId, "message id"); -} - -void MailHandler::getAttach(const int msgId) const -{ - createOutPacket(CMSG_MAIL_GET_ATTACH); - outMsg.writeInt32(msgId, "message id"); -} - -void MailHandler::deleteMessage(const int msgId) const -{ - createOutPacket(CMSG_MAIL_DELETE_MESSAGE); - outMsg.writeInt32(msgId, "message id"); -} - -void MailHandler::returnMessage(const int msgId) const -{ - createOutPacket(CMSG_MAIL_RETURN_MESSAGE); - outMsg.writeInt32(msgId, "message id"); - outMsg.writeString("", 24, "unused"); -} - -void MailHandler::setAttach(const int index, const int amount) const -{ - createOutPacket(CMSG_MAIL_SET_ATTACH); - outMsg.writeInt16(CAST_S16(index + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(amount, "amount"); -} - -void MailHandler::setAttachMoney(const int money) const -{ - createOutPacket(CMSG_MAIL_SET_ATTACH); - outMsg.writeInt16(CAST_S16(0), "index"); - outMsg.writeInt32(money, "money"); -} - -void MailHandler::resetAttach(const int flag) const -{ - createOutPacket(CMSG_MAIL_RESET_ATTACH); - outMsg.writeInt16(CAST_S16(flag), "flag"); -} - -void MailHandler::send(const std::string &name, - const std::string &title, - std::string message) const -{ - if (message.size() > 255) - message = message.substr(0, 255); - const int sz = CAST_S32(message.size()); - - createOutPacket(CMSG_MAIL_SEND); - outMsg.writeInt16(CAST_S16(69 + sz), "len"); - outMsg.writeString(name, 24, "name"); - outMsg.writeString(title, 40, "title"); - outMsg.writeInt8(CAST_S8(sz), "message size"); - outMsg.writeString(message, sz, "message"); -} - -} // namespace EAthena diff --git a/src/net/eathena/mailhandler.h b/src/net/eathena/mailhandler.h deleted file mode 100644 index 4d55238a6..000000000 --- a/src/net/eathena/mailhandler.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_MAILHANDLER_H -#define NET_EATHENA_MAILHANDLER_H - -#include "net/mailhandler.h" - -namespace EAthena -{ - -class MailHandler final : public Net::MailHandler -{ - public: - MailHandler(); - - A_DELETE_COPY(MailHandler) - - ~MailHandler(); - - void refresh() const override final; - - void readMessage(const int msgId) const override final; - - void getAttach(const int msgId) const override final; - - void deleteMessage(const int msgId) const override final; - - void returnMessage(const int msgId) const override final; - - void setAttach(const int index, const int amount) const override final; - - void setAttachMoney(const int money) const override final; - - void resetAttach(const int flag) const override final; - - void send(const std::string &name, - const std::string &title, - std::string message) const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_MAILHANDLER_H diff --git a/src/net/eathena/mailrecv.cpp b/src/net/eathena/mailrecv.cpp deleted file mode 100644 index de7945a7d..000000000 --- a/src/net/eathena/mailrecv.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/mailrecv.h" - -#include "itemcolormanager.h" -#include "notifymanager.h" - -#include "const/resources/item/cards.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/mailmessage.h" - -#include "gui/windows/mailviewwindow.h" -#include "gui/windows/mailwindow.h" - -#include "net/mailhandler.h" -#include "net/messagein.h" - -#include "utils/checkutils.h" -#include "utils/gettext.h" -#include "utils/stringutils.h" - -#include "resources/inventory/inventory.h" - -#include "debug.h" - -namespace EAthena -{ - -void MailRecv::processMailOpen(Net::MessageIn &msg) -{ - const int flag = msg.readInt32("flag"); - switch (flag) - { - case 0: // open window - if (mailWindow != nullptr) - { - if (!mailWindow->isWindowVisible()) - mailWindow->setVisible(Visible_true); - mailWindow->requestMoveToTop(); - } - break; - - case 1: // close window - if (mailWindow != nullptr) - { - if (mailWindow->isWindowVisible()) - mailWindow->setVisible(Visible_false); - } - break; - - default: - UNIMPLEMENTEDPACKETFIELD(flag); - break; - } -} - -void MailRecv::processMailList(Net::MessageIn &msg) -{ - const int count = (msg.readInt16("len") - 8) / 73; - const int amount = msg.readInt32("amount"); - if (count != amount) - logger->log("error: wrong mails count"); - mailWindow->clear(); - for (int f = 0; f < count; f ++) - { - MailMessage *const mail = new MailMessage; - mail->id = msg.readInt32("message id"); - mail->title = msg.readString(40, "title"); - mail->read = msg.readUInt8("unread flag") != 0u ? true : false; - mail->sender = msg.readString(24, "sender name"); - mail->time = msg.readInt32("time stamp"); - mail->strTime = timeToStr(mail->time); - mailWindow->addMail(mail); - } -} - -void MailRecv::processReadMail(Net::MessageIn &msg) -{ - const int sz = msg.readInt16("len") - 101; - MailMessage *const mail = new MailMessage; - mail->id = msg.readInt32("message id"); - mail->title = msg.readString(40, "title"); - mail->sender = msg.readString(24, "sender name"); - msg.readInt32("unused"); - mail->money = msg.readInt32("money"); - - const int amount = msg.readInt32("item amount"); - const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readInt16("item type")); - const uint8_t identify = msg.readUInt8("identify"); - const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); - const uint8_t refine = msg.readUInt8("refine"); - int cards[maxCards]; - for (int d = 0; d < maxCards; d ++) - cards[d] = msg.readUInt16("card"); - const int msgLen = msg.readUInt8("msg len"); - if (msgLen != sz) - logger->log("error: wrong message size"); - mail->text = msg.readString(sz, "message"); - msg.readUInt8("zero"); - mail->strTime = timeToStr(mail->time); - if (mailWindow == nullptr) - { - reportAlways("Mail window not created"); - delete mail; - return; - } - mailWindow->showMessage(mail, itemId != 0 ? 1 : 0); - if (mailViewWindow == nullptr) - { - reportAlways("Mail view window not created"); - return; - } - - Inventory *const inventory = mailViewWindow->getInventory(); - if (inventory == nullptr) - { - reportAlways("Mail view window missing inventory"); - return; - } - - const int slot = inventory->addItem(itemId, - itemType, - amount, - refine, - ItemColorManager::getColorFromCards(&cards[0]), - fromBool(identify, Identified), - damaged, - Favorite_false, - Equipm_false, - Equipped_false); - if (slot != -1) - inventory->setCards(slot, cards, maxCards); - - mailViewWindow->updateItems(); -} - -void MailRecv::processGetAttachment(Net::MessageIn &msg) -{ - const uint8_t flag = msg.readUInt8("flag"); - switch (flag) - { - case 0: - NotifyManager::notify(NotifyTypes::MAIL_GET_ATTACH_OK); - break; - case 1: - NotifyManager::notify(NotifyTypes::MAIL_GET_ATTACH_ERROR); - break; - case 2: - NotifyManager::notify(NotifyTypes::MAIL_GET_ATTACH_TOO_MANY_ITEMS); - break; - default: - UNIMPLEMENTEDPACKETFIELD(flag); - break; - } -} - -void MailRecv::processSendMailAck(Net::MessageIn &msg) -{ - const uint8_t flag = msg.readUInt8("fail flag"); - switch (flag) - { - case 0: - NotifyManager::notify(NotifyTypes::MAIL_SEND_OK); - break; - case 1: - NotifyManager::notify(NotifyTypes::MAIL_SEND_ERROR); - break; - default: - UNIMPLEMENTEDPACKETFIELD(flag); - break; - } -} - -void MailRecv::processNewMail(Net::MessageIn &msg) -{ - msg.readInt32("message id"); - const std::string subj = msg.readString(40, "title"); - const std::string sender = msg.readString(24, "sender name"); - NotifyManager::notify(NotifyTypes::NEW_MAIL, - // TRANSLATORS: mail message notification - strprintf(_("You have new mail from %s with subject %s"), - sender.c_str(), subj.c_str())); - mailHandler->refresh(); -} - -void MailRecv::processSetAttachmentAck(Net::MessageIn &msg) -{ - const int index = msg.readInt16("index"); - const int flag = msg.readUInt8("flag"); - if (flag != 0) - { - if (index != 0) - NotifyManager::notify(NotifyTypes::MAIL_ATTACH_ITEM_ERROR); - else - NotifyManager::notify(NotifyTypes::MAIL_ATTACH_MONEY_ERROR); - } -} - -void MailRecv::processDeleteAck(Net::MessageIn &msg) -{ - const int mail = msg.readInt32("message id"); - const int flag = msg.readInt16("fail flag"); - if (flag != 0) - { - NotifyManager::notify(NotifyTypes::MAIL_DELETE_ERROR); - } - else - { - NotifyManager::notify(NotifyTypes::MAIL_DELETE_OK); - mailWindow->removeMail(mail); - } -} - -void MailRecv::processMailReturn(Net::MessageIn &msg) -{ - const int mail = msg.readInt32("message id"); - const int flag = msg.readInt16("fail flag"); - if (flag != 0) - { - NotifyManager::notify(NotifyTypes::MAIL_RETURN_ERROR); - } - else - { - NotifyManager::notify(NotifyTypes::MAIL_RETURN_OK); - mailWindow->removeMail(mail); - } -} - -} // namespace EAthena diff --git a/src/net/eathena/mailrecv.h b/src/net/eathena/mailrecv.h deleted file mode 100644 index 8f56f5a9f..000000000 --- a/src/net/eathena/mailrecv.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_MAILRECV_H -#define NET_EATHENA_MAILRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace MailRecv - { - void processMailOpen(Net::MessageIn &msg); - void processMailList(Net::MessageIn &msg); - void processReadMail(Net::MessageIn &msg); - void processGetAttachment(Net::MessageIn &msg); - void processSendMailAck(Net::MessageIn &msg); - void processNewMail(Net::MessageIn &msg); - void processSetAttachmentAck(Net::MessageIn &msg); - void processDeleteAck(Net::MessageIn &msg); - void processMailReturn(Net::MessageIn &msg); - } // namespace MailRecv -} // namespace EAthena - -#endif // NET_EATHENA_MAILRECV_H diff --git a/src/net/eathena/maphandler.cpp b/src/net/eathena/maphandler.cpp deleted file mode 100644 index b16fc664f..000000000 --- a/src/net/eathena/maphandler.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/maphandler.h" - -#include "debug.h" - -namespace EAthena -{ - -MapHandler::MapHandler() : - Net::MapHandler() -{ - mapHandler = this; -} - -MapHandler::~MapHandler() -{ - mapHandler = nullptr; -} - -} // namespace EAthena diff --git a/src/net/eathena/maphandler.h b/src/net/eathena/maphandler.h deleted file mode 100644 index 855ec4da7..000000000 --- a/src/net/eathena/maphandler.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_MAPHANDLER_H -#define NET_EATHENA_MAPHANDLER_H - -#include "net/maphandler.h" - -namespace EAthena -{ - -class MapHandler final : public Net::MapHandler -{ - public: - MapHandler(); - - A_DELETE_COPY(MapHandler) - - ~MapHandler(); -}; - -} // namespace EAthena - -#endif // NET_EATHENA_MAPHANDLER_H diff --git a/src/net/eathena/maprecv.cpp b/src/net/eathena/maprecv.cpp deleted file mode 100644 index cc079feba..000000000 --- a/src/net/eathena/maprecv.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/maprecv.h" - -#include "logger.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace EAthena -{ - -void MapRecv::processInstanceStart(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readString(61, "instance name"); - msg.readInt16("flag"); -} - -void MapRecv::processInstanceCreate(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("flag"); -} - -void MapRecv::processInstanceInfo(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readString(61, "instance name"); - msg.readInt32("remaining time"); - msg.readInt32("no players close time"); -} - -void MapRecv::processInstanceDelete(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("flag"); - msg.readInt32("unused"); -} - -void MapRecv::processAddMapMarker(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readBeingId("account id"); - msg.readInt16("x"); - msg.readInt16("y"); -} - -} // namespace EAthena diff --git a/src/net/eathena/maprecv.h b/src/net/eathena/maprecv.h deleted file mode 100644 index d9fffc8a2..000000000 --- a/src/net/eathena/maprecv.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_MAPRECV_H -#define NET_EATHENA_MAPRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace MapRecv - { - void processInstanceStart(Net::MessageIn &msg); - void processInstanceCreate(Net::MessageIn &msg); - void processInstanceInfo(Net::MessageIn &msg); - void processInstanceDelete(Net::MessageIn &msg); - void processAddMapMarker(Net::MessageIn &msg); - } // namespace MapRecv -} // namespace EAthena - -#endif // NET_EATHENA_MAPRECV_H diff --git a/src/net/eathena/maptypeproperty2.h b/src/net/eathena/maptypeproperty2.h deleted file mode 100644 index 2bc235798..000000000 --- a/src/net/eathena/maptypeproperty2.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_MAPTYPEPROPERTY2_H -#define NET_EATHENA_MAPTYPEPROPERTY2_H - -#include "localconsts.h" - -namespace EAthena -{ - struct MapTypeProperty2Bits final - { - A_DEFAULT_COPY(MapTypeProperty2Bits) - - uint32_t party : 1; // allow attack party members (PvP) - uint32_t guild : 1; // allow attack guild members (GvG) - uint32_t siege : 1; // show emblem in GvG (WoE castle) - uint32_t mineffect : 1; // mine effect? - uint32_t nolockon : 1; // unknown - uint32_t countpk : 1; // show PvP counter - uint32_t nopartyformation : 1; // prevent party creation/ - // modification - uint32_t bg : 1; // is on battle ground - uint32_t noitemconsumption : 1; // unused - uint32_t usecart : 1; // unused - uint32_t summonstarmiracle : 1; // unused - uint32_t SpareBits : 15; // unused bits - } __attribute__((packed)); - - union MapTypeProperty2 final - { - MapTypeProperty2Bits bits; - uint32_t data; - } __attribute__((packed)); - -} // namespace EAthena - -#endif // NET_EATHENA_MAPTYPEPROPERTY2_H diff --git a/src/net/eathena/markethandler.cpp b/src/net/eathena/markethandler.cpp deleted file mode 100644 index 46bf44027..000000000 --- a/src/net/eathena/markethandler.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/markethandler.h" - -#include "net/eathena/marketrecv.h" -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "utils/foreach.h" - -#include "resources/item/shopitem.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -MarketHandler::MarketHandler() : - Net::MarketHandler() -{ - marketHandler = this; - MarketRecv::mBuyDialog = nullptr; -} - -MarketHandler::~MarketHandler() -{ - marketHandler = nullptr; -} - -void MarketHandler::close() const -{ - if (packetVersion < 20131218) - return; - - createOutPacket(CMSG_NPC_MARKET_CLOSE); -} - -void MarketHandler::buyItem(const int itemId, - const ItemTypeT type, - const ItemColor color A_UNUSED, - const int amount) const -{ - if (packetVersion < 20131218) - return; - const bool nonStack = type == ItemType::Weapon || - type == ItemType::Armor || - type == ItemType::PetEgg || - type == ItemType::PetArmor; - int cnt = nonStack ? amount : 1; - const int amount2 = nonStack ? 1 : amount; - if (cnt > 100) - cnt = 100; - - createOutPacket(CMSG_NPC_MARKET_BUY); - outMsg.writeInt16(CAST_S16(4 + 6 * cnt), "len"); - for (int f = 0; f < cnt; f ++) - { - outMsg.writeInt16(CAST_S16(itemId), "item id"); - outMsg.writeInt32(CAST_S16(amount2), "amount"); - } -} - -void MarketHandler::buyItems(const STD_VECTOR<ShopItem*> &items) const -{ - if (packetVersion < 20131218) - return; - int cnt = 0; - const int pairSize = 6; - - FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) - { - const ShopItem *const item = *it; - const int usedQuantity = item->getUsedQuantity(); - const ItemTypeT type = item->getType(); - if (usedQuantity == 0) - continue; - if (type == ItemType::Weapon || - type == ItemType::Armor || - type == ItemType::PetEgg || - type == ItemType::PetArmor) - { - cnt += item->getUsedQuantity(); - } - else - { - cnt ++; - } - } - - if (cnt > 100) - return; - - createOutPacket(CMSG_NPC_MARKET_BUY); - outMsg.writeInt16(CAST_S16(4 + pairSize * cnt), "len"); - FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) - { - ShopItem *const item = *it; - const int usedQuantity = item->getUsedQuantity(); - if (usedQuantity == 0) - continue; - item->increaseQuantity(usedQuantity); - item->increaseUsedQuantity(-usedQuantity); - item->update(); - const ItemTypeT type = item->getType(); - if (type == ItemType::Weapon || - type == ItemType::Armor || - type == ItemType::PetEgg || - type == ItemType::PetArmor) - { - for (int f = 0; f < usedQuantity; f ++) - { - outMsg.writeInt16(CAST_S16(item->getId()), - "item id"); - outMsg.writeInt32(CAST_S16(1), "amount"); - } - } - else - { - outMsg.writeInt16(CAST_S16(item->getId()), "item id"); - outMsg.writeInt32(CAST_S16(usedQuantity), "amount"); - } - } -} - -} // namespace EAthena diff --git a/src/net/eathena/markethandler.h b/src/net/eathena/markethandler.h deleted file mode 100644 index c06018c0b..000000000 --- a/src/net/eathena/markethandler.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_MARKETHANDLER_H -#define NET_EATHENA_MARKETHANDLER_H - -#include "net/markethandler.h" - -namespace EAthena -{ - -class MarketHandler final : public Net::MarketHandler -{ - public: - MarketHandler(); - - A_DELETE_COPY(MarketHandler) - - ~MarketHandler(); - - void close() const override final; - - void buyItem(const int itemId, - const ItemTypeT type, - const ItemColor color, - const int amount) const override final; - - void buyItems(const STD_VECTOR<ShopItem*> &items) const - override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_MARKETHANDLER_H diff --git a/src/net/eathena/marketrecv.cpp b/src/net/eathena/marketrecv.cpp deleted file mode 100644 index 8563c67ca..000000000 --- a/src/net/eathena/marketrecv.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/marketrecv.h" - -#include "notifymanager.h" - -#include "being/playerinfo.h" - -#include "const/resources/currency.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/buydialog.h" - -#include "gui/widgets/createwidget.h" - -#include "net/messagein.h" - -#include "net/eathena/npcrecv.h" - -#include "resources/beinginfo.h" - -#include "resources/db/npcdb.h" - -#include "debug.h" - -namespace EAthena -{ - -namespace MarketRecv -{ - BuyDialog *mBuyDialog = nullptr; -} // namespace MarketRecv - - -void MarketRecv::processMarketOpen(Net::MessageIn &msg) -{ - const int len = (msg.readInt16("len") - 4) / 13; - - const BeingTypeId npcId = NpcRecv::mNpcTypeId; - std::string currency; - - if (npcId != BeingTypeId_zero) - { - const BeingInfo *const info = NPCDB::get(npcId); - if (info != nullptr) - currency = info->getCurrency(); - else - currency = DEFAULT_CURRENCY; - } - else - { - currency = DEFAULT_CURRENCY; - } - - CREATEWIDGETV(mBuyDialog, BuyDialog, - fromInt(BuyDialog::Market, BeingId), - currency); - mBuyDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY)); - - for (int f = 0; f < len; f ++) - { - const int itemId = msg.readInt16("item id"); - const ItemTypeT type = static_cast<ItemTypeT>(msg.readUInt8("type")); - const int value = msg.readInt32("price"); - const int amount = msg.readInt32("amount"); - msg.readInt16("view"); - const ItemColor color = ItemColor_one; - mBuyDialog->addItem(itemId, type, color, amount, value); - } - mBuyDialog->sort(); -} - -void MarketRecv::processMarketBuyAck(Net::MessageIn &msg) -{ - const int len = (msg.readInt16("len") - 5) / 8; - const int res = msg.readUInt8("result"); - for (int f = 0; f < len; f ++) - { - msg.readInt16("item id"); - msg.readInt16("amount"); - msg.readInt32("price"); - } - if (res != 0) - NotifyManager::notify(NotifyTypes::BUY_DONE); - else - NotifyManager::notify(NotifyTypes::BUY_FAILED); -} - -} // namespace EAthena diff --git a/src/net/eathena/marketrecv.h b/src/net/eathena/marketrecv.h deleted file mode 100644 index a75491967..000000000 --- a/src/net/eathena/marketrecv.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_MARKETRECV_H -#define NET_EATHENA_MARKETRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -class BuyDialog; - -namespace EAthena -{ - namespace MarketRecv - { - extern BuyDialog *mBuyDialog; - - void processMarketOpen(Net::MessageIn &msg); - void processMarketBuyAck(Net::MessageIn &msg); - } // namespace MarketRecv -} // namespace EAthena - -#endif // NET_EATHENA_MARKETRECV_H diff --git a/src/net/eathena/menu.cpp b/src/net/eathena/menu.cpp deleted file mode 100644 index 5fb14157e..000000000 --- a/src/net/eathena/menu.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "enums/net/menutype.h" - -#include "debug.h" - -namespace EAthena -{ - MenuTypeT menu = MenuType::Unknown; -} // namespace EAthena diff --git a/src/net/eathena/menu.h b/src/net/eathena/menu.h deleted file mode 100644 index 0ed10da79..000000000 --- a/src/net/eathena/menu.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_MENU_H -#define NET_EATHENA_MENU_H - -#include "enums/net/menutype.h" - -namespace EAthena -{ - extern MenuTypeT menu; -} // namespace EAthena - -#endif // NET_EATHENA_MENU_H diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp deleted file mode 100644 index ffb1b5b2c..000000000 --- a/src/net/eathena/mercenaryhandler.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/mercenaryhandler.h" - -#include "being/playerinfo.h" - -#include "net/serverfeatures.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -namespace EAthena -{ - -MercenaryHandler::MercenaryHandler() -{ - mercenaryHandler = this; -} - -MercenaryHandler::~MercenaryHandler() -{ - mercenaryHandler = nullptr; -} - -void MercenaryHandler::fire() const -{ - createOutPacket(CMSG_MERCENARY_ACTION); - outMsg.writeInt8(2, "action"); // delete -} - -void MercenaryHandler::moveToMaster() const -{ - const BeingId id = PlayerInfo::getMercenaryId(); - if (id == BeingId_zero) - return; - createOutPacket(CMSG_HOMMERC_MOVE_TO_MASTER); - outMsg.writeBeingId(id, "mercenary id"); -} - -void MercenaryHandler::move(const int x, const int y) const -{ - const BeingId id = PlayerInfo::getMercenaryId(); - if (id == BeingId_zero) - return; - createOutPacket(CMSG_HOMMERC_MOVE_TO); - outMsg.writeBeingId(id, "mercenary id"); - outMsg.writeCoordinates(CAST_U16(x), - CAST_U16(y), - 1U, "position"); -} - -void MercenaryHandler::attack(const BeingId targetId, - const Keep keep) const -{ - const BeingId id = PlayerInfo::getMercenaryId(); - if (id == BeingId_zero) - return; - createOutPacket(CMSG_HOMMERC_ATTACK); - outMsg.writeBeingId(id, "mercenary id"); - outMsg.writeBeingId(targetId, "target id"); - outMsg.writeInt8(CAST_S8(keep == Keep_true ? 1 : 0), "keep"); -} - -void MercenaryHandler::talk(const std::string &restrict text) const -{ - if (!serverFeatures->haveMovePet()) - return; - if (text.empty()) - return; - std::string msg = text; - if (msg.size() > 500) - msg = msg.substr(0, 500); - const size_t sz = msg.size(); - - createOutPacket(CMSG_HOMMERC_TALK); - outMsg.writeInt16(CAST_S16(sz + 4 + 1), "len"); - outMsg.writeString(msg, CAST_S32(sz), "message"); - outMsg.writeInt8(0, "zero byte"); -} - -void MercenaryHandler::emote(const uint8_t emoteId) const -{ - if (!serverFeatures->haveMovePet()) - return; - createOutPacket(CMSG_HOMMERC_EMOTE); - outMsg.writeInt8(emoteId, "emote id"); -} - -void MercenaryHandler::setDirection(const unsigned char type) const -{ - if (!serverFeatures->haveMovePet()) - return; - createOutPacket(CMSG_HOMMERC_DIRECTION); - outMsg.writeInt32(0, "pet id"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(type), - "pet direction"); -} - -} // namespace EAthena diff --git a/src/net/eathena/mercenaryhandler.h b/src/net/eathena/mercenaryhandler.h deleted file mode 100644 index bd5e06b14..000000000 --- a/src/net/eathena/mercenaryhandler.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_MERCENARYHANDLER_H -#define NET_EATHENA_MERCENARYHANDLER_H - -#include "net/mercenaryhandler.h" - -namespace EAthena -{ -class MercenaryHandler final : public Net::MercenaryHandler -{ - public: - MercenaryHandler(); - - A_DELETE_COPY(MercenaryHandler) - - ~MercenaryHandler(); - - void fire() const override final; - - void moveToMaster() const override final; - - void move(const int x, const int y) const override final; - - void attack(const BeingId targetId, - const Keep keep) const override final; - - void talk(const std::string &restrict text) const override final; - - void emote(const uint8_t emoteId) const override final; - - void setDirection(const unsigned char type) const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_MERCENARYHANDLER_H diff --git a/src/net/eathena/mercenaryrecv.cpp b/src/net/eathena/mercenaryrecv.cpp deleted file mode 100644 index 457045e5b..000000000 --- a/src/net/eathena/mercenaryrecv.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/mercenaryrecv.h" - -#include "actormanager.h" -#include "notifymanager.h" - -#include "being/localplayer.h" -#include "being/mercenaryinfo.h" -#include "being/playerinfo.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/skilldialog.h" - -#include "net/messagein.h" - -#include "net/eathena/sp.h" - -#include "utils/checkutils.h" - -#include "debug.h" - -namespace EAthena -{ - -#define setMercStat(sp, stat) \ - case sp: \ - PlayerInfo::setStatBase(stat, \ - val); \ - break; - -void MercenaryRecv::processMercenaryUpdate(Net::MessageIn &msg) -{ - const int sp = msg.readInt16("type"); - const int val = msg.readInt32("value"); - switch (sp) - { - setMercStat(Sp::ATK1, Attributes::MERC_ATK); - setMercStat(Sp::MATK1, Attributes::MERC_MATK); - setMercStat(Sp::HIT, Attributes::MERC_HIT); - setMercStat(Sp::CRITICAL, Attributes::MERC_CRIT); - setMercStat(Sp::DEF1, Attributes::MERC_DEF); - setMercStat(Sp::MDEF1, Attributes::MERC_MDEF); - setMercStat(Sp::MERCFLEE, Attributes::MERC_FLEE); - setMercStat(Sp::ASPD, Attributes::MERC_ATTACK_DELAY); - setMercStat(Sp::HP, Attributes::MERC_HP); - setMercStat(Sp::MAXHP, Attributes::MERC_MAX_HP); - setMercStat(Sp::SP, Attributes::MERC_MP); - setMercStat(Sp::MAXSP, Attributes::MERC_MAX_MP); - setMercStat(Sp::MERCKILLS, Attributes::MERC_KILLS); - setMercStat(Sp::MERCFAITH, Attributes::MERC_FAITH); - default: - reportAlways("Unknown mercenary stat %d", - sp); - break; - } -} - -void MercenaryRecv::processMercenaryInfo(Net::MessageIn &msg) -{ - // +++ need create if need mercenary being and update stats - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - PlayerInfo::setStatBase(Attributes::MERC_ATK, - msg.readInt16("atk")); - PlayerInfo::setStatBase(Attributes::MERC_MATK, - msg.readInt16("matk")); - PlayerInfo::setStatBase(Attributes::MERC_HIT, - msg.readInt16("hit")); - PlayerInfo::setStatBase(Attributes::MERC_CRIT, - msg.readInt16("crit/10")); - PlayerInfo::setStatBase(Attributes::MERC_DEF, - msg.readInt16("def")); - PlayerInfo::setStatBase(Attributes::MERC_MDEF, - msg.readInt16("mdef")); - PlayerInfo::setStatBase(Attributes::MERC_FLEE, - msg.readInt16("flee")); - PlayerInfo::setStatBase(Attributes::MERC_ATTACK_DELAY, - msg.readInt16("attack speed")); - const std::string name = msg.readString(24, "name"); - const int level = msg.readInt16("level"); - PlayerInfo::setStatBase(Attributes::MERC_LEVEL, - level); - PlayerInfo::setStatBase(Attributes::MERC_HP, - msg.readInt32("hp")); - PlayerInfo::setStatBase(Attributes::MERC_MAX_HP, - msg.readInt32("max hp")); - PlayerInfo::setStatBase(Attributes::MERC_MP, - msg.readInt32("sp")); - PlayerInfo::setStatBase(Attributes::MERC_MAX_MP, - msg.readInt32("max sp")); - PlayerInfo::setStatBase(Attributes::MERC_EXPIRE, - msg.readInt32("expire time")); - PlayerInfo::setStatBase(Attributes::MERC_FAITH, - msg.readInt16("faith")); - PlayerInfo::setStatBase(Attributes::MERC_CALLS, - msg.readInt32("calls")); - PlayerInfo::setStatBase(Attributes::MERC_KILLS, - msg.readInt32("kills")); - const int range = msg.readInt16("attack range"); - PlayerInfo::setStatBase(Attributes::MERC_ATTACK_RANGE, - range); - PlayerInfo::updateAttrs(); - - if ((dstBeing != nullptr) && (localPlayer != nullptr)) - { - MercenaryInfo *const mercenary = new MercenaryInfo; - mercenary->id = dstBeing->getId(); - mercenary->name = name; - mercenary->level = level; - mercenary->range = range; - PlayerInfo::setMercenary(mercenary); - PlayerInfo::setMercenaryBeing(dstBeing); - } -} - -void MercenaryRecv::processMercenarySkills(Net::MessageIn &msg) -{ - if (skillDialog != nullptr) - skillDialog->hideSkills(SkillOwner::Mercenary); - const int count = (msg.readInt16("len") - 4) / 37; - for (int f = 0; f < count; f ++) - { - const int skillId = msg.readInt16("skill id"); - const SkillType::SkillType inf = static_cast<SkillType::SkillType>( - msg.readInt32("inf")); - const int level = msg.readInt16("skill level"); - const int sp = msg.readInt16("sp"); - const int range = msg.readInt16("range"); - const std::string name = msg.readString(24, "skill name"); - const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); - PlayerInfo::setSkillLevel(skillId, level); - if (skillDialog != nullptr) - { - if (!skillDialog->updateSkill(skillId, range, up, inf, sp)) - { - skillDialog->addSkill(SkillOwner::Mercenary, - skillId, name, level, range, up, inf, sp); - } - } - } - if (skillDialog != nullptr) - skillDialog->updateModels(); -} - -void MercenaryRecv::handleMercenaryMessage(const int cmd) -{ - PlayerInfo::setMercenary(nullptr); - if (skillDialog != nullptr) - { - skillDialog->hideSkills(SkillOwner::Mercenary); - skillDialog->updateModels(); - } - - switch (cmd) - { - case 0: - NotifyManager::notify(NotifyTypes::MERCENARY_EXPIRED); - break; - case 1: - NotifyManager::notify(NotifyTypes::MERCENARY_KILLED); - break; - case 2: - NotifyManager::notify(NotifyTypes::MERCENARY_FIRED); - break; - case 3: - NotifyManager::notify(NotifyTypes::MERCENARY_RUN); - break; - default: - NotifyManager::notify(NotifyTypes::MERCENARY_UNKNOWN); - break; - } -} - -} // namespace EAthena diff --git a/src/net/eathena/mercenaryrecv.h b/src/net/eathena/mercenaryrecv.h deleted file mode 100644 index a18314bcd..000000000 --- a/src/net/eathena/mercenaryrecv.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_MERCENARYRECV_H -#define NET_EATHENA_MERCENARYRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace MercenaryRecv - { - void handleMercenaryMessage(const int cmd); - void processMercenaryUpdate(Net::MessageIn &msg); - void processMercenaryInfo(Net::MessageIn &msg); - void processMercenarySkills(Net::MessageIn &msg); - } // namespace MercenaryRecv -} // namespace EAthena - -#endif // NET_EATHENA_MERCENARYRECV_H diff --git a/src/net/eathena/messagein.cpp b/src/net/eathena/messagein.cpp deleted file mode 100644 index c5cb79fda..000000000 --- a/src/net/eathena/messagein.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/messagein.h" - -#include "logger.h" - -#include "net/net.h" -#include "net/packetcounters.h" - -#include "utils/cast.h" -#include "utils/stringutils.h" - -PRAGMA48(GCC diagnostic push) -PRAGMA48(GCC diagnostic ignored "-Wshadow") -#ifndef SDL_BIG_ENDIAN -#include <SDL_endian.h> -#endif // SDL_BYTEORDER -PRAGMA48(GCC diagnostic pop) - -#include "debug.h" - -namespace EAthena -{ - -MessageIn::MessageIn(const char *const data, - const unsigned int length) : - Net::MessageIn(data, length) -{ -} - -void MessageIn::postInit(const char *const str, - const unsigned int version) -{ - // Read the message ID - mId = readId(); - mVersion = version; - IGNOREDEBUGLOG; - DEBUGLOG2("Receive packet", 0, "MessageIn"); -#ifdef ENABLEDEBUGLOG - if (mVersion > 0) - { - const std::string verStr = toString(mVersion); - DEBUGLOG2("Version", 0, verStr.c_str()); - } -#endif // ENABLEDEBUGLOG - - readInt16(str); -} - -uint16_t MessageIn::readId() const -{ - int16_t value = -1; - if (mPos + 2 <= mLength) - { -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - int16_t swap; - memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(int16_t)); - value = SDL_Swap16(swap); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(&value, mData + CAST_SIZE(mPos), sizeof(int16_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - } - return value; -} - -int16_t MessageIn::readInt16(const char *const str) -{ - int16_t value = -1; - if (mPos + 2 <= mLength) - { -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - int16_t swap; - memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(int16_t)); - value = SDL_Swap16(swap); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(&value, mData + CAST_SIZE(mPos), sizeof(int16_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - } - DEBUGLOG2("readInt16: " + toStringPrint(CAST_U32( - CAST_U16(value))), - mPos, str); - mPos += 2; - PacketCounters::incInBytes(2); - return value; -} - -uint16_t MessageIn::readUInt16(const char *const str) -{ - uint16_t value = 0xffU; - if (mPos + 2 <= mLength) - { -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - uint16_t swap; - memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(uint16_t)); - value = SDL_Swap16(swap); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(&value, mData + CAST_SIZE(mPos), sizeof(uint16_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - } - DEBUGLOG2("readUInt16: " + toStringPrint(CAST_U32( - CAST_U16(value))), - mPos, str); - mPos += 2; - PacketCounters::incInBytes(2); - return value; -} - -int32_t MessageIn::readInt32(const char *const str) -{ - int32_t value = -1; - if (mPos + 4 <= mLength) - { -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - int32_t swap; - memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(int32_t)); - value = SDL_Swap32(swap); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(&value, mData + CAST_SIZE(mPos), sizeof(int32_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - } - DEBUGLOG2("readInt32: " + toStringPrint(CAST_U32(value)), - mPos, str); - mPos += 4; - PacketCounters::incInBytes(4); - return value; -} - -BeingId MessageIn::readBeingId(const char *const str) -{ - return fromInt(readInt32(str), BeingId); -} - -int64_t MessageIn::readInt64(const char *const str) -{ - int64_t value = -1; - if (mPos + 8 <= mLength) - { -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - int64_t swap; - memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(int64_t)); - value = SDL_Swap64(swap); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(&value, mData + CAST_SIZE(mPos), sizeof(int64_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - } - DEBUGLOG2("readInt64: " + toStringPrint(CAST_U32(value)), - mPos, str); - mPos += 8; - PacketCounters::incInBytes(8); - return value; -} - -} // namespace EAthena diff --git a/src/net/eathena/messagein.h b/src/net/eathena/messagein.h deleted file mode 100644 index 89fc75d4b..000000000 --- a/src/net/eathena/messagein.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_MESSAGEIN_H -#define NET_EATHENA_MESSAGEIN_H - -#include "net/messagein.h" - -#include "localconsts.h" - -namespace EAthena -{ - -/** - * Used for parsing an incoming message. - * - * \ingroup Network - */ -class MessageIn final : public Net::MessageIn -{ - public: - /** - * Constructor. - */ - MessageIn(const char *const data, - const unsigned int length); - - A_DELETE_COPY(MessageIn) - - void postInit(const char *const str, - const unsigned int version); - - /**< Reads a short. */ - int16_t readInt16(const char *const str) override final; - - uint16_t readUInt16(const char *const str) override final; - - /**< Reads a long. */ - int32_t readInt32(const char *const str) override final; - - int64_t readInt64(const char *const str) override final; - - BeingId readBeingId(const char *const str) override final; - - uint16_t readId() const; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_MESSAGEIN_H diff --git a/src/net/eathena/messageout.cpp b/src/net/eathena/messageout.cpp deleted file mode 100644 index 78a242851..000000000 --- a/src/net/eathena/messageout.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/messageout.h" - -#include "net/packetcounters.h" - -#include "net/eathena/network.h" - -#include "logger.h" - -#include "debug.h" - -#ifndef SDL_BIG_ENDIAN -#error missing SDL_endian.h -#endif // SDL_BYTEORDER - -namespace EAthena -{ - -MessageOut::MessageOut(const int16_t id) : - Net::MessageOut(id), - mNetwork(EAthena::Network::instance()) -{ - mNetwork->fixSendBuffer(); - mData = mNetwork->mOutBuffer + CAST_SIZE(mNetwork->mOutSize); -} - -MessageOut::~MessageOut() -{ - DEBUGLOG2("writeEnd: ", mPos, "position after end of packet"); -} - -void MessageOut::expand(const size_t bytes) const -{ - mNetwork->mOutSize += CAST_U32(bytes); - PacketCounters::incOutBytes(CAST_S32(bytes)); -} - -void MessageOut::writeInt16(const int16_t value, const char *const str) -{ - expand(2); -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - int16_t swap = SDL_Swap16(value); - memcpy(mData + CAST_SIZE(mPos), &swap, sizeof(int16_t)); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(mData + CAST_SIZE(mPos), &value, sizeof(int16_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - - DEBUGLOG2("writeInt16: " + toStringPrint(CAST_U32( - CAST_U16(value))), - mPos, str); - mPos += 2; - PacketCounters::incOutBytes(2); -} - -void MessageOut::writeInt32(const int32_t value, const char *const str) -{ - DEBUGLOG2("writeInt32: " + toStringPrint(CAST_U32(value)), - mPos, str); - expand(4); -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - int32_t swap = SDL_Swap32(value); - memcpy(mData + CAST_SIZE(mPos), &swap, sizeof(int32_t)); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(mData + CAST_SIZE(mPos), &value, sizeof(int32_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - - mPos += 4; - PacketCounters::incOutBytes(4); -} - -void MessageOut::writeInt64(const int64_t value, const char *const str) -{ - DEBUGLOG2("writeInt64: " + toStringPrint(CAST_U32(value)), - mPos, str); - expand(8); -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - int32_t swap = SDL_Swap64(value); - memcpy(mData + CAST_SIZE(mPos), &swap, sizeof(int64_t)); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(mData + CAST_SIZE(mPos), &value, sizeof(int64_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - - mPos += 8; - PacketCounters::incOutBytes(8); -} - -void MessageOut::writeBeingId(const BeingId value, const char *const str) -{ - writeInt32(toInt(value, int32_t), str); -} - -#define LOBYTE(w) (CAST_U8(w)) -#define HIBYTE(w) (CAST_U8(( \ -CAST_U16(w)) >> 8)) - -void MessageOut::writeCoordinates(const uint16_t x, - const uint16_t y, - unsigned char direction, - const char *const str) -{ - DEBUGLOG2(strprintf("writeCoordinates: %u,%u %u", - CAST_U32(x), - CAST_U32(y), - CAST_U32(direction)), mPos, str); - unsigned char *const data = reinterpret_cast<unsigned char*>(mData) - + CAST_SIZE(mPos); - mNetwork->mOutSize += 3; - mPos += 3; - - uint16_t temp = x; - temp <<= 6; - data[0] = 0; - data[1] = 1; - data[2] = 2; - data[0] = HIBYTE(temp); - data[1] = CAST_U8(temp); - temp = y; - temp <<= 4; - data[1] |= HIBYTE(temp); - data[2] = LOBYTE(temp); - direction = toServerDirection(direction); - data[2] |= direction; - PacketCounters::incOutBytes(3); -} - -} // namespace EAthena diff --git a/src/net/eathena/messageout.h b/src/net/eathena/messageout.h deleted file mode 100644 index 38525bad7..000000000 --- a/src/net/eathena/messageout.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_MESSAGEOUT_H -#define NET_EATHENA_MESSAGEOUT_H - -#include "net/messageout.h" - -#include "localconsts.h" - -namespace EAthena -{ - -class Network; - -/** - * Used for building an outgoing message. - * - * \ingroup Network - */ -class MessageOut final : public Net::MessageOut -{ - public: - /** - * Constructor. - */ - explicit MessageOut(const int16_t id); - - A_DELETE_COPY(MessageOut) - - virtual ~MessageOut(); - - /**< Writes a short. */ - void writeInt16(const int16_t value, - const char *const str) override final; - - /**< Writes a long. */ - void writeInt32(const int32_t value, - const char *const str) override final; - - void writeInt64(const int64_t value, - const char *const str); - - void writeBeingId(const BeingId value, - const char *const str) override final; - - /** - * Encodes coordinates and direction in 3 bytes. - */ - void writeCoordinates(const uint16_t x, - const uint16_t y, - unsigned char direction, - const char *const str); - - void resetPos() - { mPos = 0; } - - private: - void expand(const size_t size) const override final; - - Network *mNetwork; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_MESSAGEOUT_H diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp deleted file mode 100644 index 6829c08a6..000000000 --- a/src/net/eathena/network.cpp +++ /dev/null @@ -1,255 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/network.h" - -#include "net/packetinfo.h" - -#include "net/ea/adminrecv.h" -#include "net/ea/beingrecv.h" -#include "net/ea/buysellrecv.h" -#include "net/ea/charserverrecv.h" -#include "net/ea/chatrecv.h" -#include "net/ea/gamerecv.h" -#include "net/ea/inventoryrecv.h" -#include "net/ea/itemrecv.h" -#include "net/ea/loginrecv.h" -#include "net/ea/maprecv.h" -#include "net/ea/npcrecv.h" -#include "net/ea/partyrecv.h" -#include "net/ea/playerrecv.h" -#include "net/ea/skillrecv.h" -#include "net/ea/traderecv.h" - -#include "net/eathena/adminrecv.h" -#include "net/eathena/auctionrecv.h" -#include "net/eathena/bankrecv.h" -#include "net/eathena/battlegroundrecv.h" -#include "net/eathena/beingrecv.h" -#include "net/eathena/buyingstorerecv.h" -#include "net/eathena/buysellrecv.h" -#include "net/eathena/cashshoprecv.h" -#include "net/eathena/charserverrecv.h" -#include "net/eathena/chatrecv.h" -#include "net/eathena/elementalrecv.h" -#include "net/eathena/familyrecv.h" -#include "net/eathena/friendsrecv.h" -#include "net/eathena/gamerecv.h" -#include "net/eathena/generalrecv.h" -#include "net/eathena/guildrecv.h" -#include "net/eathena/homunculusrecv.h" -#include "net/eathena/inventoryrecv.h" -#include "net/eathena/itemrecv.h" -#include "net/eathena/loginrecv.h" -#include "net/eathena/mail2recv.h" -#include "net/eathena/mailrecv.h" -#include "net/eathena/maprecv.h" -#include "net/eathena/marketrecv.h" -#include "net/eathena/mercenaryrecv.h" -#include "net/eathena/npcrecv.h" -#include "net/eathena/partyrecv.h" -#include "net/eathena/petrecv.h" -#include "net/eathena/playerrecv.h" -#include "net/eathena/questrecv.h" -#include "net/eathena/rouletterecv.h" -#include "net/eathena/searchstorerecv.h" -#include "net/eathena/skillrecv.h" -#include "net/eathena/traderecv.h" -#include "net/eathena/vendingrecv.h" - -#include "net/eathena/messagein.h" - -#include "resources/db/networkdb.h" - -#include "utils/cast.h" -#include "utils/checkutils.h" -#include "utils/foreach.h" - -#include "debug.h" - -extern int packetVersion; -extern int serverVersion; -extern int evolPacketOffset; - -namespace EAthena -{ - -static const unsigned int packet_lengths_size = 0xFFFFU; -static const unsigned int messagesSize = 0xFFFFU; -Network *Network::mInstance = nullptr; - -Network::Network() : - Ea::Network() -{ - mInstance = this; - mPackets = new PacketInfo[messagesSize]; -} - -Network::~Network() -{ - clearHandlers(); - mInstance = nullptr; -} - -void Network::registerHandlers() -{ -#include "net/eathena/recvpackets.inc" - RECVPACKETS_VOID -} - -void Network::registerFakeHandlers() -{ - const NetworkInPacketInfos &packets = NetworkDb::getFakePackets(); - FOR_EACH (NetworkInPacketInfosIter, it, packets) - { - const size_t id = (*it).first; - if (id >= packet_lengths_size) - { - reportAlways("Wrong fake packet id %d", CAST_S32(id)); - continue; - } - if (mPackets[id].len != 0 || - mPackets[id].func != nullptr || - mPackets[id].version != 0) - { - continue; - } - const int32_t len = (*it).second; - logger->log("Add fake packet: %d, %d", - CAST_S32(id), - len); - mPackets[id].name = "fake"; - mPackets[id].len = len; - mPackets[id].func = nullptr; - mPackets[id].version = 0; - } - - const NetworkRemovePacketInfos &removePackets = - NetworkDb::getRemovePackets(); - FOR_EACH (NetworkRemovePacketInfosIter, it, removePackets) - { - const size_t id = *it; - if (id >= packet_lengths_size) - { - reportAlways("Wrong remove packet id %d", CAST_S32(id)); - continue; - } - if (mPackets[id].len == 0 && - mPackets[id].func == nullptr && - mPackets[id].version == 0) - { - continue; - } - logger->log("Remove packet: %d", - CAST_S32(id)); - mPackets[id].name = ""; - mPackets[id].len = 0; - mPackets[id].func = nullptr; - mPackets[id].version = 0; - } -} - -void Network::clearHandlers() -{ - for (size_t f = 0; f < packet_lengths_size; f ++) - { - mPackets[f].name = ""; - mPackets[f].len = 0; - mPackets[f].func = nullptr; - mPackets[f].version = 0; - } -} - -void Network::dispatchMessages() -{ - mPauseDispatch = false; - while (messageReady()) - { - SDL_mutexP(mMutexIn); - const unsigned int msgId = readWord(0); - int len = -1; - if (msgId < packet_lengths_size) - len = mPackets[msgId].len; - if (len == -1) - len = readWord(2); - - MessageIn msg(mInBuffer, len); - unsigned int ver = mPackets[msgId].version; - if (ver == 0) - ver = packetVersion; - msg.postInit(mPackets[msgId].name, ver); - SDL_mutexV(mMutexIn); - - if (len == 0) - { - // need copy data for safty - std::string str = strprintf( - "Wrong packet %u 0x%x received. Exiting.", - msgId, msgId); - logger->safeError(str); - } - - if (msgId < messagesSize) - { - const PacketFuncPtr func = mPackets[msgId].func; - if (func != nullptr) - func(msg); - else - logger->log("Unhandled packet: %u 0x%x", msgId, msgId); - } - - skip(len); - if (mPauseDispatch) - break; - } -} - -bool Network::messageReady() -{ - int len = -1; - - SDL_mutexP(mMutexIn); - if (mInSize >= 2) - { - const int msgId = readWord(0); - if (msgId >= 0 && - CAST_U32(msgId) < packet_lengths_size) - { - len = mPackets[msgId].len; - } - - if (len == -1 && mInSize > 4) - len = readWord(2); - } - - const bool ret = (mInSize >= CAST_U32(len)); - SDL_mutexV(mMutexIn); - - return ret; -} - -Network *Network::instance() -{ - return mInstance; -} - -} // namespace EAthena diff --git a/src/net/eathena/network.h b/src/net/eathena/network.h deleted file mode 100644 index acd377be3..000000000 --- a/src/net/eathena/network.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_NETWORK_H -#define NET_EATHENA_NETWORK_H - -#include "net/ea/network.h" - -/** - * Protocol version, reported to the eAthena char and mapserver who can adjust - * the protocol accordingly. - */ -#define CLIENT_PROTOCOL_VERSION 23 - -namespace EAthena -{ - -class Network final : public Ea::Network -{ - public: - Network(); - - A_DELETE_COPY(Network) - - ~Network(); - - void clearHandlers(); - - bool messageReady(); - - void dispatchMessages(); - - void registerHandlers(); - - void registerFakeHandlers(); - - static Network *mInstance; - - protected: - friend class MessageOut; - - static Network *instance() A_WARN_UNUSED; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_NETWORK_H diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp deleted file mode 100644 index 50d076ec4..000000000 --- a/src/net/eathena/npchandler.cpp +++ /dev/null @@ -1,365 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/npchandler.h" - -#include "being/localplayer.h" - -#include "const/net/inventory.h" - -#include "gui/windows/npcdialog.h" - -#include "gui/widgets/createwidget.h" - -#include "net/messagein.h" - -#include "net/ea/npcrecv.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/npcrecv.h" - -#include "net/eathena/protocolout.h" - -#include "utils/foreach.h" - -#include "resources/item/shopitem.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -NpcHandler::NpcHandler() : - Ea::NpcHandler() -{ - npcHandler = this; -} - -NpcHandler::~NpcHandler() -{ - npcHandler = nullptr; -} - -void NpcHandler::talk(const Being *const being) const -{ - if (being == nullptr) - return; - createOutPacket(CMSG_NPC_TALK); - outMsg.writeBeingId(being->getId(), "npc id"); - outMsg.writeInt8(0, "unused"); - EAthena::NpcRecv::mNpcTypeId = being->getSubType(); -} - -void NpcHandler::nextDialog(const BeingId npcId) const -{ - createOutPacket(CMSG_NPC_NEXT_REQUEST); - outMsg.writeBeingId(npcId, "npc id"); -} - -void NpcHandler::closeDialog(const BeingId npcId) -{ - createOutPacket(CMSG_NPC_CLOSE); - outMsg.writeBeingId(npcId, "npc id"); - - const NpcDialogs::iterator it = NpcDialog::mNpcDialogs.find(npcId); - if (it != NpcDialog::mNpcDialogs.end()) - { - NpcDialog *const dialog = (*it).second; - if (dialog != nullptr) - dialog->close(); - if (dialog == Ea::NpcRecv::mDialog) - Ea::NpcRecv::mDialog = nullptr; - NpcDialog::mNpcDialogs.erase(it); - } -} - -void NpcHandler::listInput(const BeingId npcId, - const unsigned char value) const -{ - createOutPacket(CMSG_NPC_LIST_CHOICE); - outMsg.writeBeingId(npcId, "npc id"); - outMsg.writeInt8(value, "value"); -} - -void NpcHandler::integerInput(const BeingId npcId, - const int value) const -{ - createOutPacket(CMSG_NPC_INT_RESPONSE); - outMsg.writeBeingId(npcId, "npc id"); - outMsg.writeInt32(value, "value"); -} - -void NpcHandler::stringInput(const BeingId npcId, - const std::string &value) const -{ - createOutPacket(CMSG_NPC_STR_RESPONSE); - if (packetVersion >= 20151029) - { - outMsg.writeInt16(CAST_S16(value.length() + 8), "len"); - outMsg.writeBeingId(npcId, "npc id"); - outMsg.writeString(value, CAST_S32(value.length()), "value"); - } - else - { - outMsg.writeInt16(CAST_S16(value.length() + 9), "len"); - outMsg.writeBeingId(npcId, "npc id"); - outMsg.writeString(value, CAST_S32(value.length()), "value"); - outMsg.writeInt8(0, "null byte"); - } -} - -void NpcHandler::buy(const Being *const being) const -{ - if (being == nullptr) - return; - createOutPacket(CMSG_NPC_BUY_SELL_REQUEST); - outMsg.writeBeingId(being->getId(), "npc id"); - outMsg.writeInt8(0, "action"); - EAthena::NpcRecv::mNpcTypeId = being->getSubType(); -} - -void NpcHandler::buy(const BeingId beingId) const -{ - createOutPacket(CMSG_NPC_BUY_SELL_REQUEST); - outMsg.writeBeingId(beingId, "npc id"); - outMsg.writeInt8(0, "action"); - EAthena::NpcRecv::mNpcTypeId = BeingTypeId_zero; -} - -void NpcHandler::sell(const BeingId beingId) const -{ - createOutPacket(CMSG_NPC_BUY_SELL_REQUEST); - outMsg.writeBeingId(beingId, "npc id"); - outMsg.writeInt8(1, "action"); -} - -void NpcHandler::buyItem(const BeingId beingId A_UNUSED, - const int itemId, - const ItemColor color A_UNUSED, - const int amount) const -{ - createOutPacket(CMSG_NPC_BUY_REQUEST); - outMsg.writeInt16(8, "len"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - outMsg.writeInt16(CAST_S16(itemId), "item id"); -} - -void NpcHandler::buyItems(STD_VECTOR<ShopItem*> &items) const -{ - int cnt = 0; - const int pairSize = 4; - - FOR_EACH (STD_VECTOR<ShopItem*>::iterator, it, items) - { - ShopItem *const item = *it; - const int usedQuantity = item->getUsedQuantity(); - const ItemTypeT type = item->getType(); - if (usedQuantity == 0) - continue; - if (type == ItemType::Weapon || - type == ItemType::Armor || - type == ItemType::PetEgg || - type == ItemType::PetArmor) - { - cnt += item->getUsedQuantity(); - } - else - { - cnt ++; - } - } - - if (cnt > 100) - return; - - createOutPacket(CMSG_NPC_BUY_REQUEST); - outMsg.writeInt16(CAST_S16(4 + pairSize * cnt), "len"); - FOR_EACH (STD_VECTOR<ShopItem*>::iterator, it, items) - { - ShopItem *const item = *it; - const int usedQuantity = item->getUsedQuantity(); - if (usedQuantity == 0) - continue; - item->increaseUsedQuantity(-usedQuantity); - item->update(); - const ItemTypeT type = item->getType(); - if (type == ItemType::Weapon || - type == ItemType::Armor || - type == ItemType::PetEgg || - type == ItemType::PetArmor) - { - for (int f = 0; f < usedQuantity; f ++) - { - outMsg.writeInt16(CAST_S16(1), "amount"); - outMsg.writeInt16(CAST_S16(item->getId()), - "item id"); - } - } - else - { - outMsg.writeInt16(CAST_S16(usedQuantity), "amount"); - outMsg.writeInt16(CAST_S16(item->getId()), "item id"); - } - } -} - -void NpcHandler::sellItem(const BeingId beingId A_UNUSED, - const int itemId, const int amount) const -{ - createOutPacket(CMSG_NPC_SELL_REQUEST); - outMsg.writeInt16(8, "len"); - outMsg.writeInt16(CAST_S16(itemId + INVENTORY_OFFSET), - "item index"); - outMsg.writeInt16(CAST_S16(amount), "amount"); -} - -void NpcHandler::sellItems(STD_VECTOR<ShopItem*> &items) const -{ - const int pairSize = 4; - int cnt = 0; - - FOR_EACH (STD_VECTOR<ShopItem*>::iterator, it, items) - { - ShopItem *const item = *it; - const int usedQuantity = item->getUsedQuantity(); - if (usedQuantity == 0) - continue; - cnt ++; - } - - createOutPacket(CMSG_NPC_SELL_REQUEST); - outMsg.writeInt16(CAST_S16(4 + pairSize * cnt), "len"); - FOR_EACH (STD_VECTOR<ShopItem*>::iterator, it, items) - { - ShopItem *const item = *it; - const int usedQuantity = item->getUsedQuantity(); - if (usedQuantity == 0) - continue; - item->increaseUsedQuantity(-usedQuantity); - item->update(); - outMsg.writeInt16(CAST_S16( - item->getCurrentInvIndex() + INVENTORY_OFFSET), - "item index"); - outMsg.writeInt16(CAST_S16(usedQuantity), "amount"); - } -} - -void NpcHandler::completeProgressBar() const -{ - createOutPacket(CMSG_NPC_COMPLETE_PROGRESS_BAR); -} - -void NpcHandler::produceMix(const int nameId, - const int materialId1, - const int materialId2, - const int materialId3) const -{ - createOutPacket(CMSG_NPC_PRODUCE_MIX); - outMsg.writeInt16(CAST_S16(nameId), "name id"); - outMsg.writeInt16(CAST_S16(materialId1), "material 1"); - outMsg.writeInt16(CAST_S16(materialId2), "material 2"); - outMsg.writeInt16(CAST_S16(materialId3), "material 3"); -} - -void NpcHandler::cooking(const CookingTypeT type, - const int nameId) const -{ - createOutPacket(CMSG_NPC_COOKING); - outMsg.writeInt16(CAST_S16(type), "type"); - outMsg.writeInt16(CAST_S16(nameId), "name id"); -} - -void NpcHandler::repair(const int index) const -{ - createOutPacket(CMSG_NPC_REPAIR); - outMsg.writeInt16(CAST_S16(index), "index"); -} - -void NpcHandler::refine(const int index) const -{ - createOutPacket(CMSG_NPC_REFINE); - outMsg.writeInt32(index, "index"); -} - -void NpcHandler::identify(const int index) const -{ - createOutPacket(CMSG_NPC_IDENTIFY); - outMsg.writeInt16(CAST_S16(index), "index"); -} - -void NpcHandler::selectArrow(const int nameId) const -{ - createOutPacket(CMSG_NPC_SELECT_ARROW); - outMsg.writeInt16(CAST_S16(nameId), "name id"); -} - -void NpcHandler::selectAutoSpell(const int skillId) const -{ - createOutPacket(CMSG_NPC_SELECT_AUTO_SPELL); - outMsg.writeInt32(CAST_S16(skillId), "skill id"); -} - -BeingId NpcHandler::getNpc(Net::MessageIn &msg, - const NpcActionT action) -{ - const BeingId npcId = msg.readBeingId("npc id"); - - const NpcDialogs::const_iterator diag = NpcDialog::mNpcDialogs.find(npcId); - Ea::NpcRecv::mDialog = nullptr; - - if (diag == NpcDialog::mNpcDialogs.end()) - { - // Empty dialogs don't help - if (action == NpcAction::Close) - { - closeDialog(npcId); - return npcId; - } - else if (action == NpcAction::Next) - { - nextDialog(npcId); - return npcId; - } - else - { - CREATEWIDGETV(Ea::NpcRecv::mDialog, NpcDialog, npcId); - Ea::NpcRecv::mDialog->saveCamera(); - if (localPlayer != nullptr) - localPlayer->stopWalking(false); - NpcDialog::mNpcDialogs[npcId] = Ea::NpcRecv::mDialog; - } - } - else - { - NpcDialog *const dialog = diag->second; - if (Ea::NpcRecv::mDialog != nullptr && Ea::NpcRecv::mDialog != dialog) - Ea::NpcRecv::mDialog->restoreCamera(); - Ea::NpcRecv::mDialog = dialog; - if (Ea::NpcRecv::mDialog != nullptr) - Ea::NpcRecv::mDialog->saveCamera(); - } - return npcId; -} - -} // namespace EAthena diff --git a/src/net/eathena/npchandler.h b/src/net/eathena/npchandler.h deleted file mode 100644 index e5177d7c9..000000000 --- a/src/net/eathena/npchandler.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_NPCHANDLER_H -#define NET_EATHENA_NPCHANDLER_H - -#include "net/ea/npchandler.h" - -namespace EAthena -{ - -class NpcHandler final : public Ea::NpcHandler -{ - public: - NpcHandler(); - - A_DELETE_COPY(NpcHandler) - - ~NpcHandler(); - - void talk(const Being *const being) const override final; - - void nextDialog(const BeingId npcId) const override final; - - void closeDialog(const BeingId npcId) override final; - - void listInput(const BeingId npcId, - const unsigned char value) const override final; - - void integerInput(const BeingId npcId, - const int value) const override final; - - void stringInput(const BeingId npcId, - const std::string &value) const override final; - - void buy(const Being *const being) const override final; - - void buy(const BeingId beingId) const override final; - - void sell(const BeingId beingId) const override final; - - void buyItem(const BeingId beingId, - const int itemId, - const ItemColor color, - const int amount) const override final; - - void buyItems(STD_VECTOR<ShopItem*> &items) const - override final; - - void sellItem(const BeingId beingId, - const int itemId, - const int amount) const override final; - - void sellItems(STD_VECTOR<ShopItem*> &items) const override final; - - void completeProgressBar() const override final; - - void produceMix(const int nameId, - const int materialId1, - const int materialId2, - const int materialId3) const override final; - - void cooking(const CookingTypeT type, - const int nameId) const override final; - - void repair(const int index) const override final; - - void refine(const int index) const override final; - - BeingId getNpc(Net::MessageIn &msg, - const NpcActionT action) override final; - - void identify(const int index) const override final; - - void selectArrow(const int nameId) const override final; - - void selectAutoSpell(const int skillId) const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_NPCHANDLER_H diff --git a/src/net/eathena/npcrecv.cpp b/src/net/eathena/npcrecv.cpp deleted file mode 100644 index 535e57d7c..000000000 --- a/src/net/eathena/npcrecv.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/npcrecv.h" - -#include "actormanager.h" - -#include "being/being.h" - -#include "gui/windows/cutinwindow.h" -#include "gui/windows/npcdialog.h" - -#include "net/messagein.h" -#include "net/npchandler.h" - -#include "net/ea/npcrecv.h" - -#include "debug.h" - -namespace EAthena -{ - -namespace NpcRecv -{ - BeingTypeId mNpcTypeId = BeingTypeId_zero; -} // namespace NpcRecv - -void NpcRecv::processNpcCutin(Net::MessageIn &msg) -{ - Ea::NpcRecv::mRequestLang = false; - if (cutInWindow == nullptr) - { - msg.readString(64, "image name"); - msg.readUInt8("type"); - return; - } - const std::string image = msg.readString(64, "image name"); - const CutInT cutin = static_cast<CutInT>(msg.readUInt8("type")); - if (cutInWindow != nullptr) - cutInWindow->show(image, cutin); -} - -void NpcRecv::processNpcViewPoint(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - Ea::NpcRecv::mRequestLang = false; - // +++ probably need add nav point and start moving to it - msg.readInt32("npc id"); - msg.readInt32("type"); // 0 display for 15 sec, - // 1 display until teleport, - // 2 remove - msg.readInt32("x"); - msg.readInt32("y"); - msg.readUInt8("number"); // can be used for scripts - msg.readInt32("color"); -} - -void NpcRecv::processNpcShowProgressBar(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - Ea::NpcRecv::mRequestLang = false; - // +++ probably need show progress bar in npc dialog - msg.readInt32("color"); - msg.readInt32("seconds"); -} - -void NpcRecv::processNpcCloseTimeout(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - Ea::NpcRecv::mRequestLang = false; - // this packet send after npc closed by timeout. - msg.readInt32("npc id"); -} - -void NpcRecv::processArea(Net::MessageIn &msg) -{ - const int len = msg.readInt16("len"); - if (len < 12) - return; - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("npc id")); - const int area = msg.readInt32("area size"); - if (dstBeing != nullptr) - dstBeing->setAreaSize(area); -} - -void NpcRecv::processShowDigit(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readUInt8("type"); - msg.readInt32("value"); -} - -void NpcRecv::processProgressBarAbort(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; -} - -void NpcRecv::processNpcSkin(Net::MessageIn &msg) -{ - const int len = msg.readInt16("len"); - npcHandler->getNpc(msg, NpcAction::Other); - if (Ea::NpcRecv::mDialog != nullptr) - { - const std::string skin = msg.readString(len - 8, "skin"); - Ea::NpcRecv::mDialog->setSkin(skin); - } - else - { - msg.readString(len - 8, "skin"); - } -} - -} // namespace EAthena diff --git a/src/net/eathena/npcrecv.h b/src/net/eathena/npcrecv.h deleted file mode 100644 index c89d5f2f0..000000000 --- a/src/net/eathena/npcrecv.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_NPCRECV_H -#define NET_EATHENA_NPCRECV_H - -#include "enums/simpletypes/beingtypeid.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace NpcRecv - { - extern BeingTypeId mNpcTypeId; - - void processNpcCutin(Net::MessageIn &msg); - void processNpcViewPoint(Net::MessageIn &msg); - void processNpcShowProgressBar(Net::MessageIn &msg); - void processNpcCloseTimeout(Net::MessageIn &msg); - void processArea(Net::MessageIn &msg); - void processShowDigit(Net::MessageIn &msg); - void processProgressBarAbort(Net::MessageIn &msg); - void processNpcSkin(Net::MessageIn &msg); - } // namespace NpcRecv -} // namespace EAthena - -#endif // NET_EATHENA_NPCRECV_H diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc deleted file mode 100644 index af497c07c..000000000 --- a/src/net/eathena/packetsin.inc +++ /dev/null @@ -1,972 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -// very outdated packets -packet(SMSG_MAP_LOGIN_SUCCESS, 0x0073, 11, &GameRecv::processMapLogin, 1); -packet(SMSG_BEING_FAKE_NAME, 0x0078, 54, &BeingRecv::processBeingFakeName, 1); -packet(SMSG_BEING_SPAWN, 0x0079, 53, &BeingRecv::processBeingSpawn, 1); -packet(SMSG_BEING_MOVE, 0x007b, 60, &BeingRecv::processBeingMove, 1); -packet(SMSG_BEING_SPAWN_OUTDATED, 0x007c, 41, nullptr, 1); -packet(SMSG_WHISPER, 0x0097, -1, &ChatRecv::processWhisper, 1); -packet(SMSG_WHISPER_RESPONSE, 0x0098, 3, &ChatRecv::processWhisperResponse, 1); -packet(SMSG_ITEM_DROPPED, 0x009e, 17, &ItemRecv::processItemDropped, 1); -packet(SMSG_PLAYER_INVENTORY_ADD, 0x00a0, 23, &InventoryRecv::processPlayerInventoryAdd, 1); -packet(SMSG_PLAYER_INVENTORY, 0x00a3, -1, &InventoryRecv::processPlayerInventory, 1); -packet(SMSG_PLAYER_EQUIPMENT, 0x00a4, -1, &InventoryRecv::processPlayerEquipment, 1); -packet(SMSG_PLAYER_STORAGE_ITEMS, 0x00a5, -1, &InventoryRecv::processPlayerStorage, 1); -packet(SMSG_PLAYER_STORAGE_EQUIP, 0x00a6, -1, &InventoryRecv::processPlayerStorageEquip, 1); -packet(SMSG_PLAYER_EQUIP, 0x00aa, 7, &InventoryRecv::processPlayerEquip, 1); -packet(SMSG_PLAYER_UNEQUIP, 0x00ac, 7, &InventoryRecv::processPlayerUnEquip, 1); -packet(SMSG_BEING_CHANGE_LOOKS_OUTDATED, 0x00c3, 8, nullptr, 1); -packet(SMSG_TRADE_REQUEST, 0x00e5, 26, &TradeRecv::processTradeRequest, 1); -packet(SMSG_TRADE_ITEM_ADD, 0x00e9, 19, &TradeRecv::processTradeItemAdd, 1); -packet(SMSG_TRADE_RESPONSE_OUTDATED, 0x00e7, 3, nullptr, 0); -packet(SMSG_PLAYER_STORAGE_ADD, 0x00f4, 21, &InventoryRecv::processPlayerStorageAdd, 1); -packet(SMSG_PARTY_INVITED, 0x00fe, 30, &PartyRecv::processPartyInvited, 1); -packet(SMSG_PLAYER_STATUS_CHANGE, 0x0119, 13, &BeingRecv::processPlayerStatusChange, 1); -packet(SMSG_SKILL_DAMAGE, 0x0114, 31, &BeingRecv::processSkillDamage, 1); -packet(SMSG_SKILL_ENTRY, 0x011f, 16, &BeingRecv::processSkillEntry, 1); -packet(SMSG_PLAYER_CART_EQUIP, 0x0122, -1, &InventoryRecv::processPlayerCartEquip, 1); -packet(SMSG_PLAYER_CART_ITEMS, 0x0123, -1, &InventoryRecv::processPlayerCartItems, 1); -packet(SMSG_PLAYER_CART_ADD, 0x0124, 21, &InventoryRecv::processPlayerCartAdd, 1); -packet(SMSG_VENDING_ITEMS_LIST, 0x0133, -1, &VendingRecv::processItemsList, 1); -packet(SMSG_VENDING_OPEN, 0x0136, -1, &VendingRecv::processOpen, 1); -packet(SMSG_SKILL_CASTING, 0x013e, 24, &BeingRecv::processSkillCasting, 1); -packet(SMSG_BEING_STATUS_CHANGE, 0x0196, 9, &BeingRecv::processBeingStatusChange, 1); -packet(SMSG_QUEST_LIST, 0x02b1, -1, &QuestRecv::processAddQuests, 1); -packet(SMSG_BEING_VIEW_EQUIPMENT, 0x02d7, -1, &BeingRecv::processBeingViewEquipment, 1); -packet(SMSG_PARTY_SETTINGS, 0x0101, 6, &PartyRecv::processPartySettings, 1); -packet(SMSG_PLAYER_HP, 0x0106, 10, &BeingRecv::processBeingHp, 1); -packet(SMSG_PET_STATUS, 0x01a2, 35, &PetRecv::processPetStatus, 1); - -// fake packets for add packet name -packet(SMSG_SELECT_CART, 0x0000, 0, nullptr, 0); -packet(CMSG_NAVIGATE_TO, 0x0000, 0, nullptr, 0); -packet(SMSG_MERGE_ITEM, 0x0000, 0, nullptr, 0); -packet(SMSG_ACK_MERGE_ITEMS, 0x0000, 0, nullptr, 0); -packet(SMSG_RANKS_LIST, 0x0000, 0, nullptr, 0); -packet(SMSG_CHAR_CHARACTERS, 0x0000, 0, nullptr, 0); - -// login server, unknown version -packet(SMSG_LOGIN_DATA, 0x0069, -1, &LoginRecv::processLoginData, 0); -packet(SMSG_LOGIN_CODING_KEY, 0x01dc, -1, &LoginRecv::processCondingKey, 0); -packet(SMSG_LOGIN_ERROR, 0x006a, 23, &Ea::LoginRecv::processLoginError, 0); - -// char server, unknown version -packet(SMSG_CHAR_CHANGE_SLOT, 0x08d5, -1, &CharServerRecv::processCharChangeSlot, 0); -packet(SMSG_CHAR_CHECK_RENAME, 0x028e, 4, &CharServerRecv::processCharCheckRename, 0); -packet(SMSG_CHAR_CREATE_FAILED, 0x006e, 3, &Ea::CharServerRecv::processCharCreateFailed, 0); -packet(SMSG_CHAR_CREATE_SUCCEEDED, 0x006d, 149, &CharServerRecv::processCharCreate, 0); -packet(SMSG_CHAR_DELETE2_ACCEPT_ACTUAL_ACK, 0x082a, 10, &CharServerRecv::processCharDelete2AcceptActual, 0); -packet(SMSG_CHAR_DELETE2_ACK, 0x0828, 14, &CharServerRecv::processCharDelete2Ack, 0); -packet(SMSG_CHAR_DELETE2_CANCEL_ACK, 0x082c, 10, &CharServerRecv::processCharDelete2CancelAck, 0); -packet(SMSG_CHAR_DELETE_FAILED, 0x0070, 3, &CharServerRecv::processCharDeleteFailed, 0); -packet(SMSG_CHAR_DELETE_SUCCEEDED, 0x006f, 2, &Ea::CharServerRecv::processCharDelete, 0); -packet(SMSG_CHAR_LOGIN, 0x006b, -1, &CharServerRecv::processCharLogin, 0); -packet(SMSG_CHAR_LOGIN2, 0x082d, -1, &CharServerRecv::processCharLogin2, 0); -packet(SMSG_CHAR_LOGIN_ERROR, 0x006c, 3, &Ea::CharServerRecv::processCharLoginError, 0); -packet(SMSG_CHAR_MAP_INFO, 0x0071, 28, &CharServerRecv::processCharMapInfo, 0); -packet(SMSG_CHAR_PINCODE_STATUS, 0x08b9, 12, &CharServerRecv::processPincodeStatus, 0); -packet(SMSG_CHAR_RENAME, 0x0290, 4, &CharServerRecv::processCharRename, 0); -packet(SMSG_MAP_NOT_FOUND, 0x0840, -1, &GeneralRecv::processMapNotFound, 0); - -// map server, unknown versions -packet(SMSG_ADMIN_GET_LOGIN_ACK, 0x01e0, 30, &AdminRecv::processAdminGetLoginAck, 0); -packet(SMSG_ADMIN_KICK_ACK, 0x00cd, 3, &Ea::AdminRecv::processKickAck, 0); -packet(SMSG_ADMIN_SET_TILE_TYPE, 0x0192, 24, &AdminRecv::processSetTileType, 0); -packet(SMSG_BATTLE_BEGINS, 0x08df, 50, &BattleGroundRecv::processBattleBegins, 0); -packet(SMSG_BATTLE_JOINED, 0x08d9, 30, &BattleGroundRecv::processBattleJoined, 0); -packet(SMSG_BATTLE_NOTICE_DELETE, 0x08db, 27, &BattleGroundRecv::processBattleNoticeDelete, 0); -packet(SMSG_BATTLE_QUEUE_ACK, 0x08d8, 27, &BattleGroundRecv::processBattleQueueAck, 0); -packet(SMSG_BEING_ACTION, 0x008a, 29, &Ea::BeingRecv::processBeingAction, 0); -packet(SMSG_BEING_CHANGE_DIRECTION, 0x009c, 9, &BeingRecv::processBeingChangeDirection, 0); -packet(SMSG_BEING_CHAT, 0x008d, -1, &ChatRecv::processBeingChat, 0); -packet(SMSG_BEING_EMOTION, 0x00c0, 7, &Ea::BeingRecv::processBeingEmotion, 0); -packet(SMSG_BEING_MOVE2, 0x0086, 16, &BeingRecv::processBeingMove2, 0); -packet(SMSG_BEING_NAME_RESPONSE, 0x0095, 30, &Ea::BeingRecv::processNameResponse, 0); -packet(SMSG_BEING_REMOVE, 0x0080, 7, &Ea::BeingRecv::processBeingRemove, 0); -packet(SMSG_BEING_REMOVE_SKILL, 0x0120, 6, &BeingRecv::processBeingRemoveSkill, 0); -packet(SMSG_BEING_RESURRECT, 0x0148, 8, &BeingRecv::processBeingResurrect, 0); -packet(SMSG_BEING_SELFEFFECT, 0x019b, 10, &BeingRecv::processBeingSelfEffect, 0); -packet(SMSG_BEING_SLIDE, 0x01ff, 10, &BeingRecv::processBeingSlide, 0); -packet(SMSG_BEING_SOUND_EFFECT, 0x01d3, 35, &BeingRecv::processBeingSoundEffect, 0); -packet(SMSG_BEING_SPECIAL_EFFECT, 0x01f3, 10, &BeingRecv::processBeingSpecialEffect, 0); -packet(SMSG_BEING_STAT_UPDATE_1, 0x01ab, 12, &BeingRecv::processBeingStatUpdate1, 0); -packet(SMSG_BIND_ITEM, 0x02d3, 4, &InventoryRecv::processBindItem, 0); -packet(SMSG_BLADE_STOP, 0x01d1, 14, &BeingRecv::processBladeStop, 0); -packet(SMSG_CART_INFO, 0x0121, 14, &InventoryRecv::processCartInfo, 0); -packet(SMSG_CART_REMOVE, 0x012b, 2, &InventoryRecv::processCartRemove, 0); -packet(SMSG_CHANGE_MAP_SERVER, 0x0092, 28, &CharServerRecv::processChangeMapServer, 0); -packet(SMSG_CHAR_BAN_CHAR_LIST, 0x020d, -1, &CharServerRecv::processCharBanCharList, 0); -packet(SMSG_CHAR_SWITCH_RESPONSE, 0x00b3, 3, &Ea::GameRecv::processCharSwitchResponse, 0); -packet(SMSG_CHAT_DISPLAY, 0x00d7, -1, &ChatRecv::processChatDisplay, 0); -packet(SMSG_CHAT_IGNORE_LIST, 0x00d4, -1, &ChatRecv::processChatIgnoreList, 0); -packet(SMSG_CHAT_ROOM_ADD_MEMBER, 0x00dc, 28, &ChatRecv::processChatRoomAddMember, 0); -packet(SMSG_CHAT_ROOM_CREATE_ACK, 0x00d6, 3, &ChatRecv::processChatRoomCreateAck, 0); -packet(SMSG_CHAT_ROOM_DESTROY, 0x00d8, 6, &ChatRecv::processChatRoomDestroy, 0); -packet(SMSG_CHAT_ROOM_JOIN_ACK, 0x00db, -1, &ChatRecv::processChatRoomJoinAck, 0); -packet(SMSG_CHAT_ROOM_JOIN_FAILED, 0x00da, 3, &ChatRecv::processChatRoomJoinFailed, 0); -packet(SMSG_CHAT_ROOM_LEAVE, 0x00dd, 29, &ChatRecv::processChatRoomLeave, 0); -packet(SMSG_CHAT_ROOM_ROLE_CHANGE, 0x00e1, 30, &ChatRecv::processChatRoomRoleChange, 0); -packet(SMSG_CHAT_ROOM_SETTINGS, 0x00df, -1, &ChatRecv::processChatRoomSettings, 0); -packet(SMSG_CHAT_SILENCE, 0x014b, 27, &ChatRecv::processChatSilence, 0); -packet(SMSG_CHAT_TALKIE_BOX, 0x0191, 86, &ChatRecv::processChatTalkieBox, 0); -packet(SMSG_CLASS_CHANGE, 0x01b0, 11, &BeingRecv::processClassChange, 0); -packet(SMSG_COMBO_DELAY, 0x01d2, 10, &BeingRecv::processComboDelay, 0); -packet(SMSG_CONNECTION_PROBLEM, 0x0081, 3, &GeneralRecv::processConnectionProblem, 0); -packet(SMSG_FAMILY_ASK_FOR_CHILD, 0x01f6, 34, &FamilyRecv::processAskForChild, 0); -packet(SMSG_FAMILY_CALL_PARTNER, 0x01e6, 26, &FamilyRecv::processCallPartner, 0); -packet(SMSG_FAMILY_DIVORCED, 0x0205, 26, &FamilyRecv::processDivorced, 0); -packet(SMSG_FRIENDS_DELETE_PLAYER, 0x020a, 10, &FriendsRecv::processDeletePlayer, 0); -packet(SMSG_FRIENDS_LIST, 0x0201, -1, &FriendsRecv::processFriendsList, 0); -packet(SMSG_FRIENDS_PLAYER_ONLINE, 0x0206, 11, &FriendsRecv::processPlayerOnline, 0); -packet(SMSG_FRIENDS_REQUEST, 0x0207, 34, &FriendsRecv::processRequest, 0); -packet(SMSG_FRIENDS_REQUEST_ACK, 0x0209, 36, &FriendsRecv::processRequestAck, 0); -packet(SMSG_GM_CHAT, 0x009a, -1, &ChatRecv::processGmChat, 0); -packet(SMSG_GM_CHAT2, 0x01c3, -1, &ChatRecv::processGmChat2, 0); -packet(SMSG_GRAFFITI_VISIBLE, 0x01c9, 97, &BeingRecv::processGraffiti, 0); -packet(SMSG_GUILD_ALIANCE_INFO, 0x014c, -1, &GuildRecv::processGuildAlianceInfo, 0); -packet(SMSG_GUILD_ALLIANCE_ADDED_DISABLED, 0x0185, 34, nullptr, 0); -packet(SMSG_GUILD_BASIC_INFO, 0x01b6, 114, &GuildRecv::processGuildBasicInfo, 0); -packet(SMSG_GUILD_BROKEN, 0x015e, 6, &GuildRecv::processGuildBroken, 0); -packet(SMSG_GUILD_CREATE_RESPONSE, 0x0167, 3, &GuildRecv::processGuildCreateResponse, 0); -packet(SMSG_GUILD_DEL_ALLIANCE, 0x0184, 10, &GuildRecv::processGuildDelAlliance, 0); -packet(SMSG_GUILD_EMBLEM, 0x01b4, 12, &GuildRecv::processGuildEmblem, 0); -packet(SMSG_GUILD_EMBLEM_DATA, 0x0152, -1, &GuildRecv::processGuildEmblemData, 0); -packet(SMSG_GUILD_EXPULSION_LIST, 0x0163, -1, &GuildRecv::processGuildExpulsionList, 0); -packet(SMSG_GUILD_INVITE, 0x016a, 30, &GuildRecv::processGuildInvite, 0); -packet(SMSG_GUILD_INVITE_ACK, 0x0169, 3, &GuildRecv::processGuildInviteAck, 0); -packet(SMSG_GUILD_LEAVE, 0x015a, 66, &GuildRecv::processGuildLeave, 0); -packet(SMSG_GUILD_MASTER_OR_MEMBER, 0x014e, 6, &GuildRecv::processGuildMasterOrMember, 0); -packet(SMSG_GUILD_MEMBER_LIST, 0x0154, -1, &GuildRecv::processGuildMemberList, 0); -packet(SMSG_GUILD_MEMBER_LOGIN, 0x01f2, 20, &GuildRecv::processGuildMemberLogin, 0); -packet(SMSG_GUILD_MEMBER_POS_CHANGE, 0x0156, -1, &GuildRecv::processGuildMemberPosChange, 0); -packet(SMSG_GUILD_MESSAGE, 0x017f, -1, &GuildRecv::processGuildMessage, 0); -packet(SMSG_GUILD_NOTICE, 0x016f, 182, &GuildRecv::processGuildNotice, 0); -packet(SMSG_GUILD_OPPOSITION_ACK, 0x0181, 3, &GuildRecv::processGuildOppositionAck, 0); -packet(SMSG_GUILD_POSITION_CHANGED, 0x0174, -1, &GuildRecv::processGuildPositionChanged, 0); -packet(SMSG_GUILD_POSITION_INFO, 0x016c, 43, &GuildRecv::processGuildPositionInfo, 0); -packet(SMSG_GUILD_POS_INFO_LIST, 0x0160, -1, &GuildRecv::processGuildPosInfoList, 0); -packet(SMSG_GUILD_POS_NAME_LIST, 0x0166, -1, &GuildRecv::processGuildPosNameList, 0); -packet(SMSG_GUILD_REQ_ALLIANCE, 0x0171, 30, &GuildRecv::processGuildReqAlliance, 0); -packet(SMSG_GUILD_REQ_ALLIANCE_ACK, 0x0173, 3, &GuildRecv::processGuildReqAllianceAck, 0); -packet(SMSG_GUILD_SKILL_INFO, 0x0162, -1, &GuildRecv::processGuildSkillInfo, 0); -packet(SMSG_GUILD_SKILL_UP, 0x010e, 11, &GuildRecv::processGuildSkillUp, 0); -packet(SMSG_GUILD_UPDATE_COORDS, 0x01eb, 10, &GuildRecv::processGuildUpdateCoords, 0); -packet(SMSG_IGNORE_ALL_RESPONSE, 0x00d2, 4, &Ea::ChatRecv::processIgnoreAllResponse, 0); -packet(SMSG_IGNORE_NICK_ACK, 0x00d1, 4, &ChatRecv::processIgnoreNickAck, 0); -packet(SMSG_ITEM_MVP_DROPPED, 0x07fd, 59, &ItemRecv::processItemMvpDropped, 0); -packet(SMSG_ITEM_REMOVE, 0x00a1, 6, &Ea::ItemRecv::processItemRemove, 0); -packet(SMSG_ITEM_USE_RESPONSE, 0x00a8, 7, &Ea::InventoryRecv::processItemUseResponse, 0); -packet(SMSG_ITEM_VISIBLE, 0x009d, 17, &ItemRecv::processItemVisible, 0); -packet(SMSG_MANNER_MESSAGE, 0x014a, 6, &ChatRecv::processMannerMessage, 0); -packet(SMSG_MAP_AUTH_REFUSE, 0x0074, 3, &GameRecv::processMapAuthRefuse, 0); -packet(SMSG_MAP_QUIT_RESPONSE, 0x018b, 4, &Ea::GameRecv::processMapQuitResponse, 0); -packet(SMSG_MAP_TYPE, 0x01d6, 4, &BeingRecv::processMapType, 0); -packet(SMSG_MARRIAGE_PROCESS_OUTDATED, 0x01e4, 2, nullptr, 0); -packet(SMSG_MARRIAGE_PROPOSAL_OUTDATED, 0x01e2, 34, nullptr, 0); -packet(SMSG_MONSTER_INFO, 0x018c, 29, &BeingRecv::processMonsterInfo, 0); -packet(SMSG_MVP_ITEM, 0x010a, 4, &ChatRecv::processMVPItem, 0); -packet(SMSG_MVP_EXP, 0x010b, 6, &ChatRecv::processMVPExp, 0); -packet(SMSG_MVP_EFFECT, 0x010c, 6, &Ea::ChatRecv::processMVPEffect, 0); -packet(SMSG_MVP_NO_ITEM, 0x010d, 2, &ChatRecv::processMVPNoItem, 0); -packet(SMSG_NPC_BUY, 0x00c6, -1, &BuySellRecv::processNpcBuy, 0); -packet(SMSG_NPC_BUY_RESPONSE, 0x00ca, 3, &BuySellRecv::processNpcBuyResponse, 0); -packet(SMSG_NPC_BUY_SELL_CHOICE, 0x00c4, 6, &Ea::BuySellRecv::processNpcBuySellChoice, 0); -packet(SMSG_NPC_CASH_BUY, 0x0849, 16, &CashShopRecv::processCashShopBuy, 0); -packet(SMSG_NPC_CASH_POINTS, 0x0845, 10, &CashShopRecv::processCashShopPoints, 0); -packet(SMSG_NPC_CASH_SCHEDULE, 0x08ca, -1, &CashShopRecv::processCashShopSchedule, 0); -packet(SMSG_NPC_CASH_TAB_PRICE_LIST, 0x08c0, -1, &CashShopRecv::processCashShopTabPriceList, 0); -packet(SMSG_NPC_CHOICE, 0x00b7, -1, &Ea::NpcRecv::processNpcChoice, 0); -packet(SMSG_NPC_CLOSE, 0x00b6, 6, &Ea::NpcRecv::processNpcClose, 0); -packet(SMSG_NPC_CLOSE_TIMEOUT, 0x08d6, 6, &NpcRecv::processNpcCloseTimeout, 0); -packet(SMSG_NPC_CUTIN, 0x01b3, 67, &NpcRecv::processNpcCutin, 0); -packet(SMSG_NPC_INT_INPUT, 0x0142, 6, &Ea::NpcRecv::processNpcIntInput, 0); -packet(SMSG_NPC_MESSAGE, 0x00b4, -1, &Ea::NpcRecv::processNpcMessage, 0); -packet(SMSG_NPC_NEXT, 0x00b5, 6, &Ea::NpcRecv::processNpcNext, 0); -packet(SMSG_NPC_SELL, 0x00c7, -1, &Ea::BuySellRecv::processNpcSell, 0); -packet(SMSG_NPC_SELL_RESPONSE, 0x00cb, 3, &BuySellRecv::processNpcSellResponse, 0); -packet(SMSG_NPC_SHOW_DIGIT, 0x01b1, 7, &NpcRecv::processShowDigit, 0); -packet(SMSG_NPC_STR_INPUT, 0x01d4, 6, &Ea::NpcRecv::processNpcStrInput, 0); -packet(SMSG_NPC_VIEWPOINT, 0x0144, 23, &NpcRecv::processNpcViewPoint, 0); -packet(SMSG_PARTY_CREATE, 0x00fa, 3, &Ea::PartyRecv::processPartyCreate, 0); -packet(SMSG_PARTY_INFO, 0x00fb, -1, &PartyRecv::processPartyInfo, 0); -packet(SMSG_PARTY_INVITE_RESPONSE_OUTDATED, 0x00fd, 27, nullptr, 0); -packet(SMSG_PARTY_LEADER, 0x07fc, 10, &PartyRecv::processPartyLeader, 0); -packet(SMSG_PARTY_LEAVE, 0x0105, 31, &Ea::PartyRecv::processPartyLeave, 0); -packet(SMSG_PARTY_MEMBER_INFO, 0x01e9, 81, &PartyRecv::processPartyMemberInfo, 0); -packet(SMSG_PARTY_MESSAGE, 0x0109, -1, &PartyRecv::processPartyMessage, 0); -packet(SMSG_PARTY_UPDATE_COORDS, 0x0107, 10, &Ea::PartyRecv::processPartyUpdateCoords, 0); -packet(SMSG_PET_CATCH_PROCESS, 0x019e, 2, &PetRecv::processPetCatchProcess, 0); -packet(SMSG_PET_DATA, 0x01a4, 11, &PetRecv::processPetData, 0); -packet(SMSG_PET_EGGS_LIST, 0x01a6, -1, &PetRecv::processEggsList, 0); -packet(SMSG_PET_FOOD, 0x01a3, 5, &PetRecv::processPetFood, 0); -packet(SMSG_PET_MESSAGE, 0x01aa, 10, &PetRecv::processPetMessage, 0); -packet(SMSG_PET_ROULETTE, 0x01a0, 3, &PetRecv::processPetRoulette, 0); -packet(SMSG_PLAYER_ADD_SKILL, 0x0111, 39, &SkillRecv::processSkillAdd, 0); -packet(SMSG_PLAYER_ARROW_EQUIP, 0x013c, 4, &Ea::InventoryRecv::processPlayerArrowEquip, 0); -packet(SMSG_PLAYER_ARROW_MESSAGE, 0x013b, 4, &Ea::PlayerRecv::processPlayerArrowMessage, 0); -packet(SMSG_PLAYER_ATTACK_RANGE, 0x013a, 4, &Ea::InventoryRecv::processPlayerAttackRange, 0); -packet(SMSG_PLAYER_CART_ADD_ERROR, 0x012c, 3, &InventoryRecv::processCartAddError, 0); -packet(SMSG_PLAYER_CART_REMOVE, 0x0125, 8, &InventoryRecv::processPlayerCartRemove, 0); -packet(SMSG_PLAYER_CHAT, 0x008e, -1, &ChatRecv::processChat, 0); -packet(SMSG_PLAYER_GUILD_PARTY_INFO, 0x0195, 102, &BeingRecv::processPlayerGuilPartyInfo, 0); -packet(SMSG_PLAYER_HEAL, 0x013d, 6, &PlayerRecv::processPlayerHeal, 0); -packet(SMSG_PLAYER_IDENTIFIED, 0x0179, 5, &InventoryRecv::processPlayerIdentified, 0); -packet(SMSG_PLAYER_IDENTIFY_LIST, 0x0177, -1, &InventoryRecv::processPlayerIdentifyList, 0); -packet(SMSG_PLAYER_INSERT_CARD, 0x017d, 7, &InventoryRecv::processPlayerInsertCard, 0); -packet(SMSG_PLAYER_INVENTORY_REMOVE, 0x00af, 6, &InventoryRecv::processPlayerInventoryRemove, 0); -packet(SMSG_PLAYER_MOVE_TO_ATTACK, 0x0139, 16, &Ea::BeingRecv::processPlayerMoveToAttack, 0); -packet(SMSG_PLAYER_NOTIFY_MAPINFO, 0x0189, 4, &PlayerRecv::processNotifyMapInfo, 0); -packet(SMSG_PLAYER_REFINE, 0x0188, 8, &InventoryRecv::processPlayerRefine, 0); -packet(SMSG_PLAYER_REPAIR_EFFECT, 0x01fe, 5, &InventoryRecv::processPlayerRepairEffect, 0); -packet(SMSG_PLAYER_REPAIR_LIST, 0x01fc, -1, &InventoryRecv::processPlayerRepairList, 0); -packet(SMSG_PLAYER_SKILLS, 0x010f, -1, &SkillRecv::processPlayerSkills, 0); -packet(SMSG_PLAYER_SKILL_AUTO_SPELLS, 0x01cd, 30, &SkillRecv::processSkillAutoSpells, 0); -packet(SMSG_PLAYER_SKILL_PRODUCE_EFFECT, 0x018f, 6, &SkillRecv::processSkillProduceEffect, 0); -packet(SMSG_PLAYER_SKILL_PRODUCE_MIX_LIST, 0x018d, -1, &SkillRecv::processSkillProduceMixList, 0); -packet(SMSG_PLAYER_SKILL_UP, 0x010e, 11, &Ea::SkillRecv::processPlayerSkillUp, 0); -packet(SMSG_PLAYER_STAT_UPDATE_1, 0x00b0, 8, &Ea::PlayerRecv::processPlayerStatUpdate1, 0); -packet(SMSG_PLAYER_STAT_UPDATE_2, 0x00b1, 8, &Ea::PlayerRecv::processPlayerStatUpdate2, 0); -packet(SMSG_PLAYER_STAT_UPDATE_3, 0x0141, 14, &Ea::PlayerRecv::processPlayerStatUpdate3, 0); -packet(SMSG_PLAYER_STAT_UPDATE_4, 0x00bc, 6, &Ea::PlayerRecv::processPlayerStatUpdate4, 0); -packet(SMSG_PLAYER_STAT_UPDATE_5, 0x00bd, 44, &PlayerRecv::processPlayerStatUpdate5, 0); -packet(SMSG_PLAYER_STAT_UPDATE_6, 0x00be, 5, &Ea::PlayerRecv::processPlayerStatUpdate6, 0); -packet(SMSG_PLAYER_STOP, 0x0088, 10, &Ea::BeingRecv::processPlayerStop, 0); -packet(SMSG_PLAYER_STORAGE_CLOSE, 0x00f8, 2, &Ea::InventoryRecv::processPlayerStorageClose, 0); -packet(SMSG_PLAYER_STORAGE_REMOVE, 0x00f6, 8, &InventoryRecv::processPlayerStorageRemove, 0); -packet(SMSG_PLAYER_STORAGE_STATUS, 0x00f2, 6, &Ea::InventoryRecv::processPlayerStorageStatus, 0); -packet(SMSG_PLAYER_USE_CARD, 0x017b, -1, &InventoryRecv::processPlayerUseCard, 0); -packet(SMSG_PLAYER_WARP, 0x0091, 22, &Ea::PlayerRecv::processPlayerWarp, 0); -packet(SMSG_PVP_MAP_MODE, 0x0199, 4, &Ea::BeingRecv::processPvpMapMode, 0); -packet(SMSG_PVP_SET, 0x019a, 14, &BeingRecv::processPvpSet, 0); -packet(SMSG_SCRIPT_MESSAGE, 0x08b3, -1, &ChatRecv::processScriptMessage, 0); -packet(SMSG_SERVER_PING, 0x007f, 6, &GameRecv::processServerTick, 0); -packet(SMSG_SKILL_ARROW_CREATE_LIST, 0x01ad, -1, &SkillRecv::processSkillArrowCreateList, 0); -packet(SMSG_SKILL_AUTO_CAST, 0x0147, 39, &BeingRecv::processSkillAutoCast, 0); -packet(SMSG_SKILL_CAST_CANCEL, 0x01b9, 6, &BeingRecv::processSkillCancel, 0); -packet(SMSG_SKILL_DEVOTION_EFFECT, 0x01cf, 28, &SkillRecv::processSkillDevotionEffect, 0); -packet(SMSG_SKILL_FAILED, 0x0110, 10, &SkillRecv::processSkillFailed, 0); -packet(SMSG_SKILL_GROUND_DAMAGE_UNUSED, 0x0115, 35, nullptr, 0); -packet(SMSG_SKILL_GROUND_NO_DAMAGE, 0x0117, 18, &BeingRecv::processSkillGroundNoDamage, 0); -packet(SMSG_SKILL_MEMO_MESSAGE, 0x011e, 3, &SkillRecv::processSkillMemoMessage, 0); -packet(SMSG_SKILL_NO_DAMAGE, 0x011a, 15, &Ea::BeingRecv::processSkillNoDamage, 1); -packet(SMSG_SKILL_UNIT_UPDATE, 0x01ac, 6, &SkillRecv::processSkillUnitUpdate, 0); -packet(SMSG_SKILL_WARP_POINT, 0x011c, 68, &SkillRecv::processSkillWarpPoint, 0); -packet(SMSG_SOLVE_CHAR_NAME, 0x0194, 30, &BeingRecv::processSolveCharName, 0); -packet(SMSG_SPIRIT_BALLS, 0x01d0, 8, &BeingRecv::processSpiritBalls, 0); -packet(SMSG_SPIRIT_BALL_SINGLE, 0x01e1, 8, &BeingRecv::processSpiritBalls, 0); -packet(SMSG_TRADE_CANCEL, 0x00ee, 2, &Ea::TradeRecv::processTradeCancel, 0); -packet(SMSG_TRADE_COMPLETE, 0x00f0, 3, &Ea::TradeRecv::processTradeComplete, 0); -packet(SMSG_TRADE_ITEM_ADD_RESPONSE, 0x00ea, 5, &TradeRecv::processTradeItemAddResponse, 0); -packet(SMSG_TRADE_OK, 0x00ec, 3, &Ea::TradeRecv::processTradeOk, 0); -packet(SMSG_TRADE_UNDO, 0x00f1, 2, &TradeRecv::processTradeUndo, 0); -packet(SMSG_VENDING_BUY_ACK, 0x0135, 7, &VendingRecv::processBuyAck, 0); -packet(SMSG_VENDING_HIDE_BOARD, 0x0132, 6, &VendingRecv::processHideBoard, 0); -packet(SMSG_VENDING_OPEN_REQ, 0x012d, 4, &VendingRecv::processOpenReq, 0); -packet(SMSG_VENDING_REPORT, 0x0137, 6, &VendingRecv::processReport, 0); -packet(SMSG_VENDING_SHOW_BOARD, 0x0131, 86, &VendingRecv::processShowBoard, 0); -packet(SMSG_WALK_RESPONSE, 0x0087, 12, &PlayerRecv::processWalkResponse, 0); -packet(SMSG_WEDDING_EFFECT, 0x01ea, 6, &BeingRecv::processWddingEffect, 0); -packet(SMSG_WHO_ANSWER, 0x00c2, 6, &Ea::GameRecv::processWhoAnswer, 0); -packet(SMSG_BOOKING_CANCEL_VOLUNTEER, 0x0909, 6, nullptr, 0); -packet(SMSG_BOOKING_ADD_FILTERING_LIST, 0x090b, 30, nullptr, 0); -packet(SMSG_BOOKING_SUB_FILTERING_LIST, 0x090c, 30, nullptr, 0); -packet(SMSG_ADD_MAP_MARKER, 0x09c1, 10, &MapRecv::processAddMapMarker, 0); -packet(SMSG_GUILD_ONLINE_INFO, 0x016d, 14, &GuildRecv::processOnlineInfo, 0); - -// 3 -if (packetVersion >= 3) -{ - packet(SMSG_PLAYER_INVENTORY_USE, 0x01c8, 13, &Ea::InventoryRecv::processPlayerInventoryUse, 3); - packet(SMSG_SKILL_DAMAGE, 0x01de, 33, &BeingRecv::processSkillDamage, 3); -} - -// 4 -if (packetVersion >= 4) -{ - packet(SMSG_BEING_CHANGE_LOOKS2, 0x01d7, 11, &BeingRecv::processBeingChangeLook2, 4); - packet(SMSG_BEING_VISIBLE, 0x01d8, 54, &BeingRecv::processBeingVisible, 4); - packet(SMSG_BEING_SPAWN, 0x01d9, 53, &BeingRecv::processBeingSpawn, 4); - packet(SMSG_BEING_MOVE, 0x01da, 60, &BeingRecv::processBeingMove, 4); -} - -// 5 -packet(SMSG_PLAYER_STORAGE_ADD, 0x01c4, 22, &InventoryRecv::processPlayerStorageAdd, 5); -packet(SMSG_PLAYER_CART_ADD, 0x01c5, 22, &InventoryRecv::processPlayerCartAdd, 5); - -// 6 -if (packetVersion >= 6) -{ - packet(SMSG_TRADE_REQUEST, 0x01f4, 32, &TradeRecv::processTradeRequest, 6); - packet(SMSG_TRADE_RESPONSE, 0x01f5, 9, &TradeRecv::processTradeResponse, 6); -} - -if (packetVersion >= 7) -{ - packet(SMSG_BEING_VISIBLE, 0x022a, 58, &BeingRecv::processBeingVisible, 7); - packet(SMSG_BEING_SPAWN, 0x022b, 57, &BeingRecv::processBeingSpawn, 7); - packet(SMSG_BEING_MOVE, 0x022c, 65, &BeingRecv::processBeingMove, 7); -} - -// 20040816 -packet(SMSG_ADMIN_ACCOUNT_STATS, 0x0214, 42, &AdminRecv::processAccountStats, 20040816); - -// 20040817 -packet(SMSG_PVP_INFO, 0x0210, 22, &PlayerRecv::processPvpInfo, 20040817); - -// 20041101 -packet(SMSG_PLAYER_SKILL_MESSAGE, 0x0215, 6, &PlayerRecv::processPlayerSkillMessage, 20041101); - -// 20041108 -packet(SMSG_FAMILY_ASK_FOR_CHILD_REPLY, 0x0216, 6, &FamilyRecv::processAskForChildReply, 20041108); -packet(SMSG_BLACKSMITH_RANKS_LIST, 0x0219, 282, &BeingRecv::processBlacksmithRanksList, 20041108); -packet(SMSG_ALCHEMIST_RANKS_LIST, 0x021a, 282, &BeingRecv::processAlchemistRanksList, 20041108); -packet(SMSG_PLAYER_FAME_BLACKSMITH, 0x021b, 10, &PlayerRecv::processPlayerFameBlacksmith, 20041108); -packet(SMSG_PLAYER_FAME_ALCHEMIST, 0x021c, 10, &PlayerRecv::processPlayerFameAlchemist, 20041108); - -// 20041129 -packet(SMSG_PLAYER_REFINE_LIST, 0x0221, -1, &InventoryRecv::processPlayerRefineList, 20041129); -packet(SMSG_PLAYER_UPGRADE_MESSAGE, 0x0223, 8, &PlayerRecv::processPlayerUpgradeMessage, 20041129); - -// 20050328 -packet(SMSG_PLAYER_FAME_TAEKWON, 0x0224, 10, &PlayerRecv::processPlayerFameTaekwon, 20050328); -packet(SMSG_TAEKWON_RANKS_LIST, 0x0226, 282, &BeingRecv::processTaekwonRanksList, 20050328); - -// 20050411 -if (packetVersion >= 20050411) -{ - packet(SMSG_PLAYER_STATUS_CHANGE, 0x0229, 15, &BeingRecv::processPlayerStatusChange, 20050411); -} - -// 20050523 -packet(SMSG_HOMUNCULUS_DATA, 0x0230, 12, &HomunculusRecv::processHomunculusData, 20050523); - -// 20050530 -packet(SMSG_HOMUNCULUS_SKILLS, 0x0235, -1, &HomunculusRecv::processHomunculusSkills, 20050530); -packet(SMSG_PK_RANKS_LIST, 0x0238, 282, &BeingRecv::processPkRanksList, 20050530); -packet(SMSG_HOMUNCULUS_INFO, 0x022e, 71, &HomunculusRecv::processHomunculusInfo, 20050530); - -// 20050531 -packet(SMSG_HOMUNCULUS_SKILL_UP, 0x0239, 11, &HomunculusRecv::processHomunculusSkillUp, 20050531); - -// 20050608 -packet(SMSG_HOMUNCULUS_FOOD, 0x022f, 5, &HomunculusRecv::processHomunculusFood, 20050608); -packet(SMSG_PLAYER_STORAGE_PASSWORD, 0x023a, 4, &InventoryRecv::processPlayerStoragePassword, 20050608); -packet(SMSG_PLAYER_STORAGE_PASSWORD_RESULT, 0x023c, 6, &InventoryRecv::processPlayerStoragePasswordResult, 20050608); - -// 20050718 -packet(SMSG_MAIL_READ_MAIL, 0x0242, -1, &MailRecv::processReadMail, 20050718); -packet(SMSG_MAIL_SEND_MAIL_ACK, 0x0249, 3, &MailRecv::processSendMailAck, 20050718); -packet(SMSG_MAIL_NEW_MAIL, 0x024a, 70, &MailRecv::processNewMail, 20050718); -packet(SMSG_AUCTION_MESSAGE, 0x0250, 3, &AuctionRecv::processAuctionMessage, 20050718); -packet(SMSG_AUCTION_RESULTS, 0x0252, -1, &AuctionRecv::processAuctionResults, 20050718); - -// 20050801 -packet(SMSG_MAIL_GET_ATTACHMENT, 0x0245, 3, &MailRecv::processGetAttachment, 20050801); - -// 20050817 -packet(SMSG_GLADIATOR_FEEL_REQUEST, 0x0253, 3, &BeingRecv::processGladiatorFeelRequest, 20050817); - -// 20050829 -packet(SMSG_MAIL_MAILS_LIST, 0x0240, -1, &MailRecv::processMailList, 20050829); -packet(SMSG_MAIL_SET_ATTACHMENT_ACK, 0x0255, 5, &MailRecv::processSetAttachmentAck, 20050829); -packet(SMSG_MAIL_DELETE_MAIL_ACK, 0x0257, 8, &MailRecv::processDeleteAck, 20050829); - -// 20050912 -packet(SMSG_AUCTION_SET_ITEM, 0x0256, 5, &AuctionRecv::processAuctionSetItem, 20050912); - -// 20051010 -packet(SMSG_STARS_KILL, 0x020e, 32, &BeingRecv::processStarsKill, 20051010); -packet(SMSG_PLAYER_COOKING_LIST, 0x025a, -1, &InventoryRecv::processPlayerCookingList, 20051010); - -// 20051017 -packet(SMSG_AUCTION_CLOSE, 0x025d, 4, &AuctionRecv::processAuctionClose, 20051017); - -// 20051024 -packet(SMSG_AUCTION_OPEN_WINDOW, 0x025f, 6, &AuctionRecv::processOpenWindow, 20051024); -packet(SMSG_MAIL_OPEN_WINDOW, 0x0260, 6, &MailRecv::processMailOpen, 20051024); - -// 20060306 -packet(SMSG_MAIL_RETURN, 0x0274, 8, &MailRecv::processMailReturn, 20060306); - -// 20060424 -if (packetVersion >= 20060424) -{ - packet(SMSG_MAP_ACCOUNT_ID, 0x0283, 6, &GameRecv::processMapAccountId, 20060424); - packet(SMSG_BEING_SPECIAL_EFFECT_NUM, 0x0284, 14, &BeingRecv::processBeingSpecialEffectNum, 20060424); - packet(SMSG_NPC_CASH_SHOP_OPEN, 0x0287, -1, &CashShopRecv::processCashShopOpen, 20060424); - packet(SMSG_NPC_CASH_BUY_ACK, 0x0289, 8, &CashShopRecv::processCashShopBuyAck, 20060424); - packet(SMSG_PLAYER_STATUS_CHANGE2, 0x028a, 18, &BeingRecv::processPlayerStatusChange2, 20060424); - packet(SMSG_FORMAT_MESSAGE, 0x0291, 4, &ChatRecv::processFormatMessage, 20060424); - packet(SMSG_BOSS_MAP_INFO, 0x0293, 70, &BeingRecv::processBossMapInfo, 20060424); - packet(SMSG_PLAYER_READ_BOOK, 0x0294, 10, &PlayerRecv::processPlayerReadBook, 20060424); - packet(SMSG_PLAYER_ITEM_RENTAL_TIME, 0x0298, 8, &InventoryRecv::processPlayerItemRentalTime, 20060424); - packet(SMSG_PLAYER_ITEM_RENTAL_EXPIRED, 0x0299, 6, &InventoryRecv::processPlayerItemRentalExpired, 20060424); - packet(SMSG_MERCENARY_SKILLS, 0x029d, -1, &MercenaryRecv::processMercenarySkills, 20060424); - packet(SMSG_MERCENARY_UPDATE, 0x02a2, 8, &MercenaryRecv::processMercenaryUpdate, 20060424); -} - -// 20061218 -if (packetVersion >= 20061218) -{ - packet(SMSG_PLAYER_INVENTORY_ADD, 0x029a, 27, &InventoryRecv::processPlayerInventoryAdd, 20061218); -} - -// 20070227 -if (packetVersion >= 20070227) -{ - packet(SMSG_NPC_CASH_BUY_ACK, 0x0289, 12, &CashShopRecv::processCashShopBuyAck, 20070227); - packet(SMSG_QUEST_LIST_OBJECTIVES, 0x02b2, -1, &QuestRecv::processAddQuestsObjectives, 20070227); - packet(SMSG_QUEST_ADD, 0x02b3, 107, &QuestRecv::processAddQuest, 20070227); - packet(SMSG_QUEST_REMOVE, 0x02b4, 6, &QuestRecv::processRemoveQuest, 20070227); - packet(SMSG_QUEST_UPDATE_OBJECTIVES, 0x02b5, -1, &QuestRecv::processUpdateQuestsObjectives, 20070227); - packet(SMSG_QUEST_ACTIVATE, 0x02b7, 7, &QuestRecv::processActivateQuest, 20070227); - packet(SMSG_ITEM_DAMAGED, 0x02bb, 8, &InventoryRecv::processItemDamaged, 20070227); - packet(SMSG_COLOR_MESSAGE, 0x02c1, -1, &ChatRecv::processColorChat, 20070227); - packet(SMSG_PARTY_INVITATION_STATS, 0x02c9, 3, &PartyRecv::processPartyInvitationStats, 20070227); - packet(SMSG_INSTANCE_CREATE, 0x02cc, 4, &MapRecv::processInstanceCreate, 20070227); - packet(SMSG_INSTANCE_DELETE, 0x02ce, 10, &MapRecv::processInstanceDelete, 20070227); - packet(SMSG_PLAYER_EQUIP_TICK_ACK, 0x02d9, 10, &PlayerRecv::processPlayerEquipTickAck, 20070227); - packet(SMSG_PLAYER_SHOW_EQUIP, 0x02da, 3, &PlayerRecv::processPlayerShowEquip, 20070227); - packet(SMSG_BATTLE_CHAT_MESSAGE, 0x02dc, -1, &ChatRecv::processBattleChatMessage, 20070227); - packet(SMSG_BATTLE_EMBLEM, 0x02dd, 32, &BattleGroundRecv::processBattleEmblem, 20070227); - packet(SMSG_BATTLE_UPDATE_SCORE, 0x02de, 6, &BattleGroundRecv::processBattleUpdateScore, 20070227); - packet(SMSG_BATTLE_UPDATE_COORDS, 0x02df, 36, &BattleGroundRecv::processBattleUpdateCoords, 20070227); - packet(SMSG_BATTLE_UPDATE_HP, 0x02e0, 34, &BattleGroundRecv::processBattleUpdateHp, 20070227); -} - -// 20070821 -packet(SMSG_PARTY_INVITE_RESPONSE, 0x02c5, 30, &PartyRecv::processPartyInviteResponse, 20070821); -packet(SMSG_PARTY_INVITED, 0x02c6, 30, &PartyRecv::processPartyInvited, 20070821); - -// 20071002 -if (packetVersion >= 20071002) -{ - packet(SMSG_PLAYER_INVENTORY, 0x01ee, -1, &InventoryRecv::processPlayerInventory, 20071002); - packet(SMSG_PLAYER_CART_ITEMS, 0x01ef, -1, &InventoryRecv::processPlayerCartItems, 20071002); - packet(SMSG_PLAYER_STORAGE_ITEMS, 0x0295, -1, &InventoryRecv::processPlayerStorage, 20071002); - packet(SMSG_PLAYER_STORAGE_EQUIP, 0x0296, -1, &InventoryRecv::processPlayerStorageEquip, 20071002); - packet(SMSG_PLAYER_CART_EQUIP, 0x0297, -1, &InventoryRecv::processPlayerCartEquip, 20071002); - packet(SMSG_PARTY_ITEM_PICKUP, 0x02b8, 22, &PartyRecv::processPartyItemPickup, 20071002); - packet(SMSG_PLAYER_INVENTORY_ADD, 0x02d4, 29, &InventoryRecv::processPlayerInventoryAdd, 20071002); -} - -// 20071023 -packet(SMSG_INSTANCE_START, 0x02cb, 65, &MapRecv::processInstanceStart, 20071023); -packet(SMSG_INSTANCE_INFO, 0x02cd, 71, &MapRecv::processInstanceInfo, 20071023); - -// 20071106 -if (packetVersion >= 20071106) -{ - packet(SMSG_BEING_FAKE_NAME, 0x0078, 55, &BeingRecv::processBeingFakeName, 20071106); - packet(SMSG_BEING_SPAWN_OUTDATED, 0x007c, 42, nullptr, 20071106); - packet(SMSG_BEING_MOVE, 0x022c, 65, &BeingRecv::processBeingMove, 20071106); - packet(SMSG_MERCENARY_INFO, 0x029b, 80, &MercenaryRecv::processMercenaryInfo, 20071106); -} - -// 20071113 -packet(SMSG_BEING_ACTION2, 0x02e1, 33, &BeingRecv::processBeingAction2, 20071113); - -// 20080102 -if (packetVersion >= 20080102) -{ - packet(SMSG_PLAYER_EQUIPMENT, 0x02d0, -1, &InventoryRecv::processPlayerEquipment, 20080102); - packet(SMSG_PLAYER_STORAGE_EQUIP, 0x02d1, -1, &InventoryRecv::processPlayerStorageEquip, 20080102); - packet(SMSG_PLAYER_CART_EQUIP, 0x02d2, -1, &InventoryRecv::processPlayerCartEquip, 20080102); - packet(SMSG_PLAYER_INVENTORY, 0x02e8, -1, &InventoryRecv::processPlayerInventory, 20080102); - packet(SMSG_PLAYER_CART_ITEMS, 0x02e9, -1, &InventoryRecv::processPlayerCartItems, 20080102); - packet(SMSG_PLAYER_STORAGE_ITEMS, 0x02ea, -1, &InventoryRecv::processPlayerStorage, 20080102); - packet(SMSG_MAP_LOGIN_SUCCESS, 0x02eb, 13, &GameRecv::processMapLogin, 20080102); - packet(SMSG_BEING_MOVE, 0x02ec, 67, &BeingRecv::processBeingMove, 20080102); - packet(SMSG_BEING_SPAWN, 0x02ed, 59, &BeingRecv::processBeingSpawn, 20080102); - packet(SMSG_BEING_VISIBLE, 0x02ee, 60, &BeingRecv::processBeingVisible, 20080102); - packet(SMSG_BEING_FONT, 0x02ef, 8, &BeingRecv::processBeingFont, 20080102); -} - -// 20080318 -packet(SMSG_NPC_SHOW_PROGRESS_BAR, 0x02f0, 10, &NpcRecv::processNpcShowProgressBar, 20080318); -packet(SMSG_NPC_PROGRESS_BAR_ABORT, 0x02f2, 2, &NpcRecv::processProgressBarAbort, 20080318); - -// 20080827 -if (packetVersion >= 20080827) -{ - packet(SMSG_BEING_SPAWN_OUTDATED, 0x007c, 44, nullptr, 20080827); -} - -// 20081112 -packet(SMSG_PLAYER_SKILL_COOLDOWN, 0x043d, 8, &SkillRecv::processSkillCoolDown, 20081112); - -// 20081113 -if (packetVersion >= 20081113) -{ - packet(SMSG_PLAYER_SKILL_COOLDOWN_LIST, 0x043e, -1, &SkillRecv::processSkillCoolDownList, 20081113); -} - -// 20081126 -if (packetVersion >= 20081126) -{ - packet(SMSG_PET_STATUS, 0x01a2, 37, &PetRecv::processPetStatus, 20081126); -} - -// 20081210 -packet(SMSG_AUTOSHADOW_SPELL_LIST, 0x0442, -1, &PlayerRecv::processPlayerAutoShadowSpellList, 20081210); - -// 20081217 -packet(SMSG_BEING_MILLENIUM_SHIELD, 0x0440, 10, &BeingRecv::processBeingMilleniumShield, 20081217); -packet(SMSG_PLAYER_DELETE_SKILL, 0x0441, 4, &SkillRecv::processSkillDelete, 20081217); - -// 20090121 -packet(SMSG_BEING_STATUS_CHANGE, 0x043f, 25, &BeingRecv::processBeingStatusChange, 20090121); - -// 20090218 -packet(SMSG_QUEST_NPC_EFFECT, 0x0446, 14, &QuestRecv::processNpcQuestEffect, 20090218); - -// 20090603 -packet(SMSG_PARTY_SETTINGS, 0x07d8, 8, &PartyRecv::processPartySettings, 20090603); -packet(SMSG_PLAYER_SHORTCUTS, 0x07d9, 268, &PlayerRecv::processPlayerShortcuts, 20090603); - -// 20090715 -packet(SMSG_PLAYER_UPDATE_SKILL, 0x07e1, 15, &SkillRecv::processSkillUpdate, 20090715); - -// 20090805 -packet(SMSG_FORMAT_MESSAGE_NUMBER, 0x07e2, 8, &ChatRecv::processFormatMessageNumber, 20090805); - -// 20090818 -packet(SMSG_FORMAT_MESSAGE_SKILL, 0x07e6, 8, &ChatRecv::processFormatMessageSkill, 20090818); - -// 20090922 -packet(SMSG_SKILL_ITEM_LIST_WINDOW, 0x07e3, 6, &SkillRecv::processSkillItemListWindow, 20090922); -packet(SMSG_CHAR_CAPTCHA_NOT_SUPPORTED, 0x07e9, 5, &CharServerRecv::processCharCaptchaNotSupported, 20090922); - -// 20091027 -packet(SMSG_PLAYER_GET_EXP, 0x07f6, 14, &PlayerRecv::processPlayerGetExp, 20091027); - -if (packetVersion >= 20091103) -{ - packet(SMSG_BEING_MOVE, 0x07f7, -1, &BeingRecv::processBeingMove, 20091103); - packet(SMSG_BEING_SPAWN, 0x07f8, -1, &BeingRecv::processBeingSpawn, 20091103); - packet(SMSG_BEING_VISIBLE, 0x07f9, -1, &BeingRecv::processBeingVisible, 20091103); -} - -// 20091104 -if (packetVersion >= 20091104) -{ - packet(SMSG_WHISPER, 0x0097, -1, &ChatRecv::processWhisper, 20091104); -} - -// 20091117 -packet(SMSG_PLAYER_INVENTORY_REMOVE2, 0x07fa, 8, &InventoryRecv::processPlayerInventoryRemove2, 20091117); - -// 20091124 -if (packetVersion >= 20091124) -{ - packet(SMSG_SKILL_CASTING, 0x07fb, 25, &BeingRecv::processSkillCasting, 20091124); -} - -// 20091201 -packet(SMSG_BATTLE_PLAY, 0x07fe, 26, &BattleGroundRecv::processBattlePlay, 20091201); - -// 20091222 -packet(SMSG_BOOKING_REGISTER_ACK, 0x0803, 4, nullptr, 20091222); -packet(SMSG_BOOKING_SEARCH_ACK, 0x0805, -1, nullptr, 20091222); - -// 20091229 -packet(SMSG_BOOKING_DELETE_ACK, 0x0807, 4, nullptr, 20091229); -packet(SMSG_BOOKING_INSERT_NOTIFY, 0x0809, 50, nullptr, 20091229); -packet(SMSG_BOOKING_UPDATE_NOTIFY, 0x080a, 18, nullptr, 20091229); -packet(SMSG_BOOKING_DELETE_NOTIFY, 0x080b, 6, nullptr, 20091229); - -// 20100105 -if (packetVersion >= 20100105) -{ - packet(SMSG_VENDING_ITEMS_LIST, 0x0800, -1, &VendingRecv::processItemsList, 20100105); -} - -// 20100126 -packet(SMSG_PLAYER_HP, 0x080e, 14, &BeingRecv::processBeingHp, 20100126); - -// 20100223 -packet(SMSG_TRADE_ITEM_ADD, 0x080f, 20, &TradeRecv::processTradeItemAdd, 20100223); - -// 20100303 -packet(SMSG_BUYINGSTORE_OPEN, 0x0810, 3, &BuyingStoreRecv::processBuyingStoreOpen, 20100303); - -// 20100309 -packet(SMSG_BUYINGSTORE_OWN_ITEMS, 0x0813, -1, &BuyingStoreRecv::processBuyingStoreOwnItems, 20100309); -packet(SMSG_BUYINGSTORE_HIDE_BOARD, 0x0816, 6, &BuyingStoreRecv::processBuyingStoreHideBoard, 20100309); -packet(SMSG_BUYINGSTORE_ITEMS_LIST, 0x0818, -1, &BuyingStoreRecv::processBuyingStoreItemsList, 20100309); -packet(SMSG_ELEMENTAL_INFO, 0x081d, 22, &ElementalRecv::processElementalInfo, 20100309); -packet(SMSG_ELEMENTAL_UPDATE_STATUS, 0x081e, 8, &ElementalRecv::processElementalUpdateStatus, 20100309); - -// 20100420 -packet(SMSG_BUYINGSTORE_CREATE_FAILED, 0x0812, 8, &BuyingStoreRecv::processBuyingStoreCreateFailed, 20100420); -packet(SMSG_BUYINGSTORE_SHOW_BOARD, 0x0814, 86, &BuyingStoreRecv::processBuyingStoreShowBoard, 20100420); -packet(SMSG_BUYINGSTORE_SELL_FAILED, 0x081a, 4, &BuyingStoreRecv::processBuyingStoreSellFailed, 20100420); -packet(SMSG_BUYINGSTORE_REPORT, 0x081b, 10, &BuyingStoreRecv::processBuyingStoreReport, 20100420); -packet(SMSG_BUYINGSTORE_DELETE_ITEM, 0x081c, 10, &BuyingStoreRecv::processBuyingStoreDeleteItem, 20100420); -packet(SMSG_BUYINGSTORE_SELLER_SELL_FAILED, 0x0824, 6, &BuyingStoreRecv::processBuyingStoreSellerSellFailed, 20100420); - -// 20100601 -packet(SMSG_SEARCHSTORE_SEARCH_ACK, 0x0836, 0, &SearchStoreRecv::processSearchAck, 20100601); -packet(SMSG_SEARCHSTORE_SEARCH_FAILED, 0x0837, 3, &SearchStoreRecv::processSearchFailed, 20100601); - -// 20100608 -if (packetVersion >= 20100608) -{ - packet(SMSG_SEARCHSTORE_OPEN, 0x083a, 4, &SearchStoreRecv::processSearchOpen, 20100608); - packet(SMSG_SEARCHSTORE_CLICK_ACK, 0x083d, 6, &SearchStoreRecv::processSearchClickAck, 20100608); -} - -// 20100629 -if (packetVersion >= 20100629) -{ - packet(SMSG_PLAYER_EQUIPMENT, 0x02d0, -1, &InventoryRecv::processPlayerEquipment, 20100629); - packet(SMSG_PLAYER_STORAGE_EQUIP, 0x02d1, -1, &InventoryRecv::processPlayerStorageEquip, 20100629); - packet(SMSG_PLAYER_CART_EQUIP, 0x02d2, -1, &InventoryRecv::processPlayerCartEquip, 20100629); - packet(SMSG_PLAYER_EQUIP, 0x00aa, 9, &InventoryRecv::processPlayerEquip, 20100629); -} - -// 20100701 -if (packetVersion >= 20100701) -{ - packet(SMSG_SEARCHSTORE_OPEN, 0x083a, 5, &SearchStoreRecv::processSearchOpen, 20100701); -} - -// 20100803 -packet(SMSG_GUILD_EXPULSION, 0x0839, 66, &GuildRecv::processGuildExpulsion, 20100803); - -// 20101124 -if (packetVersion >= 20101124) -{ - packet(SMSG_BEING_MOVE, 0x0856, -1, &BeingRecv::processBeingMove, 20101124); - packet(SMSG_BEING_VISIBLE, 0x0857, -1, &BeingRecv::processBeingVisible, 20101124); - packet(SMSG_BEING_SPAWN, 0x0858, -1, &BeingRecv::processBeingSpawn, 20101124); - packet(SMSG_BEING_VIEW_EQUIPMENT, 0x0859, -1, &BeingRecv::processBeingViewEquipment, 20101124); -} - -// 20110718 -if (packetVersion >= 20110718) -{ - packet(SMSG_SKILL_ENTRY, 0x08c7, -1, &BeingRecv::processSkillEntry, 20110718); -} - -// 20111005 -packet(SMSG_SKILL_SNAP, 0x08d2, 10, &BeingRecv::processBeingSlide, 20111005); - -// 20111010 -packet(CMSG_NAVIGATE_TO, 0x08e2, 27, &BeingRecv::processNavigateTo, 20111010); - -// 20120000 -packet(SMSG_LOGIN_ERROR2, 0x083e, 26, &LoginRecv::processLoginError2, 20120000); - -// 20120221 -if (packetVersion >= 20120221) -{ - packet(SMSG_BEING_VISIBLE, 0x0915, -1, &BeingRecv::processBeingVisible, 20120221); - packet(SMSG_BEING_MOVE, 0x0914, -1, &BeingRecv::processBeingMove, 20120221); - packet(SMSG_BEING_SPAWN, 0x090f, -1, &BeingRecv::processBeingSpawn, 20120221); -} - -// 20120229 -if (packetVersion >= 20120229) -{ - packet(SMSG_MERGE_ITEM, 0x096d, -1, &InventoryRecv::processMergeItem, 20120229); - packet(SMSG_ACK_MERGE_ITEMS, 0x096f, 7, &InventoryRecv::processMergeItemResponse, 20120229); -} - -// 20120410 -packet(SMSG_BEING_CHARM, 0x08cf, 10, &BeingRecv::processBeingCharm, 20120410); -packet(SMSG_RECRUIT_REGISTER_ACK, 0x08e6, 4, nullptr, 20120410); -packet(SMSG_RECRUIT_SEARCH_ACK, 0x08e8, -1, nullptr, 20120410); -packet(SMSG_RECRUIT_DELETE_ACK, 0x08ea, 4, nullptr, 20120410); -packet(SMSG_RECRUIT_INSERT_NOTIFY, 0x08ec, 73, nullptr, 20120410); -packet(SMSG_RECRUIT_UPDATE_NOTIFY, 0x08ed, 43, nullptr, 20120410); -packet(SMSG_RECRUIT_DELETE_NOTIFY, 0x08ee, 6, nullptr, 20120410); -packet(SMSG_BOOKING_VOLUNTEER_INFO, 0x08f2, 36, nullptr, 20120410); -packet(SMSG_BOOKING_REFUSE_VOLUNTEER, 0x08fa, 6, nullptr, 20120410); -packet(SMSG_PLAYER_FAVORITE_ITEM, 0x0908, 5, &InventoryRecv::processFavoriteItem, 20120410); -packet(SMSG_MONSTER_HP, 0x0977, 14, &BeingRecv::processMonsterHp, 20120410); - -// 20120419 -if (packetVersion >= 20120419) -{ - packet(SMSG_CHAR_CHARACTERS, 0x099d, -1, &CharServerRecv::processCharCharacters, 20120419); -} - -// 20120502 -if (packetVersion >= 20120502) -{ - packet(SMSG_RANKS_LIST, 0x097d, 288, &BeingRecv::processRanksList, 20120502); -} - -// 20120618 -if (packetVersion >= 20120618) -{ - packet(SMSG_BEING_STATUS_CHANGE, 0x0983, 29, &BeingRecv::processBeingStatusChange, 20120618); -} - -// 20120604 -if (packetVersion >= 20120604) -{ - packet(SMSG_PLAYER_SKILL_COOLDOWN_LIST, 0x0985, -1, &SkillRecv::processSkillCoolDownList, 20120604); -} - -// 20120925 -if (packetVersion >= 20120925) -{ - packet(SMSG_PLAYER_INVENTORY_ADD, 0x0990, 31, &InventoryRecv::processPlayerInventoryAdd, 20120925); - packet(SMSG_PLAYER_INVENTORY, 0x0991, -1, &InventoryRecv::processPlayerInventory, 20120925); - packet(SMSG_PLAYER_EQUIPMENT, 0x0992, -1, &InventoryRecv::processPlayerEquipment, 20120925); - packet(SMSG_PLAYER_CART_ITEMS, 0x0993, -1, &InventoryRecv::processPlayerCartItems, 20120925); - packet(SMSG_PLAYER_CART_EQUIP, 0x0994, -1, &InventoryRecv::processPlayerCartEquip, 20120925); - packet(SMSG_PLAYER_STORAGE_ITEMS, 0x0995, -1, &InventoryRecv::processPlayerStorage, 20120925); - packet(SMSG_PLAYER_STORAGE_EQUIP, 0x0996, -1, &InventoryRecv::processPlayerStorageEquip, 20120925); - packet(SMSG_BEING_VIEW_EQUIPMENT, 0x0997, -1, &BeingRecv::processBeingViewEquipment, 20120925); - packet(SMSG_PLAYER_EQUIP, 0x0999, 11, &InventoryRecv::processPlayerEquip, 20120925); - packet(SMSG_PLAYER_UNEQUIP, 0x099a, 9, &InventoryRecv::processPlayerUnEquip, 20120925); -} - -// 20121010 -packet(SMSG_MAP_TYPE_PROPERTY2, 0x099b, 8, &BeingRecv::processMapTypeProperty, 20121010); - -// 20121212 -if (packetVersion >= 20121212) -{ - packet(SMSG_SKILL_ENTRY, 0x099f, -1, &BeingRecv::processSkillEntry, 20121212); -} - -// 20130000 -if (packetVersion >= 20130000) -{ - packet(SMSG_ITEM_DROPPED, 0x084b, 19, &ItemRecv::processItemDropped, 20130000); -} - -// 20130710 -packet(SMSG_PLAYER_RANK_POINTS, 0x097e, 12, &PlayerRecv::processPlayerRankPoints, 20130710); - -// 20130724 -packet(SMSG_BANK_STATUS, 0x09a6, 12, &BankRecv::processBankStatus, 20130724); -packet(SMSG_BANK_DEPOSIT, 0x09a8, 16, &BankRecv::processBankDeposit, 20130724); -packet(SMSG_BANK_WITHDRAW, 0x09aa, 16, &BankRecv::processBankWithdraw, 20130724); - -// 20130731 -if (packetVersion >= 20130731) -{ - packet(SMSG_SKILL_ENTRY, 0x09ca, -1, &BeingRecv::processSkillEntry, 20130731); -} - -// 20131218 -packet(SMSG_MAIL2_MAIL_LIST_PAGE, 0x09f0, -1, &Mail2Recv::processMailListPage, 20131218); -packet(SMSG_MAIL2_MAIL_DELETE, 0x09f6, 11, &Mail2Recv::processMailDelete, 20131218); - -// 20131223 -if (packetVersion >= 20131223) -{ - packet(SMSG_BEING_ACTION2, 0x08c8, 34, &BeingRecv::processBeingAction2, 20131223); - packet(SMSG_NPC_MARKET_OPEN, 0x09d5, -1, &MarketRecv::processMarketOpen, 20131223); - packet(SMSG_NPC_MARKET_BUY_ACK, 0x09d7, -1, &MarketRecv::processMarketBuyAck, 20131223); - packet(SMSG_BEING_MOVE, 0x09db, -1, &BeingRecv::processBeingMove, 20131223); - packet(SMSG_BEING_SPAWN, 0x09dc, -1, &BeingRecv::processBeingSpawn, 20131223); - packet(SMSG_BEING_VISIBLE, 0x09dd, -1, &BeingRecv::processBeingVisible, 20131223); - packet(SMSG_WHISPER_RESPONSE, 0x09df, 7, &ChatRecv::processWhisperResponse, 20131223); - packet(SMSG_SKILL_NO_DAMAGE, 0x09cb, 17, &Ea::BeingRecv::processSkillNoDamage, 20131223); -} - -// 20131230 -packet(SMSG_MAIL2_SEND_RESULT, 0x09ed, 3, &Mail2Recv::processSendResult, 20131230); - -// 20140409 -packet(SMSG_MAIL2_REQUEST_MONEY, 0x09f2, 12, &Mail2Recv::processRequestMoney, 20140409); -packet(SMSG_MAIL2_REQUEST_ITEMS, 0x09f4, 12, &Mail2Recv::processRequestItems, 20140409); - -// 20140115 -packet(SMSG_MAIL2_READ_MAIL, 0x09eb, -1, &Mail2Recv::processReadMail, 20140115); - -// 20140416 -packet(SMSG_MAIL2_OPEN_NEW_MAIL_WINDOW, 0x0a12, 27, &Mail2Recv::processOpenNewMailWindow, 20140416); - -// 20140521 -packet(SMSG_MAIL2_REMOVE_ITEM_RESULT, 0x0a07, 9, &Mail2Recv::processRemoveItemResult, 20140521); -packet(SMSG_MAIL2_CHECK_NAME_RESULT, 0x0a14, 10, &Mail2Recv::processCheckNameResult, 20140521); - -// 20140613 -if (packetVersion >= 20140613) -{ - packet(SMSG_BATTLE_UPDATE_HP, 0x0a0e, 14, &BattleGroundRecv::processBattleUpdateHp, 20140613); -} - -// 20141016 -packet(SMSG_ROULETTE_OPEN_ACK, 0x0a1a, 23, &RouletteRecv::processRouletteOpenAck, 20141016); -packet(SMSG_ROULETTE_INFO_ACK_TYPE, 0x0a1c, -1, &RouletteRecv::processRouletteInfoAckType, 20141016); -packet(SMSG_ROULETTE_GENERATE_ACK_TYPE, 0x0a20, 21, &RouletteRecv::processRouletteGenerateAckType, 20141016); -packet(SMSG_ROULETTE_RECV_ITEM_ACK, 0x0a22, 5, &RouletteRecv::processRouletteItemAck, 20141016); -if (packetVersion >= 20141016) -{ - packet(SMSG_VENDING_REPORT, 0x09e5, 18, &VendingRecv::processReport, 20141016); - packet(SMSG_BUYINGSTORE_REPORT, 0x09e6, 22, &BuyingStoreRecv::processBuyingStoreReport, 20141016); -} - -// 20141022 -if (packetVersion >= 20141022) -{ - packet(SMSG_QUEST_LIST, 0x097a, -1, &QuestRecv::processAddQuests, 20141022); - packet(SMSG_PLAYER_SHORTCUTS, 0x0a00, 269, &PlayerRecv::processPlayerShortcuts, 20141022); - packet(SMSG_MAP_LOGIN_SUCCESS, 0x0a18, 14, &GameRecv::processMapLogin, 20141022); - packet(SMSG_VENDING_OPEN_STATUS, 0x0a28, 3, &VendingRecv::processOpenStatus, 20141022); -} - -// 20141112 -packet(SMSG_MAIL2_ICON, 0x09e7, 3, &Mail2Recv::processMailIcon, 20141112); - -// 20141119 -packet(SMSG_MAIL2_ADD_ITEM_RESULT, 0x0a05, 53, &Mail2Recv::processAddItemResult, 20141119); - -// 0 -// evol packets -if (serverVersion > 0) -{ - packet2(SMSG_NPC_COMMAND, 0x0b00, 16, &Ea::NpcRecv::processNpcCommand, 0); - packet2(SMSG_BEING_NAME_RESPONSE2, 0x0b01, -1, &BeingRecv::processNameResponse2, 0); - packet2(SMSG_MAP_MASK, 0x0b02, 10, &Ea::PlayerRecv::processMapMask, 0); - packet2(SMSG_MOB_INFO, 0x0b03, -1, &BeingRecv::processMobInfo, 0); - packet2(SMSG_BEING_MOVE3, 0x0b04, -1, &Ea::BeingRecv::processBeingMove3, 0); - packet2(SMSG_MAP_MUSIC, 0x0b05, -1, &Ea::PlayerRecv::processMapMusic, 0); - packet2(SMSG_NPC_CHANGETITLE, 0x0b06, -1, &Ea::NpcRecv::processChangeTitle, 0); - packet2(SMSG_CHAT_JOIN_CHANNEL, 0x0b08, 27, &ChatRecv::processJoinChannel, 0); - packet2(SMSG_BEING_ATTRS, 0x0b0a, -1, &BeingRecv::processBeingAttrs, 0); - packet2(SMSG_NPC_AREA, 0x0b0b, -1, &NpcRecv::processArea, 0); - packet2(SMSG_ONLINE_LIST, 0x0b10, -1, &PlayerRecv::processOnlineList, 0); - packet2(SMSG_PLAYER_CLIENT_COMMAND, 0x0b16, -1, &Ea::PlayerRecv::processPlayerClientCommand, 0); - packet2(SMSG_BEING_CHANGE_LOOKS_CARDS, 0x0b17, 19, &BeingRecv::processBeingChangeLookCards, 0); - packet2(SMSG_ITEM_VISIBLE2, 0x0b18, 28, &ItemRecv::processItemVisible2, 0); - packet2(SMSG_ITEM_DROPPED2, 0x0b19, 28, &ItemRecv::processItemDropped2, 0); - packet2(SMSG_BATTLE_EMBLEM2, 0x0b1a, 34, &BattleGroundRecv::processBattleEmblem2, 0); - packet2(SMSG_MAP_SET_TILES_TYPE, 0x0b1b, 34, &Ea::MapRecv::processSetTilesType, 0); - packet2(SMSG_NPC_SKIN, 0x0b1c, -1, &NpcRecv::processNpcSkin, 0); - packet2(SMSG_PLAYER_KILLED_BY, 0x0b1d, 6, &PlayerRecv::processKilledBy, 0); - packet2(SMSG_SKILL_CASTING2, 0x0b1e, -1, &BeingRecv::processSkillCasting2, 0); - packet2(SMSG_PLAYER_ADD_SKILL2, 0x0b1f, -1, &SkillRecv::processSkillAdd2, 0); - packet2(SMSG_PLAYER_UPDATE_SKILL2, 0x0b20, -1, &SkillRecv::processSkillUpdate2, 0); - packet2(SMSG_WALK_ERROR, 0x0b21, 10, &PlayerRecv::processWalkError, 0); - packet2(SMSG_HOMUNCULUS_EXP, 0x0b22, 10, &HomunculusRecv::processHomunculusExp, 0); - packet2(SMSG_QUEST_LIST2, 0x0b23, -1, &QuestRecv::processAddQuests2, 0); - packet2(SMSG_QUEST_ADD2, 0x0b24, 23, &QuestRecv::processAddQuest2, 0); - packet2(SMSG_PLAYER_ATTRS, 0x0b25, -1, &PlayerRecv::processPlayerAttrs, 0); - - // char server - packet2(SMSG_CHAR_PASSWORD_RESPONSE, 0x0062, 3, &LoginRecv::processCharPasswordResponse, 0); -} - -// 20150226 -if ((serverVersion >= 8 || serverVersion == 0) && packetVersion >= 20150226) -{ - packet(SMSG_VENDING_OPEN, 0x0136, -1, &VendingRecv::processOpen, 20150226); - packet(SMSG_VENDING_ITEMS_LIST, 0x0800, -1, &VendingRecv::processItemsList, 20150226); - packet(SMSG_TRADE_ITEM_ADD, 0x0a09, 45, &TradeRecv::processTradeItemAdd, 20150226); - packet(SMSG_PLAYER_STORAGE_ADD, 0x0a0a, 47, &InventoryRecv::processPlayerStorageAdd, 20150226); - packet(SMSG_PLAYER_CART_ADD, 0x0a0b, 47, &InventoryRecv::processPlayerCartAdd, 20150226); - packet(SMSG_PLAYER_INVENTORY_ADD, 0x0a0c, 56, &InventoryRecv::processPlayerInventoryAdd, 20150226); - packet(SMSG_PLAYER_EQUIPMENT, 0x0a0d, -1, &InventoryRecv::processPlayerEquipment, 20150226); - packet(SMSG_PLAYER_CART_EQUIP, 0x0a0f, -1, &InventoryRecv::processPlayerCartEquip, 20150226); - packet(SMSG_PLAYER_STORAGE_EQUIP, 0x0a10, -1, &InventoryRecv::processPlayerStorageEquip, 20150226); - packet(SMSG_BEING_VIEW_EQUIPMENT, 0x0a2d, -1, &BeingRecv::processBeingViewEquipment, 20150226); -} - -// 20150513 -if (packetVersion >= 20150513) -{ - packet(SMSG_DRESS_ROOM_OPEN, 0x0a02, 4, &PlayerRecv::processDressRoomOpen, 20150513); - packet(SMSG_BEING_VISIBLE, 0x09ff, -1, &BeingRecv::processBeingVisible, 20150513); - packet(SMSG_BEING_SPAWN, 0x09fe, -1, &BeingRecv::processBeingSpawn, 20150513); - packet(SMSG_BEING_MOVE, 0x09fd, -1, &BeingRecv::processBeingMove, 20150513); - packet(SMSG_PLAYER_HEAL, 0x0a27, 8, &PlayerRecv::processPlayerHeal, 20150513); - packet(SMSG_HOMUNCULUS_INFO, 0x09f7, 75, &HomunculusRecv::processHomunculusInfo, 20150513); -} - -// 20150805 -if (packetVersion >= 20150805) -{ - packet(SMSG_SELECT_CART, 0x097f, -1, &InventoryRecv::processSelectCart, 20150805); -} - -// 20160330 -if (packetVersion >= 20160330) -{ - packet(SMSG_MAP_LOGIN_SUCCESS, 0x02eb, 13, &GameRecv::processMapLogin, 20160330); -} - -// 20160622 -if (packetVersion >= 20160622) -{ - packet(SMSG_GUILD_BASIC_INFO, 0x0a84, 94, &GuildRecv::processGuildBasicInfo, 20160622); -} - -// 20160921 -if (packetVersion >= 20160921) -{ - packet(SMSG_PLAYER_INVENTORY_ADD, 0x0a37, 59, &InventoryRecv::processPlayerInventoryAdd, 20160921); - packet(SMSG_VENDING_ITEMS_LIST, 0x0800, -1, &VendingRecv::processItemsList, 20160921); -} - -// 20161026 -if (packetVersion >= 20161026) -{ - packet(SMSG_GUILD_MEMBER_LIST, 0x0aa5, -1, &GuildRecv::processGuildMemberList, 20161026); -} - -// 20170315 -if (packetVersion >= 20170315) -{ - packet(SMSG_LOGIN_DATA, 0x0ac4, -1, &LoginRecv::processLoginData, 20170315); -} - -// 20160316 -if (packetVersion >= 20160316) -{ - packet(SMSG_MAIL2_CHECK_NAME_RESULT, 0x0a51, 34, &Mail2Recv::processCheckNameResult, 20160316); -} - -// 20160601 -if (packetVersion >= 20160601) -{ - packet(SMSG_MAIL2_MAIL_LIST_PAGE, 0x0a7d, -1, &Mail2Recv::processMailListPage, 20160601); -} - -// 20170329 -if (packetVersion >= 20170329) -{ - packet(SMSG_CHAR_MAP_INFO, 0x0ac5, 156, &CharServerRecv::processCharMapInfo, 20170329); -} - -// 20170502 -if (packetVersion >= 20170502) -{ - packet(SMSG_PARTY_MEMBER_INFO, 0x0a43, 85, &PartyRecv::processPartyMemberInfo, 20170502); - packet(SMSG_PARTY_INFO, 0x0a44, -1, &PartyRecv::processPartyInfo, 20170502); - packet(SMSG_PARTY_MEMBER_JOB_LEVEL, 0x0abd, 10, &PartyRecv::processPartyMemberJobLevel, 20170502); -} - -// 0 -// evol always packets -packet(SMSG_SERVER_VERSION_RESPONSE, 0x7531, -1, &LoginRecv::processServerVersion, 0); -packet(SMSG_UPDATE_HOST, 0x0063, -1, &Ea::LoginRecv::processUpdateHost, 0); diff --git a/src/net/eathena/packetsout.inc b/src/net/eathena/packetsout.inc deleted file mode 100644 index 3ce489a09..000000000 --- a/src/net/eathena/packetsout.inc +++ /dev/null @@ -1,8044 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#define PACKETSOUT_VOID - -// 0 -packet(CMSG_SERVER_VERSION_REQUEST, 0x7530, 0, nullptr); - -packet(CMSG_LOGIN_REGISTER, 0x0064, 0, lclif->p->parse_CA_LOGIN); -packet(CMSG_LOGIN_REGISTER2, 0x01dd, 0, lclif->p->parse_CA_LOGIN2); -packet(CMSG_LOGIN_REGISTER3, 0x01fa, 0, lclif->p->parse_CA_LOGIN3); -packet(CMSG_LOGIN_REGISTER4, 0x027c, 0, lclif->p->parse_CA_LOGIN4); -packet(CMSG_LOGIN_REGISTER_PCBANG, 0x0277, 0, lclif->p->parse_CA_LOGIN_PCBANG); -packet(CMSG_LOGIN_REGISTER_HAN, 0x02b0, 0, lclif->p->parse_CA_LOGIN_HAN); -packet(CMSG_LOGIN_REGISTER_SSO, 0x0825, -1, lclif->p->parse_CA_SSO_LOGIN_REQ); -packet(CMSG_LOGIN_REGISTER_KEY, 0x01db, 0, lclif->p->parse_CA_REQ_HASH); - -packet(CMSG_NAME_REQUEST, 0x0094, 6, clif->pGetCharNameRequest); - -packet(CMSG_CHAR_PASSWORD_CHANGE, 0x0061, 0, nullptr); -packet(CMSG_CHAR_SERVER_CONNECT, 0x0065, 0, chr->parse_char_connect); -packet(CMSG_CHAR_SELECT, 0x0066, 3, chr->parse_char_select); -packet(CMSG_CHAR_CREATE, 0x0067, 0, chr->parse_make_char_0067); -packet(CMSG_CHAR_DELETE, 0x0068, 56, chr->parse_char_delete_char_0068); -packet(CMSG_CHAR_DELETE2_REQ, 0x0827, 6, chr->parse_char_delete2_req); -packet(CMSG_CHAR_DELETE2_ACCEPT, 0x0829, 12, chr->parse_char_delete2_accept); -packet(CMSG_CHAR_DELETE2_CANCEL, 0x082b, 6, chr->parse_char_delete2_cancel); -packet(CMSG_CHAR_CREATE_PIN, 0x08ba, 10, chr->parse_char_pincode_first_pin); -packet(CMSG_CHAR_PIN_CHECK, 0x08b8, 10, chr->parse_char_pincode_check); -packet(CMSG_CHAR_PIN_CHANGE, 0x08be, 14, chr->parse_char_pincode_change); -packet(CMSG_CHAR_PIN_WINDOW, 0x08c5, 6, chr->parse_char_pincode_window); -packet(CMSG_CHAR_REQUEST_CHARS, 0x09a1, 2, chr->parse_char_request_chars); -packet(CMSG_CHAR_CHECK_RENAME, 0x08fc, 30, chr->parse_char_rename_char); -packet(CMSG_CHAR_CHECK_RENAME2, 0x028d, 34, chr->parse_char_rename_char2); -packet(CMSG_CHAR_RENAME, 0x028f, 6, chr->parse_char_rename_char_confirm); -packet(CMSG_CHAR_CHANGE_SLOT, 0x08d4, 8, chr->parse_char_move_character); -packet(CMSG_CHAR_REQUEST_CAPTCHA, 0x07e5, 8, chr->parse_char_request_captcha); -packet(CMSG_CHAR_CHECK_CAPTCHA, 0x07e7, 32, chr->parse_char_check_captcha); - -packet(CMSG_MAP_SERVER_CONNECT, 0x0072, 19, clif->pWantToConnection); -packet(CMSG_MAP_PING, 0x007e, 6, clif->pTickSend); -packet(CMSG_LOGIN_PING, 0x0200, 0, lclif->p->parse_CA_CONNECT_INFO_CHANGED); -packet(CMSG_LOGIN_HASH_CHECK, 0x0204, 0, lclif->p->parse_CA_EXE_HASHCHECK); - -packet(CMSG_CHAR_PING, 0x0187, 56, chr->parse_char_ping); -packet(CMSG_MAP_LOADED, 0x007d, 2, clif->pLoadEndAck); -packet(CMSG_CLIENT_QUIT, 0x018A, 4, clif->pQuitGame); - -packet(CMSG_CHAT_MESSAGE, 0x008c, -1, clif->pGlobalMessage); -packet(CMSG_CHAT_WHISPER, 0x0096, -1, clif->pWisMessage); -packet(CMSG_CHAT_ROOM_JOIN, 0x00d9, 14, clif->pChatAddMember); -packet2(CMSG_CHAT_JOIN_CHANNEL, 0x0b07, 0, nullptr); -packet2(CMSG_CHAT_PART_CHANNEL, 0x0b09, 0, nullptr); -packet(CMSG_BATTLE_CHAT_MESSAGE, 0x02db, -1, clif->pBattleChat); - -packet(CMSG_CREAYE_CHAT_ROOM, 0x00d5, -1, clif->pCreateChatRoom); -packet(CMSG_LEAVE_CHAT_ROOM, 0x00e3, 2, clif->pChatLeave); -packet(CMSG_SET_CHAT_ROOM_OPTIONS, 0x00de, -1, clif->pChatRoomStatusChange); -packet(CMSG_SET_CHAT_ROOM_OWNER, 0x00e0, 30, clif->pChangeChatOwner); -packet(CMSG_KICK_FROM_CHAT_ROOM, 0x00e2, 26, clif->pKickFromChat); - -packet(CMSG_SKILL_LEVELUP_REQUEST, 0x0112, 4, clif->pSkillUp); -packet(CMSG_STAT_UPDATE_REQUEST, 0x00bb, 5, clif->pStatusUp); -packet(CMSG_SKILL_USE_BEING, 0x0113, 10, clif->pUseSkillToId); -packet(CMSG_SKILL_USE_POSITION, 0x0116, 10, clif->pUseSkillToPos); -packet(CMSG_SKILL_USE_POSITION_MORE, 0x0190, 90, clif->pUseSkillToPosMoreInfo); -packet(CMSG_SKILL_USE_MAP, 0x011b, 20, clif->pUseSkillMap); - -packet(CMSG_PLAYER_INVENTORY_USE, 0x0439, 8, clif->pUseItem); -packet(CMSG_PLAYER_INVENTORY_DROP, 0x00a2, 6, clif->pDropItem); -packet(CMSG_PLAYER_EQUIP, 0x00a9, 6, clif->pEquipItem); -packet(CMSG_PLAYER_UNEQUIP, 0x00ab, 4, clif->pUnequipItem); -packet(CMSG_PLAYER_USE_CARD, 0x017a, 4, clif->pUseCard); -packet(CMSG_PLAYER_INSERT_CARD, 0x017c, 6, clif->pInsertCard); -packet(CMSG_PLAYER_VIEW_EQUIPMENT, 0x02d6, 6, clif->pViewPlayerEquip); -packet(CMSG_PLAYER_SET_EQUIPMENT_VISIBLE, 0x02d8, 10, clif->pEquipTick); - -packet(CMSG_ITEM_PICKUP, 0x009f, 6, clif->pTakeItem); -packet(CMSG_PLAYER_CHANGE_DIR, 0x009b, 5, clif->pChangeDir); -packet(CMSG_PLAYER_CHANGE_DEST, 0x0085, 5, clif->pWalkToXY); -packet(CMSG_PLAYER_CHANGE_ACT, 0x0089, 7, clif->pActionRequest); -packet(CMSG_PLAYER_RESTART, 0x00b2, 3, clif->pRestart); -packet(CMSG_PLAYER_EMOTE, 0x00bf, 3, clif->pEmotion); -packet(CMSG_PLAYER_STOP_ATTACK, 0x0118, 2, clif->pStopAttack); -packet(CMSG_WHO_REQUEST, 0x00c1, 2, clif->pHowManyConnections); - -packet(CMSG_NPC_TALK, 0x0090, 7, clif->pNpcClicked); -packet(CMSG_NPC_NEXT_REQUEST, 0x00b9, 6, clif->pNpcNextClicked); -packet(CMSG_NPC_CLOSE, 0x0146, 6, clif->pNpcCloseClicked); -packet(CMSG_NPC_LIST_CHOICE, 0x00b8, 7, clif->pNpcSelectMenu); -packet(CMSG_NPC_INT_RESPONSE, 0x0143, 10, clif->pNpcAmountInput); -packet(CMSG_NPC_STR_RESPONSE, 0x01d5, -1, clif->pNpcStringInput); -packet(CMSG_NPC_BUY_SELL_REQUEST, 0x00c5, 7, clif->pNpcBuySellSelected); -packet(CMSG_NPC_BUY_REQUEST, 0x00c8, -1, clif->pNpcBuyListSend); -packet(CMSG_NPC_SELL_REQUEST, 0x00c9, -1, clif->pNpcSellListSend); - -packet(CMSG_TRADE_REQUEST, 0x00e4, 6, clif->pTradeRequest); -packet(CMSG_TRADE_RESPONSE, 0x00e6, 3, clif->pTradeAck); -packet(CMSG_TRADE_ITEM_ADD_REQUEST, 0x00e8, 8, clif->pTradeAddItem); -packet(CMSG_TRADE_CANCEL_REQUEST, 0x00ed, 2, clif->pTradeCancel); -packet(CMSG_TRADE_ADD_COMPLETE, 0x00eb, 2, clif->pTradeOk); -packet(CMSG_TRADE_OK, 0x00ef, 2, clif->pTradeCommit); - -packet(CMSG_PARTY_CREATE, 0x00f9, 26, clif->pCreateParty); -packet(CMSG_PARTY_CREATE2, 0x01e8, 28, clif->pCreateParty2); -packet(CMSG_PARTY_INVITE, 0x00fc, 6, clif->pPartyInvite); -packet(CMSG_PARTY_INVITED, 0x00ff, 10, clif->pReplyPartyInvite); -packet(CMSG_PARTY_INVITED2, 0x02c7, 7, clif->pReplyPartyInvite2); -packet(CMSG_PARTY_LEAVE, 0x0100, 2, clif->pLeaveParty); -packet(CMSG_PARTY_SETTINGS, 0x0102, 6, clif->pPartyChangeOption); -packet(CMSG_PARTY_KICK, 0x0103, 30, clif->pRemovePartyMember); -packet(CMSG_PARTY_MESSAGE, 0x0108, -1, clif->pPartyMessage); -packet(CMSG_PARTY_CHANGE_LEADER, 0x07da, 6, clif->pPartyChangeLeader); -packet(CMSG_PARTY_ALLOW_INVITES, 0x02c8, 3, clif->pPartyTick); - -packet(CMSG_MOVE_TO_STORAGE, 0x00f3, 8, clif->pMoveToKafra); -packet(CMSG_MOVE_FROM_STORAGE, 0x00f5, 8, clif->pMoveFromKafra); -packet(CMSG_CLOSE_STORAGE, 0x00f7, 2, clif->pCloseKafra); - -packet(CMSG_MOVE_TO_CART, 0x0126, 8, clif->pPutItemToCart); -packet(CMSG_MOVE_FROM_CART, 0x0127, 8, clif->pGetItemFromCart); -packet(CMSG_CHANGE_CART, 0x01af, 4, clif->pChangeCart); -packet(CMSG_MOVE_FROM_STORAGE_TO_CART, 0x0128, 8, clif->pMoveFromKafraToCart); -packet(CMSG_MOVE_FROM_CART_TO_STORAGE, 0x0129, 8, clif->pMoveToKafraFromCart); - -packet(CMSG_ADMIN_ANNOUNCE, 0x0099, -1, clif->pBroadcast); -packet(CMSG_ADMIN_LOCAL_ANNOUNCE, 0x019C, -1, clif->pLocalBroadcast); -packet(CMSG_ADMIN_HIDE, 0x019D, 6, clif->pGMHide); -packet(CMSG_ADMIN_KICK, 0x00CC, 6, clif->pGMKick); -packet(CMSG_ADMIN_KICK_ALL, 0x00ce, 2, clif->pGMKickAll); -packet(CMSG_ADMIN_RESET_PLAYER, 0x0197, 4, clif->pResetChar); -packet(CMSG_ADMIN_GOTO, 0x01bb, 26, clif->pGMShift); -packet(CMSG_ADMIN_RECALL, 0x01bd, 26, clif->pGMRecall); -packet(CMSG_ADMIN_MUTE, 0x0149, 9, clif->pGMReqNoChat); -packet(CMSG_ADMIN_MUTE_NAME, 0x0212, 26, clif->pGMRc); -packet(CMSG_ADMIN_ID_TO_LOGIN, 0x01df, 6, clif->pGMReqAccountName); -packet(CMSG_ADMIN_SET_TILE_TYPE, 0x0198, 8, clif->pGMChangeMapType); -packet(CMSG_ADMIN_UNEQUIP_ALL, 0x07f5, 6, clif->pGMFullStrip); -packet(CMSG_ADMIN_REQUEST_STATS, 0x0213, 26, clif->pCheck); -packet(CMSG_ADMIN_MONSTER_ITEM, 0x013f, 26, clif->pGM_Monster_Item); - -packet(CMSG_GUILD_CHECK_MASTER, 0x014d, 2, clif->pGuildCheckMaster); -packet(CMSG_GUILD_REQUEST_INFO, 0x014f, 6, clif->pGuildRequestInfo); -packet(CMSG_GUILD_REQUEST_EMBLEM, 0x0151, 6, clif->pGuildRequestEmblem); -packet(CMSG_GUILD_CHANGE_EMBLEM, 0x0153, -1, clif->pGuildChangeEmblem); -packet(CMSG_GUILD_CHANGE_MEMBER_POS, 0x0155, -1, clif->pGuildChangeMemberPosition); -packet(CMSG_GUILD_LEAVE, 0x0159, 54, clif->pGuildLeave); -packet(CMSG_GUILD_EXPULSION, 0x015b, 54, clif->pGuildExpulsion); -packet(CMSG_GUILD_BREAK, 0x015d, 42, clif->pGuildBreak); -packet(CMSG_GUILD_CHANGE_POS_INFO, 0x0161, -1, clif->pGuildChangePositionInfo); -packet(CMSG_GUILD_CREATE, 0x0165, 30, clif->pCreateGuild); -packet(CMSG_GUILD_INVITE, 0x0168, 14, clif->pGuildInvite); -packet(CMSG_GUILD_INVITE_REPLY, 0x016b, 10, clif->pGuildReplyInvite); -packet(CMSG_GUILD_CHANGE_NOTICE, 0x016e, 186, clif->pGuildChangeNotice); -packet(CMSG_GUILD_ALLIANCE_REQUEST, 0x0170, 14, clif->pGuildRequestAlliance); -packet(CMSG_GUILD_ALLIANCE_REPLY, 0x0172, 10, clif->pGuildReplyAlliance); -packet(CMSG_GUILD_MESSAGE, 0x017e, -1, clif->pGuildMessage); -packet(CMSG_GUILD_OPPOSITION, 0x0180, 6, clif->pGuildOpposition); -packet(CMSG_GUILD_ALLIANCE_DELETE, 0x0183, 10, clif->pGuildDelAlliance); - -packet(CMSG_SOLVE_CHAR_NAME, 0x0193, 6, clif->pSolveCharName); -packet(CMSG_IGNORE_ALL, 0x00d0, 3, clif->pPMIgnoreAll); -packet(CMSG_IGNORE_NICK, 0x00cf, 27, clif->pPMIgnore); -packet(CMSG_REQUEST_IGNORE_LIST, 0x00d3, 2, clif->pPMIgnoreList); -packet(CMSG_SET_SHORTCUTS, 0x02ba, 11, clif->pHotkey); -packet(CMSG_NPC_COMPLETE_PROGRESS_BAR, 0x02f1, 2, clif->pProgressbar); -packet(CMSG_NPC_PRODUCE_MIX, 0x018e, 10, clif->pProduceMix); -packet(CMSG_NPC_COOKING, 0x025b, 6, clif->pCooking); -packet(CMSG_NPC_REPAIR, 0x01fd, 15, clif->pRepairItem); -packet(CMSG_NPC_REFINE, 0x0222, 6, clif->pWeaponRefine); -packet(CMSG_NPC_IDENTIFY, 0x0178, 4, clif->pItemIdentify); -packet(CMSG_NPC_SELECT_ARROW, 0x01ae, 4, clif->pSelectArrow); -packet(CMSG_NPC_SELECT_AUTO_SPELL, 0x01ce, 6, clif->pAutoSpell); - -packet(CMSG_PLAYER_MAPMOVE, 0x0140, 22, clif->pMapMove); -packet(CMSG_REMOVE_OPTION, 0x012a, 2, clif->pRemoveOption); -packet(CMSG_PLAYER_SET_MEMO, 0x011d, 2, clif->pRequestMemo); - -packet(CMSG_PET_CATCH, 0x019f, 6, clif->pCatchPet); -packet(CMSG_PET_SEND_MESSAGE, 0x01a9, 6, clif->pSendEmotion); -packet(CMSG_PET_SET_NAME, 0x01a5, 26, clif->pChangePetName); -packet(CMSG_PET_SELECT_EGG, 0x01a7, 4, clif->pSelectEgg); -packet(CMSG_PET_MENU_ACTION, 0x01a1, 3, clif->pPetMenu); -packet2(CMSG_PET_TALK, 0x0b0c, 0, nullptr); -packet2(CMSG_PET_EMOTE, 0x0b0d, 0, nullptr); -packet2(CMSG_PET_MOVE_TO, 0x0b11, 0, nullptr); -packet2(CMSG_PET_DIRECTION, 0x0b12, 0, nullptr); - -packet(CMSG_MERCENARY_ACTION, 0x029f, 3, clif->pmercenary_action); -packet(CMSG_HOMUNCULUS_SET_NAME, 0x0231, 26, clif->pChangeHomunculusName); -packet(CMSG_HOMMERC_MOVE_TO_MASTER, 0x0234, 6, clif->pHomMoveToMaster); -packet(CMSG_HOMMERC_MOVE_TO, 0x0232, 9, clif->pHomMoveTo); -packet(CMSG_HOMMERC_ATTACK, 0x0233, 11, clif->pHomAttack); -packet2(CMSG_HOMMERC_TALK, 0x0b13, 0, nullptr); -packet2(CMSG_HOMMERC_EMOTE, 0x0b14, 0, nullptr); -packet2(CMSG_HOMMERC_DIRECTION, 0x0b15, 0, nullptr); - -packet(CMSG_DORI_DORI, 0x01e7, 2, clif->pNoviceDoriDori); -packet(CMSG_EXPLOSION_SPIRITS, 0x01ed, 2, clif->pNoviceExplosionSpirits); -packet(CMSG_PVP_INFO, 0x020f, 10, clif->pPVPInfo); -packet(CMSG_PLAYER_AUTO_REVIVE, 0x0292, 2, clif->pAutoRevive); -packet(CMSG_QUEST_ACTIVATE, 0x02b6, 7, clif->pquestStateAck); - -packet(CMSG_MAIL_REFRESH_INBOX, 0x023f, 2, clif->pMail_refreshinbox); -packet(CMSG_MAIL_READ_MESSAGE, 0x0241, 6, clif->pMail_read); -packet(CMSG_MAIL_GET_ATTACH, 0x0244, 6, clif->pMail_getattach); -packet(CMSG_MAIL_DELETE_MESSAGE, 0x0243, 6, clif->pMail_delete); -packet(CMSG_MAIL_RETURN_MESSAGE, 0x0273, 30, clif->pMail_return); -packet(CMSG_MAIL_SET_ATTACH, 0x0247, 8, clif->pMail_setattach); -packet(CMSG_MAIL_RESET_ATTACH, 0x0246, 4, clif->pMail_winopen); -packet(CMSG_MAIL_SEND, 0x0248, -1, clif->pMail_send); - -packet(CMSG_FAMILY_ASK_FOR_CHILD, 0x01f9, 6, clif->pAdopt_request); -packet(CMSG_FAMILY_ASK_FOR_CHILD_REPLY, 0x01f7, 14, clif->pAdopt_reply); - -packet(CMSG_FRIENDS_ADD_PLAYER, 0x0202, 26, clif->pFriendsListAdd); -packet(CMSG_FRIENDS_REQUEST_ACK, 0x0208, 14, clif->pFriendsListReply); -packet(CMSG_FRIENDS_DELETE_PLAYER, 0x0203, 10, clif->pFriendsListRemove); - -packet(CMSG_AUCTION_CANCEL_REG, 0x024b, 4, clif->pAuction_cancelreg); -packet(CMSG_AUCTION_SET_ITEM, 0x024c, 8, clif->pAuction_setitem); -packet(CMSG_AUCTION_REGISTER, 0x024d, 12, clif->pAuction_register); -packet(CMSG_AUCTION_CANCEL, 0x024e, 6, clif->pAuction_cancel); -packet(CMSG_AUCTION_CLOSE, 0x025d, 6, clif->pAuction_close); -packet(CMSG_AUCTION_BID, 0x024f, 10, clif->pAuction_bid); -packet(CMSG_AUCTION_SEARCH, 0x0251, 34, clif->pAuction_search); -packet(CMSG_AUCTION_BUY_SELL, 0x025c, 4, clif->pAuction_buysell); - -packet(CMSG_VENDING_CLOSE, 0x012e, 2, clif->pCloseVending); -packet(CMSG_VENDING_LIST_REQ, 0x0130, 6, clif->pVendingListReq); -packet(CMSG_VENDING_BUY, 0x0134, -1, clif->pPurchaseReq); -packet(CMSG_VENDING_BUY2, 0x0801, -1, clif->pPurchaseReq2); -packet(CMSG_VENDING_CREATE_SHOP, 0x01b2, -1, clif->pOpenVending); - - -packet(CMSG_MERGE_ITEM_ACK, 0x096e, -1, clif->ackmergeitems); -packet(CMSG_MERGE_ITEM_CANCEL, 0x0974, 2, clif->cancelmergeitem); - -packet2(CMSG_SET_STATUS, 0x0b0e, 0, nullptr); - -packet2(CMSG_ONLINE_LIST, 0x0b0f, 0, nullptr); - -packet2(CMSG_PLAYER_INVENTORY_USE2, 0x0b26, 6, nullptr); - -#ifndef PACKETS_UPDATE -// 0 -packet(CMSG_ALCHEMIST_RANKS, 0x0000, 0, nullptr); -packet(CMSG_BLACKSMITH_RANKS, 0x0000, 0, nullptr); -packet(CMSG_PK_RANKS, 0x0000, 0, nullptr); -packet(CMSG_TAEKWON_RANKS, 0x0000, 0, nullptr); -packet(CMSG_BUYINGSTORE_CLOSE, 0x0000, 0, nullptr); -packet(CMSG_BUYINGSTORE_CREATE, 0x0000, 0, nullptr); -packet(CMSG_BUYINGSTORE_SELL, 0x0000, 0, nullptr); -packet(CMSG_SEARCHSTORE_SEARCH, 0x0000, 0, nullptr); -packet(CMSG_SEARCHSTORE_CLOSE, 0x0000, 0, nullptr); -packet(CMSG_HOMUNCULUS_MENU, 0x0000, 0, nullptr); -packet(CMSG_SEARCHSTORE_CLICK, 0x0000, 0, nullptr); -packet(CMSG_BUYINGSTORE_OPEN, 0x0000, 0, nullptr); -packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0000, 0, nullptr); -packet(CMSG_QUICK_IDENTIFY_ITEM, 0x0000, 0, nullptr); -packet(CMSG_PARTY_INVITE2, 0x0000, 0, nullptr); -packet(CMSG_SKILL_FEEL_SAVE_OK, 0x0000, 0, nullptr); -packet(CMSG_SKILL_SELECT_MENU, 0x0000, 0, nullptr); -packet(CMSG_PLAYER_LESS_EFFECTS, 0x0000, 0, nullptr); -packet(CMSG_SHORTCUTS_ROW_SHIFT, 0x0000, 0, nullptr); -packet(CMSG_NPC_SHOP_CLOSE, 0x0000, 0, nullptr); -packet(CMSG_NPC_MARKET_BUY, 0x0000, 0, nullptr); -packet(CMSG_NPC_MARKET_CLOSE, 0x0000, 0, nullptr); -packet(CMSG_BANK_DEPOSIT, 0x0000, 0, nullptr); -packet(CMSG_BANK_WITHDRAW, 0x0000, 0, nullptr); -packet(CMSG_BANK_CHECK, 0x0000, 0, nullptr); -packet(CMSG_BANK_OPEN, 0x0000, 0, nullptr); -packet(CMSG_BANK_CLOSE, 0x0000, 0, nullptr); -packet(CMSG_REQUEST_RANKS, 0x0000, 0, nullptr); -packet(CMSG_PLAYER_FAVORITE_ITEM, 0x0000, 0, nullptr); -packet(CMSG_BATTLE_REGISTER, 0x0000, 0, nullptr); -packet(CMSG_BATTLE_REVOKE, 0x0000, 0, nullptr); -packet(CMSG_BATTLE_BEGIN_ACK, 0x0000, 0, nullptr); -packet(CMSG_BATTLE_CHECK_STATE, 0x0000, 0, nullptr); -packet(CMSG_NPC_CASH_SHOP_BUY, 0x0000, 0, nullptr); -packet(CMSG_NPC_CASH_SHOP_BUY1, 0x0000, 0, nullptr); -packet(CMSG_NPC_CASH_SHOP_CLOSE, 0x0000, 0, nullptr); -packet(CMSG_NPC_CASH_SHOP_OPEN, 0x0000, 0, nullptr); -packet(CMSG_NPC_CASH_SHOP_REQUEST_TAB, 0x0000, 0, nullptr); -packet(CMSG_NPC_CASH_SHOP_SCHEDULE, 0x0000, 0, nullptr); -packet(CMSG_GUILD_INVITE2, 0x0000, 0, nullptr); -packet(CMSG_STORAGE_PASSWORD, 0x0000, 0, nullptr); -packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0000, 0, nullptr); -packet(CMSG_SELECT_CART, 0x0000, 0, nullptr); -packet(CMSG_ROULETTE_INFO, 0x0000, 0, nullptr); -packet(CMSG_ROULETTE_GENERATE, 0x0000, 0, nullptr); -packet(CMSG_ROULETTE_OPEN, 0x0000, 0, nullptr); -packet(CMSG_ROULETTE_CLOSE, 0x0000, 0, nullptr); -packet(CMSG_ROULETTE_RECV_ITEM, 0x0000, 0, nullptr); -packet(CMSG_ADMIN_RECALL2, 0x0000, 0, nullptr); -packet(CMSG_ADMIN_REMOVE2, 0x0000, 0, nullptr); -packet(CMSG_BOOKING_REGISTER_REQ, 0x0000, 0, nullptr); -packet(CMSG_BOOKING_SEARCH_REQ, 0x0000, 0, nullptr); -packet(CMSG_BOOKING_DELETE_REQ, 0x0000, 0, nullptr); -packet(CMSG_BOOKING_UPDATE_REQ, 0x0000, 0, nullptr); -packet(CMSG_MAIL2_CHECK_NAME, 0x0000, 0, nullptr); -packet(CMSG_MAIL2_OPEN_WRITE_MAIL, 0x0000, 0, nullptr); -packet(CMSG_MAIL2_ADD_ITEM_TO_MAIL, 0x0000, 0, nullptr); -packet(CMSG_MAIL2_REMOVE_ITEM_MAIL, 0x0000, 0, nullptr); -packet(CMSG_MAIL2_SEND_MAIL, 0x0000, 0, nullptr); -packet(CMSG_MAIL2_NEXT_PAGE, 0x0000, 0, nullptr); -packet(CMSG_MAIL2_READ_MAIL, 0x0000, 0, nullptr); -packet(CMSG_MAIL2_DELETE_MAIL, 0x0000, 0, nullptr); -packet(CMSG_MAIL2_REQUEST_MONEY, 0x0000, 0, nullptr); -packet(CMSG_MAIL2_REQUEST_ITEMS, 0x0000, 0, nullptr); -packet(CMSG_MAIL2_REFRESH_MAIL_LIST, 0x0000, 0, nullptr); -packet(CMSG_MAIL2_OPEN_MAILBOX, 0x0000, 0, nullptr); -packet(CMSG_MAIL2_CLOSE_MAILBOX, 0x0000, 0, nullptr); -packet(CMSG_MAIL2_CANCEL_WRITE_MAIL, 0x0000, 0, nullptr); -#else -// 20040713 -if (packetVersion >= 20040713) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x009b, 13, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x009f, 10, clif->pTakeItem); -} - -// 20040726 -if (packetVersion >= 20040726) -{ - packet(CMSG_CHAT_MESSAGE, 0x00f3, -1, clif->pGlobalMessage); - packet(CMSG_MAP_PING, 0x00f7, 10, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x009f, 13, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0094, 10, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0072, 14, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0113, 16, clif->pMoveToKafra); -} - -// 20040809 -if (packetVersion >= 20040809) -{ - packet(CMSG_MAP_PING, 0x00f7, 13, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x009f, 12, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0094, 13, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0072, 17, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0113, 23, clif->pMoveToKafra); -} - -// 20040906 -if (packetVersion >= 20040906) -{ - packet(CMSG_CHAT_MESSAGE, 0x009f, -1, clif->pGlobalMessage); - packet(CMSG_MAP_PING, 0x0116, 11, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x00f3, 10, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0113, 11, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0094, 17, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x007e, 19, clif->pMoveToKafra); -} - -// 20040920 -if (packetVersion >= 20040920) -{ - packet(CMSG_MAP_PING, 0x0116, 14, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x00f3, 18, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0113, 14, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0094, 19, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x007e, 25, clif->pMoveToKafra); -} - -// 20041005 -if (packetVersion >= 20041005) -{ - packet(CMSG_MAP_PING, 0x0116, 10, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x00f3, 13, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0113, 10, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0094, 14, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x007e, 16, clif->pMoveToKafra); -} - -// 20041025 -if (packetVersion >= 20041025) -{ - packet(CMSG_MAP_PING, 0x0116, 9, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x00f3, 15, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0113, 9, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0094, 12, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x007e, 13, clif->pMoveToKafra); -} - -// 20041108 -if (packetVersion >= 20041108) -{ - packet(CMSG_ALCHEMIST_RANKS, 0x0218, 2, clif->pAlchemist); - packet(CMSG_BLACKSMITH_RANKS, 0x0217, 2, clif->pBlacksmith); -} - -// 20041115 -if (packetVersion >= 20041115) -{ - packet(CMSG_PLAYER_LESS_EFFECTS, 0x021d, 6, clif->pLessEffect); -} - -// 20041129 -if (packetVersion >= 20041129) -{ - packet(CMSG_CHAT_MESSAGE, 0x0085, -1, clif->pGlobalMessage); - packet(CMSG_MAP_PING, 0x0089, 7, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x00f3, 8, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x00a2, 7, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0116, 12, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0094, 14, clif->pMoveToKafra); -} - -// 20050110 -if (packetVersion >= 20050110) -{ - packet(CMSG_CHAT_MESSAGE, 0x00f3, -1, clif->pGlobalMessage); - packet(CMSG_CLOSE_STORAGE, 0x0193, 2, clif->pCloseKafra); - packet(CMSG_MAP_PING, 0x0089, 9, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0085, 23, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x00f5, 9, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0116, 20, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0094, 20, clif->pMoveToKafra); -} - -// 20050328 -if (packetVersion >= 20050328) -{ - packet(CMSG_TAEKWON_RANKS, 0x0225, 2, clif->pTaekwon); -} - -// 20050425 -if (packetVersion >= 20050425) -{ - packet(CMSG_HOMUNCULUS_MENU, 0x022d, 5, clif->pHomMenu); -} - -// 20050509 -if (packetVersion >= 20050509) -{ - packet(CMSG_MAP_PING, 0x0089, 8, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0085, 11, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x00f5, 8, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0116, 10, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0094, 14, clif->pMoveToKafra); -} - -// 20050530 -if (packetVersion >= 20050530) -{ - packet(CMSG_PK_RANKS, 0x0237, 2, clif->pRankingPk); -} - -// 20050628 -if (packetVersion >= 20050628) -{ - packet(CMSG_MAP_PING, 0x0089, 13, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0085, 17, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x00f5, 13, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0116, 12, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0094, 31, clif->pMoveToKafra); -} - -// 20050718 -if (packetVersion >= 20050718) -{ - packet(CMSG_MAP_PING, 0x0089, 7, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0085, 11, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x00f5, 7, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0094, 21, clif->pMoveToKafra); -} - -// 20050719 -if (packetVersion >= 20050719) -{ - packet(CMSG_MAP_PING, 0x0089, 13, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0085, 17, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x00f5, 13, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0094, 31, clif->pMoveToKafra); -} - -// 20050817 -if (packetVersion >= 20050817) -{ - packet(CMSG_SKILL_FEEL_SAVE_OK, 0x0254, 3, clif->pFeelSaveOk); -} - -// 20060327 -if (packetVersion >= 20060327) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0085, 12, clif->pChangeDir); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0116, 17, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0094, 23, clif->pMoveToKafra); -} - -// 20070108 -if (packetVersion >= 20070108) -{ - packet(CMSG_MAP_PING, 0x0089, 11, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0085, 14, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x00f5, 11, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0116, 19, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0094, 17, clif->pMoveToKafra); -} - -// 20070212 -if (packetVersion >= 20070212) -{ - packet(CMSG_MAP_PING, 0x0089, 8, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0085, 11, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x00f5, 8, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0116, 10, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0094, 14, clif->pMoveToKafra); -} - -// 20070227 -if (packetVersion >= 20070227) -{ - packet(CMSG_PARTY_INVITE2, 0x02c4, 26, clif->pPartyInvite2); -} - -// 20080827 -if (packetVersion >= 20080827) -{ - packet(CMSG_MAP_PING, 0x0089, 11, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0085, 10, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x00f5, 11, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0116, 17, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0094, 19, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x00a7, 9, clif->pWalkToXY); - packet(CMSG_NAME_REQUEST, 0x008c, 14, clif->pGetCharNameRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0113, 25, clif->pUseSkillToPos); - packet(CMSG_SOLVE_CHAR_NAME, 0x00a2, 14, clif->pSolveCharName); - packet(CMSG_MOVE_FROM_STORAGE, 0x00f7, 17, clif->pMoveFromKafra); -} - -// 20080910 -if (packetVersion >= 20080910) -{ - packet(CMSG_MAP_SERVER_CONNECT, 0x0436, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0437, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_BEING, 0x0438, 10, clif->pUseSkillToId); -} - -// 20081210 -if (packetVersion >= 20081210) -{ - packet(CMSG_SKILL_SELECT_MENU, 0x0443, 8, clif->pSkillSelectMenu); -} - -// 20090603 -if (packetVersion >= 20090603) -{ - packet(CMSG_PARTY_SETTINGS, 0x07d7, 8, clif->pPartyChangeOption); -} - -// 20091222 -if (packetVersion >= 20091222) -{ - packet(CMSG_BOOKING_DELETE_REQ, 0x0806, 4, clif->pPartyBookingDeleteReq); -} - -// 20091229 -if (packetVersion >= 20091229) -{ - packet(CMSG_BOOKING_SEARCH_REQ, 0x0803, 14, clif->pPartyBookingSearchReq); - packet(CMSG_BOOKING_DELETE_REQ, 0x0806, 2, clif->pPartyBookingDeleteReq); - packet(CMSG_BOOKING_UPDATE_REQ, 0x0808, 14, clif->pPartyBookingUpdateReq); -} - -// 20100303 -if (packetVersion >= 20100303) -{ - packet(CMSG_BUYINGSTORE_CREATE, 0x0811, -1, clif->pReqOpenBuyingStore); -} - -// 20100420 -if (packetVersion >= 20100420) -{ - packet(CMSG_BUYINGSTORE_CLOSE, 0x0815, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BUYINGSTORE_SELL, 0x0819, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_OPEN, 0x0817, 6, clif->pReqClickBuyingStore); -} - -// 20100601 -if (packetVersion >= 20100601) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x0835, -1, clif->pSearchStoreInfo); -} - -// 20100608 -if (packetVersion >= 20100608) -{ - packet(CMSG_SEARCHSTORE_CLICK, 0x083c, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0838, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLOSE, 0x083b, 2, clif->pCloseSearchStoreInfo); -} - -// 20100803 -if (packetVersion >= 20100803) -{ - packet(CMSG_ADMIN_RECALL2, 0x0842, 6, clif->pGMRecall2); - packet(CMSG_ADMIN_REMOVE2, 0x0843, 6, clif->pGMRemove2); -} - -// 20101124 -if (packetVersion >= 20101124) -{ - packet(CMSG_MAP_PING, 0x0360, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0361, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0362, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0363, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0364, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0367, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_DEST, 0x035f, 5, clif->pWalkToXY); - packet(CMSG_NAME_REQUEST, 0x0368, 6, clif->pGetCharNameRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0366, 10, clif->pUseSkillToPos); - packet(CMSG_SOLVE_CHAR_NAME, 0x0369, 6, clif->pSolveCharName); - packet(CMSG_MOVE_FROM_STORAGE, 0x0365, 8, clif->pMoveFromKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x0436, 19, clif->pWantToConnection); - packet(CMSG_NPC_CASH_SHOP_BUY, 0x0288, -1, clif->pcashshop_buy); -} - -// 20110614 -if (packetVersion >= 20110614) -{ - packet(CMSG_NPC_CASH_SHOP_SCHEDULE, 0x08c9, 2, clif->pCashShopSchedule); -} - -// 20110718 -if (packetVersion >= 20110718) -{ - packet(CMSG_NPC_CASH_SHOP_CLOSE, 0x084a, 2, clif->pCashShopClose); - packet(CMSG_NPC_CASH_SHOP_OPEN, 0x0844, 2, clif->pCashShopOpen); - packet(CMSG_NPC_CASH_SHOP_REQUEST_TAB, 0x0846, 4, clif->pCashShopReqTab); - packet(CMSG_NPC_CASH_SHOP_BUY1, 0x0848, -1, clif->pCashShopBuy); -} - -// 20111005 -if (packetVersion >= 20111005) -{ - packet(CMSG_NAME_REQUEST, 0x088a, 6, clif->pGetCharNameRequest); - packet(CMSG_MAP_PING, 0x0817, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0366, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0815, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0885, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0893, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x08ad, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0364, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0369, 10, clif->pUseSkillToPos); - packet(CMSG_SOLVE_CHAR_NAME, 0x0838, 6, clif->pSolveCharName); - packet(CMSG_MOVE_FROM_STORAGE, 0x0897, 8, clif->pMoveFromKafra); - packet(CMSG_BATTLE_REGISTER, 0x08d7, 28, clif->pBGQueueRegister); - packet(CMSG_BATTLE_REVOKE, 0x08da, 26, clif->pBGQueueRevokeReq); - packet(CMSG_BATTLE_BEGIN_ACK, 0x08e0, 51, clif->pBGQueueBattleBeginAck); - packet(CMSG_BATTLE_CHECK_STATE, 0x090a, 26, clif->pBGQueueCheckState); -} - -// 20111102 -if (packetVersion >= 20111102) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x08ab, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x0835, 19, clif->pWantToConnection); // non PACKETVER_RE - packet(CMSG_MAP_SERVER_CONNECT, 0x083c, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x0899, 6, clif->pTickSend); // non PACKETVER_RE - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x088b, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0892, 5, clif->pWalkToXY); // non PACKETVER_RE - packet(CMSG_BUYINGSTORE_CLOSE, 0x089b, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_ACT, 0x08aa, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_SELL, 0x089e, -1, clif->pReqTradeBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0436, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x08a2, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_BUYINGSTORE_OPEN, 0x08a1, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0898, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_CREATE, 0x0835, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x02c4, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x088d, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0281, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0811, -1, clif->pItemListWindowSelected); -} - -// 20120307 -if (packetVersion >= 20120307) -{ - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0884, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x086A, 19, clif->pWantToConnection); - packet(CMSG_CHAR_CREATE, 0x0970, 31, chr->parse_char_create_new_char); - packet(CMSG_MAP_PING, 0x0887, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0890, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0865, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x02c4, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x093b, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0885, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0369, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x0963, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0863, 5, clif->pHomMenu); - packet(CMSG_SKILL_USE_BEING, 0x0889, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x0929, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0861, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0870, -1, clif->pItemListWindowSelected); -} - -// 20120410 -if (packetVersion >= 20120410) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MAP_SERVER_CONNECT, 0x094b, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x0886, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0871, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0938, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0891, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x086c, 8, clif->pMoveToKafra); - packet(CMSG_NAME_REQUEST, 0x0889, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_SOLVE_CHAR_NAME, 0x0884, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x089c, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_FROM_STORAGE, 0x08a6, 8, clif->pMoveFromKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x0885, 5, clif->pHomMenu); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_FAVORITE_ITEM, 0x0907, 5, clif->pMoveItem); - packet(CMSG_PARTY_INVITE2, 0x091c, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0961, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0945, -1, clif->pItemListWindowSelected); -} - -// 20120418 -if (packetVersion >= 20120418) -{ - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_GUILD_INVITE2, 0x0916, 26, clif->pGuildInvite2); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x08a8, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); -} - -// 20120502 -if (packetVersion >= 20120502) -{ - packet(CMSG_SELECT_CART, 0x0980, 7, clif->pSelectCart); -} - -// 20120702 -if (packetVersion >= 20120702) -{ - packet(CMSG_MAP_SERVER_CONNECT, 0x0363, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x0364, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0960, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x089f, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x089e, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x08a0, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0889, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0953, 5, clif->pWalkToXY); - packet(CMSG_NAME_REQUEST, 0x094a, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x085a, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0863, 10, clif->pUseSkillToPos); - packet(CMSG_SOLVE_CHAR_NAME, 0x0886, 6, clif->pSolveCharName); - packet(CMSG_MOVE_FROM_STORAGE, 0x0861, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_BEING, 0x0862, 10, clif->pUseSkillToId); -} - -// 20120710 -if (packetVersion >= 20120710) -{ - packet(CMSG_BUYINGSTORE_CLOSE, 0x0886, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); -} - -// 20120716 -if (packetVersion >= 20120716) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x0811, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0940, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0819, 36, clif->pStoragePassword); -} - -// 20120925 -if (packetVersion >= 20120925) -{ - packet(CMSG_PLAYER_EQUIP, 0x0998, 8, clif->pEquipItem); -} - -// 20130320 -if (packetVersion >= 20130320) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x094e, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x0888, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x0363, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0897, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0933, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0438, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x08ac, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x085a, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x092e, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0881, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0886, 2, clif->pReqCloseBuyingStore); - packet(CMSG_NAME_REQUEST, 0x0898, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x088e, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0959, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0922, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x094c, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x086f, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x0365, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x0874, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x035f, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x093f, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_CREATE, 0x0938, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x089b, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x086d, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0947, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0868, -1, clif->pItemListWindowSelected); -} - -// 20130320 -if (packetVersion >= 20130320) -{ - packet(CMSG_BANK_DEPOSIT, 0x09a7, 10, clif->pBankDeposit); - packet(CMSG_BANK_WITHDRAW, 0x09a9, 10, clif->pBankWithdraw); - packet(CMSG_BANK_CHECK, 0x09ab, 6, clif->pBankCheck); -} - -// 20130417 -if (packetVersion >= 20130417) -{ - packet(CMSG_BANK_OPEN, 0x09b6, 6, clif->pBankOpen); - packet(CMSG_BANK_CLOSE, 0x09b8, 6, clif->pBankClose); -} - -// 20130515 -if (packetVersion >= 20130515) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x0943, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0362, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x08a1, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0944, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0887, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0962, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x08ac, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0931, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x0947, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x093e, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0963, -1, clif->pItemListWindowSelected); -} - -// 20130522 -if (packetVersion >= 20130522) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x095b, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x08a9, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x07ec, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0925, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x095e, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x089c, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x08a3, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0964, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x08aa, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0360, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x086e, 2, clif->pReqCloseBuyingStore); - packet(CMSG_NAME_REQUEST, 0x08a6, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x08a2, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0811, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0952, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0369, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0362, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x093e, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x087e, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x0368, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0926, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_CREATE, 0x0874, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x095c, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x0950, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x088e, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x086a, -1, clif->pItemListWindowSelected); -} - -// 20130529 -if (packetVersion >= 20130529) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x0918, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x0919, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x0897, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0951, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0895, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0938, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x085e, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0941, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0876, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0964, 2, clif->pReqCloseBuyingStore); - packet(CMSG_NAME_REQUEST, 0x0863, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0890, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0917, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0936, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0937, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0877, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x085a, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x0957, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x0892, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x023b, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x08a7, 6, clif->pDropItem); - packet(CMSG_BUYINGSTORE_CREATE, 0x0869, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x0438, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x08a8, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0956, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0958, -1, clif->pItemListWindowSelected); -} - -// 20130605 -if (packetVersion >= 20130605) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_REQUEST_RANKS, 0x097c, 4, clif->pRanklist); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0883, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); -} - -// 20130612 -if (packetVersion >= 20130612) -{ - packet(CMSG_MAP_SERVER_CONNECT, 0x0919, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DIR, 0x087e, 5, clif->pChangeDir); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0940, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x093a, 5, clif->pHomMenu); - packet(CMSG_STORAGE_PASSWORD, 0x0964, 36, clif->pStoragePassword); -} - -// 20130618 -if (packetVersion >= 20130618) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x0281, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x095b, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x0930, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08a6, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0962, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0885, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x094f, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0363, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x088e, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x085a, 2, clif->pReqCloseBuyingStore); - packet(CMSG_NAME_REQUEST, 0x0944, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0889, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x096a, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0891, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0945, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0953, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x0890, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x0936, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x0862, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x02c4, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0917, 6, clif->pDropItem); - packet(CMSG_BUYINGSTORE_CREATE, 0x0932, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x0951, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x0887, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0864, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0942, -1, clif->pItemListWindowSelected); -} - -// 20130626 -if (packetVersion >= 20130626) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x088c, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x094d, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x088b, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0921, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0365, 2, clif->pReqCloseBuyingStore); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x08ab, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x0817, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0960, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0952, 6, clif->pDropItem); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x0895, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0930, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x08a5, -1, clif->pItemListWindowSelected); -} - -// 20130703 -if (packetVersion >= 20130703) -{ - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0930, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0360, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x0202, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x094a, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0873, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); -} - -// 20130807 -if (packetVersion >= 20130807) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_STORAGE_PASSWORD, 0x0887, 36, clif->pStoragePassword); -} - -// 20130814 -if (packetVersion >= 20130814) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x0889, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x0368, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x088a, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x088c, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0926, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0202, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0962, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0941, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x093a, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x094e, 2, clif->pReqCloseBuyingStore); - packet(CMSG_NAME_REQUEST, 0x0937, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0874, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0887, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0835, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0923, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0281, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x0868, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x0873, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x0895, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0958, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x095f, 6, clif->pDropItem); - packet(CMSG_BUYINGSTORE_CREATE, 0x0936, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x0947, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x0927, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0885, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x08a4, -1, clif->pItemListWindowSelected); -} - -// 20130814 -if (packetVersion >= 20130814) -{ - packet(CMSG_ADMIN_MONSTER_ITEM, 0x09ce, 102, clif->pGM_Monster_Item); -} - -// 20131211 -if (packetVersion >= 20131211) -{ - packet(CMSG_MAIL2_CLOSE_MAILBOX, 0x09e9, 2, clif->pRodexCloseMailbox); -} - -// 20131218 -if (packetVersion >= 20131218) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x092f, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0947, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x022d, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x08ab, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0811, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_NPC_SHOP_CLOSE, 0x09d4, 2, clif->pNPCShopClosed); - packet(CMSG_NPC_MARKET_BUY, 0x09d6, -1, clif->pNPCMarketPurchase); - packet(CMSG_NPC_MARKET_CLOSE, 0x09d8, 2, clif->pNPCMarketClosed); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x085c, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); -} -if (packetVersion >= 20131218) -{ - packet(CMSG_MAIL2_NEXT_PAGE, 0x09ee, 11, clif->pRodexNextMaillist); - packet(CMSG_MAIL2_DELETE_MAIL, 0x09f5, 11, clif->pRodexDeleteMail); - packet(CMSG_MAIL2_REFRESH_MAIL_LIST, 0x09ef, 11, clif->pRodexRefreshMaillist); -} - -// 20131223 -if (packetVersion >= 20131223) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_STORAGE_PASSWORD, 0x08a4, 36, clif->pStoragePassword); -} - -if (packetVersion >= 20131223) -{ - packet(CMSG_MAIL2_READ_MAIL, 0x09ea, 11, clif->pRodexReadMail); -} - -// 20131230 -if (packetVersion >= 20131230) -{ - packet(CMSG_BUYINGSTORE_CREATE, 0x0365, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_SELL, 0x087f, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x093d, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_CLOSE, 0x094c, 2, clif->pReqCloseBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0949, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_CLICK, 0x087b, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_BUYINGSTORE_OPEN, 0x0969, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x02C4, 10, clif->pUseSkillToId); - packet(CMSG_NAME_REQUEST, 0x0926, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_DIR, 0x094A, 5, clif->pChangeDir); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0860, 6, clif->pDropItem); - packet(CMSG_SKILL_USE_POSITION, 0x091E, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x092A, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0369, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_MOVE_TO_STORAGE, 0x0968, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x035f, 5, clif->pWalkToXY); - packet(CMSG_MAP_PING, 0x0438, 6, clif->pTickSend); - packet(CMSG_MOVE_FROM_STORAGE, 0x0895, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0871, 7, clif->pActionRequest); - packet(CMSG_MAP_SERVER_CONNECT, 0x089c, 19, clif->pWantToConnection); - packet(CMSG_PARTY_INVITE2, 0x08a9, 26, clif->pPartyInvite2); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0943, 26, clif->pFriendsListAdd); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x096a, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0898, 6, clif->pSolveCharName); - packet(CMSG_STORAGE_PASSWORD, 0x091d, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x022d, -1, clif->pItemListWindowSelected); -} -if (packetVersion >= 20131230) -{ - packet(CMSG_MAIL2_SEND_MAIL, 0x09ec, -1, clif->pRodexSendMail); -} - -// 20140108 -if (packetVersion == 20140108) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0936, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20140115 -if (packetVersion == 20140115) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0361, 6, clif->pDropItem); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_MOVE_FROM_STORAGE, 0x0367, 8, clif->pMoveFromKafra); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_NAME_REQUEST, 0x0802, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0865, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_SELL, 0x0887, -1, clif->pReqTradeBuyingStore); -// packet(UNKNOWN, 0x088a, 8, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x088e, 8, clif->pMoveToKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x089b, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08a7, 5, clif->pChangeDir); - packet(CMSG_HOMUNCULUS_MENU, 0x092d, 5, clif->pHomMenu); - packet(CMSG_ITEM_PICKUP, 0x0940, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x095b, 4, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x095d, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0965, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_SERVER_CONNECT, 0x0966, 19, clif->pWantToConnection); - packet(CMSG_BOOKING_REGISTER_REQ, 0x096a, 18, clif->pPartyBookingRegisterReq); -} - -// 20140122 -if (packetVersion == 20140122) -{ - packet(CMSG_PLAYER_CHANGE_ACT, 0x0360, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_OPEN, 0x07ec, 6, clif->pReqClickBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0811, 2, clif->pReqCloseBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0863, 5, clif->pHomMenu); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0870, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MAP_SERVER_CONNECT, 0x0871, 19, clif->pWantToConnection); - packet(CMSG_PARTY_INVITE2, 0x0872, 26, clif->pPartyInvite2); -// packet(UNKNOWN, 0x088c, 8, clif->pDull); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0890, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0893, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0899, -1, clif->pSearchStoreInfo); - packet(CMSG_NAME_REQUEST, 0x089d, 6, clif->pGetCharNameRequest); -// packet(UNKNOWN, 0x08a2, 4, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x08aa, 6, clif->pDropItem); - packet(CMSG_MAP_PING, 0x0917, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x091a, 5, clif->pChangeDir); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0925, 5, clif->pWalkToXY); - packet(CMSG_MOVE_TO_STORAGE, 0x092f, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_BEING, 0x0940, 10, clif->pUseSkillToId); - packet(CMSG_SOLVE_CHAR_NAME, 0x0941, 6, clif->pSolveCharName); - packet(CMSG_ITEM_PICKUP, 0x0942, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x094b, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_MOVE_FROM_STORAGE, 0x094c, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_POSITION, 0x0950, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0952, -1, clif->pReqTradeBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0955, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_CLICK, 0x0957, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x095d, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_CREATE, 0x095f, -1, clif->pReqOpenBuyingStore); -} - -// 20140129 -if (packetVersion == 20140129) -{ - packet(CMSG_SKILL_USE_BEING, 0x0281, 10, clif->pUseSkillToId); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); -// packet(UNKNOWN, 0x0361, 8, clif->pDull); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0367, 6, clif->pDropItem); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DIR, 0x07ec, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x0802, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); -// packet(UNKNOWN, 0x083c, 4, clif->pDull); - packet(CMSG_HOMUNCULUS_MENU, 0x0884, 5, clif->pHomMenu); - packet(CMSG_ITEM_PICKUP, 0x0885, 6, clif->pTakeItem); - packet(CMSG_MOVE_FROM_STORAGE, 0x0889, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0921, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0924, -1, clif->pItemListWindowSelected); - packet(CMSG_STORAGE_PASSWORD, 0x092c, 36, clif->pStoragePassword); - packet(CMSG_MOVE_TO_STORAGE, 0x094d, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0958, 26, clif->pPartyInvite2); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0961, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20140129 -if (packetVersion >= 20140129) -{ - packet(CMSG_SHORTCUTS_ROW_SHIFT, 0x0a01, 3, clif->pHotkeyRowShift); -} - -// 20140205 -if (packetVersion == 20140205) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0938, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20140212 -if (packetVersion == 20140212) -{ - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x02c4, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0369, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0438, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SKILL_USE_BEING, 0x086e, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_SELL, 0x0874, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_OPEN, 0x0877, 6, clif->pReqClickBuyingStore); - packet(CMSG_SEARCHSTORE_CLICK, 0x0878, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_CHANGE_DEST, 0x087e, 5, clif->pWalkToXY); - packet(CMSG_MOVE_FROM_STORAGE, 0x0888, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_CREATE, 0x088c, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x089d, 10, clif->pUseSkillToPos); - packet(CMSG_SEARCHSTORE_SEARCH, 0x089e, -1, clif->pSearchStoreInfo); - packet(CMSG_STORAGE_PASSWORD, 0x08a0, 36, clif->pStoragePassword); - packet(CMSG_PARTY_INVITE2, 0x08a1, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x08a7, -1, clif->pItemListWindowSelected); - packet(CMSG_MOVE_TO_STORAGE, 0x08ac, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x08ad, 6, clif->pDropItem); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0919, 5, clif->pChangeDir); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x091b, 26, clif->pFriendsListAdd); - packet(CMSG_SOLVE_CHAR_NAME, 0x0928, 6, clif->pSolveCharName); - packet(CMSG_MAP_PING, 0x0930, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0934, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0936, 4, clif->pDull); - packet(CMSG_MAP_SERVER_CONNECT, 0x093d, 19, clif->pWantToConnection); - packet(CMSG_HOMUNCULUS_MENU, 0x0944, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x094e, 8, clif->pDull); - packet(CMSG_NAME_REQUEST, 0x0952, 6, clif->pGetCharNameRequest); - packet(CMSG_ITEM_PICKUP, 0x0953, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0960, 2, clif->pReqCloseBuyingStore); -} - -// 20140212 -if (packetVersion >= 20140212) -{ - packet(CMSG_MAIL2_OPEN_MAILBOX, 0x09e8, 11, clif->pRodexOpenMailbox); -} - -// 20140219 -if (packetVersion == 20140219) -{ - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0202, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x0360, 4, clif->pDull); - packet(CMSG_SOLVE_CHAR_NAME, 0x0364, 6, clif->pSolveCharName); - packet(CMSG_ITEM_PICKUP, 0x0802, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SKILL_USE_BEING, 0x0838, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_OPEN, 0x085b, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x085c, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DEST, 0x085d, 5, clif->pWalkToXY); - packet(CMSG_NAME_REQUEST, 0x085f, 6, clif->pGetCharNameRequest); - packet(CMSG_HOMUNCULUS_MENU, 0x0860, 5, clif->pHomMenu); - packet(CMSG_STORAGE_PASSWORD, 0x0868, 36, clif->pStoragePassword); - packet(CMSG_PARTY_INVITE2, 0x086f, 26, clif->pPartyInvite2); - packet(CMSG_MOVE_TO_STORAGE, 0x087c, 8, clif->pMoveToKafra); -// packet(UNKNOWN, 0x0889, 8, clif->pDull); - packet(CMSG_BUYINGSTORE_CREATE, 0x0897, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_SELL, 0x0898, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x089f, 6, clif->pDropItem); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08a6, 5, clif->pChangeDir); - packet(CMSG_SEARCHSTORE_CLICK, 0x08aa, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x08ac, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0921, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0927, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0939, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_SERVER_CONNECT, 0x0946, 19, clif->pWantToConnection); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0949, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0953, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BUYINGSTORE_CLOSE, 0x095a, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MAP_PING, 0x0961, 6, clif->pTickSend); -} - -// 20140226 -if (packetVersion == 20140226) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_BUYINGSTORE_SELL, 0x0361, -1, clif->pReqTradeBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0362, 26, clif->pFriendsListAdd); - packet(CMSG_STORAGE_PASSWORD, 0x0364, 36, clif->pStoragePassword); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0811, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_HOMUNCULUS_MENU, 0x0867, 5, clif->pHomMenu); - packet(CMSG_MAP_SERVER_CONNECT, 0x0877, 19, clif->pWantToConnection); - packet(CMSG_SEARCHSTORE_CLICK, 0x0887, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0894, 6, clif->pDropItem); - packet(CMSG_MOVE_FROM_STORAGE, 0x0895, 8, clif->pMoveFromKafra); - packet(CMSG_MOVE_TO_STORAGE, 0x091a, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0921, 26, clif->pPartyInvite2); -// packet(UNKNOWN, 0x0931, 4, clif->pDull); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0941, 18, clif->pPartyBookingRegisterReq); -// packet(UNKNOWN, 0x0962, 8, clif->pDull); - packet(CMSG_ITEM_PICKUP, 0x0964, 6, clif->pTakeItem); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0969, -1, clif->pItemListWindowSelected); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20140305 -if (packetVersion == 20140305) -{ - packet(CMSG_ITEM_PICKUP, 0x0202, 6, clif->pTakeItem); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0361, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0436, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_MAP_SERVER_CONNECT, 0x0438, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x07e4, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0815, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x0878, 4, clif->pDull); - packet(CMSG_HOMUNCULUS_MENU, 0x0934, 5, clif->pHomMenu); - packet(CMSG_STORAGE_PASSWORD, 0x095e, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20140312 -if (packetVersion == 20140312) -{ - packet(CMSG_SKILL_USE_BEING, 0x0202, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x023b, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0366, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_OPEN, 0x085e, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_PING, 0x086f, 6, clif->pTickSend); - packet(CMSG_MAP_SERVER_CONNECT, 0x0889, 19, clif->pWantToConnection); - packet(CMSG_SKILL_USE_POSITION, 0x088c, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x088d, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_CHANGE_ACT, 0x088e, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_CREATE, 0x0891, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0894, 5, clif->pWalkToXY); - packet(CMSG_NAME_REQUEST, 0x089b, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_CLICK, 0x089d, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x089e, 6, clif->pDropItem); -// packet(UNKNOWN, 0x08a6, 4, clif->pDull); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x08a9, 26, clif->pFriendsListAdd); - packet(CMSG_SOLVE_CHAR_NAME, 0x08ad, 6, clif->pSolveCharName); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x091b, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PARTY_INVITE2, 0x091c, 26, clif->pPartyInvite2); - packet(CMSG_HOMUNCULUS_MENU, 0x091e, 5, clif->pHomMenu); - packet(CMSG_ITEM_PICKUP, 0x092a, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0948, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x094a, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x094b, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_DIR, 0x094c, 5, clif->pChangeDir); - packet(CMSG_MOVE_FROM_STORAGE, 0x0957, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_SELL, 0x095d, -1, clif->pReqTradeBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x095e, 36, clif->pStoragePassword); - packet(CMSG_MOVE_TO_STORAGE, 0x0966, 8, clif->pMoveToKafra); -} - -// 20140326 -if (packetVersion == 20140326) -{ - packet(CMSG_NAME_REQUEST, 0x0362, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_SELL, 0x0365, -1, clif->pReqTradeBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x07ec, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_OPEN, 0x083c, 6, clif->pReqClickBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x085b, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0865, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SEARCHSTORE_CLICK, 0x0867, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0869, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_FROM_STORAGE, 0x086b, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x087c, 5, clif->pWalkToXY); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x087e, 26, clif->pFriendsListAdd); - packet(CMSG_SKILL_USE_POSITION, 0x087f, 10, clif->pUseSkillToPos); -// packet(UNKNOWN, 0x0887, 4, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0898, 6, clif->pDropItem); -// packet(UNKNOWN, 0x08aa, 8, clif->pDull); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x08ac, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x08ad, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x0918, 6, clif->pTickSend); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0928, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_STORAGE_PASSWORD, 0x092a, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_CHANGE_ACT, 0x093d, 7, clif->pActionRequest); - packet(CMSG_HOMUNCULUS_MENU, 0x0942, 5, clif->pHomMenu); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0945, -1, clif->pItemListWindowSelected); - packet(CMSG_PARTY_INVITE2, 0x0946, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0956, 5, clif->pChangeDir); - packet(CMSG_MOVE_TO_STORAGE, 0x0959, 8, clif->pMoveToKafra); - packet(CMSG_SOLVE_CHAR_NAME, 0x095a, 6, clif->pSolveCharName); - packet(CMSG_SEARCHSTORE_SEARCH, 0x095c, -1, clif->pSearchStoreInfo); - packet(CMSG_SKILL_USE_BEING, 0x0969, 10, clif->pUseSkillToId); -} - -// 20140326 -if (packetVersion >= 20140326) -{ - packet(CMSG_MAIL2_REQUEST_MONEY, 0x09f1, 11, clif->pRodexRequestZeny); - packet(CMSG_MAIL2_REQUEST_ITEMS, 0x09f3, 11, clif->pRodexRequestItems); - packet(CMSG_MAIL2_CANCEL_WRITE_MAIL, 0x0a03, 2, clif->pRodexCancelWriteMail); -} - -// 20140402 -if (packetVersion == 20140402) -{ - packet(CMSG_BUYINGSTORE_OPEN, 0x023b, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0360, 5, clif->pChangeDir); - packet(CMSG_SKILL_USE_POSITION, 0x0364, 10, clif->pUseSkillToPos); - packet(CMSG_SOLVE_CHAR_NAME, 0x07ec, 6, clif->pSolveCharName); - packet(CMSG_MOVE_FROM_STORAGE, 0x085b, 8, clif->pMoveFromKafra); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x085d, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0867, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x0868, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0882, 6, clif->pDropItem); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0883, -1, clif->pItemListWindowSelected); - packet(CMSG_NAME_REQUEST, 0x088a, 6, clif->pGetCharNameRequest); -// packet(UNKNOWN, 0x088c, 4, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x0890, 26, clif->pPartyInvite2); - packet(CMSG_HOMUNCULUS_MENU, 0x0896, 5, clif->pHomMenu); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x089a, 26, clif->pFriendsListAdd); - packet(CMSG_BOOKING_REGISTER_REQ, 0x08ac, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_BUYINGSTORE_SELL, 0x091f, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0920, 19, clif->pWantToConnection); - packet(CMSG_STORAGE_PASSWORD, 0x0926, 36, clif->pStoragePassword); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x092d, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0933, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_CHANGE_DEST, 0x093f, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CREATE, 0x0944, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0946, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x094c, 8, clif->pDull); - packet(CMSG_MAP_PING, 0x0950, 6, clif->pTickSend); - packet(CMSG_ITEM_PICKUP, 0x0958, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x095c, 8, clif->pMoveToKafra); - packet(CMSG_SEARCHSTORE_CLICK, 0x0965, 12, clif->pSearchStoreInfoListItemClick); -} - -// 20140409 -if (packetVersion == 20140409) -{ - packet(CMSG_MOVE_FROM_STORAGE, 0x0819, 8, clif->pMoveFromKafra); - packet(CMSG_SOLVE_CHAR_NAME, 0x085b, 6, clif->pSolveCharName); - packet(CMSG_SEARCHSTORE_CLICK, 0x0868, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x086a, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_SELL, 0x086d, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0873, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0875, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_PING, 0x087e, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0883, 5, clif->pWalkToXY); - packet(CMSG_NAME_REQUEST, 0x0884, 6, clif->pGetCharNameRequest); -// packet(UNKNOWN, 0x088a, 8, clif->pDull); - packet(CMSG_ITEM_PICKUP, 0x0890, 6, clif->pTakeItem); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0893, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_BEING, 0x0896, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_CREATE, 0x0897, -1, clif->pReqOpenBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0899, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x08a2, 4, clif->pDull); - packet(CMSG_SKILL_USE_POSITION, 0x08a4, 10, clif->pUseSkillToPos); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x08a6, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08a7, 5, clif->pChangeDir); - packet(CMSG_STORAGE_PASSWORD, 0x08a9, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0918, 6, clif->pDropItem); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x091c, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PARTY_INVITE2, 0x092e, 26, clif->pPartyInvite2); - packet(CMSG_MOVE_TO_STORAGE, 0x0942, 8, clif->pMoveToKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x0947, 5, clif->pHomMenu); - packet(CMSG_BOOKING_REGISTER_REQ, 0x094c, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_BUYINGSTORE_OPEN, 0x095a, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x095e, 19, clif->pWantToConnection); -} - -// 20140416 -if (packetVersion == 20140416) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x095c, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -if (packetVersion >= 20140416) -{ - packet(CMSG_MAIL2_OPEN_WRITE_MAIL, 0x0a08, 26, clif->pRodexOpenWriteMail); - packet(CMSG_MAIL2_ADD_ITEM_TO_MAIL, 0x0a04, 6, clif->pRodexAddItem); - packet(CMSG_MAIL2_REMOVE_ITEM_MAIL, 0x0a06, 6, clif->pRodexRemoveItem); -} - -// 20140423 -if (packetVersion == 20140423) -{ - packet(CMSG_BOOKING_REGISTER_REQ, 0x022d, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_STORAGE_PASSWORD, 0x0360, 36, clif->pStoragePassword); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0436, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_FROM_STORAGE, 0x0811, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_DIR, 0x083c, 5, clif->pChangeDir); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x085a, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x085b, 5, clif->pWalkToXY); - packet(CMSG_MOVE_TO_STORAGE, 0x0862, 8, clif->pMoveToKafra); - packet(CMSG_BUYINGSTORE_SELL, 0x0863, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0866, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x086b, 6, clif->pDropItem); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x086f, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0873, -1, clif->pItemListWindowSelected); - packet(CMSG_SOLVE_CHAR_NAME, 0x088b, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_BEING, 0x0890, 10, clif->pUseSkillToId); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0895, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0896, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_CREATE, 0x0897, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x0898, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_OPEN, 0x089b, 6, clif->pReqClickBuyingStore); - packet(CMSG_NAME_REQUEST, 0x089d, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_CLOSE, 0x089f, 2, clif->pReqCloseBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x08a8, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x08ad, 8, clif->pDull); - packet(CMSG_MAP_PING, 0x091a, 6, clif->pTickSend); - packet(CMSG_PARTY_INVITE2, 0x0920, 26, clif->pPartyInvite2); - packet(CMSG_SEARCHSTORE_CLICK, 0x094f, 12, clif->pSearchStoreInfoListItemClick); -// packet(UNKNOWN, 0x095e, 4, clif->pDull); -} - -// 20140423 -if (packetVersion >= 20140423) -{ - packet(CMSG_MAIL2_CHECK_NAME, 0x0a13, 26, clif->pRodexCheckName); -} - -// 20140508 -if (packetVersion == 20140508) -{ - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0202, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x022d, 5, clif->pHomMenu); - packet(CMSG_STORAGE_PASSWORD, 0x023b, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x0281, 4, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x02c4, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_DEST, 0x035f, 5, clif->pWalkToXY); - packet(CMSG_MAP_PING, 0x0360, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0361, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0362, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0363, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0364, 8, clif->pMoveToKafra); - packet(CMSG_MOVE_FROM_STORAGE, 0x0365, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_POSITION, 0x0366, 10, clif->pUseSkillToPos); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0367, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_NAME_REQUEST, 0x0368, 6, clif->pGetCharNameRequest); - packet(CMSG_SOLVE_CHAR_NAME, 0x0369, 6, clif->pSolveCharName); - packet(CMSG_MAP_SERVER_CONNECT, 0x0436, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0437, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_BEING, 0x0438, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x07e4, -1, clif->pItemListWindowSelected); -// packet(UNKNOWN, 0x07ec, 8, clif->pDull); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0802, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_BUYINGSTORE_CREATE, 0x0811, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0815, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BUYINGSTORE_OPEN, 0x0817, 6, clif->pReqClickBuyingStore); - packet(CMSG_BUYINGSTORE_SELL, 0x0819, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0835, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0838, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x083c, 12, clif->pSearchStoreInfoListItemClick); -} - -// 20140514 -if (packetVersion == 20140514) -{ - packet(CMSG_SEARCHSTORE_CLICK, 0x0437, 12, clif->pSearchStoreInfoListItemClick); -// packet(UNKNOWN, 0x0817, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0865, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_SELL, 0x0867, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0868, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x0876, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x0877, 8, clif->pDull); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x087d, -1, clif->pItemListWindowSelected); - packet(CMSG_STORAGE_PASSWORD, 0x0885, 36, clif->pStoragePassword); - packet(CMSG_MAP_PING, 0x0886, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x088a, 5, clif->pChangeDir); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x088b, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_ITEM_PICKUP, 0x0895, 6, clif->pTakeItem); - packet(CMSG_SOLVE_CHAR_NAME, 0x089a, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x089c, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x08a5, 6, clif->pGetCharNameRequest); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0918, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MAP_SERVER_CONNECT, 0x091d, 19, clif->pWantToConnection); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0921, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BUYINGSTORE_OPEN, 0x0925, 6, clif->pReqClickBuyingStore); - packet(CMSG_MOVE_TO_STORAGE, 0x092c, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION, 0x092f, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_CLOSE, 0x094d, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x094e, 8, clif->pMoveFromKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x0958, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DEST, 0x095f, 5, clif->pWalkToXY); - packet(CMSG_PARTY_INVITE2, 0x0962, 26, clif->pPartyInvite2); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0965, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x096a, 6, clif->pDropItem); -} - -// 20140521 -if (packetVersion == 20140521) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0869, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x088b, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x088d, 5, clif->pChangeDir); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x089c, 26, clif->pFriendsListAdd); - packet(CMSG_MAP_SERVER_CONNECT, 0x08ac, 19, clif->pWantToConnection); - packet(CMSG_HOMUNCULUS_MENU, 0x0968, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20140528 -if (packetVersion == 20140528) -{ - packet(CMSG_PLAYER_CHANGE_DEST, 0x0202, 5, clif->pWalkToXY); - packet(CMSG_STORAGE_PASSWORD, 0x0360, 36, clif->pStoragePassword); - packet(CMSG_BOOKING_REGISTER_REQ, 0x085f, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SOLVE_CHAR_NAME, 0x0862, 6, clif->pSolveCharName); - packet(CMSG_HOMUNCULUS_MENU, 0x0872, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0875, 6, clif->pDropItem); - packet(CMSG_MAP_PING, 0x0877, 6, clif->pTickSend); - packet(CMSG_MOVE_FROM_STORAGE, 0x0879, 8, clif->pMoveFromKafra); - packet(CMSG_SEARCHSTORE_SEARCH, 0x087e, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_CLICK, 0x088a, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x088f, 90, clif->pUseSkillToPosMoreInfo); -// packet(UNKNOWN, 0x0894, 8, clif->pDull); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0896, -1, clif->pItemListWindowSelected); - packet(CMSG_ITEM_PICKUP, 0x089d, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_POSITION, 0x08a4, 10, clif->pUseSkillToPos); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x08a8, 2, clif->pSearchStoreInfoNextPage); -// packet(UNKNOWN, 0x08ab, 4, clif->pDull); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x091d, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0929, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_CREATE, 0x0930, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0938, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MOVE_TO_STORAGE, 0x093a, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x093f, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_OPEN, 0x094a, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x094b, 5, clif->pChangeDir); - packet(CMSG_NAME_REQUEST, 0x095f, 6, clif->pGetCharNameRequest); - packet(CMSG_SKILL_USE_BEING, 0x0963, 10, clif->pUseSkillToId); - packet(CMSG_MAP_SERVER_CONNECT, 0x0964, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_SELL, 0x0966, -1, clif->pReqTradeBuyingStore); -} - -// 20140605 -if (packetVersion == 20140605) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0361, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0368, 7, clif->pActionRequest); - packet(CMSG_MAP_SERVER_CONNECT, 0x0369, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0817, 5, clif->pChangeDir); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0921, 36, clif->pStoragePassword); - packet(CMSG_HOMUNCULUS_MENU, 0x0931, 5, clif->pHomMenu); - packet(CMSG_SOLVE_CHAR_NAME, 0x0940, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x094c, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20140605 -if (packetVersion >= 20140605) -{ - packet(CMSG_ROULETTE_OPEN, 0x0a19, -1, clif->pRouletteOpen); - packet(CMSG_ROULETTE_INFO, 0x0a1b, 2, clif->pRouletteInfo); - packet(CMSG_ROULETTE_CLOSE, 0x0a1d, 14, clif->pRouletteClose); -} - -// 20140611 -if (packetVersion == 20140611) -{ - packet(CMSG_BUYINGSTORE_CLOSE, 0x0364, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0438, -1, clif->pSearchStoreInfo); - packet(CMSG_MOVE_TO_STORAGE, 0x07e4, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0838, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_SELL, 0x0864, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_PING, 0x0867, 6, clif->pTickSend); -// packet(UNKNOWN, 0x086c, 4, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x0874, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_PICKUP, 0x0878, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_POSITION, 0x088c, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0891, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0893, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CREATE, 0x0894, -1, clif->pReqOpenBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x089b, 26, clif->pFriendsListAdd); - packet(CMSG_SKILL_USE_BEING, 0x08a1, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x08a2, 8, clif->pDull); - packet(CMSG_NAME_REQUEST, 0x0924, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_CLICK, 0x0936, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_STORAGE_PASSWORD, 0x0941, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x094a, -1, clif->pItemListWindowSelected); - packet(CMSG_SOLVE_CHAR_NAME, 0x094f, 6, clif->pSolveCharName); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0950, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0951, 5, clif->pChangeDir); - packet(CMSG_MOVE_FROM_STORAGE, 0x0952, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x0957, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0958, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0963, 6, clif->pDropItem); - packet(CMSG_HOMUNCULUS_MENU, 0x0965, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0969, 2, clif->pSearchStoreInfoNextPage); -} - -if (packetVersion >= 20140611) -{ -// new packets - packet(CMSG_ROULETTE_GENERATE, 0x0a1f, 2, clif->pRouletteGenerate); - packet(CMSG_ROULETTE_RECV_ITEM, 0x0a21, 6, clif->pRouletteRecvItem); -// changed packets - packet(CMSG_ROULETTE_OPEN, 0x0a19, 2, clif->pRouletteOpen); - packet(CMSG_ROULETTE_CLOSE, 0x0a1d, 2, clif->pRouletteClose); -} - -// 20140612 -if (packetVersion == 20140612) -{ - packet(CMSG_BUYINGSTORE_CLOSE, 0x0364, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0438, -1, clif->pSearchStoreInfo); - packet(CMSG_MOVE_TO_STORAGE, 0x07e4, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0838, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_SELL, 0x0864, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_PING, 0x0867, 6, clif->pTickSend); -// packet(UNKNOWN, 0x086c, 4, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x0874, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_PICKUP, 0x0878, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_POSITION, 0x088c, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0891, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0893, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CREATE, 0x0894, -1, clif->pReqOpenBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x089b, 26, clif->pFriendsListAdd); - packet(CMSG_SKILL_USE_BEING, 0x08a1, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x08a2, 8, clif->pDull); - packet(CMSG_NAME_REQUEST, 0x0924, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_CLICK, 0x0936, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_STORAGE_PASSWORD, 0x0941, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x094a, -1, clif->pItemListWindowSelected); - packet(CMSG_SOLVE_CHAR_NAME, 0x094f, 6, clif->pSolveCharName); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0950, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0951, 5, clif->pChangeDir); - packet(CMSG_MOVE_FROM_STORAGE, 0x0952, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x0957, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0958, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0963, 6, clif->pDropItem); - packet(CMSG_HOMUNCULUS_MENU, 0x0965, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0969, 2, clif->pSearchStoreInfoNextPage); -} - -// 20140613 -if (packetVersion == 20140613) -{ - packet(CMSG_BUYINGSTORE_CLOSE, 0x0364, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0438, -1, clif->pSearchStoreInfo); - packet(CMSG_MOVE_TO_STORAGE, 0x07e4, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0838, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_SELL, 0x0864, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_PING, 0x0867, 6, clif->pTickSend); -// packet(UNKNOWN, 0x086c, 4, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x0874, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_PICKUP, 0x0878, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_POSITION, 0x088c, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0891, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0893, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CREATE, 0x0894, -1, clif->pReqOpenBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x089b, 26, clif->pFriendsListAdd); - packet(CMSG_SKILL_USE_BEING, 0x08a1, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x08a2, 8, clif->pDull); - packet(CMSG_NAME_REQUEST, 0x0924, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_CLICK, 0x0936, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_STORAGE_PASSWORD, 0x0941, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x094a, -1, clif->pItemListWindowSelected); - packet(CMSG_SOLVE_CHAR_NAME, 0x094f, 6, clif->pSolveCharName); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0950, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0951, 5, clif->pChangeDir); - packet(CMSG_MOVE_FROM_STORAGE, 0x0952, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x0957, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0958, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0963, 6, clif->pDropItem); - packet(CMSG_HOMUNCULUS_MENU, 0x0965, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0969, 2, clif->pSearchStoreInfoNextPage); -} - -// 20140618 -if (packetVersion == 20140618) -{ - packet(CMSG_MOVE_TO_STORAGE, 0x085d, 8, clif->pMoveToKafra); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x085f, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_MAP_PING, 0x0860, 6, clif->pTickSend); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0861, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_SEARCH, 0x086c, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_CREATE, 0x0878, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x087d, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_SELL, 0x0884, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x0885, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0886, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0890, 5, clif->pChangeDir); - packet(CMSG_SKILL_USE_BEING, 0x0892, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_OPEN, 0x08a6, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_CHANGE_DEST, 0x08a7, 5, clif->pWalkToXY); -// packet(UNKNOWN, 0x08ac, 4, clif->pDull); - packet(CMSG_SKILL_USE_POSITION, 0x0917, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x091f, -1, clif->pItemListWindowSelected); - packet(CMSG_SEARCHSTORE_CLICK, 0x0929, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_ITEM_PICKUP, 0x0935, 6, clif->pTakeItem); - packet(CMSG_PARTY_INVITE2, 0x0938, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0939, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_ACT, 0x093b, 7, clif->pActionRequest); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0945, 6, clif->pDropItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0954, 26, clif->pFriendsListAdd); - packet(CMSG_STORAGE_PASSWORD, 0x0957, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x095d, 6, clif->pGetCharNameRequest); - packet(CMSG_MAP_SERVER_CONNECT, 0x095e, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x0962, 8, clif->pDull); - packet(CMSG_HOMUNCULUS_MENU, 0x0967, 5, clif->pHomMenu); -} - -if (packetVersion >= 20140618) -{ - packet(CMSG_ROULETTE_RECV_ITEM, 0x0a21, 3, clif->pRouletteRecvItem); -} - -// 20140625 -if (packetVersion == 20140625) -{ - packet(CMSG_MOVE_TO_STORAGE, 0x0202, 8, clif->pMoveToKafra); - packet(CMSG_MOVE_FROM_STORAGE, 0x023b, 8, clif->pMoveFromKafra); -// packet(UNKNOWN, 0x0815, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_SELL, 0x0817, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0835, 5, clif->pWalkToXY); - packet(CMSG_SEARCHSTORE_SEARCH, 0x085a, -1, clif->pSearchStoreInfo); - packet(CMSG_SKILL_USE_BEING, 0x0861, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x086b, 26, clif->pPartyInvite2); - packet(CMSG_SOLVE_CHAR_NAME, 0x0875, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_POSITION, 0x087b, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0885, 6, clif->pDropItem); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0886, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_CLICK, 0x0888, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x088a, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_SERVER_CONNECT, 0x088e, 19, clif->pWantToConnection); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0897, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MAP_PING, 0x08a1, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08a2, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x091a, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0923, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0928, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0940, -1, clif->pReqOpenBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0946, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x094e, 8, clif->pDull); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0959, 7, clif->pActionRequest); - packet(CMSG_STORAGE_PASSWORD, 0x0960, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_OPEN, 0x0968, 6, clif->pReqClickBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0969, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20140702 -if (packetVersion == 20140702) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x022d, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_CREATE, 0x023b, -1, clif->pReqOpenBuyingStore); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0364, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0437, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_TO_STORAGE, 0x0438, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION, 0x07e4, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0815, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0819, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_CLICK, 0x0835, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x085a, 6, clif->pDropItem); - packet(CMSG_BOOKING_REGISTER_REQ, 0x086c, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0887, 5, clif->pWalkToXY); - packet(CMSG_MOVE_FROM_STORAGE, 0x0892, 8, clif->pMoveFromKafra); -// packet(UNKNOWN, 0x0895, 8, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x08a0, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_PICKUP, 0x08a2, 6, clif->pTakeItem); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0925, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x092c, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x0933, 4, clif->pDull); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0940, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20140709 -if (packetVersion == 20140709) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x0364, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0437, 7, clif->pActionRequest); - packet(CMSG_STORAGE_PASSWORD, 0x0860, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x0866, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0869, 5, clif->pChangeDir); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0875, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_BEING, 0x0877, 10, clif->pUseSkillToId); - packet(CMSG_NAME_REQUEST, 0x0879, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x087a, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_MOVE_TO_STORAGE, 0x0887, 8, clif->pMoveToKafra); -// packet(UNKNOWN, 0x0888, 8, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x088b, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0894, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BUYINGSTORE_OPEN, 0x0897, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0898, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x08ad, 6, clif->pDropItem); - packet(CMSG_PLAYER_CHANGE_DEST, 0x091a, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0925, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SKILL_USE_POSITION, 0x092f, 10, clif->pUseSkillToPos); - packet(CMSG_SOLVE_CHAR_NAME, 0x0931, 6, clif->pSolveCharName); - packet(CMSG_MAP_PING, 0x0934, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_SELL, 0x0939, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SEARCHSTORE_CLICK, 0x093f, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_BUYINGSTORE_CREATE, 0x0940, -1, clif->pReqOpenBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x094d, 5, clif->pHomMenu); - packet(CMSG_MOVE_FROM_STORAGE, 0x094e, 8, clif->pMoveFromKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x094f, 26, clif->pFriendsListAdd); - packet(CMSG_BOOKING_REGISTER_REQ, 0x095f, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_ITEM_PICKUP, 0x0961, 6, clif->pTakeItem); -} - -// 20140716 -if (packetVersion == 20140716) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x0362, -1, clif->pSearchStoreInfo); - packet(CMSG_STORAGE_PASSWORD, 0x07e4, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0811, 7, clif->pActionRequest); - packet(CMSG_NAME_REQUEST, 0x085c, 6, clif->pGetCharNameRequest); - packet(CMSG_MAP_SERVER_CONNECT, 0x085f, 19, clif->pWantToConnection); - packet(CMSG_PARTY_INVITE2, 0x0868, 26, clif->pPartyInvite2); - packet(CMSG_MOVE_TO_STORAGE, 0x0871, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_BEING, 0x0881, 10, clif->pUseSkillToId); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x088b, 2, clif->pSearchStoreInfoNextPage); -// packet(UNKNOWN, 0x088d, 8, clif->pDull); - packet(CMSG_SKILL_USE_POSITION, 0x088f, 10, clif->pUseSkillToPos); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0896, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x089a, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_SELL, 0x089f, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x08a2, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x08a4, -1, clif->pReqOpenBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x08ac, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0918, 5, clif->pWalkToXY); - packet(CMSG_BOOKING_REGISTER_REQ, 0x091f, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0926, 6, clif->pDropItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x092c, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x092f, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x0938, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x093b, 6, clif->pReqClickBuyingStore); -// packet(UNKNOWN, 0x0947, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0952, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0958, 6, clif->pTakeItem); - packet(CMSG_MAP_PING, 0x0959, 6, clif->pTickSend); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0969, -1, clif->pItemListWindowSelected); -} - -// 20140723 -if (packetVersion == 20140723) -{ - packet(CMSG_MAP_PING, 0x02c4, 6, clif->pTickSend); - packet(CMSG_STORAGE_PASSWORD, 0x0364, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x0368, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_CLICK, 0x0436, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_BUYINGSTORE_CREATE, 0x0819, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x0838, 10, clif->pUseSkillToId); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x085a, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x085f, 5, clif->pWalkToXY); - packet(CMSG_MOVE_TO_STORAGE, 0x0869, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x086d, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_SEARCH, 0x087d, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_OPEN, 0x0888, 6, clif->pReqClickBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0891, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0896, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0898, 8, clif->pDull); - packet(CMSG_BUYINGSTORE_SELL, 0x089e, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x08a2, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x08ad, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SOLVE_CHAR_NAME, 0x0927, 6, clif->pSolveCharName); - packet(CMSG_MAP_SERVER_CONNECT, 0x092f, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0934, 26, clif->pFriendsListAdd); - packet(CMSG_PARTY_INVITE2, 0x0935, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0939, -1, clif->pItemListWindowSelected); - packet(CMSG_ITEM_PICKUP, 0x093d, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_POSITION, 0x0945, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0947, 7, clif->pActionRequest); - packet(CMSG_HOMUNCULUS_MENU, 0x0948, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x095f, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0960, 5, clif->pChangeDir); -} - -// 20140730 -if (packetVersion == 20140730) -{ - packet(CMSG_SKILL_USE_POSITION, 0x022d, 10, clif->pUseSkillToPos); - packet(CMSG_NAME_REQUEST, 0x0364, 6, clif->pGetCharNameRequest); - packet(CMSG_SKILL_USE_BEING, 0x0366, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_SELL, 0x0367, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0437, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x07ec, 4, clif->pDull); -// packet(UNKNOWN, 0x0802, 8, clif->pDull); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0815, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0817, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x085e, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x085f, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x087d, 8, clif->pMoveFromKafra); - packet(CMSG_SEARCHSTORE_SEARCH, 0x087e, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x087f, 6, clif->pDropItem); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0889, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MAP_PING, 0x088b, 6, clif->pTickSend); - packet(CMSG_SEARCHSTORE_CLICK, 0x088d, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_TO_STORAGE, 0x0892, 8, clif->pMoveToKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x08a0, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_OPEN, 0x08a6, 6, clif->pReqClickBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x08a7, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x08a9, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_STORAGE_PASSWORD, 0x08ad, 36, clif->pStoragePassword); - packet(CMSG_PARTY_INVITE2, 0x091e, 26, clif->pPartyInvite2); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0924, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_ITEM_PICKUP, 0x092a, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_CREATE, 0x0934, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0940, 5, clif->pChangeDir); - packet(CMSG_HOMUNCULUS_MENU, 0x0946, 5, clif->pHomMenu); -} - -// 20140806 -if (packetVersion == 20140806) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0948, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20140813 -if (packetVersion == 20140813) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0365, 36, clif->pStoragePassword); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_SEARCHSTORE_SEARCH, 0x07e4, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x0802, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0819, -1, clif->pItemListWindowSelected); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_HOMUNCULUS_MENU, 0x0868, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0878, 5, clif->pChangeDir); - packet(CMSG_PARTY_INVITE2, 0x087c, 26, clif->pPartyInvite2); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0882, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_FROM_STORAGE, 0x0895, 8, clif->pMoveFromKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0897, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0899, 6, clif->pDropItem); - packet(CMSG_ITEM_PICKUP, 0x08a3, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x08a7, 8, clif->pDull); -// packet(UNKNOWN, 0x08ab, 4, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x0967, 8, clif->pMoveToKafra); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20140814 -if (packetVersion == 20140814) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0365, 36, clif->pStoragePassword); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_SEARCHSTORE_SEARCH, 0x07e4, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x0802, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0819, -1, clif->pItemListWindowSelected); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_HOMUNCULUS_MENU, 0x0868, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0878, 5, clif->pChangeDir); - packet(CMSG_PARTY_INVITE2, 0x087c, 26, clif->pPartyInvite2); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0882, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_FROM_STORAGE, 0x0895, 8, clif->pMoveFromKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0897, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0899, 6, clif->pDropItem); - packet(CMSG_ITEM_PICKUP, 0x08a3, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x08a7, 8, clif->pDull); -// packet(UNKNOWN, 0x08ab, 4, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x0967, 8, clif->pMoveToKafra); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20140820 -if (packetVersion == 20140820) -{ - packet(CMSG_BUYINGSTORE_CLOSE, 0x035f, 2, clif->pReqCloseBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x07ec, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0835, 5, clif->pChangeDir); - packet(CMSG_MAP_PING, 0x0861, 6, clif->pTickSend); - packet(CMSG_MAP_SERVER_CONNECT, 0x0864, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x0869, 8, clif->pDull); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x086c, -1, clif->pItemListWindowSelected); - packet(CMSG_PARTY_INVITE2, 0x086e, 26, clif->pPartyInvite2); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0872, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0876, 6, clif->pDropItem); - packet(CMSG_NAME_REQUEST, 0x0891, 6, clif->pGetCharNameRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0899, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x089a, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x089b, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x08a3, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CREATE, 0x08a7, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x091d, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_BEING, 0x092f, 10, clif->pUseSkillToId); - packet(CMSG_SEARCHSTORE_CLICK, 0x0936, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_HOMUNCULUS_MENU, 0x0937, 5, clif->pHomMenu); - packet(CMSG_STORAGE_PASSWORD, 0x093a, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_OPEN, 0x093e, 6, clif->pReqClickBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x094a, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0951, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0952, 7, clif->pActionRequest); - packet(CMSG_MOVE_TO_STORAGE, 0x0956, 8, clif->pMoveToKafra); -// packet(UNKNOWN, 0x0958, 4, clif->pDull); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0961, 18, clif->pPartyBookingRegisterReq); -} - -// 20140827 -if (packetVersion == 20140827) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0943, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20140903 -if (packetVersion == 20140903) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MAP_SERVER_CONNECT, 0x088f, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x089b, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x0931, 5, clif->pHomMenu); - packet(CMSG_STORAGE_PASSWORD, 0x0941, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x0943, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0945, 5, clif->pChangeDir); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20140917 -if (packetVersion == 20140917) -{ - packet(CMSG_PARTY_INVITE2, 0x022d, 26, clif->pPartyInvite2); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0364, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_MOVE_TO_STORAGE, 0x0365, 8, clif->pMoveToKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x0366, 19, clif->pWantToConnection); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0367, -1, clif->pSearchStoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0369, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_CREATE, 0x0838, -1, clif->pReqOpenBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x0864, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x086d, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0889, 7, clif->pActionRequest); - packet(CMSG_HOMUNCULUS_MENU, 0x0895, 5, clif->pHomMenu); - packet(CMSG_MAP_PING, 0x0897, 6, clif->pTickSend); - packet(CMSG_NAME_REQUEST, 0x0898, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_OPEN, 0x089c, 6, clif->pReqClickBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x08a8, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_SELL, 0x0919, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x091e, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_CLICK, 0x092a, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x0930, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_BEING, 0x0949, 10, clif->pUseSkillToId); - packet(CMSG_SKILL_USE_POSITION, 0x094f, 10, clif->pUseSkillToPos); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0951, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0955, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0956, -1, clif->pItemListWindowSelected); -// packet(UNKNOWN, 0x0957, 8, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x095a, 6, clif->pDropItem); - packet(CMSG_PLAYER_CHANGE_DEST, 0x095c, 5, clif->pWalkToXY); - packet(CMSG_PLAYER_CHANGE_DIR, 0x095e, 5, clif->pChangeDir); -// packet(UNKNOWN, 0x0966, 4, clif->pDull); -} - -// 20140924 -if (packetVersion == 20140924) -{ - packet(CMSG_SKILL_USE_POSITION, 0x0366, 10, clif->pUseSkillToPos); - packet(CMSG_PARTY_INVITE2, 0x0367, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x07e4, 36, clif->pStoragePassword); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0802, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0815, 5, clif->pWalkToXY); -// packet(UNKNOWN, 0x0862, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_CREATE, 0x0864, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0865, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_SELL, 0x0867, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x086b, 2, clif->pReqCloseBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x086d, 6, clif->pTakeItem); - packet(CMSG_HOMUNCULUS_MENU, 0x086e, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x0886, 6, clif->pGetCharNameRequest); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x088b, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0894, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0898, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_MOVE_TO_STORAGE, 0x089c, 8, clif->pMoveToKafra); - packet(CMSG_SOLVE_CHAR_NAME, 0x08a5, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_BEING, 0x08a7, 10, clif->pUseSkillToId); - packet(CMSG_MAP_SERVER_CONNECT, 0x0918, 19, clif->pWantToConnection); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x091b, 2, clif->pSearchStoreInfoNextPage); -// packet(UNKNOWN, 0x0925, 8, clif->pDull); - packet(CMSG_MAP_PING, 0x0926, 6, clif->pTickSend); - packet(CMSG_MOVE_FROM_STORAGE, 0x0928, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_OPEN, 0x092b, 6, clif->pReqClickBuyingStore); - packet(CMSG_SEARCHSTORE_CLICK, 0x092d, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0934, 5, clif->pChangeDir); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0949, 6, clif->pDropItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0952, 26, clif->pFriendsListAdd); -} - -// 20141001 -if (packetVersion == 20141001) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0361, 6, clif->pDropItem); - packet(CMSG_SEARCHSTORE_CLICK, 0x0365, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_MOVE_FROM_STORAGE, 0x0838, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_TO_STORAGE, 0x087c, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0884, 26, clif->pPartyInvite2); - packet(CMSG_NAME_REQUEST, 0x0885, 6, clif->pGetCharNameRequest); - packet(CMSG_BOOKING_REGISTER_REQ, 0x089c, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x089d, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08ad, 5, clif->pChangeDir); -// packet(UNKNOWN, 0x091c, 4, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x092a, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0937, -1, clif->pItemListWindowSelected); -// packet(UNKNOWN, 0x0939, 8, clif->pDull); - packet(CMSG_ITEM_PICKUP, 0x093f, 6, clif->pTakeItem); - packet(CMSG_MAP_SERVER_CONNECT, 0x094b, 19, clif->pWantToConnection); - packet(CMSG_HOMUNCULUS_MENU, 0x0952, 5, clif->pHomMenu); -} - -// 20141008 -if (packetVersion == 20141008) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0942, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20141015 -if (packetVersion == 20141015) -{ - packet(CMSG_MOVE_FROM_STORAGE, 0x022d, 8, clif->pMoveFromKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_HOMUNCULUS_MENU, 0x0364, 5, clif->pHomMenu); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MAP_SERVER_CONNECT, 0x086e, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x0922, 4, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x0936, 36, clif->pStoragePassword); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x094b, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0967, 5, clif->pChangeDir); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20141016 -if (packetVersion == 20141016) -{ - packet(CMSG_MOVE_FROM_STORAGE, 0x022d, 8, clif->pMoveFromKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_HOMUNCULUS_MENU, 0x0364, 5, clif->pHomMenu); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MAP_SERVER_CONNECT, 0x086e, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x0922, 4, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x0936, 36, clif->pStoragePassword); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x094b, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0967, 5, clif->pChangeDir); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20141022 -if (packetVersion == 20141022) -{ - packet(CMSG_SKILL_USE_POSITION, 0x023b, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_STORAGE_PASSWORD, 0x0438, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_CLICK, 0x0835, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_TO_STORAGE, 0x0878, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x087d, 6, clif->pDropItem); - packet(CMSG_PARTY_INVITE2, 0x0896, 26, clif->pPartyInvite2); - packet(CMSG_HOMUNCULUS_MENU, 0x0899, 5, clif->pHomMenu); - packet(CMSG_MOVE_FROM_STORAGE, 0x08aa, 8, clif->pMoveFromKafra); -// packet(UNKNOWN, 0x08ab, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08ad, 5, clif->pChangeDir); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x091a, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x092b, 8, clif->pDull); - packet(CMSG_MAP_SERVER_CONNECT, 0x093b, 19, clif->pWantToConnection); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0940, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_ITEM_PICKUP, 0x094e, 6, clif->pTakeItem); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0955, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20141029 -if (packetVersion == 20141029) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0369, 5, clif->pWalkToXY); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x0437, 36, clif->pStoragePassword); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0940, 7, clif->pActionRequest); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20141105 -if (packetVersion == 20141105) -{ -// packet(UNKNOWN, 0x022d, 4, clif->pDull); - packet(CMSG_SKILL_USE_BEING, 0x035f, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_CREATE, 0x0360, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x085c, 10, clif->pUseSkillToPos); - packet(CMSG_NAME_REQUEST, 0x0863, 6, clif->pGetCharNameRequest); - packet(CMSG_MAP_PING, 0x0864, 6, clif->pTickSend); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0865, 26, clif->pFriendsListAdd); - packet(CMSG_STORAGE_PASSWORD, 0x0871, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x0874, 8, clif->pDull); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0875, 7, clif->pActionRequest); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0877, -1, clif->pItemListWindowSelected); - packet(CMSG_SEARCHSTORE_CLICK, 0x0879, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0887, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0892, 6, clif->pDropItem); - packet(CMSG_MOVE_FROM_STORAGE, 0x0898, 8, clif->pMoveFromKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x08a0, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08a5, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_CLOSE, 0x08a7, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MOVE_TO_STORAGE, 0x08ad, 8, clif->pMoveToKafra); - packet(CMSG_SOLVE_CHAR_NAME, 0x091d, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_OPEN, 0x091e, 6, clif->pReqClickBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x092b, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_SEARCH, 0x093e, -1, clif->pSearchStoreInfo); - packet(CMSG_HOMUNCULUS_MENU, 0x0944, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0948, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PARTY_INVITE2, 0x0950, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0957, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_SELL, 0x095f, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0968, 18, clif->pPartyBookingRegisterReq); -} - -// 20141112 -if (packetVersion == 20141112) -{ - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0362, 26, clif->pFriendsListAdd); - packet(CMSG_SOLVE_CHAR_NAME, 0x0438, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_CLOSE, 0x07e4, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BUYINGSTORE_SELL, 0x0835, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0838, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_MOVE_TO_STORAGE, 0x083c, 8, clif->pMoveToKafra); - packet(CMSG_SEARCHSTORE_SEARCH, 0x085f, -1, clif->pSearchStoreInfo); - packet(CMSG_SKILL_USE_BEING, 0x0863, 10, clif->pUseSkillToId); - packet(CMSG_NAME_REQUEST, 0x0869, 6, clif->pGetCharNameRequest); - packet(CMSG_BOOKING_REGISTER_REQ, 0x086c, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_BUYINGSTORE_CREATE, 0x0871, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0885, 5, clif->pChangeDir); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0886, -1, clif->pItemListWindowSelected); - packet(CMSG_PARTY_INVITE2, 0x0887, 26, clif->pPartyInvite2); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x088d, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_DEST, 0x08a0, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_OPEN, 0x08a1, 6, clif->pReqClickBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x08ab, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_CLICK, 0x0919, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_HOMUNCULUS_MENU, 0x0926, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0929, 7, clif->pActionRequest); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0943, 6, clif->pDropItem); - packet(CMSG_MAP_SERVER_CONNECT, 0x094b, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x094c, 4, clif->pDull); -// packet(UNKNOWN, 0x094f, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0955, 8, clif->pMoveFromKafra); - packet(CMSG_MAP_PING, 0x095d, 6, clif->pTickSend); - packet(CMSG_ITEM_PICKUP, 0x0960, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_POSITION, 0x0962, 10, clif->pUseSkillToPos); -} - -// 20141119 -if (packetVersion == 20141119) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x0202, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_OPEN, 0x085a, 6, clif->pReqClickBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0861, 26, clif->pFriendsListAdd); - packet(CMSG_PARTY_INVITE2, 0x0865, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0866, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0872, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_BEING, 0x0873, 10, clif->pUseSkillToId); - packet(CMSG_NAME_REQUEST, 0x0875, 6, clif->pGetCharNameRequest); - packet(CMSG_SOLVE_CHAR_NAME, 0x087c, 6, clif->pSolveCharName); -// packet(UNKNOWN, 0x0885, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0887, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0888, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_BUYINGSTORE_CREATE, 0x088d, -1, clif->pReqOpenBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0895, -1, clif->pItemListWindowSelected); - packet(CMSG_ITEM_PICKUP, 0x08a8, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_CLICK, 0x08aa, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_POSITION, 0x0918, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0920, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x0921, 19, clif->pWantToConnection); - packet(CMSG_MOVE_FROM_STORAGE, 0x0929, 8, clif->pMoveFromKafra); -// packet(UNKNOWN, 0x092f, 8, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x0933, 36, clif->pStoragePassword); - packet(CMSG_MAP_PING, 0x0938, 6, clif->pTickSend); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0940, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_MOVE_TO_STORAGE, 0x0941, 8, clif->pMoveToKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x0942, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0948, 5, clif->pWalkToXY); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x094c, 6, clif->pDropItem); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0963, 90, clif->pUseSkillToPosMoreInfo); -} - -// 20141119 -if (packetVersion >= 20141119) -{ - packet(CMSG_QUICK_IDENTIFY_ITEM, 0x0a35, 4, clif->pOneClick_ItemIdentify); -} - -// 20141126 -if (packetVersion == 20141126) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); -// packet(UNKNOWN, 0x0367, 8, clif->pDull); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0802, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0819, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MAP_SERVER_CONNECT, 0x086e, 19, clif->pWantToConnection); - packet(CMSG_MOVE_FROM_STORAGE, 0x0871, 8, clif->pMoveFromKafra); -// packet(UNKNOWN, 0x0884, 4, clif->pDull); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0896, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08a4, 5, clif->pChangeDir); - packet(CMSG_STORAGE_PASSWORD, 0x08ad, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0920, 6, clif->pDropItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0942, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_PICKUP, 0x095a, 6, clif->pTakeItem); - packet(CMSG_HOMUNCULUS_MENU, 0x095b, 5, clif->pHomMenu); - packet(CMSG_MOVE_TO_STORAGE, 0x095f, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0965, 26, clif->pPartyInvite2); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20141203 -if (packetVersion == 20141203) -{ - packet(CMSG_SOLVE_CHAR_NAME, 0x0202, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_SELL, 0x0281, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0362, -1, clif->pReqOpenBuyingStore); - packet(CMSG_NAME_REQUEST, 0x0367, 6, clif->pGetCharNameRequest); -// packet(UNKNOWN, 0x0368, 8, clif->pDull); - packet(CMSG_MAP_SERVER_CONNECT, 0x0802, 19, clif->pWantToConnection); - packet(CMSG_MOVE_TO_STORAGE, 0x0861, 8, clif->pMoveToKafra); - packet(CMSG_SEARCHSTORE_SEARCH, 0x086c, -1, clif->pSearchStoreInfo); - packet(CMSG_MOVE_FROM_STORAGE, 0x086d, 8, clif->pMoveFromKafra); - packet(CMSG_ITEM_PICKUP, 0x086e, 6, clif->pTakeItem); - packet(CMSG_PLAYER_CHANGE_DEST, 0x087b, 5, clif->pWalkToXY); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x087e, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0880, 5, clif->pChangeDir); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0889, 26, clif->pFriendsListAdd); - packet(CMSG_STORAGE_PASSWORD, 0x0898, 36, clif->pStoragePassword); - packet(CMSG_SKILL_USE_POSITION, 0x089c, 10, clif->pUseSkillToPos); - packet(CMSG_SEARCHSTORE_CLICK, 0x089d, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_CHANGE_ACT, 0x08a5, 7, clif->pActionRequest); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x08aa, 6, clif->pDropItem); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0917, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BOOKING_REGISTER_REQ, 0x091c, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PARTY_INVITE2, 0x091d, 26, clif->pPartyInvite2); - packet(CMSG_MAP_PING, 0x0928, 6, clif->pTickSend); -// packet(UNKNOWN, 0x092a, 4, clif->pDull); - packet(CMSG_HOMUNCULUS_MENU, 0x0936, 5, clif->pHomMenu); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0952, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0957, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BUYINGSTORE_OPEN, 0x095c, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x0962, 10, clif->pUseSkillToId); -} - -// 20141210 -if (packetVersion == 20141210) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_HOMUNCULUS_MENU, 0x0436, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DIR, 0x07e4, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_PICKUP, 0x087b, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_SELL, 0x0885, -1, clif->pReqTradeBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x08ac, -1, clif->pItemListWindowSelected); - packet(CMSG_PARTY_INVITE2, 0x0917, 26, clif->pPartyInvite2); -// packet(UNKNOWN, 0x0927, 8, clif->pDull); - packet(CMSG_BOOKING_REGISTER_REQ, 0x092b, 18, clif->pPartyBookingRegisterReq); -// packet(UNKNOWN, 0x0947, 4, clif->pDull); - packet(CMSG_MAP_SERVER_CONNECT, 0x0954, 19, clif->pWantToConnection); - packet(CMSG_MOVE_FROM_STORAGE, 0x0955, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0958, 6, clif->pDropItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0961, 26, clif->pFriendsListAdd); - packet(CMSG_STORAGE_PASSWORD, 0x0963, 36, clif->pStoragePassword); - packet(CMSG_MOVE_TO_STORAGE, 0x0967, 8, clif->pMoveToKafra); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20141224 -if (packetVersion == 20141224) -{ - packet(CMSG_MOVE_TO_STORAGE, 0x0361, 8, clif->pMoveToKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0438, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0835, -1, clif->pItemListWindowSelected); - packet(CMSG_SEARCHSTORE_SEARCH, 0x085a, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_CLOSE, 0x085e, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0865, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_HOMUNCULUS_MENU, 0x0867, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_OPEN, 0x086c, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0870, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x087a, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x087b, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x089a, 5, clif->pWalkToXY); - packet(CMSG_BOOKING_REGISTER_REQ, 0x089b, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PARTY_INVITE2, 0x08a3, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x08a4, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_SELL, 0x08a8, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x08ac, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0930, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0932, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x093a, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_MAP_PING, 0x0945, 6, clif->pTickSend); - packet(CMSG_NAME_REQUEST, 0x0946, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_CLICK, 0x0949, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MAP_SERVER_CONNECT, 0x094f, 19, clif->pWantToConnection); - packet(CMSG_SOLVE_CHAR_NAME, 0x0950, 6, clif->pSolveCharName); - packet(CMSG_MOVE_FROM_STORAGE, 0x0953, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_POSITION, 0x0956, 10, clif->pUseSkillToPos); - packet(CMSG_SKILL_USE_BEING, 0x095b, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_ACT, 0x095f, 7, clif->pActionRequest); -} - -// 20141231 -if (packetVersion == 20141231) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x086d, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150107 -if (packetVersion == 20150107) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x087c, 26, clif->pFriendsListAdd); - packet(CMSG_STORAGE_PASSWORD, 0x0895, 36, clif->pStoragePassword); - packet(CMSG_HOMUNCULUS_MENU, 0x092d, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0943, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x0947, 19, clif->pWantToConnection); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150114 -if (packetVersion == 20150114) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_BEING, 0x0436, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MAP_SERVER_CONNECT, 0x083c, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0868, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x0899, 5, clif->pHomMenu); - packet(CMSG_STORAGE_PASSWORD, 0x0946, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x0955, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0957, 5, clif->pChangeDir); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150121 -if (packetVersion == 20150121) -{ - packet(CMSG_BOOKING_REGISTER_REQ, 0x0281, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x07e4, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x087c, 4, clif->pDull); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x088b, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x089d, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DIR, 0x089e, 5, clif->pChangeDir); - packet(CMSG_STORAGE_PASSWORD, 0x08ab, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x0918, 8, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0919, 6, clif->pDropItem); - packet(CMSG_ITEM_PICKUP, 0x091d, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0955, 8, clif->pMoveToKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x0959, 19, clif->pWantToConnection); - packet(CMSG_MOVE_FROM_STORAGE, 0x0963, 8, clif->pMoveFromKafra); - packet(CMSG_PARTY_INVITE2, 0x0967, 26, clif->pPartyInvite2); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150128 -if (packetVersion == 20150128) -{ - packet(CMSG_SEARCHSTORE_CLICK, 0x0202, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_CHANGE_DIR, 0x023b, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_OPEN, 0x035f, 6, clif->pReqClickBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0365, -1, clif->pSearchStoreInfo); -// packet(UNKNOWN, 0x0368, 8, clif->pDull); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0838, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_CREATE, 0x085a, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x0864, 10, clif->pUseSkillToPos); - packet(CMSG_MOVE_TO_STORAGE, 0x086d, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0870, 5, clif->pWalkToXY); - packet(CMSG_NAME_REQUEST, 0x0874, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_SELL, 0x0875, -1, clif->pReqTradeBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0876, 5, clif->pHomMenu); - packet(CMSG_SOLVE_CHAR_NAME, 0x087d, 6, clif->pSolveCharName); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0888, -1, clif->pItemListWindowSelected); - packet(CMSG_BOOKING_REGISTER_REQ, 0x089a, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_ITEM_PICKUP, 0x08ab, 6, clif->pTakeItem); - packet(CMSG_MAP_PING, 0x091f, 6, clif->pTickSend); - packet(CMSG_PARTY_INVITE2, 0x0927, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0929, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x092d, 2, clif->pSearchStoreInfoNextPage); -// packet(UNKNOWN, 0x0938, 4, clif->pDull); - packet(CMSG_SKILL_USE_BEING, 0x093a, 10, clif->pUseSkillToId); - packet(CMSG_MAP_SERVER_CONNECT, 0x0944, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_CLOSE, 0x094d, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x094e, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0952, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0963, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0968, 6, clif->pDropItem); -} - -// 20150129 -if (packetVersion == 20150129) -{ - packet(CMSG_SEARCHSTORE_CLICK, 0x0202, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_CHANGE_DIR, 0x023b, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_OPEN, 0x035f, 6, clif->pReqClickBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0365, -1, clif->pSearchStoreInfo); -// packet(UNKNOWN, 0x0368, 8, clif->pDull); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0838, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_CREATE, 0x085a, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x0864, 10, clif->pUseSkillToPos); - packet(CMSG_MOVE_TO_STORAGE, 0x086d, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0870, 5, clif->pWalkToXY); - packet(CMSG_NAME_REQUEST, 0x0874, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_SELL, 0x0875, -1, clif->pReqTradeBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0876, 5, clif->pHomMenu); - packet(CMSG_SOLVE_CHAR_NAME, 0x087d, 6, clif->pSolveCharName); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0888, -1, clif->pItemListWindowSelected); - packet(CMSG_BOOKING_REGISTER_REQ, 0x089a, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_ITEM_PICKUP, 0x08ab, 6, clif->pTakeItem); - packet(CMSG_MAP_PING, 0x091f, 6, clif->pTickSend); - packet(CMSG_PARTY_INVITE2, 0x0927, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0929, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x092d, 2, clif->pSearchStoreInfoNextPage); -// packet(UNKNOWN, 0x0938, 4, clif->pDull); - packet(CMSG_SKILL_USE_BEING, 0x093a, 10, clif->pUseSkillToId); - packet(CMSG_MAP_SERVER_CONNECT, 0x0944, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_CLOSE, 0x094d, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x094e, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0952, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0963, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0968, 6, clif->pDropItem); -} - -// 20150130 -if (packetVersion == 20150130) -{ - packet(CMSG_SEARCHSTORE_CLICK, 0x0202, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_CHANGE_DIR, 0x023b, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_OPEN, 0x035f, 6, clif->pReqClickBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0365, -1, clif->pSearchStoreInfo); -// packet(UNKNOWN, 0x0368, 8, clif->pDull); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0838, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_CREATE, 0x085a, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x0864, 10, clif->pUseSkillToPos); - packet(CMSG_MOVE_TO_STORAGE, 0x086d, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0870, 5, clif->pWalkToXY); - packet(CMSG_NAME_REQUEST, 0x0874, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_SELL, 0x0875, -1, clif->pReqTradeBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0876, 5, clif->pHomMenu); - packet(CMSG_SOLVE_CHAR_NAME, 0x087d, 6, clif->pSolveCharName); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0888, -1, clif->pItemListWindowSelected); - packet(CMSG_BOOKING_REGISTER_REQ, 0x089a, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_ITEM_PICKUP, 0x08ab, 6, clif->pTakeItem); - packet(CMSG_MAP_PING, 0x091f, 6, clif->pTickSend); - packet(CMSG_PARTY_INVITE2, 0x0927, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0929, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x092d, 2, clif->pSearchStoreInfoNextPage); -// packet(UNKNOWN, 0x0938, 4, clif->pDull); - packet(CMSG_SKILL_USE_BEING, 0x093a, 10, clif->pUseSkillToId); - packet(CMSG_MAP_SERVER_CONNECT, 0x0944, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_CLOSE, 0x094d, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x094e, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0952, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0963, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0968, 6, clif->pDropItem); -} - -// 20150204 -if (packetVersion == 20150204) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0966, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150211 -if (packetVersion == 20150211) -{ -// packet(UNKNOWN, 0x023b, 4, clif->pDull); - packet(CMSG_HOMUNCULUS_MENU, 0x0368, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0369, 5, clif->pChangeDir); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0436, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0437, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x07e4, 6, clif->pDropItem); - packet(CMSG_SKILL_USE_POSITION, 0x0817, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0819, 2, clif->pReqCloseBuyingStore); -// packet(UNKNOWN, 0x0835, 8, clif->pDull); - packet(CMSG_BUYINGSTORE_SELL, 0x0862, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x0863, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_PICKUP, 0x0870, 6, clif->pTakeItem); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0873, 5, clif->pWalkToXY); - packet(CMSG_NAME_REQUEST, 0x087b, 6, clif->pGetCharNameRequest); - packet(CMSG_STORAGE_PASSWORD, 0x087f, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_CREATE, 0x0882, -1, clif->pReqOpenBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x0883, 8, clif->pMoveFromKafra); - packet(CMSG_MAP_PING, 0x0885, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0886, 6, clif->pReqClickBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x089c, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x08a0, 26, clif->pFriendsListAdd); - packet(CMSG_MAP_SERVER_CONNECT, 0x08a4, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_ACT, 0x08aa, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0919, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0920, 6, clif->pSolveCharName); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0944, -1, clif->pSearchStoreInfo); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0951, -1, clif->pItemListWindowSelected); - packet(CMSG_PARTY_INVITE2, 0x0957, 26, clif->pPartyInvite2); - packet(CMSG_MOVE_TO_STORAGE, 0x0958, 8, clif->pMoveToKafra); -} - -// 20150217 -if (packetVersion == 20150217) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x085b, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150225 -if (packetVersion == 20150225) -{ - packet(CMSG_BUYINGSTORE_OPEN, 0x02c4, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_PARTY_INVITE2, 0x0360, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0362, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_NAME_REQUEST, 0x0436, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x0817, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0819, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0867, 18, clif->pPartyBookingRegisterReq); -// packet(UNKNOWN, 0x0885, 4, clif->pDull); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0896, -1, clif->pItemListWindowSelected); -// packet(UNKNOWN, 0x089b, 8, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x089c, 8, clif->pMoveToKafra); - packet(CMSG_STORAGE_PASSWORD, 0x08a4, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0940, -1, clif->pSearchStoreInfo); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0946, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0948, 6, clif->pDropItem); - packet(CMSG_HOMUNCULUS_MENU, 0x094f, 5, clif->pHomMenu); - packet(CMSG_MOVE_FROM_STORAGE, 0x0952, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0955, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x096a, 19, clif->pWantToConnection); -} - -// 20150226 -if (packetVersion == 20150226) -{ - packet(CMSG_BUYINGSTORE_OPEN, 0x02c4, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_PARTY_INVITE2, 0x0360, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0362, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_NAME_REQUEST, 0x0436, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x0817, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0819, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0867, 18, clif->pPartyBookingRegisterReq); -// packet(UNKNOWN, 0x0885, 4, clif->pDull); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0896, -1, clif->pItemListWindowSelected); -// packet(UNKNOWN, 0x089b, 8, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x089c, 8, clif->pMoveToKafra); - packet(CMSG_STORAGE_PASSWORD, 0x08a4, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0940, -1, clif->pSearchStoreInfo); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0946, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0948, 6, clif->pDropItem); - packet(CMSG_HOMUNCULUS_MENU, 0x094f, 5, clif->pHomMenu); - packet(CMSG_MOVE_FROM_STORAGE, 0x0952, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0955, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x096a, 19, clif->pWantToConnection); -} - -// 20150304 -if (packetVersion == 20150304) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); - packet(CMSG_ITEM_PICKUP, 0x0363, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); -// packet(UNKNOWN, 0x0802, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_FROM_STORAGE, 0x0862, 8, clif->pMoveFromKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x086d, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0879, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x087e, 19, clif->pWantToConnection); - packet(CMSG_STORAGE_PASSWORD, 0x0892, 36, clif->pStoragePassword); - packet(CMSG_PARTY_INVITE2, 0x089a, 26, clif->pPartyInvite2); - packet(CMSG_BOOKING_REGISTER_REQ, 0x093a, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_TO_STORAGE, 0x0947, 8, clif->pMoveToKafra); -// packet(UNKNOWN, 0x095d, 8, clif->pDull); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0960, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x0961, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150311 -if (packetVersion == 20150311) -{ - packet(CMSG_HOMUNCULUS_MENU, 0x023b, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0360, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0436, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_SELL, 0x0438, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0815, 19, clif->pWantToConnection); - packet(CMSG_SKILL_USE_POSITION, 0x0838, 10, clif->pUseSkillToPos); - packet(CMSG_NAME_REQUEST, 0x086a, 6, clif->pGetCharNameRequest); - packet(CMSG_STORAGE_PASSWORD, 0x086c, 36, clif->pStoragePassword); - packet(CMSG_BOOKING_REGISTER_REQ, 0x087b, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0883, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0886, 5, clif->pWalkToXY); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0888, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0896, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_BEING, 0x08a1, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_PICKUP, 0x08a3, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_CLICK, 0x08a5, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x08a6, 26, clif->pFriendsListAdd); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x091c, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0928, 5, clif->pChangeDir); -// packet(UNKNOWN, 0x092a, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x092e, 8, clif->pMoveFromKafra); - packet(CMSG_PARTY_INVITE2, 0x093b, 26, clif->pPartyInvite2); - packet(CMSG_SOLVE_CHAR_NAME, 0x0943, 6, clif->pSolveCharName); -// packet(UNKNOWN, 0x0946, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_OPEN, 0x0957, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_PING, 0x0958, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_CREATE, 0x095b, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0963, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0964, 8, clif->pMoveToKafra); -} - -// 20150318 -if (packetVersion == 20150318) -{ -// packet(UNKNOWN, 0x0202, 4, clif->pDull); - packet(CMSG_MAP_PING, 0x023b, 6, clif->pTickSend); -// packet(UNKNOWN, 0x0281, 8, clif->pDull); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0367, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x07e4, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0802, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_SERVER_CONNECT, 0x0811, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_CREATE, 0x0862, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_OPEN, 0x0863, 6, clif->pReqClickBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0873, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0885, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0889, 7, clif->pActionRequest); - packet(CMSG_SEARCHSTORE_CLICK, 0x088c, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_TO_STORAGE, 0x089c, 8, clif->pMoveToKafra); - packet(CMSG_BUYINGSTORE_SELL, 0x08a4, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x091d, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0920, 6, clif->pDropItem); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0927, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0928, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_BEING, 0x0936, 10, clif->pUseSkillToId); - packet(CMSG_SKILL_USE_POSITION, 0x0937, 10, clif->pUseSkillToPos); - packet(CMSG_PARTY_INVITE2, 0x0938, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_DEST, 0x093a, 5, clif->pWalkToXY); - packet(CMSG_SOLVE_CHAR_NAME, 0x093c, 6, clif->pSolveCharName); - packet(CMSG_HOMUNCULUS_MENU, 0x094c, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x0951, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0958, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0959, -1, clif->pSearchStoreInfo); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0960, 18, clif->pPartyBookingRegisterReq); -} - -// 20150325 -if (packetVersion == 20150325) -{ - packet(CMSG_PARTY_INVITE2, 0x0202, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0363, 6, clif->pDropItem); - packet(CMSG_SKILL_USE_BEING, 0x0365, 10, clif->pUseSkillToId); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0438, 2, clif->pSearchStoreInfoNextPage); -// packet(UNKNOWN, 0x0802, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_OPEN, 0x0819, 6, clif->pReqClickBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x085d, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_CREATE, 0x086f, -1, clif->pReqOpenBuyingStore); - packet(CMSG_MOVE_TO_STORAGE, 0x087c, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DIR, 0x087e, 5, clif->pChangeDir); - packet(CMSG_SEARCHSTORE_CLICK, 0x0883, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_POSITION, 0x0885, 10, clif->pUseSkillToPos); - packet(CMSG_NAME_REQUEST, 0x0891, 6, clif->pGetCharNameRequest); -// packet(UNKNOWN, 0x0893, 8, clif->pDull); - packet(CMSG_BUYINGSTORE_SELL, 0x0897, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0899, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_ACT, 0x08a1, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x08a7, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_STORAGE_PASSWORD, 0x0919, 36, clif->pStoragePassword); - packet(CMSG_ITEM_PICKUP, 0x092c, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0931, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0932, 5, clif->pWalkToXY); - packet(CMSG_HOMUNCULUS_MENU, 0x0938, 5, clif->pHomMenu); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0940, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0947, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x094a, 19, clif->pWantToConnection); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0950, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x0954, 6, clif->pTickSend); - packet(CMSG_MOVE_FROM_STORAGE, 0x0969, 8, clif->pMoveFromKafra); -} - -// 20150401 -if (packetVersion == 20150401) -{ - packet(CMSG_PLAYER_CHANGE_ACT, 0x0362, 7, clif->pActionRequest); - packet(CMSG_NAME_REQUEST, 0x0367, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_OPEN, 0x0437, 6, clif->pReqClickBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x083c, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_CLICK, 0x085e, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_CHANGE_DEST, 0x086f, 5, clif->pWalkToXY); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0875, -1, clif->pItemListWindowSelected); -// packet(UNKNOWN, 0x087e, 8, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x088c, 6, clif->pDropItem); - packet(CMSG_MAP_PING, 0x088f, 6, clif->pTickSend); - packet(CMSG_MOVE_FROM_STORAGE, 0x0895, 8, clif->pMoveFromKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x0898, 5, clif->pHomMenu); - packet(CMSG_STORAGE_PASSWORD, 0x089c, 36, clif->pStoragePassword); - packet(CMSG_MOVE_TO_STORAGE, 0x08a5, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x091b, 26, clif->pPartyInvite2); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x091c, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_CREATE, 0x0922, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0924, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0938, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0939, 19, clif->pWantToConnection); - packet(CMSG_SKILL_USE_POSITION, 0x093a, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x093b, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x093e, 2, clif->pSearchStoreInfoNextPage); -// packet(UNKNOWN, 0x0946, 4, clif->pDull); - packet(CMSG_ITEM_PICKUP, 0x0949, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_BEING, 0x094b, 10, clif->pUseSkillToId); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0953, 26, clif->pFriendsListAdd); - packet(CMSG_SOLVE_CHAR_NAME, 0x095f, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0964, 5, clif->pChangeDir); -} - -// 20150408 -if (packetVersion == 20150408) -{ - packet(CMSG_MOVE_FROM_STORAGE, 0x0819, 8, clif->pMoveFromKafra); - packet(CMSG_MAP_PING, 0x085a, 6, clif->pTickSend); - packet(CMSG_SKILL_USE_BEING, 0x085c, 10, clif->pUseSkillToId); - packet(CMSG_HOMUNCULUS_MENU, 0x085e, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0865, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_SELL, 0x0868, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x086b, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x086e, 10, clif->pUseSkillToPos); - packet(CMSG_PARTY_INVITE2, 0x0878, 26, clif->pPartyInvite2); - packet(CMSG_NAME_REQUEST, 0x087e, 6, clif->pGetCharNameRequest); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x087f, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_MOVE_TO_STORAGE, 0x0888, 8, clif->pMoveToKafra); - packet(CMSG_STORAGE_PASSWORD, 0x0889, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0891, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0898, 6, clif->pDropItem); - packet(CMSG_PLAYER_CHANGE_DEST, 0x089c, 5, clif->pWalkToXY); - packet(CMSG_SOLVE_CHAR_NAME, 0x08a2, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x08a4, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x091b, 4, clif->pDull); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x091e, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0922, 5, clif->pChangeDir); -// packet(UNKNOWN, 0x092a, 8, clif->pDull); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0946, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x094f, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_BUYINGSTORE_OPEN, 0x0955, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0957, 19, clif->pWantToConnection); - packet(CMSG_ITEM_PICKUP, 0x0959, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_CLICK, 0x095e, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0963, 2, clif->pSearchStoreInfoNextPage); -} - -// 20150415 -if (packetVersion == 20150415) -{ - packet(CMSG_MOVE_TO_STORAGE, 0x0361, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0364, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0366, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_OPEN, 0x0368, 6, clif->pReqClickBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0802, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_ITEM_PICKUP, 0x0817, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0835, 6, clif->pDropItem); -// packet(UNKNOWN, 0x085e, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_SELL, 0x0863, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PARTY_INVITE2, 0x0867, 26, clif->pPartyInvite2); - packet(CMSG_SKILL_USE_POSITION, 0x0868, 10, clif->pUseSkillToPos); - packet(CMSG_HOMUNCULUS_MENU, 0x0869, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_ACT, 0x086c, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0880, 8, clif->pDull); - packet(CMSG_SKILL_USE_BEING, 0x088e, 10, clif->pUseSkillToId); - packet(CMSG_NAME_REQUEST, 0x0891, 6, clif->pGetCharNameRequest); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0898, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_CREATE, 0x08a0, -1, clif->pReqOpenBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x0922, 8, clif->pMoveFromKafra); - packet(CMSG_SOLVE_CHAR_NAME, 0x092e, 6, clif->pSolveCharName); - packet(CMSG_MAP_PING, 0x093c, 6, clif->pTickSend); - packet(CMSG_SEARCHSTORE_CLICK, 0x093e, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MAP_SERVER_CONNECT, 0x0941, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0946, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x094d, 5, clif->pChangeDir); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0953, -1, clif->pSearchStoreInfo); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x095c, 26, clif->pFriendsListAdd); - packet(CMSG_STORAGE_PASSWORD, 0x0960, 36, clif->pStoragePassword); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0961, 18, clif->pPartyBookingRegisterReq); -} - -// 20150422 -if (packetVersion == 20150422) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0955, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150429 -if (packetVersion == 20150429) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0363, 5, clif->pChangeDir); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0867, 36, clif->pStoragePassword); - packet(CMSG_MAP_SERVER_CONNECT, 0x086a, 19, clif->pWantToConnection); - packet(CMSG_PARTY_INVITE2, 0x0886, 26, clif->pPartyInvite2); - packet(CMSG_HOMUNCULUS_MENU, 0x088f, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0894, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0899, 8, clif->pMoveToKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x089f, -1, clif->pItemListWindowSelected); -// packet(UNKNOWN, 0x08a6, 8, clif->pDull); -// packet(UNKNOWN, 0x08a8, 4, clif->pDull); - packet(CMSG_BOOKING_REGISTER_REQ, 0x08ad, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_FROM_STORAGE, 0x0929, 8, clif->pMoveFromKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x093d, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_PICKUP, 0x0943, 6, clif->pTakeItem); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150507 -if (packetVersion == 20150507) -{ - packet(CMSG_HOMUNCULUS_MENU, 0x023b, 5, clif->pHomMenu); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0362, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x0817, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_TO_STORAGE, 0x085a, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0864, 26, clif->pPartyInvite2); -// packet(UNKNOWN, 0x0887, 8, clif->pDull); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0889, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MAP_SERVER_CONNECT, 0x0924, 19, clif->pWantToConnection); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x092e, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_CHANGE_DIR, 0x093b, 5, clif->pChangeDir); - packet(CMSG_MOVE_FROM_STORAGE, 0x0941, 8, clif->pMoveFromKafra); -// packet(UNKNOWN, 0x0942, 4, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x0953, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0955, 6, clif->pDropItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0958, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150513 -if (packetVersion == 20150513) -{ - packet(CMSG_BUYINGSTORE_CLOSE, 0x022d, 2, clif->pReqCloseBuyingStore); -// packet(UNKNOWN, 0x02c4, 8, clif->pDull); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0363, 19, clif->pWantToConnection); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0817, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_FROM_STORAGE, 0x0864, 8, clif->pMoveFromKafra); - packet(CMSG_MOVE_TO_STORAGE, 0x0879, 8, clif->pMoveToKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0883, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0885, 6, clif->pDropItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x08a8, 26, clif->pFriendsListAdd); - packet(CMSG_STORAGE_PASSWORD, 0x0923, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0924, 5, clif->pChangeDir); -// packet(UNKNOWN, 0x0927, 4, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x094a, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_PICKUP, 0x0958, 6, clif->pTakeItem); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0960, -1, clif->pItemListWindowSelected); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150520 -if (packetVersion == 20150520) -{ - packet(CMSG_MAP_PING, 0x0202, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_SELL, 0x0361, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0835, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BUYINGSTORE_OPEN, 0x085e, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0865, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_CREATE, 0x0868, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SEARCHSTORE_CLICK, 0x087d, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PARTY_INVITE2, 0x0880, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0882, -1, clif->pItemListWindowSelected); - packet(CMSG_SEARCHSTORE_SEARCH, 0x088c, -1, clif->pSearchStoreInfo); - packet(CMSG_STORAGE_PASSWORD, 0x089c, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x089e, 6, clif->pDropItem); - packet(CMSG_NAME_REQUEST, 0x08a2, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08ad, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x091c, 6, clif->pTakeItem); - packet(CMSG_PLAYER_CHANGE_ACT, 0x091d, 7, clif->pActionRequest); - packet(CMSG_MOVE_FROM_STORAGE, 0x0924, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x092b, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0931, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SKILL_USE_BEING, 0x0936, 10, clif->pUseSkillToId); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x093d, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x0940, 8, clif->pDull); - packet(CMSG_SOLVE_CHAR_NAME, 0x0945, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_POSITION, 0x094e, 10, clif->pUseSkillToPos); - packet(CMSG_HOMUNCULUS_MENU, 0x095b, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x095f, 2, clif->pSearchStoreInfoNextPage); -// packet(UNKNOWN, 0x0960, 4, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x0961, 8, clif->pMoveToKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x096a, 18, clif->pPartyBookingRegisterReq); -} - -// 20150527 -if (packetVersion == 20150527) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SKILL_USE_BEING, 0x0838, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x083c, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_CLICK, 0x0940, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150603 -if (packetVersion == 20150603) -{ - packet(CMSG_PARTY_INVITE2, 0x0361, 26, clif->pPartyInvite2); -// packet(UNKNOWN, 0x0437, 8, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0811, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_OPEN, 0x0819, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0860, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0864, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_TO_STORAGE, 0x0867, 8, clif->pMoveToKafra); - packet(CMSG_MOVE_FROM_STORAGE, 0x086a, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0873, 7, clif->pActionRequest); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0877, -1, clif->pItemListWindowSelected); - packet(CMSG_NAME_REQUEST, 0x0881, 6, clif->pGetCharNameRequest); -// packet(UNKNOWN, 0x0884, 4, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x088b, 6, clif->pDropItem); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0897, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_CLICK, 0x089a, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_BUYINGSTORE_CREATE, 0x089d, -1, clif->pReqOpenBuyingStore); - packet(CMSG_MAP_PING, 0x089e, 6, clif->pTickSend); - packet(CMSG_SKILL_USE_POSITION, 0x08a1, 10, clif->pUseSkillToPos); - packet(CMSG_MAP_SERVER_CONNECT, 0x08ad, 19, clif->pWantToConnection); - packet(CMSG_SOLVE_CHAR_NAME, 0x091b, 6, clif->pSolveCharName); - packet(CMSG_STORAGE_PASSWORD, 0x0922, 36, clif->pStoragePassword); - packet(CMSG_ITEM_PICKUP, 0x092d, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x093b, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BOOKING_REGISTER_REQ, 0x093f, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_HOMUNCULUS_MENU, 0x0955, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0956, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x0960, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_SELL, 0x0969, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PLAYER_CHANGE_DEST, 0x096a, 5, clif->pWalkToXY); -} - -// 20150610 -if (packetVersion == 20150610) -{ - packet(CMSG_BUYINGSTORE_CLOSE, 0x022d, 2, clif->pReqCloseBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0438, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_SELL, 0x07e4, -1, clif->pReqTradeBuyingStore); -// packet(UNKNOWN, 0x0835, 8, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x0870, 26, clif->pPartyInvite2); - packet(CMSG_SOLVE_CHAR_NAME, 0x0872, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_OPEN, 0x0877, 6, clif->pReqClickBuyingStore); - packet(CMSG_NAME_REQUEST, 0x087e, 6, clif->pGetCharNameRequest); - packet(CMSG_MOVE_FROM_STORAGE, 0x0884, 8, clif->pMoveFromKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x0885, 5, clif->pHomMenu); - packet(CMSG_MAP_SERVER_CONNECT, 0x0888, 19, clif->pWantToConnection); - packet(CMSG_MOVE_TO_STORAGE, 0x088c, 8, clif->pMoveToKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x088d, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DEST, 0x088f, 5, clif->pWalkToXY); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0897, 26, clif->pFriendsListAdd); - packet(CMSG_STORAGE_PASSWORD, 0x08a0, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x08ac, 6, clif->pDropItem); - packet(CMSG_ITEM_PICKUP, 0x0925, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_SEARCH, 0x092b, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_CREATE, 0x092c, -1, clif->pReqOpenBuyingStore); -// packet(UNKNOWN, 0x092e, 4, clif->pDull); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0932, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_ACT, 0x093e, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0940, 10, clif->pUseSkillToPos); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0946, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SKILL_USE_BEING, 0x0949, 10, clif->pUseSkillToId); - packet(CMSG_MAP_PING, 0x0957, 6, clif->pTickSend); - packet(CMSG_SEARCHSTORE_CLICK, 0x095d, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0964, 5, clif->pChangeDir); -} - -// 20150617 -if (packetVersion == 20150617) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_ITEM_PICKUP, 0x0360, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_OPEN, 0x0362, 6, clif->pReqClickBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0363, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0365, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_MAP_SERVER_CONNECT, 0x0436, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x07ec, -1, clif->pReqTradeBuyingStore); -// packet(UNKNOWN, 0x0811, 8, clif->pDull); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_FROM_STORAGE, 0x0869, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x086a, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DIR, 0x086b, 5, clif->pChangeDir); - packet(CMSG_PARTY_INVITE2, 0x0870, 26, clif->pPartyInvite2); - packet(CMSG_MOVE_TO_STORAGE, 0x087a, 8, clif->pMoveToKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x0886, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x0894, 4, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0940, 6, clif->pDropItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x094e, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150618 -if (packetVersion == 20150618) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_ITEM_PICKUP, 0x0360, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_OPEN, 0x0362, 6, clif->pReqClickBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0363, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0365, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_MAP_SERVER_CONNECT, 0x0436, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x07ec, -1, clif->pReqTradeBuyingStore); -// packet(UNKNOWN, 0x0811, 8, clif->pDull); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_FROM_STORAGE, 0x0869, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x086a, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DIR, 0x086b, 5, clif->pChangeDir); - packet(CMSG_PARTY_INVITE2, 0x0870, 26, clif->pPartyInvite2); - packet(CMSG_MOVE_TO_STORAGE, 0x087a, 8, clif->pMoveToKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x0886, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x0894, 4, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0940, 6, clif->pDropItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x094e, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150624 -if (packetVersion == 20150624) -{ - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0364, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_HOMUNCULUS_MENU, 0x0365, 5, clif->pHomMenu); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0870, 36, clif->pStoragePassword); - packet(CMSG_MOVE_FROM_STORAGE, 0x0940, 8, clif->pMoveFromKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0941, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0966, 5, clif->pChangeDir); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150702 -if (packetVersion == 20150702) -{ - packet(CMSG_MAP_SERVER_CONNECT, 0x023b, 19, clif->pWantToConnection); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0281, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_MOVE_FROM_STORAGE, 0x07e4, 8, clif->pMoveFromKafra); - packet(CMSG_NAME_REQUEST, 0x0802, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_SELL, 0x086d, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_PING, 0x087d, 6, clif->pTickSend); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x087e, -1, clif->pItemListWindowSelected); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0883, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_CLOSE, 0x088e, 2, clif->pReqCloseBuyingStore); -// packet(UNKNOWN, 0x0893, 4, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x08a0, 6, clif->pDropItem); - packet(CMSG_BUYINGSTORE_OPEN, 0x08a4, 6, clif->pReqClickBuyingStore); - packet(CMSG_PARTY_INVITE2, 0x08a5, 26, clif->pPartyInvite2); - packet(CMSG_SKILL_USE_BEING, 0x08a6, 10, clif->pUseSkillToId); - packet(CMSG_SKILL_USE_POSITION, 0x08ad, 10, clif->pUseSkillToPos); - packet(CMSG_STORAGE_PASSWORD, 0x0919, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x0923, 8, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x0928, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x092c, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CREATE, 0x093e, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SEARCHSTORE_CLICK, 0x093f, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_ITEM_PICKUP, 0x0946, 6, clif->pTakeItem); - packet(CMSG_SOLVE_CHAR_NAME, 0x094e, 6, clif->pSolveCharName); - packet(CMSG_HOMUNCULUS_MENU, 0x0954, 5, clif->pHomMenu); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0956, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0958, 7, clif->pActionRequest); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x095f, 26, clif->pFriendsListAdd); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0960, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0968, 5, clif->pChangeDir); -} - -// 20150708 -if (packetVersion == 20150708) -{ - packet(CMSG_SOLVE_CHAR_NAME, 0x022d, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x02c4, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PARTY_INVITE2, 0x0366, 26, clif->pPartyInvite2); - packet(CMSG_HOMUNCULUS_MENU, 0x0368, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_SELL, 0x0436, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_MAP_SERVER_CONNECT, 0x0811, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_TO_STORAGE, 0x085e, 8, clif->pMoveToKafra); - packet(CMSG_ITEM_PICKUP, 0x0872, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x087f, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0884, 5, clif->pWalkToXY); - packet(CMSG_PLAYER_CHANGE_DIR, 0x089d, 5, clif->pChangeDir); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x08a5, -1, clif->pItemListWindowSelected); - packet(CMSG_STORAGE_PASSWORD, 0x08ad, 36, clif->pStoragePassword); - packet(CMSG_BOOKING_REGISTER_REQ, 0x091f, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_FROM_STORAGE, 0x092a, 8, clif->pMoveFromKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x093c, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x095b, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0962, 8, clif->pDull); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150715 -if (packetVersion == 20150715) -{ - packet(CMSG_BUYINGSTORE_CREATE, 0x023b, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x0362, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0364, -1, clif->pItemListWindowSelected); - packet(CMSG_SOLVE_CHAR_NAME, 0x0436, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_BEING, 0x0437, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0438, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_SELL, 0x0835, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PLAYER_CHANGE_ACT, 0x083c, 7, clif->pActionRequest); - packet(CMSG_NAME_REQUEST, 0x085c, 6, clif->pGetCharNameRequest); - packet(CMSG_MOVE_FROM_STORAGE, 0x086f, 8, clif->pMoveFromKafra); - packet(CMSG_MAP_PING, 0x0873, 6, clif->pTickSend); - packet(CMSG_MAP_SERVER_CONNECT, 0x0879, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x087c, 6, clif->pDropItem); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x087f, 2, clif->pSearchStoreInfoNextPage); -// packet(UNKNOWN, 0x0886, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0895, -1, clif->pSearchStoreInfo); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0896, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PARTY_INVITE2, 0x0897, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0899, 2, clif->pReqCloseBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x089a, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x08a4, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08ac, 5, clif->pChangeDir); - packet(CMSG_SEARCHSTORE_CLICK, 0x0917, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_HOMUNCULUS_MENU, 0x093e, 5, clif->pHomMenu); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0944, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_OPEN, 0x0950, 6, clif->pReqClickBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0956, 36, clif->pStoragePassword); - packet(CMSG_MOVE_TO_STORAGE, 0x0961, 8, clif->pMoveToKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0965, 18, clif->pPartyBookingRegisterReq); -} - -// 20150729 -if (packetVersion == 20150729) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x0437, -1, clif->pSearchStoreInfo); - packet(CMSG_HOMUNCULUS_MENU, 0x0438, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x085b, 8, clif->pDull); - packet(CMSG_ITEM_PICKUP, 0x0860, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x086c, 8, clif->pMoveToKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x086d, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DEST, 0x086e, 5, clif->pWalkToXY); - packet(CMSG_MOVE_FROM_STORAGE, 0x086f, 8, clif->pMoveFromKafra); - packet(CMSG_NAME_REQUEST, 0x0870, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_CLICK, 0x0880, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0881, 7, clif->pActionRequest); - packet(CMSG_SOLVE_CHAR_NAME, 0x0886, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_POSITION, 0x089a, 10, clif->pUseSkillToPos); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x089b, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x08a3, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08a4, 5, clif->pChangeDir); - packet(CMSG_PARTY_INVITE2, 0x08ac, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_OPEN, 0x08ad, 6, clif->pReqClickBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0920, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x092b, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SKILL_USE_BEING, 0x092f, 10, clif->pUseSkillToId); - packet(CMSG_MAP_PING, 0x093a, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_CREATE, 0x093f, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0940, 6, clif->pDropItem); - packet(CMSG_MAP_SERVER_CONNECT, 0x094f, 19, clif->pWantToConnection); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0955, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_SELL, 0x095e, -1, clif->pReqTradeBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0961, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_CLOSE, 0x096a, 2, clif->pReqCloseBuyingStore); -} - -// 20150805 -if (packetVersion == 20150805) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x088a, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150812 -if (packetVersion == 20150812) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x087f, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150819 -if (packetVersion == 20150819) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0202, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_BEING, 0x022d, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_PICKUP, 0x0281, 6, clif->pTakeItem); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x085d, 8, clif->pMoveFromKafra); -// packet(UNKNOWN, 0x0862, 8, clif->pDull); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0865, 26, clif->pFriendsListAdd); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0871, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_HOMUNCULUS_MENU, 0x0888, 5, clif->pHomMenu); - packet(CMSG_MOVE_TO_STORAGE, 0x0919, 8, clif->pMoveToKafra); - packet(CMSG_STORAGE_PASSWORD, 0x091e, 36, clif->pStoragePassword); - packet(CMSG_MAP_SERVER_CONNECT, 0x0927, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0940, 6, clif->pDropItem); - packet(CMSG_PARTY_INVITE2, 0x0961, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0967, 5, clif->pChangeDir); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20150826 -if (packetVersion == 20150826) -{ - packet(CMSG_STORAGE_PASSWORD, 0x0362, 36, clif->pStoragePassword); - packet(CMSG_MOVE_FROM_STORAGE, 0x0368, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0436, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_ACT, 0x07ec, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_OPEN, 0x0819, 6, clif->pReqClickBuyingStore); -// packet(UNKNOWN, 0x0861, 8, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0865, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x086b, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_CREATE, 0x0870, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x087b, 6, clif->pSolveCharName); - packet(CMSG_PARTY_INVITE2, 0x088b, 26, clif->pPartyInvite2); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x088d, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0890, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SKILL_USE_BEING, 0x0891, 10, clif->pUseSkillToId); - packet(CMSG_SEARCHSTORE_CLICK, 0x08a0, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_TO_STORAGE, 0x08a1, 8, clif->pMoveToKafra); - packet(CMSG_ITEM_PICKUP, 0x08a4, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_SELL, 0x08a8, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0924, 6, clif->pDropItem); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0928, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x092e, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_NAME_REQUEST, 0x093b, 6, clif->pGetCharNameRequest); - packet(CMSG_HOMUNCULUS_MENU, 0x0945, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DIR, 0x094f, 5, clif->pChangeDir); - packet(CMSG_MAP_PING, 0x0951, 6, clif->pTickSend); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0959, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_SERVER_CONNECT, 0x0964, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x0968, 4, clif->pDull); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0969, -1, clif->pSearchStoreInfo); -} - -// 20150902 -if (packetVersion == 20150902) -{ - packet(CMSG_BOOKING_REGISTER_REQ, 0x023b, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_BUYINGSTORE_CREATE, 0x0360, -1, clif->pReqOpenBuyingStore); - packet(CMSG_MAP_PING, 0x0367, 6, clif->pTickSend); - packet(CMSG_STORAGE_PASSWORD, 0x0802, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_SEARCH, 0x083c, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_CHANGE_ACT, 0x085b, 7, clif->pActionRequest); - packet(CMSG_SOLVE_CHAR_NAME, 0x085d, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_BEING, 0x0863, 10, clif->pUseSkillToId); - packet(CMSG_SKILL_USE_POSITION, 0x086f, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DEST, 0x087b, 5, clif->pWalkToXY); -// packet(UNKNOWN, 0x087f, 4, clif->pDull); - packet(CMSG_SEARCHSTORE_CLICK, 0x0886, 12, clif->pSearchStoreInfoListItemClick); -// packet(UNKNOWN, 0x0887, 8, clif->pDull); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0889, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x088d, 8, clif->pMoveFromKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0892, -1, clif->pItemListWindowSelected); - packet(CMSG_MOVE_TO_STORAGE, 0x0897, 8, clif->pMoveToKafra); - packet(CMSG_NAME_REQUEST, 0x0899, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x08a9, 6, clif->pDropItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0923, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_PICKUP, 0x0928, 6, clif->pTakeItem); - packet(CMSG_HOMUNCULUS_MENU, 0x092a, 5, clif->pHomMenu); - packet(CMSG_PARTY_INVITE2, 0x092d, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0941, 5, clif->pChangeDir); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0947, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_OPEN, 0x094f, 6, clif->pReqClickBuyingStore); - packet(CMSG_BUYINGSTORE_SELL, 0x0953, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x095b, 19, clif->pWantToConnection); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0960, 2, clif->pSearchStoreInfoNextPage); -} - -// 20150909 -if (packetVersion == 20150909) -{ - packet(CMSG_PLAYER_CHANGE_ACT, 0x023b, 7, clif->pActionRequest); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0360, 2, clif->pReqCloseBuyingStore); - packet(CMSG_NAME_REQUEST, 0x0361, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0365, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_STORAGE_PASSWORD, 0x0369, 36, clif->pStoragePassword); - packet(CMSG_MOVE_FROM_STORAGE, 0x0437, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x0861, 4, clif->pDull); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0871, -1, clif->pItemListWindowSelected); - packet(CMSG_BOOKING_REGISTER_REQ, 0x087b, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_ITEM_PICKUP, 0x0883, 6, clif->pTakeItem); - packet(CMSG_MAP_SERVER_CONNECT, 0x0886, 19, clif->pWantToConnection); - packet(CMSG_PARTY_INVITE2, 0x088f, 26, clif->pPartyInvite2); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0895, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x0928, 8, clif->pDull); - packet(CMSG_BUYINGSTORE_OPEN, 0x0940, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0941, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x095e, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0962, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DIR, 0x096a, 5, clif->pChangeDir); -} - -// 20150916 -if (packetVersion == 20150916) -{ - packet(CMSG_SKILL_USE_POSITION, 0x022d, 10, clif->pUseSkillToPos); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0817, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BUYINGSTORE_OPEN, 0x0835, 6, clif->pReqClickBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x085e, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0869, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0873, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0877, 5, clif->pWalkToXY); - packet(CMSG_SEARCHSTORE_CLICK, 0x087f, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_BUYINGSTORE_SELL, 0x0881, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x089b, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_ITEM_PICKUP, 0x089c, 6, clif->pTakeItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x089e, 26, clif->pFriendsListAdd); - packet(CMSG_MAP_PING, 0x08ac, 6, clif->pTickSend); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0920, -1, clif->pSearchStoreInfo); - packet(CMSG_PARTY_INVITE2, 0x0924, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CLOSE, 0x092e, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x092f, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x0934, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0936, 5, clif->pChangeDir); -// packet(UNKNOWN, 0x0938, 4, clif->pDull); - packet(CMSG_SKILL_USE_BEING, 0x093e, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0941, 36, clif->pStoragePassword); - packet(CMSG_SOLVE_CHAR_NAME, 0x0942, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_CREATE, 0x0948, -1, clif->pReqOpenBuyingStore); -// packet(UNKNOWN, 0x094f, 8, clif->pDull); - packet(CMSG_NAME_REQUEST, 0x095a, 6, clif->pGetCharNameRequest); - packet(CMSG_HOMUNCULUS_MENU, 0x0960, 5, clif->pHomMenu); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0961, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_SERVER_CONNECT, 0x0969, 19, clif->pWantToConnection); -} - -// 20150923 -if (packetVersion == 20150923) -{ - packet(CMSG_BOOKING_REGISTER_REQ, 0x0361, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0366, -1, clif->pSearchStoreInfo); - packet(CMSG_STORAGE_PASSWORD, 0x07e4, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_SELL, 0x0817, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x085c, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x085d, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x0864, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_CLOSE, 0x086e, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x086f, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0870, 5, clif->pChangeDir); - packet(CMSG_MOVE_FROM_STORAGE, 0x0879, 8, clif->pMoveFromKafra); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x087f, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0886, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_OPEN, 0x088e, 6, clif->pReqClickBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0892, -1, clif->pReqOpenBuyingStore); -// packet(UNKNOWN, 0x0895, 4, clif->pDull); - packet(CMSG_SKILL_USE_POSITION, 0x089b, 10, clif->pUseSkillToPos); - packet(CMSG_MOVE_TO_STORAGE, 0x089f, 8, clif->pMoveToKafra); - packet(CMSG_MAP_PING, 0x08a0, 6, clif->pTickSend); - packet(CMSG_MAP_SERVER_CONNECT, 0x08a2, 19, clif->pWantToConnection); - packet(CMSG_NAME_REQUEST, 0x08a5, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_CLICK, 0x08a6, 12, clif->pSearchStoreInfoListItemClick); -// packet(UNKNOWN, 0x091e, 8, clif->pDull); - packet(CMSG_ITEM_PICKUP, 0x092b, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0930, 6, clif->pDropItem); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0936, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PARTY_INVITE2, 0x093b, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0951, 7, clif->pActionRequest); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0961, -1, clif->pItemListWindowSelected); -} - -// 20151001 -if (packetVersion == 20151001) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0960, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -if (packetVersion >= 20151001) -{ - packet(CMSG_CHAR_CREATE, 0x0a39, 36, chr->parse_char_create_new_char); -} - -// 20151007 -if (packetVersion == 20151007) -{ - packet(CMSG_BUYINGSTORE_SELL, 0x0202, -1, clif->pReqTradeBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0811, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x0862, 4, clif->pDull); - packet(CMSG_HOMUNCULUS_MENU, 0x093f, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DIR, 0x095f, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x0961, 19, clif->pWantToConnection); - packet(CMSG_STORAGE_PASSWORD, 0x0967, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20151014 -if (packetVersion == 20151014) -{ - packet(CMSG_BOOKING_REGISTER_REQ, 0x0202, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0817, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0838, -1, clif->pSearchStoreInfo); - packet(CMSG_SKILL_USE_BEING, 0x085a, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_ACT, 0x085c, 7, clif->pActionRequest); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0860, 6, clif->pDropItem); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0863, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_SELL, 0x0867, -1, clif->pReqTradeBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0872, 5, clif->pHomMenu); - packet(CMSG_SKILL_USE_POSITION, 0x0874, 10, clif->pUseSkillToPos); - packet(CMSG_MOVE_FROM_STORAGE, 0x0881, 8, clif->pMoveFromKafra); - packet(CMSG_MAP_PING, 0x0883, 6, clif->pTickSend); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0884, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_OPEN, 0x0889, 6, clif->pReqClickBuyingStore); -// packet(UNKNOWN, 0x088e, 8, clif->pDull); -// packet(UNKNOWN, 0x089a, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_CLOSE, 0x089b, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_DEST, 0x089f, 5, clif->pWalkToXY); - packet(CMSG_ITEM_PICKUP, 0x08aa, 6, clif->pTakeItem); - packet(CMSG_PARTY_INVITE2, 0x091c, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x091d, 36, clif->pStoragePassword); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0930, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_CREATE, 0x0934, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SEARCHSTORE_CLICK, 0x0944, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x094f, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SOLVE_CHAR_NAME, 0x0956, 6, clif->pSolveCharName); - packet(CMSG_MOVE_TO_STORAGE, 0x095e, 8, clif->pMoveToKafra); - packet(CMSG_NAME_REQUEST, 0x0961, 6, clif->pGetCharNameRequest); - packet(CMSG_MAP_SERVER_CONNECT, 0x0964, 19, clif->pWantToConnection); -} - -// 20151021 -if (packetVersion == 20151021) -{ - packet(CMSG_MAP_SERVER_CONNECT, 0x023b, 19, clif->pWantToConnection); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_STORAGE_PASSWORD, 0x02c4, 36, clif->pStoragePassword); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_MOVE_TO_STORAGE, 0x0361, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_PLAYER_CHANGE_DIR, 0x07ec, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x086a, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x091d, 5, clif->pHomMenu); - packet(CMSG_PARTY_INVITE2, 0x0940, 26, clif->pPartyInvite2); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20151022 -if (packetVersion == 20151022) -{ - packet(CMSG_MAP_SERVER_CONNECT, 0x023b, 19, clif->pWantToConnection); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_STORAGE_PASSWORD, 0x02c4, 36, clif->pStoragePassword); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_MOVE_TO_STORAGE, 0x0361, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_PLAYER_CHANGE_DIR, 0x07ec, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x086a, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x091d, 5, clif->pHomMenu); - packet(CMSG_PARTY_INVITE2, 0x0940, 26, clif->pPartyInvite2); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20151028 -if (packetVersion == 20151028) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0860, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20151029 -if (packetVersion == 20151029) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0860, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20151104 -if (packetVersion == 20151104) -{ - packet(CMSG_BUYINGSTORE_CREATE, 0x023b, -1, clif->pReqOpenBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0360, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0363, 5, clif->pWalkToXY); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_OPEN, 0x0436, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0437, 6, clif->pDropItem); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x07ec, 26, clif->pFriendsListAdd); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0811, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_BUYINGSTORE_SELL, 0x0815, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MAP_PING, 0x0886, 6, clif->pTickSend); - packet(CMSG_NAME_REQUEST, 0x0887, 6, clif->pGetCharNameRequest); - packet(CMSG_MOVE_TO_STORAGE, 0x088b, 8, clif->pMoveToKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x088d, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x08a3, 4, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x08a5, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0928, 5, clif->pChangeDir); -// packet(UNKNOWN, 0x0939, 8, clif->pDull); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x093a, -1, clif->pItemListWindowSelected); - packet(CMSG_STORAGE_PASSWORD, 0x0940, 36, clif->pStoragePassword); - packet(CMSG_ITEM_PICKUP, 0x0964, 6, clif->pTakeItem); -} - -// 20151111 -if (packetVersion == 20151111) -{ - packet(CMSG_BUYINGSTORE_CREATE, 0x02c4, -1, clif->pReqOpenBuyingStore); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0362, 5, clif->pHomMenu); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_MOVE_TO_STORAGE, 0x0369, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); -// packet(UNKNOWN, 0x0802, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PARTY_INVITE2, 0x0815, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x085d, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0862, 6, clif->pDropItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0871, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0885, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DIR, 0x089c, 5, clif->pChangeDir); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0942, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_ITEM_PICKUP, 0x094a, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x0958, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0966, 8, clif->pMoveFromKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x0967, 19, clif->pWantToConnection); - packet(CMSG_STORAGE_PASSWORD, 0x0969, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20151118 -if (packetVersion == 20151118) -{ - packet(CMSG_MAP_PING, 0x022d, 6, clif->pTickSend); - packet(CMSG_HOMUNCULUS_MENU, 0x035f, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PARTY_INVITE2, 0x0365, 26, clif->pPartyInvite2); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_TO_STORAGE, 0x086b, 8, clif->pMoveToKafra); - packet(CMSG_STORAGE_PASSWORD, 0x088b, 36, clif->pStoragePassword); - packet(CMSG_MOVE_FROM_STORAGE, 0x08ab, 8, clif->pMoveFromKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0921, 26, clif->pFriendsListAdd); - packet(CMSG_MAP_SERVER_CONNECT, 0x0925, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DIR, 0x092e, 5, clif->pChangeDir); -// packet(UNKNOWN, 0x092f, 8, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x093c, 6, clif->pDropItem); - packet(CMSG_ITEM_PICKUP, 0x0943, 6, clif->pTakeItem); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0946, -1, clif->pItemListWindowSelected); -// packet(UNKNOWN, 0x0957, 4, clif->pDull); - packet(CMSG_BOOKING_REGISTER_REQ, 0x095c, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20151125 -if (packetVersion == 20151125) -{ - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0361, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0365, 5, clif->pWalkToXY); - packet(CMSG_MOVE_FROM_STORAGE, 0x0366, 8, clif->pMoveFromKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0368, -1, clif->pItemListWindowSelected); - packet(CMSG_ITEM_PICKUP, 0x0438, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_CREATE, 0x0802, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0838, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_NAME_REQUEST, 0x085e, 6, clif->pGetCharNameRequest); - packet(CMSG_MOVE_TO_STORAGE, 0x085f, 8, clif->pMoveToKafra); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0863, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0883, 5, clif->pChangeDir); - packet(CMSG_STORAGE_PASSWORD, 0x0884, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x0885, 4, clif->pDull); - packet(CMSG_MAP_PING, 0x088c, 6, clif->pTickSend); - packet(CMSG_MAP_SERVER_CONNECT, 0x088d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0899, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_CHANGE_ACT, 0x089c, 7, clif->pActionRequest); - packet(CMSG_SEARCHSTORE_SEARCH, 0x089f, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x08a9, 6, clif->pDropItem); - packet(CMSG_BUYINGSTORE_SELL, 0x08ad, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0920, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_BEING, 0x092a, 10, clif->pUseSkillToId); - packet(CMSG_SKILL_USE_POSITION, 0x092e, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_OPEN, 0x0939, 6, clif->pReqClickBuyingStore); - packet(CMSG_SEARCHSTORE_CLICK, 0x093e, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_HOMUNCULUS_MENU, 0x0951, 5, clif->pHomMenu); - packet(CMSG_PARTY_INVITE2, 0x0956, 26, clif->pPartyInvite2); -// packet(UNKNOWN, 0x0957, 8, clif->pDull); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0959, 90, clif->pUseSkillToPosMoreInfo); -} - -// 20151202 -if (packetVersion == 20151202) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0870, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20151209 -if (packetVersion == 20151209) -{ - packet(CMSG_PLAYER_CHANGE_DEST, 0x0365, 5, clif->pWalkToXY); - packet(CMSG_SOLVE_CHAR_NAME, 0x0369, 6, clif->pSolveCharName); - packet(CMSG_PARTY_INVITE2, 0x07e4, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_PICKUP, 0x07ec, 6, clif->pTakeItem); - packet(CMSG_MAP_PING, 0x0811, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0819, 2, clif->pReqCloseBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x085b, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x085d, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_CREATE, 0x085e, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0861, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0866, 5, clif->pChangeDir); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0875, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x087a, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_BUYINGSTORE_OPEN, 0x087f, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x088e, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x088f, 8, clif->pDull); - packet(CMSG_SKILL_USE_POSITION, 0x0894, 10, clif->pUseSkillToPos); - packet(CMSG_HOMUNCULUS_MENU, 0x08a1, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_SELL, 0x0920, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x092d, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0930, 6, clif->pDropItem); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0932, -1, clif->pItemListWindowSelected); - packet(CMSG_MOVE_TO_STORAGE, 0x093b, 8, clif->pMoveToKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x0948, 19, clif->pWantToConnection); - packet(CMSG_BOOKING_REGISTER_REQ, 0x094a, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0956, 90, clif->pUseSkillToPosMoreInfo); -// packet(UNKNOWN, 0x095c, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0961, 7, clif->pActionRequest); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0964, 26, clif->pFriendsListAdd); -} - -// 20151216 -if (packetVersion == 20151216) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x022d, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_OPEN, 0x0361, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0362, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x0364, 4, clif->pDull); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SEARCHSTORE_CLICK, 0x0436, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_BUYINGSTORE_CLOSE, 0x083c, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MAP_PING, 0x085b, 6, clif->pTickSend); - packet(CMSG_MOVE_FROM_STORAGE, 0x0864, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_POSITION, 0x0865, 10, clif->pUseSkillToPos); -// packet(UNKNOWN, 0x086a, 8, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x086e, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CREATE, 0x0870, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0874, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_STORAGE_PASSWORD, 0x0885, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x088b, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x089d, 7, clif->pActionRequest); - packet(CMSG_SOLVE_CHAR_NAME, 0x089e, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_DEST, 0x08a2, 5, clif->pWalkToXY); - packet(CMSG_ITEM_PICKUP, 0x08a9, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x08ac, 8, clif->pMoveToKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x091d, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0944, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x0947, 19, clif->pWantToConnection); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0949, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_SELL, 0x0954, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0960, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0966, 6, clif->pDropItem); - packet(CMSG_SKILL_USE_BEING, 0x0968, 10, clif->pUseSkillToId); -} - -// 20151223 -if (packetVersion == 20151223) -{ - packet(CMSG_MOVE_TO_STORAGE, 0x02c4, 8, clif->pMoveToKafra); -// packet(UNKNOWN, 0x0362, 8, clif->pDull); - packet(CMSG_ITEM_PICKUP, 0x0364, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x0802, 4, clif->pDull); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0815, -1, clif->pSearchStoreInfo); - packet(CMSG_NAME_REQUEST, 0x0864, 6, clif->pGetCharNameRequest); - packet(CMSG_MAP_SERVER_CONNECT, 0x0866, 19, clif->pWantToConnection); - packet(CMSG_SKILL_USE_POSITION, 0x086e, 10, clif->pUseSkillToPos); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0872, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_BEING, 0x0875, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0876, 6, clif->pDropItem); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0881, 7, clif->pActionRequest); - packet(CMSG_MOVE_FROM_STORAGE, 0x0884, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_SELL, 0x0886, -1, clif->pReqTradeBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x088d, 5, clif->pHomMenu); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0890, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_CREATE, 0x0891, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0898, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PARTY_INVITE2, 0x08aa, 26, clif->pPartyInvite2); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0918, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BUYINGSTORE_OPEN, 0x091a, 6, clif->pReqClickBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x091b, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0920, 5, clif->pWalkToXY); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0923, 5, clif->pChangeDir); - packet(CMSG_MAP_PING, 0x0924, 6, clif->pTickSend); - packet(CMSG_SOLVE_CHAR_NAME, 0x095e, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_CLOSE, 0x095f, 2, clif->pReqCloseBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0965, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_CLICK, 0x0967, 12, clif->pSearchStoreInfoListItemClick); -} - -// 20151230 -if (packetVersion == 20151230) -{ - packet(CMSG_MOVE_TO_STORAGE, 0x02c4, 8, clif->pMoveToKafra); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); -// packet(UNKNOWN, 0x0366, 8, clif->pDull); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_CREATE, 0x0436, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x07ec, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0815, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x085b, -1, clif->pItemListWindowSelected); - packet(CMSG_PARTY_INVITE2, 0x0861, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0869, 5, clif->pChangeDir); - packet(CMSG_SKILL_USE_POSITION, 0x0886, 10, clif->pUseSkillToPos); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x088e, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0897, 6, clif->pDropItem); - packet(CMSG_MOVE_FROM_STORAGE, 0x091d, 8, clif->pMoveFromKafra); - packet(CMSG_STORAGE_PASSWORD, 0x0923, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x093a, 4, clif->pDull); - packet(CMSG_HOMUNCULUS_MENU, 0x0949, 5, clif->pHomMenu); - packet(CMSG_ITEM_PICKUP, 0x094e, 6, clif->pTakeItem); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160106 -if (packetVersion == 20160106) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_HOMUNCULUS_MENU, 0x07ec, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_PICKUP, 0x0861, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x086a, 6, clif->pDropItem); -// packet(UNKNOWN, 0x086c, 4, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x0878, 36, clif->pStoragePassword); - packet(CMSG_BOOKING_REGISTER_REQ, 0x087a, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MAP_SERVER_CONNECT, 0x087f, 19, clif->pWantToConnection); - packet(CMSG_MOVE_TO_STORAGE, 0x0885, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0889, 5, clif->pChangeDir); - packet(CMSG_PARTY_INVITE2, 0x088a, 26, clif->pPartyInvite2); - packet(CMSG_MOVE_FROM_STORAGE, 0x0891, 8, clif->pMoveFromKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x08a0, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x091d, -1, clif->pItemListWindowSelected); -// packet(UNKNOWN, 0x0940, 8, clif->pDull); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160113 -if (packetVersion == 20160113) -{ - packet(CMSG_SKILL_USE_POSITION, 0x022d, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DEST, 0x023b, 5, clif->pWalkToXY); - packet(CMSG_BOOKING_REGISTER_REQ, 0x035f, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_STORAGE_PASSWORD, 0x0815, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_CHANGE_DIR, 0x085b, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_OPEN, 0x0864, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x086d, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x0873, 4, clif->pDull); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0875, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0888, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PARTY_INVITE2, 0x088b, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CLOSE, 0x088c, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x0892, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_SELL, 0x0893, -1, clif->pReqTradeBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0899, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_CHANGE_ACT, 0x089a, 7, clif->pActionRequest); - packet(CMSG_MAP_PING, 0x08a0, 6, clif->pTickSend); - packet(CMSG_ITEM_PICKUP, 0x08a6, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_SEARCH, 0x08aa, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_CLICK, 0x0919, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_NAME_REQUEST, 0x091b, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0924, 6, clif->pDropItem); - packet(CMSG_SOLVE_CHAR_NAME, 0x0930, 6, clif->pSolveCharName); - packet(CMSG_MOVE_TO_STORAGE, 0x0932, 8, clif->pMoveToKafra); - packet(CMSG_MOVE_FROM_STORAGE, 0x093c, 8, clif->pMoveFromKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0941, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_SERVER_CONNECT, 0x094d, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x094f, 8, clif->pDull); - packet(CMSG_BUYINGSTORE_CREATE, 0x0967, -1, clif->pReqOpenBuyingStore); -} - -// 20160120 -if (packetVersion == 20160120) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0865, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160127 -if (packetVersion == 20160127) -{ - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_DIR, 0x085e, 5, clif->pChangeDir); - packet(CMSG_HOMUNCULUS_MENU, 0x0922, 5, clif->pHomMenu); - packet(CMSG_STORAGE_PASSWORD, 0x095a, 36, clif->pStoragePassword); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0961, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160203 -if (packetVersion == 20160203) -{ - packet(CMSG_BUYINGSTORE_SELL, 0x0202, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0361, 26, clif->pFriendsListAdd); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0436, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_PING, 0x0437, 6, clif->pTickSend); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x07e4, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0811, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0819, 19, clif->pWantToConnection); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0835, -1, clif->pItemListWindowSelected); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_BOOKING_REGISTER_REQ, 0x086c, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_HOMUNCULUS_MENU, 0x0872, 5, clif->pHomMenu); - packet(CMSG_STORAGE_PASSWORD, 0x0873, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x088c, 4, clif->pDull); -// packet(UNKNOWN, 0x0918, 8, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x093e, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0940, 5, clif->pWalkToXY); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0947, 6, clif->pDropItem); - packet(CMSG_MOVE_FROM_STORAGE, 0x0954, 8, clif->pMoveFromKafra); - packet(CMSG_ITEM_PICKUP, 0x095a, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x095d, 8, clif->pMoveToKafra); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160211 -if (packetVersion == 20160211) -{ - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_BOOKING_REGISTER_REQ, 0x023b, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_STORAGE_PASSWORD, 0x0365, 36, clif->pStoragePassword); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_DIR, 0x086c, 5, clif->pChangeDir); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0870, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x0886, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160217 -if (packetVersion == 20160217) -{ - packet(CMSG_BUYINGSTORE_SELL, 0x0202, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x023b, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0362, 5, clif->pChangeDir); - packet(CMSG_SEARCHSTORE_CLICK, 0x0365, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_TO_STORAGE, 0x0864, 8, clif->pMoveToKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0870, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x0873, 5, clif->pHomMenu); - packet(CMSG_MAP_SERVER_CONNECT, 0x087a, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x0888, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x088d, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x088f, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0899, 4, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x08a0, 8, clif->pMoveFromKafra); - packet(CMSG_PARTY_INVITE2, 0x08a9, 26, clif->pPartyInvite2); - packet(CMSG_BOOKING_REGISTER_REQ, 0x08ac, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x08ad, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x091d, 5, clif->pWalkToXY); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0920, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_BEING, 0x0926, 10, clif->pUseSkillToId); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x092e, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x093b, -1, clif->pItemListWindowSelected); - packet(CMSG_SEARCHSTORE_SEARCH, 0x093e, -1, clif->pSearchStoreInfo); - packet(CMSG_ITEM_PICKUP, 0x0941, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_POSITION, 0x094a, 10, clif->pUseSkillToPos); -// packet(UNKNOWN, 0x094f, 8, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x095e, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x0966, 6, clif->pGetCharNameRequest); - packet(CMSG_SOLVE_CHAR_NAME, 0x0967, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_CREATE, 0x0969, -1, clif->pReqOpenBuyingStore); -} - -// 20160224 -if (packetVersion == 20160224) -{ - packet(CMSG_PARTY_INVITE2, 0x022d, 26, clif->pPartyInvite2); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_SKILL_USE_BEING, 0x0364, 10, clif->pUseSkillToId); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_MOVE_FROM_STORAGE, 0x0369, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0436, 6, clif->pDropItem); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_TO_STORAGE, 0x083c, 8, clif->pMoveToKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x0861, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x086b, 8, clif->pDull); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0884, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_OPEN, 0x0885, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0888, 5, clif->pWalkToXY); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x08a9, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x0920, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0929, 5, clif->pChangeDir); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x092f, -1, clif->pItemListWindowSelected); - packet(CMSG_STORAGE_PASSWORD, 0x0936, 36, clif->pStoragePassword); - packet(CMSG_ITEM_PICKUP, 0x0938, 6, clif->pTakeItem); - packet(CMSG_BOOKING_REGISTER_REQ, 0x094c, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_HOMUNCULUS_MENU, 0x0961, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160302 -if (packetVersion == 20160302) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x022d, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_OPEN, 0x0367, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0802, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0819, 5, clif->pWalkToXY); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x085b, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_CREATE, 0x0864, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0865, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_SELL, 0x0867, -1, clif->pReqTradeBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0868, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_CLICK, 0x0873, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0875, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SKILL_USE_POSITION, 0x087a, 10, clif->pUseSkillToPos); - packet(CMSG_PARTY_INVITE2, 0x087d, 26, clif->pPartyInvite2); - packet(CMSG_SKILL_USE_BEING, 0x0883, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_CLOSE, 0x08a6, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x08a9, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x091a, 6, clif->pDropItem); - packet(CMSG_ITEM_PICKUP, 0x0927, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x092d, 4, clif->pDull); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x092f, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_NAME_REQUEST, 0x0945, 6, clif->pGetCharNameRequest); - packet(CMSG_STORAGE_PASSWORD, 0x094e, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x0950, 8, clif->pDull); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0957, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x095a, 6, clif->pTickSend); - packet(CMSG_MOVE_TO_STORAGE, 0x0960, 8, clif->pMoveToKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0961, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SOLVE_CHAR_NAME, 0x0967, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0968, 7, clif->pActionRequest); -} - -// 20160309 -if (packetVersion == 20160309) -{ - packet(CMSG_PLAYER_INVENTORY_DROP, 0x023b, 6, clif->pDropItem); - packet(CMSG_BUYINGSTORE_OPEN, 0x0281, 6, clif->pReqClickBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0361, 26, clif->pFriendsListAdd); - packet(CMSG_STORAGE_PASSWORD, 0x0364, 36, clif->pStoragePassword); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_POSITION, 0x0819, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0838, 5, clif->pWalkToXY); - packet(CMSG_PARTY_INVITE2, 0x083c, 26, clif->pPartyInvite2); - packet(CMSG_MOVE_TO_STORAGE, 0x085a, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_BEING, 0x085f, 10, clif->pUseSkillToId); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0866, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_SEARCH, 0x086a, -1, clif->pSearchStoreInfo); -// packet(UNKNOWN, 0x0873, 8, clif->pDull); - packet(CMSG_MAP_SERVER_CONNECT, 0x087c, 19, clif->pWantToConnection); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x087e, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x089b, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_CHANGE_DIR, 0x089d, 5, clif->pChangeDir); - packet(CMSG_BOOKING_REGISTER_REQ, 0x08a7, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_NAME_REQUEST, 0x091d, 6, clif->pGetCharNameRequest); - packet(CMSG_MOVE_FROM_STORAGE, 0x0920, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_CREATE, 0x0922, -1, clif->pReqOpenBuyingStore); -// packet(UNKNOWN, 0x0929, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_SELL, 0x092a, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x092e, 2, clif->pReqCloseBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0932, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_ACT, 0x094f, 7, clif->pActionRequest); - packet(CMSG_MAP_PING, 0x0956, 6, clif->pTickSend); - packet(CMSG_SEARCHSTORE_CLICK, 0x095e, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_ITEM_PICKUP, 0x096a, 6, clif->pTakeItem); -} - -// 20160316 -if (packetVersion == 20160316) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0922, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160318 -if (packetVersion == 20160318) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0922, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160323 -if (packetVersion == 20160323) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0365, 26, clif->pFriendsListAdd); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x0867, 8, clif->pDull); - packet(CMSG_ITEM_PICKUP, 0x0869, 6, clif->pTakeItem); - packet(CMSG_MOVE_FROM_STORAGE, 0x086a, 8, clif->pMoveFromKafra); - packet(CMSG_STORAGE_PASSWORD, 0x0872, 36, clif->pStoragePassword); - packet(CMSG_MAP_SERVER_CONNECT, 0x0878, 19, clif->pWantToConnection); - packet(CMSG_PARTY_INVITE2, 0x0883, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0896, -1, clif->pItemListWindowSelected); - packet(CMSG_HOMUNCULUS_MENU, 0x089a, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x091b, 4, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x0926, 8, clif->pMoveToKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0927, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0933, 5, clif->pChangeDir); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x093c, 6, clif->pDropItem); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160330 -if (packetVersion == 20160330) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0365, 36, clif->pStoragePassword); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x0867, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_PICKUP, 0x086d, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x0878, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x087f, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0889, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_HOMUNCULUS_MENU, 0x088b, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x088d, 4, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x0918, 8, clif->pMoveToKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x0925, 19, clif->pWantToConnection); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x092a, -1, clif->pItemListWindowSelected); - packet(CMSG_BOOKING_REGISTER_REQ, 0x092c, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0930, 5, clif->pChangeDir); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0939, 6, clif->pDropItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x093b, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -if (packetVersion >= 20160330) -{ - packet(CMSG_MAIL2_SEND_MAIL, 0x0a6e, -1, clif->pRodexSendMail); -} - -// 20160406 -if (packetVersion == 20160406) -{ - packet(CMSG_SOLVE_CHAR_NAME, 0x0364, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x07e4, 6, clif->pDropItem); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0819, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BOOKING_REGISTER_REQ, 0x085a, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION, 0x085c, 10, clif->pUseSkillToPos); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0869, -1, clif->pSearchStoreInfo); - packet(CMSG_ITEM_PICKUP, 0x0877, 6, clif->pTakeItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0878, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_CREATE, 0x0879, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_SELL, 0x0884, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0892, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x0895, 19, clif->pWantToConnection); - packet(CMSG_PARTY_INVITE2, 0x0898, 26, clif->pPartyInvite2); - packet(CMSG_NAME_REQUEST, 0x089b, 6, clif->pGetCharNameRequest); - packet(CMSG_MOVE_FROM_STORAGE, 0x089e, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_ACT, 0x08a1, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_CLOSE, 0x08a9, 2, clif->pReqCloseBuyingStore); -// packet(UNKNOWN, 0x08ac, 8, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x0927, 8, clif->pMoveToKafra); - packet(CMSG_SEARCHSTORE_CLICK, 0x092d, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0933, 5, clif->pChangeDir); - packet(CMSG_SKILL_USE_BEING, 0x0934, 10, clif->pUseSkillToId); - packet(CMSG_MAP_PING, 0x0940, 6, clif->pTickSend); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0949, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_OPEN, 0x094d, 6, clif->pReqClickBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0953, 36, clif->pStoragePassword); - packet(CMSG_HOMUNCULUS_MENU, 0x095d, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DEST, 0x095f, 5, clif->pWalkToXY); -// packet(UNKNOWN, 0x0962, 4, clif->pDull); -} - -// 20160414 -if (packetVersion == 20160414) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0362, -1, clif->pItemListWindowSelected); - packet(CMSG_ITEM_PICKUP, 0x0363, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MAP_SERVER_CONNECT, 0x0862, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x087a, 8, clif->pDull); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0880, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_FROM_STORAGE, 0x0885, 8, clif->pMoveFromKafra); - packet(CMSG_PARTY_INVITE2, 0x089e, 26, clif->pPartyInvite2); -// packet(UNKNOWN, 0x0918, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0922, 5, clif->pChangeDir); - packet(CMSG_STORAGE_PASSWORD, 0x0927, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0931, 6, clif->pDropItem); - packet(CMSG_HOMUNCULUS_MENU, 0x0934, 5, clif->pHomMenu); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0945, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_TO_STORAGE, 0x0953, 8, clif->pMoveToKafra); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160420 -if (packetVersion == 20160420) -{ - packet(CMSG_SEARCHSTORE_SEARCH, 0x022d, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_PING, 0x02c4, 6, clif->pTickSend); - packet(CMSG_PARTY_INVITE2, 0x035f, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0819, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_PICKUP, 0x0864, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x0870, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0872, 5, clif->pChangeDir); - packet(CMSG_MOVE_TO_STORAGE, 0x0874, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0884, 6, clif->pDropItem); - packet(CMSG_MAP_SERVER_CONNECT, 0x0888, 19, clif->pWantToConnection); - packet(CMSG_MOVE_FROM_STORAGE, 0x088b, 8, clif->pMoveFromKafra); - packet(CMSG_STORAGE_PASSWORD, 0x08a5, 36, clif->pStoragePassword); - packet(CMSG_BOOKING_REGISTER_REQ, 0x092f, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0935, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x094e, -1, clif->pItemListWindowSelected); -// packet(UNKNOWN, 0x095c, 8, clif->pDull); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160504 -if (packetVersion == 20160504) -{ - packet(CMSG_HOMUNCULUS_MENU, 0x0202, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_CREATE, 0x0363, -1, clif->pReqOpenBuyingStore); -// packet(UNKNOWN, 0x0365, 4, clif->pDull); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x083c, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_ACT, 0x085f, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_SELL, 0x086b, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x087f, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x0884, 10, clif->pUseSkillToPos); - packet(CMSG_MOVE_TO_STORAGE, 0x0886, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0887, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_PICKUP, 0x088a, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_BEING, 0x088d, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x088f, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0890, 6, clif->pDropItem); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0893, 18, clif->pPartyBookingRegisterReq); -// packet(UNKNOWN, 0x0898, 8, clif->pDull); - packet(CMSG_SOLVE_CHAR_NAME, 0x089d, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08ad, 5, clif->pChangeDir); - packet(CMSG_MAP_PING, 0x0918, 6, clif->pTickSend); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0921, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_NAME_REQUEST, 0x0922, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0924, 5, clif->pWalkToXY); - packet(CMSG_SEARCHSTORE_SEARCH, 0x093e, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x0940, 19, clif->pWantToConnection); - packet(CMSG_MOVE_FROM_STORAGE, 0x0941, 8, clif->pMoveFromKafra); - packet(CMSG_SEARCHSTORE_CLICK, 0x0948, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0952, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_OPEN, 0x095b, 6, clif->pReqClickBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0969, 36, clif->pStoragePassword); -} - -// 20160511 -if (packetVersion == 20160511) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_DIR, 0x085e, 5, clif->pChangeDir); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0894, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x089b, 4, clif->pDull); - packet(CMSG_HOMUNCULUS_MENU, 0x0918, 5, clif->pHomMenu); - packet(CMSG_MAP_SERVER_CONNECT, 0x0920, 19, clif->pWantToConnection); - packet(CMSG_STORAGE_PASSWORD, 0x0940, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160518 -if (packetVersion == 20160518) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_DIR, 0x086c, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x0874, 19, clif->pWantToConnection); - packet(CMSG_STORAGE_PASSWORD, 0x089a, 36, clif->pStoragePassword); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x08a9, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x0928, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160525 -if (packetVersion == 20160525) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x085a, 4, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x085e, 6, clif->pDropItem); - packet(CMSG_HOMUNCULUS_MENU, 0x0867, 5, clif->pHomMenu); - packet(CMSG_MAP_SERVER_CONNECT, 0x086a, 19, clif->pWantToConnection); - packet(CMSG_ITEM_PICKUP, 0x0899, 6, clif->pTakeItem); - packet(CMSG_PLAYER_CHANGE_DIR, 0x089c, 5, clif->pChangeDir); - packet(CMSG_STORAGE_PASSWORD, 0x091d, 36, clif->pStoragePassword); - packet(CMSG_BOOKING_REGISTER_REQ, 0x092c, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0937, -1, clif->pItemListWindowSelected); - packet(CMSG_PARTY_INVITE2, 0x0945, 26, clif->pPartyInvite2); - packet(CMSG_MOVE_TO_STORAGE, 0x094a, 8, clif->pMoveToKafra); -// packet(UNKNOWN, 0x094e, 8, clif->pDull); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0951, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_FROM_STORAGE, 0x0956, 8, clif->pMoveFromKafra); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160601 -if (packetVersion == 20160601) -{ - packet(CMSG_BUYINGSTORE_CLOSE, 0x0202, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PARTY_INVITE2, 0x02c4, 26, clif->pPartyInvite2); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0817, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_PICKUP, 0x0863, 6, clif->pTakeItem); - packet(CMSG_MOVE_FROM_STORAGE, 0x0870, 8, clif->pMoveFromKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x087d, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x088d, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x088f, 8, clif->pMoveToKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x0895, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x08a7, 8, clif->pDull); - packet(CMSG_MAP_SERVER_CONNECT, 0x08ac, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x0924, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x095b, 5, clif->pChangeDir); - packet(CMSG_STORAGE_PASSWORD, 0x095f, 36, clif->pStoragePassword); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0961, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160608 -if (packetVersion == 20160608) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x022d, -1, clif->pItemListWindowSelected); - packet(CMSG_BOOKING_REGISTER_REQ, 0x02c4, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PARTY_INVITE2, 0x035f, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0436, 5, clif->pWalkToXY); - packet(CMSG_MAP_SERVER_CONNECT, 0x0437, 19, clif->pWantToConnection); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DIR, 0x07ec, 5, clif->pChangeDir); - packet(CMSG_MAP_PING, 0x0802, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x085c, 8, clif->pDull); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0885, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_SELL, 0x0889, -1, clif->pReqTradeBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x0899, 6, clif->pTakeItem); - packet(CMSG_HOMUNCULUS_MENU, 0x089b, 5, clif->pHomMenu); - packet(CMSG_MOVE_FROM_STORAGE, 0x08a6, 8, clif->pMoveFromKafra); -// packet(UNKNOWN, 0x093b, 4, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x094d, 6, clif->pDropItem); - packet(CMSG_STORAGE_PASSWORD, 0x0958, 36, clif->pStoragePassword); - packet(CMSG_MOVE_TO_STORAGE, 0x095b, 8, clif->pMoveToKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0969, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160609 -if (packetVersion == 20160609) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x022d, -1, clif->pItemListWindowSelected); - packet(CMSG_BOOKING_REGISTER_REQ, 0x02c4, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PARTY_INVITE2, 0x035f, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0436, 5, clif->pWalkToXY); - packet(CMSG_MAP_SERVER_CONNECT, 0x0437, 19, clif->pWantToConnection); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DIR, 0x07ec, 5, clif->pChangeDir); - packet(CMSG_MAP_PING, 0x0802, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x085c, 8, clif->pDull); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0885, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_SELL, 0x0889, -1, clif->pReqTradeBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x0899, 6, clif->pTakeItem); - packet(CMSG_HOMUNCULUS_MENU, 0x089b, 5, clif->pHomMenu); - packet(CMSG_MOVE_FROM_STORAGE, 0x08a6, 8, clif->pMoveFromKafra); -// packet(UNKNOWN, 0x093b, 4, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x094d, 6, clif->pDropItem); - packet(CMSG_STORAGE_PASSWORD, 0x0958, 36, clif->pStoragePassword); - packet(CMSG_MOVE_TO_STORAGE, 0x095b, 8, clif->pMoveToKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0969, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160615 -if (packetVersion == 20160615) -{ - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0281, 26, clif->pFriendsListAdd); - packet(CMSG_MAP_SERVER_CONNECT, 0x0363, 19, clif->pWantToConnection); - packet(CMSG_STORAGE_PASSWORD, 0x0364, 36, clif->pStoragePassword); - packet(CMSG_HOMUNCULUS_MENU, 0x0369, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x083c, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0866, 5, clif->pWalkToXY); -// packet(UNKNOWN, 0x0870, 4, clif->pDull); - packet(CMSG_SOLVE_CHAR_NAME, 0x087d, 6, clif->pSolveCharName); - packet(CMSG_ITEM_PICKUP, 0x087e, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x087f, 90, clif->pUseSkillToPosMoreInfo); -// packet(UNKNOWN, 0x0884, 8, clif->pDull); - packet(CMSG_BUYINGSTORE_SELL, 0x0887, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x0888, 10, clif->pUseSkillToId); - packet(CMSG_MAP_PING, 0x088a, 6, clif->pTickSend); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x088d, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_POSITION, 0x0891, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0898, 6, clif->pDropItem); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x092f, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PARTY_INVITE2, 0x093e, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0947, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0948, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_OPEN, 0x094a, 6, clif->pReqClickBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x094b, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0954, 5, clif->pChangeDir); - packet(CMSG_MOVE_TO_STORAGE, 0x0957, 8, clif->pMoveToKafra); - packet(CMSG_MOVE_FROM_STORAGE, 0x0958, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x095c, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_BUYINGSTORE_CREATE, 0x095e, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SEARCHSTORE_CLICK, 0x0961, 12, clif->pSearchStoreInfoListItemClick); -} - -// 20160622 -if (packetVersion == 20160622) -{ - packet(CMSG_SKILL_USE_POSITION, 0x023b, 10, clif->pUseSkillToPos); - packet(CMSG_MOVE_FROM_STORAGE, 0x035f, 8, clif->pMoveFromKafra); - packet(CMSG_PARTY_INVITE2, 0x0361, 26, clif->pPartyInvite2); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_HOMUNCULUS_MENU, 0x07e4, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_SELL, 0x0861, -1, clif->pReqTradeBuyingStore); -// packet(UNKNOWN, 0x0865, 4, clif->pDull); -// packet(UNKNOWN, 0x0867, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0880, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0887, 2, clif->pReqCloseBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0890, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_OPEN, 0x0891, 6, clif->pReqClickBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0892, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BOOKING_REGISTER_REQ, 0x089a, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_ACT, 0x089e, 7, clif->pActionRequest); - packet(CMSG_SOLVE_CHAR_NAME, 0x08a2, 6, clif->pSolveCharName); - packet(CMSG_STORAGE_PASSWORD, 0x08a8, 36, clif->pStoragePassword); - packet(CMSG_ITEM_PICKUP, 0x091c, 6, clif->pTakeItem); - packet(CMSG_MAP_PING, 0x092d, 6, clif->pTickSend); - packet(CMSG_SKILL_USE_BEING, 0x092f, 10, clif->pUseSkillToId); - packet(CMSG_MAP_SERVER_CONNECT, 0x0936, 19, clif->pWantToConnection); - packet(CMSG_SEARCHSTORE_CLICK, 0x0937, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_TO_STORAGE, 0x093b, 8, clif->pMoveToKafra); - packet(CMSG_BUYINGSTORE_CREATE, 0x093f, -1, clif->pReqOpenBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0946, -1, clif->pItemListWindowSelected); - packet(CMSG_NAME_REQUEST, 0x0959, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0965, 5, clif->pChangeDir); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0969, 6, clif->pDropItem); -} - -// 20160629 -if (packetVersion == 20160629) -{ - packet(CMSG_SEARCHSTORE_CLICK, 0x0202, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_CHANGE_DEST, 0x022d, 5, clif->pWalkToXY); -// packet(UNKNOWN, 0x035f, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_OPEN, 0x0363, 6, clif->pReqClickBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0368, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x085c, 90, clif->pUseSkillToPosMoreInfo); -// packet(UNKNOWN, 0x085e, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0860, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0861, 6, clif->pDropItem); - packet(CMSG_SOLVE_CHAR_NAME, 0x0863, 6, clif->pSolveCharName); - packet(CMSG_STORAGE_PASSWORD, 0x0867, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x086b, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_MAP_SERVER_CONNECT, 0x0881, 19, clif->pWantToConnection); - packet(CMSG_HOMUNCULUS_MENU, 0x0885, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x088e, 6, clif->pGetCharNameRequest); - packet(CMSG_MAP_PING, 0x0893, 6, clif->pTickSend); - packet(CMSG_BOOKING_REGISTER_REQ, 0x091e, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_FROM_STORAGE, 0x0922, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_BEING, 0x0925, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x0926, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x093e, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0946, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0948, 5, clif->pChangeDir); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x094a, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0957, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_ACT, 0x095a, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0968, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x0969, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x096a, 8, clif->pMoveToKafra); -} - -// 20160630 -if (packetVersion == 20160630) -{ - packet(CMSG_SEARCHSTORE_CLICK, 0x0202, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_CHANGE_DEST, 0x022d, 5, clif->pWalkToXY); -// packet(UNKNOWN, 0x035f, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_OPEN, 0x0363, 6, clif->pReqClickBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0368, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x085c, 90, clif->pUseSkillToPosMoreInfo); -// packet(UNKNOWN, 0x085e, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0860, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0861, 6, clif->pDropItem); - packet(CMSG_SOLVE_CHAR_NAME, 0x0863, 6, clif->pSolveCharName); - packet(CMSG_STORAGE_PASSWORD, 0x0867, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x086b, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_MAP_SERVER_CONNECT, 0x0881, 19, clif->pWantToConnection); - packet(CMSG_HOMUNCULUS_MENU, 0x0885, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x088e, 6, clif->pGetCharNameRequest); - packet(CMSG_MAP_PING, 0x0893, 6, clif->pTickSend); - packet(CMSG_BOOKING_REGISTER_REQ, 0x091e, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_FROM_STORAGE, 0x0922, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_BEING, 0x0925, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x0926, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x093e, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0946, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0948, 5, clif->pChangeDir); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x094a, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0957, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_ACT, 0x095a, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0968, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x0969, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x096a, 8, clif->pMoveToKafra); -} - -// 20160706 -if (packetVersion == 20160706) -{ - packet(CMSG_SOLVE_CHAR_NAME, 0x0362, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_OPEN, 0x0436, 6, clif->pReqClickBuyingStore); - packet(CMSG_PARTY_INVITE2, 0x085f, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0860, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_SELL, 0x0869, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x086b, -1, clif->pReqOpenBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0884, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x0886, 4, clif->pDull); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0889, -1, clif->pSearchStoreInfo); - packet(CMSG_HOMUNCULUS_MENU, 0x0892, 5, clif->pHomMenu); - packet(CMSG_SKILL_USE_BEING, 0x0899, 10, clif->pUseSkillToId); - packet(CMSG_BOOKING_REGISTER_REQ, 0x08a4, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MAP_SERVER_CONNECT, 0x08a5, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x08a8, 6, clif->pTickSend); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0918, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x091b, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_POSITION, 0x0924, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0926, 5, clif->pChangeDir); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0927, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_MOVE_FROM_STORAGE, 0x0929, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x092d, 5, clif->pWalkToXY); - packet(CMSG_MOVE_TO_STORAGE, 0x0939, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x093d, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0944, 8, clif->pDull); - packet(CMSG_NAME_REQUEST, 0x0945, 6, clif->pGetCharNameRequest); - packet(CMSG_STORAGE_PASSWORD, 0x094c, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0952, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_CLICK, 0x0957, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_ITEM_PICKUP, 0x0958, 6, clif->pTakeItem); -} - -// 20160713 -if (packetVersion == 20160713) -{ - packet(CMSG_STORAGE_PASSWORD, 0x022d, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0363, 5, clif->pChangeDir); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0364, -1, clif->pItemListWindowSelected); - packet(CMSG_ITEM_PICKUP, 0x0838, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_OPEN, 0x0860, 6, clif->pReqClickBuyingStore); - packet(CMSG_BUYINGSTORE_SELL, 0x0865, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0869, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0875, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SKILL_USE_POSITION, 0x0877, 10, clif->pUseSkillToPos); - packet(CMSG_MAP_PING, 0x087b, 6, clif->pTickSend); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0883, -1, clif->pSearchStoreInfo); - packet(CMSG_BOOKING_REGISTER_REQ, 0x088d, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SEARCHSTORE_CLICK, 0x0892, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PARTY_INVITE2, 0x089a, 26, clif->pPartyInvite2); -// packet(UNKNOWN, 0x089f, 4, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x08a2, 8, clif->pMoveFromKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x08a4, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DEST, 0x091c, 5, clif->pWalkToXY); - packet(CMSG_SOLVE_CHAR_NAME, 0x091d, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0921, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_HOMUNCULUS_MENU, 0x0922, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x092c, 6, clif->pGetCharNameRequest); - packet(CMSG_SKILL_USE_BEING, 0x0931, 10, clif->pUseSkillToId); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0939, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0944, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0945, 7, clif->pActionRequest); - packet(CMSG_MOVE_TO_STORAGE, 0x0947, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0957, 6, clif->pDropItem); -// packet(UNKNOWN, 0x095b, 8, clif->pDull); -} - -// 20160720 -if (packetVersion == 20160720) -{ - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0362, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SKILL_USE_BEING, 0x0363, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0365, 7, clif->pActionRequest); - packet(CMSG_MAP_SERVER_CONNECT, 0x07e4, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_SELL, 0x0819, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0838, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x085b, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x086a, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BUYINGSTORE_OPEN, 0x086d, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x087f, 6, clif->pDropItem); - packet(CMSG_SKILL_USE_POSITION, 0x0883, 10, clif->pUseSkillToPos); - packet(CMSG_NAME_REQUEST, 0x0887, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0897, -1, clif->pSearchStoreInfo); - packet(CMSG_STORAGE_PASSWORD, 0x089a, 36, clif->pStoragePassword); - packet(CMSG_HOMUNCULUS_MENU, 0x089c, 5, clif->pHomMenu); - packet(CMSG_MOVE_FROM_STORAGE, 0x089e, 8, clif->pMoveFromKafra); - packet(CMSG_SEARCHSTORE_CLICK, 0x08a0, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x08aa, -1, clif->pItemListWindowSelected); -// packet(UNKNOWN, 0x0917, 4, clif->pDull); - packet(CMSG_ITEM_PICKUP, 0x091c, 6, clif->pTakeItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x092a, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_CHANGE_DIR, 0x093b, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_CREATE, 0x093e, -1, clif->pReqOpenBuyingStore); - packet(CMSG_MAP_PING, 0x0946, 6, clif->pTickSend); - packet(CMSG_SOLVE_CHAR_NAME, 0x094d, 6, clif->pSolveCharName); -// packet(UNKNOWN, 0x0953, 8, clif->pDull); - packet(CMSG_BOOKING_REGISTER_REQ, 0x095b, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_TO_STORAGE, 0x0960, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0969, 26, clif->pPartyInvite2); -} - -// 20160727 -if (packetVersion == 20160727) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); -// packet(UNKNOWN, 0x023b, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0362, -1, clif->pSearchStoreInfo); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0363, 26, clif->pFriendsListAdd); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0436, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_MAP_PING, 0x0438, 6, clif->pTickSend); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x07ec, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0866, 4, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x0868, 26, clif->pPartyInvite2); - packet(CMSG_SEARCHSTORE_CLICK, 0x0869, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_BUYINGSTORE_OPEN, 0x0874, 6, clif->pReqClickBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0877, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0883, 7, clif->pActionRequest); - packet(CMSG_MAP_SERVER_CONNECT, 0x0887, 19, clif->pWantToConnection); - packet(CMSG_SKILL_USE_BEING, 0x088e, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_SELL, 0x0891, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x089f, 10, clif->pUseSkillToPos); - packet(CMSG_STORAGE_PASSWORD, 0x08a2, 36, clif->pStoragePassword); - packet(CMSG_SOLVE_CHAR_NAME, 0x08a4, 6, clif->pSolveCharName); - packet(CMSG_ITEM_PICKUP, 0x08a7, 6, clif->pTakeItem); - packet(CMSG_PLAYER_CHANGE_DEST, 0x092e, 5, clif->pWalkToXY); - packet(CMSG_HOMUNCULUS_MENU, 0x0936, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0941, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_NAME_REQUEST, 0x0946, 6, clif->pGetCharNameRequest); - packet(CMSG_MOVE_FROM_STORAGE, 0x0949, 8, clif->pMoveFromKafra); - packet(CMSG_MOVE_TO_STORAGE, 0x0951, 8, clif->pMoveToKafra); - packet(CMSG_BUYINGSTORE_CREATE, 0x095f, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0966, 2, clif->pReqCloseBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0969, -1, clif->pItemListWindowSelected); -} - -// 20160803 -if (packetVersion == 20160803) -{ - packet(CMSG_MAP_SERVER_CONNECT, 0x0364, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_OPEN, 0x085d, 6, clif->pReqClickBuyingStore); -// packet(UNKNOWN, 0x0878, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x087f, 5, clif->pWalkToXY); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0881, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_TO_STORAGE, 0x0886, 8, clif->pMoveToKafra); - packet(CMSG_NAME_REQUEST, 0x0887, 6, clif->pGetCharNameRequest); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0888, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_CLOSE, 0x088b, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0891, 5, clif->pChangeDir); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0895, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x089c, 6, clif->pDropItem); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x089e, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BUYINGSTORE_CREATE, 0x08a1, -1, clif->pReqOpenBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x091b, 6, clif->pTakeItem); - packet(CMSG_STORAGE_PASSWORD, 0x0929, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_CLICK, 0x0930, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x0932, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0934, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0937, 10, clif->pUseSkillToPos); -// packet(UNKNOWN, 0x093a, 8, clif->pDull); - packet(CMSG_MAP_PING, 0x093e, 6, clif->pTickSend); - packet(CMSG_SEARCHSTORE_SEARCH, 0x093f, -1, clif->pSearchStoreInfo); - packet(CMSG_HOMUNCULUS_MENU, 0x0952, 5, clif->pHomMenu); - packet(CMSG_MOVE_FROM_STORAGE, 0x0955, 8, clif->pMoveFromKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0956, -1, clif->pItemListWindowSelected); - packet(CMSG_SOLVE_CHAR_NAME, 0x0959, 6, clif->pSolveCharName); - packet(CMSG_PARTY_INVITE2, 0x095a, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x096a, -1, clif->pReqTradeBuyingStore); -} - -// 20160810 -if (packetVersion == 20160810) -{ - packet(CMSG_STORAGE_PASSWORD, 0x0361, 36, clif->pStoragePassword); - packet(CMSG_SKILL_USE_POSITION, 0x0819, 10, clif->pUseSkillToPos); - packet(CMSG_PARTY_INVITE2, 0x0838, 26, clif->pPartyInvite2); - packet(CMSG_SEARCHSTORE_CLICK, 0x085d, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x085e, 6, clif->pDropItem); - packet(CMSG_BOOKING_REGISTER_REQ, 0x085f, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SOLVE_CHAR_NAME, 0x0860, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_CREATE, 0x086f, -1, clif->pReqOpenBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0875, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_OPEN, 0x0879, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_CHANGE_DEST, 0x087a, 5, clif->pWalkToXY); - packet(CMSG_MAP_SERVER_CONNECT, 0x0885, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0888, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0890, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_CHANGE_DIR, 0x089d, 5, clif->pChangeDir); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x089f, -1, clif->pItemListWindowSelected); - packet(CMSG_MOVE_TO_STORAGE, 0x08a9, 8, clif->pMoveToKafra); - packet(CMSG_ITEM_PICKUP, 0x091a, 6, clif->pTakeItem); - packet(CMSG_NAME_REQUEST, 0x091b, 6, clif->pGetCharNameRequest); - packet(CMSG_SKILL_USE_BEING, 0x091c, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x0926, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_SELL, 0x092b, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x092d, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0935, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_MAP_PING, 0x0943, 6, clif->pTickSend); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x094b, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0959, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_ACT, 0x095b, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0967, 8, clif->pDull); -} - -// 20160831 -if (packetVersion == 20160831) -{ - packet(CMSG_SKILL_USE_POSITION_MORE, 0x022d, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0366, 6, clif->pDropItem); - packet(CMSG_BUYINGSTORE_OPEN, 0x07ec, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0835, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0865, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x086d, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0870, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PARTY_INVITE2, 0x0874, 26, clif->pPartyInvite2); -// packet(UNKNOWN, 0x0876, 8, clif->pDull); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0878, 7, clif->pActionRequest); - packet(CMSG_NAME_REQUEST, 0x087c, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_SELL, 0x08a8, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_PING, 0x08a9, 6, clif->pTickSend); - packet(CMSG_STORAGE_PASSWORD, 0x0917, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x091b, 4, clif->pDull); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x092c, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x092e, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0938, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_HOMUNCULUS_MENU, 0x093a, 5, clif->pHomMenu); - packet(CMSG_SOLVE_CHAR_NAME, 0x0946, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_DIR, 0x094a, 5, clif->pChangeDir); - packet(CMSG_MOVE_TO_STORAGE, 0x094f, 8, clif->pMoveToKafra); - packet(CMSG_BUYINGSTORE_CREATE, 0x0950, -1, clif->pReqOpenBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0954, -1, clif->pItemListWindowSelected); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0957, -1, clif->pSearchStoreInfo); - packet(CMSG_MOVE_FROM_STORAGE, 0x095e, 8, clif->pMoveFromKafra); - packet(CMSG_ITEM_PICKUP, 0x0960, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_POSITION, 0x0964, 10, clif->pUseSkillToPos); - packet(CMSG_SKILL_USE_BEING, 0x0967, 10, clif->pUseSkillToId); -} - -// 20160907 -if (packetVersion == 20160907) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x091c, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160913 -if (packetVersion == 20160913) -{ - packet(CMSG_BOOKING_REGISTER_REQ, 0x0361, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_TO_STORAGE, 0x0817, 8, clif->pMoveToKafra); - packet(CMSG_SEARCHSTORE_CLICK, 0x085b, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_NAME_REQUEST, 0x0865, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_OPEN, 0x0874, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_PING, 0x0875, 6, clif->pTickSend); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0879, 6, clif->pDropItem); -// packet(UNKNOWN, 0x087a, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x087b, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0887, -1, clif->pItemListWindowSelected); - packet(CMSG_ITEM_PICKUP, 0x0889, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_BEING, 0x088e, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_SELL, 0x088f, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0891, -1, clif->pSearchStoreInfo); - packet(CMSG_SKILL_USE_POSITION, 0x0892, 10, clif->pUseSkillToPos); - packet(CMSG_MOVE_FROM_STORAGE, 0x089b, 8, clif->pMoveFromKafra); - packet(CMSG_STORAGE_PASSWORD, 0x089c, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08a5, 5, clif->pChangeDir); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0928, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_CREATE, 0x0935, -1, clif->pReqOpenBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x093a, 5, clif->pHomMenu); - packet(CMSG_PARTY_INVITE2, 0x0949, 26, clif->pPartyInvite2); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x094a, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0950, 7, clif->pActionRequest); - packet(CMSG_MAP_SERVER_CONNECT, 0x0952, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0954, 5, clif->pWalkToXY); -// packet(UNKNOWN, 0x0962, 4, clif->pDull); - packet(CMSG_SOLVE_CHAR_NAME, 0x0963, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0968, 2, clif->pReqCloseBuyingStore); -} - -// 20160921 -if (packetVersion == 20160921) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x094a, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20160928 -if (packetVersion == 20160928) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0202, -1, clif->pItemListWindowSelected); - packet(CMSG_NAME_REQUEST, 0x035f, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_CREATE, 0x0366, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_OPEN, 0x0436, 6, clif->pReqClickBuyingStore); -// packet(UNKNOWN, 0x0811, 8, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x0838, 26, clif->pPartyInvite2); - packet(CMSG_MOVE_FROM_STORAGE, 0x0864, 8, clif->pMoveFromKafra); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0866, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x086d, 6, clif->pDropItem); - packet(CMSG_HOMUNCULUS_MENU, 0x0872, 5, clif->pHomMenu); - packet(CMSG_SOLVE_CHAR_NAME, 0x0878, 6, clif->pSolveCharName); - packet(CMSG_SEARCHSTORE_CLICK, 0x087f, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MAP_SERVER_CONNECT, 0x0889, 19, clif->pWantToConnection); - packet(CMSG_SEARCHSTORE_SEARCH, 0x088e, -1, clif->pSearchStoreInfo); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0897, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_ACT, 0x089a, 7, clif->pActionRequest); - packet(CMSG_STORAGE_PASSWORD, 0x08a2, 36, clif->pStoragePassword); - packet(CMSG_MOVE_TO_STORAGE, 0x08a9, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0919, 5, clif->pWalkToXY); - packet(CMSG_MAP_PING, 0x091e, 6, clif->pTickSend); - packet(CMSG_SKILL_USE_BEING, 0x0927, 10, clif->pUseSkillToId); - packet(CMSG_SKILL_USE_POSITION, 0x092d, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0944, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_CLOSE, 0x094d, 2, clif->pReqCloseBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x094e, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_SELL, 0x0953, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0955, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_ITEM_PICKUP, 0x0957, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x095a, 4, clif->pDull); -} - -// 20161005 -if (packetVersion == 20161005) -{ - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0202, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0368, 7, clif->pActionRequest); - packet(CMSG_STORAGE_PASSWORD, 0x0838, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x0863, 6, clif->pGetCharNameRequest); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0886, -1, clif->pItemListWindowSelected); - packet(CMSG_MOVE_FROM_STORAGE, 0x088e, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0891, 5, clif->pChangeDir); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0892, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PARTY_INVITE2, 0x089b, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_PICKUP, 0x089c, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x08a0, 8, clif->pMoveToKafra); - packet(CMSG_BUYINGSTORE_CLOSE, 0x08ac, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BUYINGSTORE_SELL, 0x08ad, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0918, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SOLVE_CHAR_NAME, 0x0919, 6, clif->pSolveCharName); -// packet(UNKNOWN, 0x091e, 8, clif->pDull); - packet(CMSG_MAP_PING, 0x092b, 6, clif->pTickSend); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0931, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x0932, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_POSITION, 0x093b, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0942, 6, clif->pDropItem); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0944, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0945, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CREATE, 0x094a, -1, clif->pReqOpenBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x094d, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x0952, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_OPEN, 0x095a, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x095b, 19, clif->pWantToConnection); - packet(CMSG_SKILL_USE_BEING, 0x0967, 10, clif->pUseSkillToId); -} - -// 20161012 -if (packetVersion == 20161012) -{ - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x023b, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0364, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x0365, 6, clif->pTickSend); - packet(CMSG_PARTY_INVITE2, 0x0369, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CREATE, 0x07ec, -1, clif->pReqOpenBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0819, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x085b, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_CLOSE, 0x085e, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0863, 7, clif->pActionRequest); - packet(CMSG_ITEM_PICKUP, 0x0868, 6, clif->pTakeItem); - packet(CMSG_MAP_SERVER_CONNECT, 0x086d, 19, clif->pWantToConnection); - packet(CMSG_SEARCHSTORE_CLICK, 0x0872, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0875, -1, clif->pSearchStoreInfo); - packet(CMSG_SKILL_USE_POSITION, 0x0880, 10, clif->pUseSkillToPos); - packet(CMSG_MOVE_TO_STORAGE, 0x0893, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08a0, 5, clif->pChangeDir); - packet(CMSG_SOLVE_CHAR_NAME, 0x092d, 6, clif->pSolveCharName); - packet(CMSG_NAME_REQUEST, 0x0936, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_OPEN, 0x0937, 6, clif->pReqClickBuyingStore); - packet(CMSG_BUYINGSTORE_SELL, 0x0939, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0943, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_FROM_STORAGE, 0x0944, 8, clif->pMoveFromKafra); -// packet(UNKNOWN, 0x094f, 8, clif->pDull); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0951, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_HOMUNCULUS_MENU, 0x095c, 5, clif->pHomMenu); - packet(CMSG_SKILL_USE_BEING, 0x0962, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0966, 5, clif->pWalkToXY); - packet(CMSG_STORAGE_PASSWORD, 0x0967, 36, clif->pStoragePassword); -} - -// 20161019 -if (packetVersion == 20161019) -{ - packet(CMSG_BUYINGSTORE_OPEN, 0x022d, 6, clif->pReqClickBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_HOMUNCULUS_MENU, 0x0360, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0361, 5, clif->pWalkToXY); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0437, 5, clif->pChangeDir); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0889, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x0892, 4, clif->pDull); - packet(CMSG_MAP_SERVER_CONNECT, 0x0946, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0963, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20161026 -if (packetVersion == 20161026) -{ - packet(CMSG_STORAGE_PASSWORD, 0x0363, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0438, 5, clif->pWalkToXY); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0802, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_TO_STORAGE, 0x085a, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_ACT, 0x085f, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_SELL, 0x0861, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_PING, 0x0862, 6, clif->pTickSend); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x086a, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x086c, 12, clif->pSearchStoreInfoListItemClick); -// packet(UNKNOWN, 0x086e, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_SEARCH, 0x087a, -1, clif->pSearchStoreInfo); -// packet(UNKNOWN, 0x087c, 4, clif->pDull); - packet(CMSG_SKILL_USE_POSITION, 0x087f, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0886, 6, clif->pDropItem); - packet(CMSG_BUYINGSTORE_OPEN, 0x0891, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x0894, 10, clif->pUseSkillToId); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0898, 26, clif->pFriendsListAdd); - packet(CMSG_MAP_SERVER_CONNECT, 0x091a, 19, clif->pWantToConnection); - packet(CMSG_ITEM_PICKUP, 0x091b, 6, clif->pTakeItem); - packet(CMSG_SOLVE_CHAR_NAME, 0x0926, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_CREATE, 0x092c, -1, clif->pReqOpenBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x092e, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_CLOSE, 0x092f, 2, clif->pReqCloseBuyingStore); - packet(CMSG_NAME_REQUEST, 0x0930, 6, clif->pGetCharNameRequest); - packet(CMSG_MOVE_FROM_STORAGE, 0x094b, 8, clif->pMoveFromKafra); - packet(CMSG_PARTY_INVITE2, 0x0953, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x095c, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x095e, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0962, 5, clif->pChangeDir); -} - -// 20161102 -if (packetVersion == 20161102) -{ - packet(CMSG_MOVE_FROM_STORAGE, 0x0361, 8, clif->pMoveFromKafra); -// packet(UNKNOWN, 0x0367, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0436, 7, clif->pActionRequest); - packet(CMSG_ITEM_PICKUP, 0x0802, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_CREATE, 0x0838, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x083c, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_BEING, 0x085f, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_TO_STORAGE, 0x0869, 8, clif->pMoveToKafra); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x086c, 2, clif->pSearchStoreInfoNextPage); -// packet(UNKNOWN, 0x086f, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0874, -1, clif->pSearchStoreInfo); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0886, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_HOMUNCULUS_MENU, 0x088f, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0890, 6, clif->pDropItem); - packet(CMSG_PARTY_INVITE2, 0x089f, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x08a2, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PLAYER_CHANGE_DEST, 0x08aa, 5, clif->pWalkToXY); - packet(CMSG_STORAGE_PASSWORD, 0x091b, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_OPEN, 0x0922, 6, clif->pReqClickBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0925, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0928, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x092f, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0936, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0946, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0949, 5, clif->pChangeDir); - packet(CMSG_SEARCHSTORE_CLICK, 0x095e, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0964, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_POSITION, 0x0965, 10, clif->pUseSkillToPos); - packet(CMSG_MAP_PING, 0x0966, 6, clif->pTickSend); -} - -// 20161103 -if (packetVersion == 20161103) -{ - packet(CMSG_MOVE_FROM_STORAGE, 0x0361, 8, clif->pMoveFromKafra); -// packet(UNKNOWN, 0x0367, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0436, 7, clif->pActionRequest); - packet(CMSG_ITEM_PICKUP, 0x0802, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_CREATE, 0x0838, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x083c, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_BEING, 0x085f, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_TO_STORAGE, 0x0869, 8, clif->pMoveToKafra); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x086c, 2, clif->pSearchStoreInfoNextPage); -// packet(UNKNOWN, 0x086f, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0874, -1, clif->pSearchStoreInfo); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0886, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_HOMUNCULUS_MENU, 0x088f, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0890, 6, clif->pDropItem); - packet(CMSG_PARTY_INVITE2, 0x089f, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x08a2, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PLAYER_CHANGE_DEST, 0x08aa, 5, clif->pWalkToXY); - packet(CMSG_STORAGE_PASSWORD, 0x091b, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_OPEN, 0x0922, 6, clif->pReqClickBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0925, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0928, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x092f, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0936, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0946, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0949, 5, clif->pChangeDir); - packet(CMSG_SEARCHSTORE_CLICK, 0x095e, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0964, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_POSITION, 0x0965, 10, clif->pUseSkillToPos); - packet(CMSG_MAP_PING, 0x0966, 6, clif->pTickSend); -} - -// 20161109 -if (packetVersion == 20161109) -{ - packet(CMSG_BOOKING_REGISTER_REQ, 0x02c4, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0361, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_MOVE_FROM_STORAGE, 0x0362, 8, clif->pMoveFromKafra); - packet(CMSG_MAP_PING, 0x0365, 6, clif->pTickSend); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0366, -1, clif->pSearchStoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0835, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_CLOSE, 0x085d, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x085e, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0865, 5, clif->pWalkToXY); - packet(CMSG_PLAYER_CHANGE_ACT, 0x086a, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x086d, 10, clif->pUseSkillToPos); - packet(CMSG_MAP_SERVER_CONNECT, 0x0870, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_OPEN, 0x0876, 6, clif->pReqClickBuyingStore); -// packet(UNKNOWN, 0x087a, 8, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x0881, 8, clif->pMoveToKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x088e, -1, clif->pItemListWindowSelected); - packet(CMSG_SEARCHSTORE_CLICK, 0x0891, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_ITEM_PICKUP, 0x0898, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x089a, 6, clif->pDropItem); - packet(CMSG_BUYINGSTORE_CREATE, 0x089d, -1, clif->pReqOpenBuyingStore); -// packet(UNKNOWN, 0x089f, 4, clif->pDull); - packet(CMSG_HOMUNCULUS_MENU, 0x08a7, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_SELL, 0x08ad, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PARTY_INVITE2, 0x0927, 26, clif->pPartyInvite2); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0937, 26, clif->pFriendsListAdd); - packet(CMSG_STORAGE_PASSWORD, 0x093c, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x093f, 6, clif->pGetCharNameRequest); - packet(CMSG_SKILL_USE_BEING, 0x0954, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0956, 5, clif->pChangeDir); -} - -// 20161116 -if (packetVersion == 20161116) -{ - packet(CMSG_MAP_PING, 0x0368, 6, clif->pTickSend); - packet(CMSG_MOVE_TO_STORAGE, 0x0369, 8, clif->pMoveToKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0835, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x085f, 6, clif->pDropItem); - packet(CMSG_PARTY_INVITE2, 0x0864, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_PICKUP, 0x086f, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0885, -1, clif->pSearchStoreInfo); - packet(CMSG_HOMUNCULUS_MENU, 0x088b, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_OPEN, 0x088d, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x088f, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0890, 5, clif->pWalkToXY); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0892, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0893, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08a1, 5, clif->pChangeDir); - packet(CMSG_BOOKING_REGISTER_REQ, 0x08a2, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SEARCHSTORE_CLICK, 0x08aa, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_FROM_STORAGE, 0x08ac, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0920, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SKILL_USE_POSITION, 0x0925, 10, clif->pUseSkillToPos); - packet(CMSG_SKILL_USE_BEING, 0x092a, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_CREATE, 0x0931, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_SELL, 0x093c, -1, clif->pReqTradeBuyingStore); - packet(CMSG_NAME_REQUEST, 0x094a, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0952, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0957, 6, clif->pSolveCharName); - packet(CMSG_STORAGE_PASSWORD, 0x095b, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x095d, 4, clif->pDull); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x095f, 2, clif->pSearchStoreInfoNextPage); -// packet(UNKNOWN, 0x0967, 8, clif->pDull); -} - -// 20161123 -if (packetVersion == 20161123) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_BOOKING_REGISTER_REQ, 0x035f, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0362, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_PING, 0x0437, 6, clif->pTickSend); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x085c, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0861, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0862, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0866, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x086f, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0871, 4, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x087f, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0880, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_SELL, 0x0882, -1, clif->pReqTradeBuyingStore); - packet(CMSG_NAME_REQUEST, 0x088b, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_DIR, 0x089c, 5, clif->pChangeDir); - packet(CMSG_SKILL_USE_POSITION, 0x08a9, 10, clif->pUseSkillToPos); - packet(CMSG_SEARCHSTORE_CLICK, 0x08aa, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MOVE_TO_STORAGE, 0x091a, 8, clif->pMoveToKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x0926, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_OPEN, 0x092a, 6, clif->pReqClickBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x092f, 6, clif->pTakeItem); - packet(CMSG_HOMUNCULUS_MENU, 0x0930, 5, clif->pHomMenu); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0941, 26, clif->pFriendsListAdd); - packet(CMSG_SKILL_USE_BEING, 0x094d, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_CREATE, 0x094f, -1, clif->pReqOpenBuyingStore); -// packet(UNKNOWN, 0x095a, 8, clif->pDull); - packet(CMSG_PLAYER_CHANGE_ACT, 0x095b, 7, clif->pActionRequest); - packet(CMSG_MOVE_FROM_STORAGE, 0x0962, 8, clif->pMoveFromKafra); - packet(CMSG_SOLVE_CHAR_NAME, 0x096a, 6, clif->pSolveCharName); -} - -// 20161130 -if (packetVersion == 20161130) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_CHANGE_DIR, 0x035f, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_PING, 0x0361, 6, clif->pTickSend); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); -// packet(UNKNOWN, 0x088f, 4, clif->pDull); - packet(CMSG_HOMUNCULUS_MENU, 0x0931, 5, clif->pHomMenu); - packet(CMSG_MAP_SERVER_CONNECT, 0x0943, 19, clif->pWantToConnection); - packet(CMSG_STORAGE_PASSWORD, 0x0954, 36, clif->pStoragePassword); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0959, 26, clif->pFriendsListAdd); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20161207 -if (packetVersion == 20161207) -{ - packet(CMSG_HOMUNCULUS_MENU, 0x023b, 5, clif->pHomMenu); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0361, 19, clif->pWantToConnection); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0867, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x0868, 8, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x0875, 8, clif->pMoveToKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x087e, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0886, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08a1, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x08a2, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x08ad, 6, clif->pDropItem); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0918, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_FROM_STORAGE, 0x091d, 8, clif->pMoveFromKafra); -// packet(UNKNOWN, 0x0943, 4, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x095d, 36, clif->pStoragePassword); - packet(CMSG_PARTY_INVITE2, 0x0965, 26, clif->pPartyInvite2); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20161214 -if (packetVersion == 20161214) -{ - packet(CMSG_BUYINGSTORE_OPEN, 0x022d, 6, clif->pReqClickBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0281, -1, clif->pSearchStoreInfo); - packet(CMSG_MOVE_FROM_STORAGE, 0x02c4, 8, clif->pMoveFromKafra); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_HOMUNCULUS_MENU, 0x0360, 5, clif->pHomMenu); - packet(CMSG_MOVE_TO_STORAGE, 0x0364, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_MAP_SERVER_CONNECT, 0x0369, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0436, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); -// packet(UNKNOWN, 0x0819, 4, clif->pDull); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x085a, -1, clif->pItemListWindowSelected); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0862, 26, clif->pFriendsListAdd); - packet(CMSG_PARTY_INVITE2, 0x086d, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0887, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0895, 8, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x0899, 36, clif->pStoragePassword); - packet(CMSG_BOOKING_REGISTER_REQ, 0x08a6, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_ITEM_PICKUP, 0x092e, 6, clif->pTakeItem); - packet(CMSG_PLAYER_CHANGE_DIR, 0x093d, 5, clif->pChangeDir); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20161221 -if (packetVersion == 20161221) -{ - packet(CMSG_ITEM_PICKUP, 0x035f, 6, clif->pTakeItem); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); - packet(CMSG_SOLVE_CHAR_NAME, 0x0366, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0438, 5, clif->pWalkToXY); - packet(CMSG_MOVE_TO_STORAGE, 0x0817, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x085b, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0866, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_CLICK, 0x0876, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_NAME_REQUEST, 0x0881, 6, clif->pGetCharNameRequest); -// packet(UNKNOWN, 0x0884, 8, clif->pDull); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0885, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_SELL, 0x088c, -1, clif->pReqTradeBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0890, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x0899, 4, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x089a, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_ACT, 0x089b, 7, clif->pActionRequest); - packet(CMSG_MAP_PING, 0x08aa, 6, clif->pTickSend); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x091e, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PARTY_INVITE2, 0x0926, 26, clif->pPartyInvite2); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0928, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_CLOSE, 0x092c, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x092e, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_HOMUNCULUS_MENU, 0x0930, 5, clif->pHomMenu); - packet(CMSG_SKILL_USE_BEING, 0x0943, 10, clif->pUseSkillToId); - packet(CMSG_SKILL_USE_POSITION, 0x0946, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_CREATE, 0x094b, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_OPEN, 0x095a, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0964, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0965, 5, clif->pChangeDir); -} - -// 20161228 -if (packetVersion == 20161228) -{ - packet(CMSG_BUYINGSTORE_SELL, 0x0362, -1, clif->pReqTradeBuyingStore); - packet(CMSG_NAME_REQUEST, 0x085a, 6, clif->pGetCharNameRequest); - packet(CMSG_HOMUNCULUS_MENU, 0x085e, 5, clif->pHomMenu); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0865, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_CREATE, 0x086a, -1, clif->pReqOpenBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x086c, 6, clif->pTakeItem); - packet(CMSG_MAP_SERVER_CONNECT, 0x086d, 19, clif->pWantToConnection); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0870, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0871, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0875, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_CLICK, 0x087f, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0886, 5, clif->pWalkToXY); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0889, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0893, 6, clif->pDropItem); - packet(CMSG_MOVE_TO_STORAGE, 0x089f, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_BEING, 0x08a2, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_OPEN, 0x08a3, 6, clif->pReqClickBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x08a5, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_FROM_STORAGE, 0x08ab, 8, clif->pMoveFromKafra); - packet(CMSG_SOLVE_CHAR_NAME, 0x08ac, 6, clif->pSolveCharName); - packet(CMSG_STORAGE_PASSWORD, 0x08ad, 36, clif->pStoragePassword); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x091c, 26, clif->pFriendsListAdd); - packet(CMSG_SKILL_USE_POSITION, 0x0929, 10, clif->pUseSkillToPos); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x092c, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PARTY_INVITE2, 0x0934, 26, clif->pPartyInvite2); -// packet(UNKNOWN, 0x0935, 8, clif->pDull); -// packet(UNKNOWN, 0x0938, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_ACT, 0x093d, 7, clif->pActionRequest); - packet(CMSG_MAP_PING, 0x0944, 6, clif->pTickSend); -} - -// 20170104 -if (packetVersion == 20170104) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_MAP_SERVER_CONNECT, 0x0438, 19, clif->pWantToConnection); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_POSITION, 0x083c, 10, clif->pUseSkillToPos); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x085a, 26, clif->pFriendsListAdd); - packet(CMSG_STORAGE_PASSWORD, 0x087f, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0896, 5, clif->pChangeDir); - packet(CMSG_HOMUNCULUS_MENU, 0x091b, 5, clif->pHomMenu); - packet(CMSG_SKILL_USE_BEING, 0x0940, 10, clif->pUseSkillToId); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170111 -if (packetVersion == 20170111) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 8, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_HOMUNCULUS_MENU, 0x085d, 5, clif->pHomMenu); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0877, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x087f, 4, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x088a, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08a1, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x08a3, 6, clif->pTakeItem); - packet(CMSG_BOOKING_REGISTER_REQ, 0x08a6, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_STORAGE_PASSWORD, 0x091a, 36, clif->pStoragePassword); - packet(CMSG_MAP_SERVER_CONNECT, 0x091b, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0940, 6, clif->pDropItem); - packet(CMSG_MOVE_FROM_STORAGE, 0x094c, 8, clif->pMoveFromKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0961, -1, clif->pItemListWindowSelected); - packet(CMSG_PARTY_INVITE2, 0x0969, 26, clif->pPartyInvite2); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170118 -if (packetVersion == 20170118) -{ - packet(CMSG_SKILL_USE_POSITION, 0x022d, 10, clif->pUseSkillToPos); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_NAME_REQUEST, 0x0364, 6, clif->pGetCharNameRequest); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_HOMUNCULUS_MENU, 0x0436, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_MAP_SERVER_CONNECT, 0x0438, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_FROM_STORAGE, 0x0862, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0865, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x086f, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x0873, 4, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x089e, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x08ad, -1, clif->pItemListWindowSelected); - packet(CMSG_BOOKING_REGISTER_REQ, 0x091f, 18, clif->pPartyBookingRegisterReq); -// packet(UNKNOWN, 0x0927, 8, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0933, 6, clif->pDropItem); - packet(CMSG_STORAGE_PASSWORD, 0x0958, 36, clif->pStoragePassword); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0962, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_TO_STORAGE, 0x096a, 8, clif->pMoveToKafra); -} - -// 20170125 -if (packetVersion == 20170125) -{ - packet(CMSG_PLAYER_CHANGE_ACT, 0x0438, 7, clif->pActionRequest); - packet(CMSG_MAP_SERVER_CONNECT, 0x0811, 19, clif->pWantToConnection); - packet(CMSG_PARTY_INVITE2, 0x086e, 26, clif->pPartyInvite2); - packet(CMSG_HOMUNCULUS_MENU, 0x0876, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0877, 6, clif->pDropItem); - packet(CMSG_SKILL_USE_BEING, 0x0879, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_PICKUP, 0x087b, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_SELL, 0x087d, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0881, 5, clif->pChangeDir); -// packet(UNKNOWN, 0x0884, 8, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x0893, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x0894, 4, clif->pDull); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0895, -1, clif->pItemListWindowSelected); - packet(CMSG_SOLVE_CHAR_NAME, 0x0898, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x089b, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_CREATE, 0x08a5, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_OPEN, 0x091b, 6, clif->pReqClickBuyingStore); - packet(CMSG_MOVE_TO_STORAGE, 0x091c, 8, clif->pMoveToKafra); - packet(CMSG_BUYINGSTORE_CLOSE, 0x091d, 2, clif->pReqCloseBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0920, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x0929, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_POSITION, 0x092b, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0930, 5, clif->pWalkToXY); - packet(CMSG_SEARCHSTORE_SEARCH, 0x093c, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_PING, 0x0943, 6, clif->pTickSend); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0944, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_FROM_STORAGE, 0x095c, 8, clif->pMoveFromKafra); - packet(CMSG_NAME_REQUEST, 0x0965, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0968, 2, clif->pSearchStoreInfoNextPage); -} - -// 20170201 -if (packetVersion == 20170201) -{ - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0815, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_BOOKING_REGISTER_REQ, 0x085d, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DIR, 0x085e, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0875, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x0879, 4, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x0881, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0884, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0885, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_STORAGE_PASSWORD, 0x0886, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x088b, 6, clif->pDropItem); -// packet(UNKNOWN, 0x08a4, 8, clif->pDull); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0919, 26, clif->pFriendsListAdd); - packet(CMSG_PARTY_INVITE2, 0x0920, 26, clif->pPartyInvite2); - packet(CMSG_HOMUNCULUS_MENU, 0x0938, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_CREATE, 0x0940, -1, clif->pReqOpenBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x094c, 19, clif->pWantToConnection); - packet(CMSG_MOVE_FROM_STORAGE, 0x0966, 8, clif->pMoveFromKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0969, -1, clif->pItemListWindowSelected); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170208 -if (packetVersion == 20170208) -{ -// packet(UNKNOWN, 0x02c4, 4, clif->pDull); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0367, -1, clif->pItemListWindowSelected); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x085c, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0860, 5, clif->pChangeDir); -// packet(UNKNOWN, 0x087a, 8, clif->pDull); - packet(CMSG_MAP_SERVER_CONNECT, 0x088c, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0892, 26, clif->pFriendsListAdd); - packet(CMSG_BOOKING_REGISTER_REQ, 0x08a1, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_TO_STORAGE, 0x08ac, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0921, 6, clif->pDropItem); - packet(CMSG_ITEM_PICKUP, 0x0923, 6, clif->pTakeItem); - packet(CMSG_HOMUNCULUS_MENU, 0x092d, 5, clif->pHomMenu); - packet(CMSG_MOVE_FROM_STORAGE, 0x0932, 8, clif->pMoveFromKafra); - packet(CMSG_STORAGE_PASSWORD, 0x0937, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170215 -if (packetVersion == 20170215) -{ - packet(CMSG_STORAGE_PASSWORD, 0x02c4, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_SELL, 0x035f, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_PING, 0x0360, 6, clif->pTickSend); - packet(CMSG_MAP_SERVER_CONNECT, 0x0811, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_CHANGE_ACT, 0x083c, 7, clif->pActionRequest); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x085c, 6, clif->pDropItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0876, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x087c, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_CHANGE_DIR, 0x087d, 5, clif->pChangeDir); - packet(CMSG_SKILL_USE_BEING, 0x087e, 10, clif->pUseSkillToId); - packet(CMSG_SOLVE_CHAR_NAME, 0x0883, 6, clif->pSolveCharName); -// packet(UNKNOWN, 0x0884, 8, clif->pDull); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x088a, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PARTY_INVITE2, 0x088b, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CREATE, 0x088c, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x0890, 10, clif->pUseSkillToPos); -// packet(UNKNOWN, 0x0896, 4, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x089b, 8, clif->pMoveToKafra); - packet(CMSG_SEARCHSTORE_CLICK, 0x08a2, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_BOOKING_REGISTER_REQ, 0x08a8, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_BUYINGSTORE_CLOSE, 0x091c, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x0925, 8, clif->pMoveFromKafra); - packet(CMSG_SEARCHSTORE_SEARCH, 0x092b, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x092d, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_ITEM_PICKUP, 0x0942, 6, clif->pTakeItem); - packet(CMSG_NAME_REQUEST, 0x094e, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_OPEN, 0x095f, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0962, 5, clif->pHomMenu); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0969, 5, clif->pWalkToXY); -} - -// 20170222 -if (packetVersion == 20170222) -{ - packet(CMSG_HOMUNCULUS_MENU, 0x0202, 5, clif->pHomMenu); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x085f, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0866, 6, clif->pDropItem); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0870, 18, clif->pPartyBookingRegisterReq); -// packet(UNKNOWN, 0x0871, 4, clif->pDull); -// packet(UNKNOWN, 0x0877, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0889, -1, clif->pSearchStoreInfo); - packet(CMSG_ITEM_PICKUP, 0x0894, 6, clif->pTakeItem); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08a3, 5, clif->pChangeDir); - packet(CMSG_PARTY_INVITE2, 0x08a8, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0937, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_SERVER_CONNECT, 0x0939, 19, clif->pWantToConnection); - packet(CMSG_STORAGE_PASSWORD, 0x0943, 36, clif->pStoragePassword); - packet(CMSG_MOVE_TO_STORAGE, 0x095d, 8, clif->pMoveToKafra); - packet(CMSG_MOVE_FROM_STORAGE, 0x0962, 8, clif->pMoveFromKafra); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170228 -if (packetVersion == 20170228) -{ - packet(CMSG_PLAYER_INVENTORY_DROP, 0x022d, 6, clif->pDropItem); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0360, 7, clif->pActionRequest); - packet(CMSG_HOMUNCULUS_MENU, 0x0362, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_CLICK, 0x0819, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x085e, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0863, -1, clif->pSearchStoreInfo); - packet(CMSG_MAP_SERVER_CONNECT, 0x086b, 19, clif->pWantToConnection); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0873, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_CREATE, 0x0874, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0876, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0883, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0884, 5, clif->pWalkToXY); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0889, 5, clif->pChangeDir); - packet(CMSG_NAME_REQUEST, 0x0893, 6, clif->pGetCharNameRequest); - packet(CMSG_MOVE_TO_STORAGE, 0x089e, 8, clif->pMoveToKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x08a0, 26, clif->pFriendsListAdd); - packet(CMSG_STORAGE_PASSWORD, 0x08a2, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x08a6, 8, clif->pDull); - packet(CMSG_BUYINGSTORE_OPEN, 0x08a7, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x091f, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_PICKUP, 0x092a, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_SELL, 0x092e, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_PING, 0x0937, 6, clif->pTickSend); -// packet(UNKNOWN, 0x093e, 4, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0944, 8, clif->pMoveFromKafra); - packet(CMSG_SOLVE_CHAR_NAME, 0x0947, 6, clif->pSolveCharName); - packet(CMSG_PARTY_INVITE2, 0x0948, 26, clif->pPartyInvite2); - packet(CMSG_SKILL_USE_POSITION, 0x0952, 10, clif->pUseSkillToPos); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0955, 18, clif->pPartyBookingRegisterReq); -} - -// 20170308 -if (packetVersion == 20170308) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x087d, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170315 -if (packetVersion == 20170315) -{ - packet(CMSG_SKILL_USE_POSITION, 0x02c4, 10, clif->pUseSkillToPos); - packet(CMSG_SEARCHSTORE_SEARCH, 0x035f, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0360, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0366, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0367, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_SELL, 0x0436, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_PING, 0x07ec, 6, clif->pTickSend); -// packet(UNKNOWN, 0x085c, 4, clif->pDull); - packet(CMSG_HOMUNCULUS_MENU, 0x0863, 5, clif->pHomMenu); - packet(CMSG_MOVE_FROM_STORAGE, 0x086a, 8, clif->pMoveFromKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0872, 26, clif->pFriendsListAdd); - packet(CMSG_PARTY_INVITE2, 0x087b, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0884, 7, clif->pActionRequest); - packet(CMSG_BOOKING_REGISTER_REQ, 0x088b, 18, clif->pPartyBookingRegisterReq); -// packet(UNKNOWN, 0x088d, 8, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x088f, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_BEING, 0x0892, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_CLOSE, 0x089c, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MOVE_TO_STORAGE, 0x08aa, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x091a, 6, clif->pDropItem); - packet(CMSG_BUYINGSTORE_CREATE, 0x091b, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SEARCHSTORE_CLICK, 0x091d, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SOLVE_CHAR_NAME, 0x0920, 6, clif->pSolveCharName); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0922, -1, clif->pItemListWindowSelected); - packet(CMSG_NAME_REQUEST, 0x0944, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_OPEN, 0x094a, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x094e, 19, clif->pWantToConnection); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0950, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_STORAGE_PASSWORD, 0x0952, 36, clif->pStoragePassword); -} - -// 20170322 -if (packetVersion == 20170322) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x091a, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170329 -if (packetVersion == 20170329) -{ - packet(CMSG_PARTY_INVITE2, 0x0281, 26, clif->pPartyInvite2); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0362, 5, clif->pHomMenu); - packet(CMSG_MOVE_TO_STORAGE, 0x0363, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x085d, 36, clif->pStoragePassword); - packet(CMSG_BOOKING_REGISTER_REQ, 0x087a, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0888, -1, clif->pSearchStoreInfo); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x08a8, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0917, 8, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0926, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x0929, 6, clif->pTakeItem); - packet(CMSG_MAP_SERVER_CONNECT, 0x092e, 19, clif->pWantToConnection); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0937, -1, clif->pItemListWindowSelected); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0939, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_FROM_STORAGE, 0x0949, 8, clif->pMoveFromKafra); -// packet(UNKNOWN, 0x095f, 4, clif->pDull); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170405 -if (packetVersion == 20170405) -{ - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x022d, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0281, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0362, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0363, 4, clif->pDull); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_ITEM_PICKUP, 0x0369, 6, clif->pTakeItem); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_HOMUNCULUS_MENU, 0x0835, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_TO_STORAGE, 0x085f, 8, clif->pMoveToKafra); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0860, -1, clif->pItemListWindowSelected); - packet(CMSG_PARTY_INVITE2, 0x0864, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0865, 5, clif->pChangeDir); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x086f, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_FROM_STORAGE, 0x0893, 8, clif->pMoveFromKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x08a5, 19, clif->pWantToConnection); - packet(CMSG_STORAGE_PASSWORD, 0x094c, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x094f, 8, clif->pDull); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0964, 6, clif->pDropItem); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170412 -if (packetVersion == 20170412) -{ - packet(CMSG_SKILL_USE_POSITION, 0x023b, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_OPEN, 0x0365, 6, clif->pReqClickBuyingStore); - packet(CMSG_BUYINGSTORE_SELL, 0x0863, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0869, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_FROM_STORAGE, 0x086d, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0878, 5, clif->pWalkToXY); -// packet(UNKNOWN, 0x0879, 4, clif->pDull); - packet(CMSG_SKILL_USE_BEING, 0x087b, 10, clif->pUseSkillToId); - packet(CMSG_SEARCHSTORE_SEARCH, 0x088b, -1, clif->pSearchStoreInfo); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0890, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_CREATE, 0x0893, -1, clif->pReqOpenBuyingStore); - packet(CMSG_SOLVE_CHAR_NAME, 0x0898, 6, clif->pSolveCharName); - packet(CMSG_HOMUNCULUS_MENU, 0x089a, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x089c, 6, clif->pDropItem); - packet(CMSG_PLAYER_CHANGE_ACT, 0x08a1, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DIR, 0x091a, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x091e, 19, clif->pWantToConnection); - packet(CMSG_MAP_PING, 0x0929, 6, clif->pTickSend); -// packet(UNKNOWN, 0x092e, 8, clif->pDull); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0938, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0942, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_TO_STORAGE, 0x0945, 8, clif->pMoveToKafra); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0949, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PARTY_INVITE2, 0x094f, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0952, 2, clif->pReqCloseBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x0959, 6, clif->pTakeItem); - packet(CMSG_NAME_REQUEST, 0x095b, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_CLICK, 0x095c, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_STORAGE_PASSWORD, 0x095d, 36, clif->pStoragePassword); -} - -// 20170419 -if (packetVersion == 20170419) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0811, 5, clif->pChangeDir); - packet(CMSG_SEARCHSTORE_CLICK, 0x0819, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_NAME_REQUEST, 0x0838, 6, clif->pGetCharNameRequest); - packet(CMSG_PLAYER_CHANGE_ACT, 0x085a, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x085e, 5, clif->pWalkToXY); - packet(CMSG_PARTY_INVITE2, 0x0862, 26, clif->pPartyInvite2); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0868, -1, clif->pSearchStoreInfo); - packet(CMSG_BOOKING_REGISTER_REQ, 0x086a, 18, clif->pPartyBookingRegisterReq); -// packet(UNKNOWN, 0x0872, 8, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x0881, 36, clif->pStoragePassword); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x088d, -1, clif->pItemListWindowSelected); - packet(CMSG_HOMUNCULUS_MENU, 0x088f, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0897, 6, clif->pDropItem); - packet(CMSG_MAP_PING, 0x0898, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_CREATE, 0x089d, -1, clif->pReqOpenBuyingStore); - packet(CMSG_MOVE_TO_STORAGE, 0x08aa, 8, clif->pMoveToKafra); - packet(CMSG_SOLVE_CHAR_NAME, 0x091b, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_BEING, 0x0920, 10, clif->pUseSkillToId); - packet(CMSG_MAP_SERVER_CONNECT, 0x0922, 19, clif->pWantToConnection); - packet(CMSG_MOVE_FROM_STORAGE, 0x0930, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0931, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0935, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x093a, 26, clif->pFriendsListAdd); - packet(CMSG_SKILL_USE_POSITION, 0x093f, 10, clif->pUseSkillToPos); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0942, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_ITEM_PICKUP, 0x095c, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_SELL, 0x095d, -1, clif->pReqTradeBuyingStore); -// packet(UNKNOWN, 0x0963, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_OPEN, 0x0965, 6, clif->pReqClickBuyingStore); -} - -// 20170426 -if (packetVersion == 20170426) -{ - packet(CMSG_STORAGE_PASSWORD, 0x0281, 36, clif->pStoragePassword); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0866, -1, clif->pItemListWindowSelected); -// packet(UNKNOWN, 0x086f, 8, clif->pDull); - packet(CMSG_BOOKING_REGISTER_REQ, 0x087a, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SOLVE_CHAR_NAME, 0x0887, 6, clif->pSolveCharName); - packet(CMSG_MOVE_FROM_STORAGE, 0x0899, 8, clif->pMoveFromKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x089c, 5, clif->pHomMenu); - packet(CMSG_MAP_SERVER_CONNECT, 0x08a2, 19, clif->pWantToConnection); - packet(CMSG_ITEM_PICKUP, 0x08a4, 6, clif->pTakeItem); -// packet(UNKNOWN, 0x091f, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0927, 5, clif->pChangeDir); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0940, 6, clif->pDropItem); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0958, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_TO_STORAGE, 0x0963, 8, clif->pMoveToKafra); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170502 -if (packetVersion == 20170502) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0875, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0894, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x089c, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x093c, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x0950, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170517 -if (packetVersion == 20170517) -{ -// packet(UNKNOWN, 0x0364, 8, clif->pDull); - packet(CMSG_BUYINGSTORE_CREATE, 0x0367, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0437, 7, clif->pActionRequest); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0802, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_BEING, 0x0815, 10, clif->pUseSkillToId); - packet(CMSG_SKILL_USE_POSITION, 0x0817, 10, clif->pUseSkillToPos); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0868, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0875, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SOLVE_CHAR_NAME, 0x087b, 6, clif->pSolveCharName); - packet(CMSG_SEARCHSTORE_SEARCH, 0x087d, -1, clif->pSearchStoreInfo); - packet(CMSG_MOVE_FROM_STORAGE, 0x088c, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_DIR, 0x088d, 5, clif->pChangeDir); - packet(CMSG_NAME_REQUEST, 0x0894, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_CLICK, 0x0896, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PARTY_INVITE2, 0x0899, 26, clif->pPartyInvite2); -// packet(UNKNOWN, 0x089e, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_CLOSE, 0x089f, 2, clif->pReqCloseBuyingStore); - packet(CMSG_MAP_PING, 0x08a2, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DEST, 0x08a8, 5, clif->pWalkToXY); - packet(CMSG_MOVE_TO_STORAGE, 0x08aa, 8, clif->pMoveToKafra); - packet(CMSG_BUYINGSTORE_SELL, 0x091b, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_SERVER_CONNECT, 0x0923, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x093b, 6, clif->pDropItem); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0945, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_OPEN, 0x0946, 6, clif->pReqClickBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0947, 36, clif->pStoragePassword); - packet(CMSG_HOMUNCULUS_MENU, 0x0958, 5, clif->pHomMenu); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0960, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_PICKUP, 0x0964, 6, clif->pTakeItem); -} - -// 20170524 -if (packetVersion == 20170524) -{ - packet(CMSG_PARTY_INVITE2, 0x0364, 26, clif->pPartyInvite2); - packet(CMSG_STORAGE_PASSWORD, 0x0368, 36, clif->pStoragePassword); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0802, 6, clif->pDropItem); - packet(CMSG_PLAYER_CHANGE_ACT, 0x085e, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_OPEN, 0x085f, 6, clif->pReqClickBuyingStore); - packet(CMSG_MAP_PING, 0x0860, 6, clif->pTickSend); - packet(CMSG_ITEM_PICKUP, 0x0864, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0866, -1, clif->pSearchStoreInfo); - packet(CMSG_MOVE_TO_STORAGE, 0x0868, 8, clif->pMoveToKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x086d, 5, clif->pHomMenu); - packet(CMSG_MAP_SERVER_CONNECT, 0x0873, 19, clif->pWantToConnection); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0874, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BUYINGSTORE_CREATE, 0x087d, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_SELL, 0x0882, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SKILL_USE_BEING, 0x088d, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_FROM_STORAGE, 0x0894, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x089c, 5, clif->pWalkToXY); - packet(CMSG_SEARCHSTORE_CLICK, 0x08a1, 12, clif->pSearchStoreInfoListItemClick); -// packet(UNKNOWN, 0x091e, 8, clif->pDull); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0923, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0925, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0934, 5, clif->pChangeDir); - packet(CMSG_SKILL_USE_POSITION, 0x0946, 10, clif->pUseSkillToPos); -// packet(UNKNOWN, 0x0958, 4, clif->pDull); - packet(CMSG_NAME_REQUEST, 0x095a, 6, clif->pGetCharNameRequest); - packet(CMSG_BOOKING_REGISTER_REQ, 0x095b, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0964, 2, clif->pReqCloseBuyingStore); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0967, 26, clif->pFriendsListAdd); - packet(CMSG_SOLVE_CHAR_NAME, 0x0968, 6, clif->pSolveCharName); -} - -// 20170531 -if (packetVersion == 20170531) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0361, 5, clif->pChangeDir); - packet(CMSG_SKILL_USE_BEING, 0x0369, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_DEST, 0x07e4, 5, clif->pWalkToXY); - packet(CMSG_BUYINGSTORE_SELL, 0x07ec, -1, clif->pReqTradeBuyingStore); - packet(CMSG_MAP_PING, 0x0819, 6, clif->pTickSend); -// packet(UNKNOWN, 0x085b, 8, clif->pDull); - packet(CMSG_SOLVE_CHAR_NAME, 0x085f, 6, clif->pSolveCharName); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0861, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x0868, 4, clif->pDull); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0873, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x0875, 10, clif->pUseSkillToPos); - packet(CMSG_PARTY_INVITE2, 0x0878, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_CHANGE_ACT, 0x087b, 7, clif->pActionRequest); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0885, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_CREATE, 0x088b, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x088d, 6, clif->pDropItem); - packet(CMSG_MAP_SERVER_CONNECT, 0x0894, 19, clif->pWantToConnection); - packet(CMSG_STORAGE_PASSWORD, 0x089a, 36, clif->pStoragePassword); - packet(CMSG_HOMUNCULUS_MENU, 0x089c, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x08a2, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x08ac, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_MOVE_TO_STORAGE, 0x08ad, 8, clif->pMoveToKafra); - packet(CMSG_NAME_REQUEST, 0x092d, 6, clif->pGetCharNameRequest); - packet(CMSG_MOVE_FROM_STORAGE, 0x0933, 8, clif->pMoveFromKafra); - packet(CMSG_SEARCHSTORE_CLICK, 0x0937, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0940, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_BUYINGSTORE_OPEN, 0x0945, 6, clif->pReqClickBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x0963, 6, clif->pTakeItem); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0968, -1, clif->pSearchStoreInfo); -} - -// 20170607 -if (packetVersion == 20170607) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0361, -1, clif->pItemListWindowSelected); - packet(CMSG_STORAGE_PASSWORD, 0x0364, 36, clif->pStoragePassword); - packet(CMSG_MAP_PING, 0x07e4, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_DIR, 0x085a, 5, clif->pChangeDir); - packet(CMSG_SEARCHSTORE_SEARCH, 0x085e, -1, clif->pSearchStoreInfo); - packet(CMSG_NAME_REQUEST, 0x0862, 6, clif->pGetCharNameRequest); - packet(CMSG_BUYINGSTORE_OPEN, 0x0863, 6, clif->pReqClickBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0864, 6, clif->pDropItem); - packet(CMSG_MAP_SERVER_CONNECT, 0x0871, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x0873, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_CLICK, 0x0875, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0885, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_FROM_STORAGE, 0x088a, 8, clif->pMoveFromKafra); - packet(CMSG_ITEM_PICKUP, 0x0897, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x089d, 8, clif->pMoveToKafra); - packet(CMSG_SKILL_USE_BEING, 0x08a9, 10, clif->pUseSkillToId); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x08ab, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0917, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0918, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_BUYINGSTORE_SELL, 0x0919, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PARTY_INVITE2, 0x0925, 26, clif->pPartyInvite2); - packet(CMSG_SKILL_USE_POSITION, 0x0927, 10, clif->pUseSkillToPos); -// packet(UNKNOWN, 0x0931, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0934, 5, clif->pWalkToXY); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0938, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_CLOSE, 0x093d, 2, clif->pReqCloseBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0942, 5, clif->pHomMenu); - packet(CMSG_SOLVE_CHAR_NAME, 0x0944, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_CREATE, 0x0949, -1, clif->pReqOpenBuyingStore); -} - -// 20170614 -if (packetVersion == 20170614) -{ - packet(CMSG_MOVE_FROM_STORAGE, 0x023b, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0361, 5, clif->pWalkToXY); - packet(CMSG_HOMUNCULUS_MENU, 0x0364, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0367, 6, clif->pDropItem); - packet(CMSG_STORAGE_PASSWORD, 0x0437, 36, clif->pStoragePassword); - packet(CMSG_SKILL_USE_POSITION, 0x0838, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_ACT, 0x083c, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_OPEN, 0x0860, 6, clif->pReqClickBuyingStore); -// packet(UNKNOWN, 0x0865, 4, clif->pDull); - packet(CMSG_MAP_PING, 0x0866, 6, clif->pTickSend); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0867, 26, clif->pFriendsListAdd); - packet(CMSG_BUYINGSTORE_CLOSE, 0x086b, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x086c, -1, clif->pSearchStoreInfo); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0877, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MOVE_TO_STORAGE, 0x0879, 8, clif->pMoveToKafra); - packet(CMSG_SOLVE_CHAR_NAME, 0x087d, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_DIR, 0x087e, 5, clif->pChangeDir); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0889, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PARTY_INVITE2, 0x0899, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x089d, -1, clif->pItemListWindowSelected); - packet(CMSG_BUYINGSTORE_CREATE, 0x08a2, -1, clif->pReqOpenBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x08ad, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_BEING, 0x091b, 10, clif->pUseSkillToId); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0928, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BUYINGSTORE_SELL, 0x092f, -1, clif->pReqTradeBuyingStore); - packet(CMSG_NAME_REQUEST, 0x0936, 6, clif->pGetCharNameRequest); - packet(CMSG_MAP_SERVER_CONNECT, 0x0944, 19, clif->pWantToConnection); -// packet(UNKNOWN, 0x0957, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_CLICK, 0x0963, 12, clif->pSearchStoreInfoListItemClick); -} - -// 20170621 -if (packetVersion == 20170621) -{ - packet(CMSG_SEARCHSTORE_CLICK, 0x0202, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x0361, 6, clif->pTakeItem); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0365, -1, clif->pItemListWindowSelected); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0366, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x07e4, 26, clif->pFriendsListAdd); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0802, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_CHANGE_DIR, 0x085d, 5, clif->pChangeDir); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x087d, 6, clif->pDropItem); - packet(CMSG_PARTY_INVITE2, 0x0885, 26, clif->pPartyInvite2); - packet(CMSG_MOVE_FROM_STORAGE, 0x0889, 8, clif->pMoveFromKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x08a8, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x0956, 8, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x0957, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x095b, 4, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x095c, 8, clif->pMoveToKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x0961, 19, clif->pWantToConnection); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170628 -if (packetVersion == 20170628) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0863, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170705 -if (packetVersion == 20170705) -{ - packet(CMSG_STORAGE_PASSWORD, 0x0202, 36, clif->pStoragePassword); - packet(CMSG_BOOKING_REGISTER_REQ, 0x02c4, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MOVE_TO_STORAGE, 0x0879, 8, clif->pMoveToKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0886, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x088d, 8, clif->pDull); - packet(CMSG_PARTY_INVITE2, 0x088e, 26, clif->pPartyInvite2); - packet(CMSG_MAP_SERVER_CONNECT, 0x089a, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x089d, 6, clif->pDropItem); - packet(CMSG_PLAYER_CHANGE_DIR, 0x091a, 5, clif->pChangeDir); -// packet(UNKNOWN, 0x092f, 4, clif->pDull); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0930, -1, clif->pItemListWindowSelected); - packet(CMSG_ITEM_PICKUP, 0x0932, 6, clif->pTakeItem); - packet(CMSG_MOVE_FROM_STORAGE, 0x0934, 8, clif->pMoveFromKafra); - packet(CMSG_HOMUNCULUS_MENU, 0x094c, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170712 -if (packetVersion == 20170712) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0202, 5, clif->pChangeDir); - packet(CMSG_MAP_SERVER_CONNECT, 0x022d, 19, clif->pWantToConnection); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x023b, 26, clif->pFriendsListAdd); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x0361, 5, clif->pHomMenu); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0944, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170719 -if (packetVersion == 20170719) -{ - packet(CMSG_PLAYER_CHANGE_ACT, 0x022d, 7, clif->pActionRequest); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0367, 2, clif->pReqCloseBuyingStore); -// packet(UNKNOWN, 0x0368, 4, clif->pDull); - packet(CMSG_HOMUNCULUS_MENU, 0x0369, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x07e4, 6, clif->pGetCharNameRequest); - packet(CMSG_MAP_PING, 0x085a, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_CREATE, 0x085e, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_OPEN, 0x0863, 6, clif->pReqClickBuyingStore); - packet(CMSG_PARTY_INVITE2, 0x086e, 26, clif->pPartyInvite2); - packet(CMSG_ITEM_PICKUP, 0x087d, 6, clif->pTakeItem); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0881, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_CLICK, 0x0882, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0885, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_POSITION, 0x0891, 10, clif->pUseSkillToPos); - packet(CMSG_SKILL_USE_BEING, 0x0898, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x089a, 36, clif->pStoragePassword); - packet(CMSG_SEARCHSTORE_SEARCH, 0x089d, -1, clif->pSearchStoreInfo); - packet(CMSG_MOVE_FROM_STORAGE, 0x08a6, 8, clif->pMoveFromKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x08a8, 19, clif->pWantToConnection); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x091b, 6, clif->pDropItem); - packet(CMSG_SOLVE_CHAR_NAME, 0x091f, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_SELL, 0x092c, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x092e, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_BOOKING_REGISTER_REQ, 0x092f, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DEST, 0x093d, 5, clif->pWalkToXY); -// packet(UNKNOWN, 0x093e, 8, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0944, 5, clif->pChangeDir); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0946, 26, clif->pFriendsListAdd); - packet(CMSG_MOVE_TO_STORAGE, 0x0966, 8, clif->pMoveToKafra); -} - -// 20170726 -if (packetVersion == 20170726) -{ - packet(CMSG_BUYINGSTORE_CREATE, 0x0363, -1, clif->pReqOpenBuyingStore); - packet(CMSG_MOVE_TO_STORAGE, 0x0364, 8, clif->pMoveToKafra); - packet(CMSG_MAP_SERVER_CONNECT, 0x0366, 19, clif->pWantToConnection); - packet(CMSG_SKILL_USE_BEING, 0x0369, 10, clif->pUseSkillToId); - packet(CMSG_PARTY_INVITE2, 0x0438, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0838, 2, clif->pReqCloseBuyingStore); - packet(CMSG_BUYINGSTORE_OPEN, 0x0873, 6, clif->pReqClickBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0874, -1, clif->pItemListWindowSelected); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0878, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0881, 4, clif->pDull); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0888, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x088e, 5, clif->pWalkToXY); -// packet(UNKNOWN, 0x08a3, 8, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x08a7, 36, clif->pStoragePassword); - packet(CMSG_NAME_REQUEST, 0x08aa, 6, clif->pGetCharNameRequest); - packet(CMSG_ITEM_PICKUP, 0x08ab, 6, clif->pTakeItem); - packet(CMSG_MAP_PING, 0x08ac, 6, clif->pTickSend); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x091d, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_CLICK, 0x091e, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_HOMUNCULUS_MENU, 0x091f, 5, clif->pHomMenu); - packet(CMSG_SOLVE_CHAR_NAME, 0x0921, 6, clif->pSolveCharName); - packet(CMSG_BUYINGSTORE_SELL, 0x0923, -1, clif->pReqTradeBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0943, 6, clif->pDropItem); - packet(CMSG_MOVE_FROM_STORAGE, 0x094f, 8, clif->pMoveFromKafra); - packet(CMSG_SKILL_USE_POSITION, 0x0950, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0952, 5, clif->pChangeDir); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0954, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x095a, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0963, -1, clif->pSearchStoreInfo); -} - -// 20170801 -if (packetVersion == 20170801) -{ - packet(CMSG_PLAYER_INVENTORY_DROP, 0x022d, 6, clif->pDropItem); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0281, 5, clif->pChangeDir); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0361, -1, clif->pItemListWindowSelected); - packet(CMSG_HOMUNCULUS_MENU, 0x0362, 5, clif->pHomMenu); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PARTY_INVITE2, 0x0802, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x087d, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x08a6, 4, clif->pDull); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x094f, 26, clif->pFriendsListAdd); - packet(CMSG_MAP_SERVER_CONNECT, 0x095a, 19, clif->pWantToConnection); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170816 -if (packetVersion == 20170816) -{ - packet(CMSG_NAME_REQUEST, 0x022d, 6, clif->pGetCharNameRequest); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x035f, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0361, -1, clif->pItemListWindowSelected); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0362, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0438, 7, clif->pActionRequest); - packet(CMSG_SOLVE_CHAR_NAME, 0x085a, 6, clif->pSolveCharName); - packet(CMSG_SKILL_USE_POSITION, 0x0862, 10, clif->pUseSkillToPos); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0864, 2, clif->pReqCloseBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x087e, 6, clif->pTakeItem); - packet(CMSG_BUYINGSTORE_SELL, 0x0881, -1, clif->pReqTradeBuyingStore); - packet(CMSG_STORAGE_PASSWORD, 0x0882, 36, clif->pStoragePassword); -// packet(UNKNOWN, 0x0884, 8, clif->pDull); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0888, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_MAP_PING, 0x0889, 6, clif->pTickSend); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x08a3, 26, clif->pFriendsListAdd); -// packet(UNKNOWN, 0x08a7, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x08a9, 5, clif->pWalkToXY); - packet(CMSG_HOMUNCULUS_MENU, 0x08ac, 5, clif->pHomMenu); - packet(CMSG_SEARCHSTORE_CLICK, 0x091c, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_BUYINGSTORE_OPEN, 0x0921, 6, clif->pReqClickBuyingStore); - packet(CMSG_MOVE_FROM_STORAGE, 0x0925, 8, clif->pMoveFromKafra); - packet(CMSG_BUYINGSTORE_CREATE, 0x092c, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PARTY_INVITE2, 0x093a, 26, clif->pPartyInvite2); - packet(CMSG_MAP_SERVER_CONNECT, 0x093d, 19, clif->pWantToConnection); - packet(CMSG_SKILL_USE_BEING, 0x0940, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0941, 6, clif->pDropItem); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0950, 5, clif->pChangeDir); - packet(CMSG_MOVE_TO_STORAGE, 0x0959, 8, clif->pMoveToKafra); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0960, -1, clif->pSearchStoreInfo); -} - -// 20170823 -if (packetVersion == 20170823) -{ - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0281, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PARTY_INVITE2, 0x0361, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0362, 6, clif->pDropItem); -// packet(UNKNOWN, 0x0363, 8, clif->pDull); - packet(CMSG_MOVE_FROM_STORAGE, 0x0364, 8, clif->pMoveFromKafra); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0365, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0366, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); -// packet(UNKNOWN, 0x0436, 4, clif->pDull); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_ITEM_PICKUP, 0x07e4, 6, clif->pTakeItem); - packet(CMSG_MOVE_TO_STORAGE, 0x07ec, 8, clif->pMoveToKafra); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0802, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_MAP_SERVER_CONNECT, 0x086c, 19, clif->pWantToConnection); - packet(CMSG_STORAGE_PASSWORD, 0x086d, 36, clif->pStoragePassword); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x08ac, 26, clif->pFriendsListAdd); - packet(CMSG_HOMUNCULUS_MENU, 0x095b, 5, clif->pHomMenu); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170830 -if (packetVersion == 20170830) -{ - packet(CMSG_PLAYER_CHANGE_DIR, 0x0281, 5, clif->pChangeDir); - packet(CMSG_ITEM_PICKUP, 0x02c4, 6, clif->pTakeItem); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0363, 18, clif->pPartyBookingRegisterReq); -// packet(UNKNOWN, 0x0364, 8, clif->pDull); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0860, 2, clif->pReqCloseBuyingStore); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0865, 5, clif->pWalkToXY); - packet(CMSG_PARTY_INVITE2, 0x086a, 26, clif->pPartyInvite2); -// packet(UNKNOWN, 0x0875, 4, clif->pDull); - packet(CMSG_MAP_SERVER_CONNECT, 0x0884, 19, clif->pWantToConnection); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0885, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SKILL_USE_BEING, 0x0888, 10, clif->pUseSkillToId); - packet(CMSG_BUYINGSTORE_CREATE, 0x0897, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0899, 6, clif->pDropItem); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x089a, -1, clif->pItemListWindowSelected); - packet(CMSG_MOVE_TO_STORAGE, 0x089e, 8, clif->pMoveToKafra); - packet(CMSG_STORAGE_PASSWORD, 0x08a2, 36, clif->pStoragePassword); - packet(CMSG_MOVE_FROM_STORAGE, 0x08a8, 8, clif->pMoveFromKafra); - packet(CMSG_MAP_PING, 0x091e, 6, clif->pTickSend); - packet(CMSG_HOMUNCULUS_MENU, 0x0921, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_OPEN, 0x0925, 6, clif->pReqClickBuyingStore); - packet(CMSG_NAME_REQUEST, 0x092e, 6, clif->pGetCharNameRequest); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0939, 26, clif->pFriendsListAdd); - packet(CMSG_PLAYER_CHANGE_ACT, 0x093e, 7, clif->pActionRequest); - packet(CMSG_SOLVE_CHAR_NAME, 0x0940, 6, clif->pSolveCharName); - packet(CMSG_SEARCHSTORE_CLICK, 0x0942, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0943, -1, clif->pSearchStoreInfo); - packet(CMSG_BUYINGSTORE_SELL, 0x0947, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0951, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SKILL_USE_POSITION, 0x0959, 10, clif->pUseSkillToPos); -} - -// 20170906 -if (packetVersion == 20170906) -{ -// packet(UNKNOWN, 0x0202, 4, clif->pDull); - packet(CMSG_STORAGE_PASSWORD, 0x0281, 36, clif->pStoragePassword); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x02c4, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_MAP_PING, 0x035f, 6, clif->pTickSend); - packet(CMSG_BUYINGSTORE_OPEN, 0x0360, 6, clif->pReqClickBuyingStore); - packet(CMSG_PARTY_INVITE2, 0x0366, 26, clif->pPartyInvite2); - packet(CMSG_SOLVE_CHAR_NAME, 0x0368, 6, clif->pSolveCharName); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0369, 7, clif->pActionRequest); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0437, 5, clif->pWalkToXY); - packet(CMSG_SKILL_USE_POSITION, 0x0438, 10, clif->pUseSkillToPos); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0802, 5, clif->pChangeDir); - packet(CMSG_BUYINGSTORE_SELL, 0x0811, -1, clif->pReqTradeBuyingStore); - packet(CMSG_BUYINGSTORE_CREATE, 0x0815, -1, clif->pReqOpenBuyingStore); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0817, 2, clif->pReqCloseBuyingStore); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0819, -1, clif->pSearchStoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0835, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_SEARCHSTORE_CLICK, 0x0838, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x0860, 6, clif->pDropItem); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0866, -1, clif->pItemListWindowSelected); -// packet(UNKNOWN, 0x086c, 8, clif->pDull); - packet(CMSG_MOVE_TO_STORAGE, 0x087b, 8, clif->pMoveToKafra); - packet(CMSG_MOVE_FROM_STORAGE, 0x08a2, 8, clif->pMoveFromKafra); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x08a3, 26, clif->pFriendsListAdd); - packet(CMSG_BOOKING_REGISTER_REQ, 0x08a7, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_ITEM_PICKUP, 0x091a, 6, clif->pTakeItem); - packet(CMSG_HOMUNCULUS_MENU, 0x091e, 5, clif->pHomMenu); - packet(CMSG_MAP_SERVER_CONNECT, 0x0953, 19, clif->pWantToConnection); - packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); -} - -// 20170913 -if (packetVersion == 20170913) -{ - packet(CMSG_NAME_REQUEST, 0x0281, 6, clif->pGetCharNameRequest); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x035f, 26, clif->pFriendsListAdd); - packet(CMSG_SEARCHSTORE_SEARCH, 0x0437, -1, clif->pSearchStoreInfo); - packet(CMSG_MOVE_FROM_STORAGE, 0x07e4, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_ACT, 0x0817, 7, clif->pActionRequest); - packet(CMSG_MAP_SERVER_CONNECT, 0x0835, 19, clif->pWantToConnection); - packet(CMSG_BUYINGSTORE_CLOSE, 0x085a, 2, clif->pReqCloseBuyingStore); - packet(CMSG_ITEM_PICKUP, 0x0860, 6, clif->pTakeItem); - packet(CMSG_PARTY_INVITE2, 0x0865, 26, clif->pPartyInvite2); - packet(CMSG_BUYINGSTORE_CREATE, 0x0866, -1, clif->pReqOpenBuyingStore); - packet(CMSG_HOMUNCULUS_MENU, 0x088c, 5, clif->pHomMenu); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0890, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_MOVE_TO_STORAGE, 0x0891, 8, clif->pMoveToKafra); - packet(CMSG_STORAGE_PASSWORD, 0x0892, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_OPEN, 0x08a6, 6, clif->pReqClickBuyingStore); -// packet(UNKNOWN, 0x08a7, 4, clif->pDull); - packet(CMSG_SKILL_USE_BEING, 0x08aa, 10, clif->pUseSkillToId); - packet(CMSG_BOOKING_REGISTER_REQ, 0x08ab, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_PLAYER_CHANGE_DIR, 0x08ac, 5, clif->pChangeDir); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x08ad, -1, clif->pItemListWindowSelected); - packet(CMSG_MAP_PING, 0x091b, 6, clif->pTickSend); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x091d, 6, clif->pDropItem); -// packet(UNKNOWN, 0x091e, 8, clif->pDull); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x0920, 2, clif->pSearchStoreInfoNextPage); - packet(CMSG_PLAYER_CHANGE_DEST, 0x0923, 5, clif->pWalkToXY); - packet(CMSG_SEARCHSTORE_CLICK, 0x0925, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_BUYINGSTORE_SELL, 0x0927, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SKILL_USE_POSITION, 0x095a, 10, clif->pUseSkillToPos); - packet(CMSG_SOLVE_CHAR_NAME, 0x095c, 6, clif->pSolveCharName); -} - -// 20170920 -if (packetVersion == 20170920) -{ - packet(CMSG_ITEM_PICKUP, 0x0369, 6, clif->pTakeItem); - packet(CMSG_ITEM_LIST_WINDOW_SELECT, 0x0436, -1, clif->pItemListWindowSelected); - packet(CMSG_MOVE_FROM_STORAGE, 0x07ec, 8, clif->pMoveFromKafra); - packet(CMSG_PLAYER_CHANGE_DEST, 0x085a, 5, clif->pWalkToXY); - packet(CMSG_FRIENDS_ADD_PLAYER, 0x0861, 26, clif->pFriendsListAdd); - packet(CMSG_SKILL_USE_BEING, 0x0862, 10, clif->pUseSkillToId); - packet(CMSG_STORAGE_PASSWORD, 0x0864, 36, clif->pStoragePassword); - packet(CMSG_BUYINGSTORE_CREATE, 0x0865, -1, clif->pReqOpenBuyingStore); - packet(CMSG_PARTY_INVITE2, 0x086a, 26, clif->pPartyInvite2); - packet(CMSG_PLAYER_INVENTORY_DROP, 0x086c, 6, clif->pDropItem); - packet(CMSG_BUYINGSTORE_CLOSE, 0x0874, 2, clif->pReqCloseBuyingStore); -// packet(UNKNOWN, 0x0875, 4, clif->pDull); - packet(CMSG_NAME_REQUEST, 0x0889, 6, clif->pGetCharNameRequest); - packet(CMSG_MAP_PING, 0x088e, 6, clif->pTickSend); - packet(CMSG_PLAYER_CHANGE_ACT, 0x089b, 7, clif->pActionRequest); - packet(CMSG_SKILL_USE_POSITION, 0x0919, 10, clif->pUseSkillToPos); -// packet(UNKNOWN, 0x091e, 8, clif->pDull); - packet(CMSG_SOLVE_CHAR_NAME, 0x0921, 6, clif->pSolveCharName); - packet(CMSG_MAP_SERVER_CONNECT, 0x0923, 19, clif->pWantToConnection); - packet(CMSG_MOVE_TO_STORAGE, 0x0926, 8, clif->pMoveToKafra); - packet(CMSG_BUYINGSTORE_SELL, 0x092e, -1, clif->pReqTradeBuyingStore); - packet(CMSG_SEARCHSTORE_CLICK, 0x0937, 12, clif->pSearchStoreInfoListItemClick); - packet(CMSG_PLAYER_CHANGE_DIR, 0x0939, 5, clif->pChangeDir); - packet(CMSG_BOOKING_REGISTER_REQ, 0x0945, 18, clif->pPartyBookingRegisterReq); - packet(CMSG_SEARCHSTORE_SEARCH, 0x094c, -1, clif->pSearchStoreInfo); - packet(CMSG_HOMUNCULUS_MENU, 0x095d, 5, clif->pHomMenu); - packet(CMSG_BUYINGSTORE_OPEN, 0x0961, 6, clif->pReqClickBuyingStore); - packet(CMSG_SKILL_USE_POSITION_MORE, 0x0966, 90, clif->pUseSkillToPosMoreInfo); - packet(CMSG_SEARCHSTORE_NEXT_PAGE, 0x096a, 2, clif->pSearchStoreInfoNextPage); -} - -#endif diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp deleted file mode 100644 index 07482dce7..000000000 --- a/src/net/eathena/partyhandler.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/partyhandler.h" - -#include "actormanager.h" -#include "notifymanager.h" -#include "party.h" - -#include "being/localplayer.h" - -#include "enums/resources/notifytypes.h" - -#include "net/ea/partyrecv.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/partyrecv.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -PartyHandler::PartyHandler() : - Ea::PartyHandler() -{ - partyHandler = this; -} - -PartyHandler::~PartyHandler() -{ - partyHandler = nullptr; -} - -void PartyHandler::create(const std::string &name) const -{ - createOutPacket(CMSG_PARTY_CREATE); - outMsg.writeString(name.substr(0, 23), 24, "party name"); -} - -void PartyHandler::invite(const std::string &name) const -{ - if (actorManager == nullptr) - return; - const Being *const being = actorManager->findBeingByName( - name, ActorType::Player); - if (being != nullptr) - { - createOutPacket(CMSG_PARTY_INVITE); - outMsg.writeBeingId(being->getId(), "account id"); - } - else - { - if (packetVersion < 20070227) - return; - createOutPacket(CMSG_PARTY_INVITE2); - outMsg.writeString(name, 24, "nick"); - } -} - -void PartyHandler::inviteResponse(const int partyId, - const bool accept) const -{ - if (localPlayer != nullptr) - { - createOutPacket(CMSG_PARTY_INVITED2); - outMsg.writeInt32(partyId, "party id"); - outMsg.writeInt8(CAST_S8(accept ? 1 : 0), "accept"); - } -} - -void PartyHandler::leave() const -{ - createOutPacket(CMSG_PARTY_LEAVE); -} - -void PartyHandler::kick(const Being *const being) const -{ - if (being != nullptr) - { - createOutPacket(CMSG_PARTY_KICK); - outMsg.writeBeingId(being->getId(), "account id"); - outMsg.writeString(being->getName(), 24, "player name"); - } -} - -void PartyHandler::kick(const std::string &name) const -{ - if (Ea::taParty == nullptr) - return; - - const PartyMember *const m = Ea::taParty->getMember(name); - if (m == nullptr) - { - NotifyManager::notify(NotifyTypes::PARTY_USER_NOT_IN_PARTY, name); - return; - } - - createOutPacket(CMSG_PARTY_KICK); - outMsg.writeBeingId(m->getID(), "account id"); - outMsg.writeString(name, 24, "player name"); -} - -void PartyHandler::chat(const std::string &text) const -{ - createOutPacket(CMSG_PARTY_MESSAGE); - const std::string mes = std::string(localPlayer->getName()).append( - " : ").append(text); - if (packetVersion >= 20151001) - { - outMsg.writeInt16(CAST_S16(mes.length() + 4), "len"); - outMsg.writeString(mes, CAST_S32(mes.length()), "nick : message"); - } - else - { - outMsg.writeInt16(CAST_S16(mes.length() + 4 + 1), "len"); - outMsg.writeString(mes, CAST_S32(mes.length()), "nick : message"); - outMsg.writeInt8(0, "null char"); - } -} - -// +++ must be 3 types item, exp, pickup -void PartyHandler::setShareExperience(const PartyShareT share) const -{ - if (share == PartyShare::NOT_POSSIBLE) - return; - - createOutPacket(CMSG_PARTY_SETTINGS); - if (packetVersion >= 20090603) - { - outMsg.writeInt32(CAST_S32(share), "share exp"); - outMsg.writeInt16(CAST_S16(Ea::PartyRecv::mShareItems), - "share items"); - } - else - { - outMsg.writeInt32(CAST_S32(share), "share exp"); - } -} - -// +++ must be 3 types item, exp, pickup -void PartyHandler::setShareItems(const PartyShareT share) const -{ - if (share == PartyShare::NOT_POSSIBLE) - return; - - createOutPacket(CMSG_PARTY_SETTINGS); - if (packetVersion >= 20090603) - { - outMsg.writeInt32(CAST_S32(Ea::PartyRecv::mShareExp), - "share exp"); - outMsg.writeInt16(CAST_S16(share), "share items"); - } -} - -void PartyHandler::changeLeader(const std::string &name) const -{ - const Being *const being = actorManager->findBeingByName( - name, ActorType::Player); - if (being == nullptr) - return; - createOutPacket(CMSG_PARTY_CHANGE_LEADER); - outMsg.writeBeingId(being->getId(), "account id"); -} - -void PartyHandler::allowInvite(const bool allow) const -{ - createOutPacket(CMSG_PARTY_ALLOW_INVITES); - outMsg.writeInt8(CAST_S8(allow ? 1 : 0), "allow"); -} - -PartyShareT PartyHandler::getShareAutoItems() const -{ - return PartyRecv::mShareAutoItems; -} - -void PartyHandler::setShareAutoItems(const PartyShareT share) const -{ - PartyRecv::mShareAutoItems = share; -} - -} // namespace EAthena diff --git a/src/net/eathena/partyhandler.h b/src/net/eathena/partyhandler.h deleted file mode 100644 index 4b87f09fd..000000000 --- a/src/net/eathena/partyhandler.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_PARTYHANDLER_H -#define NET_EATHENA_PARTYHANDLER_H - -#include "net/ea/partyhandler.h" - -namespace EAthena -{ - -class PartyHandler final : public Ea::PartyHandler -{ - public: - PartyHandler(); - - A_DELETE_COPY(PartyHandler) - - ~PartyHandler(); - - void create(const std::string &name) const override final; - - void invite(const std::string &name) const override final; - - void inviteResponse(const int partyId, - const bool accept) const override final; - - void leave() const override final; - - void kick(const Being *const being) const override final; - - void kick(const std::string &name) const override final; - - void chat(const std::string &text) const override final; - - void setShareExperience(const PartyShareT share) const override final; - - void setShareItems(const PartyShareT share) const override final; - - void changeLeader(const std::string &name) const override final; - - void allowInvite(const bool allow) const override final; - - void setShareAutoItems(const PartyShareT share) const override final; - - PartyShareT getShareAutoItems() const override final A_WARN_UNUSED; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_PARTYHANDLER_H diff --git a/src/net/eathena/partyrecv.cpp b/src/net/eathena/partyrecv.cpp deleted file mode 100644 index 9ce0dbdce..000000000 --- a/src/net/eathena/partyrecv.cpp +++ /dev/null @@ -1,422 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/partyrecv.h" - -#include "notifymanager.h" -#include "party.h" - -#include "being/localplayer.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/chatwindow.h" -#include "gui/windows/socialwindow.h" - -#include "gui/widgets/tabs/chat/partytab.h" - -#include "net/messagein.h" - -#include "net/ea/partyrecv.h" - -#include "utils/checkutils.h" -#include "utils/foreach.h" - -#include "debug.h" - -namespace EAthena -{ - -namespace PartyRecv -{ - PartyShareT mShareAutoItems = PartyShare::UNKNOWN; -} // namespace PartyRecv - -void PartyRecv::processPartyInvitationStats(Net::MessageIn &msg) -{ - // +++ for now server allow only switch this option but not using it. - msg.readUInt8("allow party"); -} - -void PartyRecv::processPartyMemberInfo(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("account id"); - const bool leader = msg.readInt32("leader") == 0U; - int level = 0; - if (msg.getVersion() >= 20170502) - { - msg.readInt16("class"); - level = msg.readInt16("level"); - } - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - const bool online = msg.readInt8("online") == 0U; - msg.readString(24, "party name"); - const std::string nick = msg.readString(24, "player name"); - const std::string map = msg.readString(16, "map name"); - msg.readInt8("pickup item share (&1)"); - msg.readInt8("get item share (&2)"); - - if (Ea::taParty == nullptr) - return; - - PartyMember *const member = Ea::taParty->addMember(id, nick); - if (member != nullptr) - { - if ((partyTab != nullptr) && member->getOnline() != online) - partyTab->showOnline(nick, fromBool(online, Online)); - member->setLeader(leader); - member->setOnline(online); - member->setMap(map); - member->setX(x); - member->setY(y); - if (level != 0) - member->setLevel(level); - } -} - -void PartyRecv::processPartyMemberJobLevel(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("account id"); - msg.readInt16("class"); - const int level = msg.readInt16("level"); - - if (Ea::taParty == nullptr) - return; - - PartyMember *const member = Ea::taParty->getMember(id); - if (member != nullptr) - { - member->setOnline(true); - if (level != 0) - member->setLevel(level); - } - else - { - reportAlways("processPartyMemberJobLevel: party member not exists."); - } -} - -void PartyRecv::processPartySettings(Net::MessageIn &msg) -{ - if (partyTab == nullptr) - { - if (chatWindow == nullptr) - return; - - Ea::PartyRecv::createTab(); - } - - const PartyShareT exp = static_cast<PartyShareT>( - msg.readInt32("party exp")); - Ea::PartyRecv::processPartyExpSettingsContinue(msg, exp); - if (msg.getVersion() >= 20090603) - { - const PartyShareT item = static_cast<PartyShareT>( - msg.readInt8("pickup item share (&1)")); - Ea::PartyRecv::processPartyItemSettingsContinue(msg, item); - const PartyShareT autoItem = static_cast<PartyShareT>( - msg.readInt8("get auto item share (&2)")); - processPartyAutoItemSettingsContinue(msg, autoItem); - } -} - -void PartyRecv::processPartyInfo(Net::MessageIn &msg) -{ - bool isOldParty = false; - std::set<std::string> names; - std::set<std::string> onlineNames; - if (Ea::taParty == nullptr) - { - logger->log1("error: party empty in SMSG_PARTY_INFO"); - Ea::taParty = Party::getParty(1); - } - if (partyTab == nullptr) - Ea::PartyRecv::createTab(); - - if (Ea::taParty != nullptr) - { - if (Ea::taParty->getNumberOfElements() > 1) - { - isOldParty = true; - Ea::taParty->getNamesSet(names); - const Party::MemberList *const members = Ea::taParty->getMembers(); - FOR_EACHP (Party::MemberList::const_iterator, it, members) - { - if ((*it)->getOnline()) - onlineNames.insert((*it)->getName()); - } - if (localPlayer != nullptr) - onlineNames.insert(localPlayer->getName()); - } - } - - if (localPlayer == nullptr) - logger->log1("error: localPlayer==0 in SMSG_PARTY_INFO"); - - if (Ea::taParty != nullptr) - Ea::taParty->clearMembers(); - - const int length = msg.readInt16("len"); - if (Ea::taParty != nullptr) - { - const std::string name = msg.readString(24, "party name"); - Ea::taParty->setName(name); - } - else - { - msg.readString(24, "party name"); - } - - int partySize = 0; - int offset = 0; - if (msg.getVersion() >= 20170502) - { - partySize = 50; - offset = 28 + 6; - } - else - { - partySize = 46; - offset = 28; - } - - const int count = (length - offset) / partySize; - if (localPlayer != nullptr && - Ea::taParty != nullptr) - { - localPlayer->setParty(Ea::taParty); - localPlayer->setPartyName(Ea::taParty->getName()); - } - - for (int i = 0; i < count; i++) - { - const BeingId id = msg.readBeingId("account id"); - std::string nick = msg.readString(24, "nick"); - std::string map = msg.readString(16, "map name"); - const bool leader = msg.readUInt8("leader") == 0U; - const bool online = msg.readUInt8("online") == 0U; - int level = 0; - if (msg.getVersion() >= 20170502) - { - msg.readInt16("class"); - level = msg.readInt16("level"); - } - - if (Ea::taParty != nullptr) - { - bool joined(false); - - if (isOldParty) - { - if (names.find(nick) == names.end()) - { - NotifyManager::notify(NotifyTypes::PARTY_USER_JOINED, - nick); - joined = true; - } - } - PartyMember *const member = Ea::taParty->addMember(id, nick); - if (member != nullptr) - { - if (!joined && (partyTab != nullptr)) - { - if (!names.empty() && ((onlineNames.find(nick) - == onlineNames.end() && online) - || (onlineNames.find(nick) != onlineNames.end() - && !online))) - { - partyTab->showOnline(nick, fromBool(online, Online)); - } - } - member->setLeader(leader); - member->setOnline(online); - member->setMap(map); - if (level != 0) - member->setLevel(level); - } - } - } - - if (msg.getVersion() >= 20170502) - { - msg.readInt8("pickup item share (&1)"); - msg.readInt8("get item share (&2)"); - msg.readInt32("unknown"); - } - - if (Ea::taParty != nullptr) - Ea::taParty->sort(); - - if ((localPlayer != nullptr) && (Ea::taParty != nullptr)) - { - localPlayer->setParty(Ea::taParty); - localPlayer->setPartyName(Ea::taParty->getName()); - if (socialWindow != nullptr) - socialWindow->updateParty(); - } -} - -void PartyRecv::processPartyMessage(Net::MessageIn &msg) -{ - const int msgLength = msg.readInt16("len") - 8; - if (msgLength <= 0) - return; - - const BeingId id = msg.readBeingId("id"); - std::string chatMsg = msg.readString(msgLength, "message"); - - const size_t pos = chatMsg.find(" : ", 0); - if (pos != std::string::npos) - chatMsg.erase(0, pos + 3); - - if ((Ea::taParty != nullptr) && (partyTab != nullptr)) - { - const PartyMember *const member = Ea::taParty->getMember(id); - if (member != nullptr) - { - partyTab->chatLog(member->getName(), chatMsg); - } - else - { - NotifyManager::notify(NotifyTypes::PARTY_UNKNOWN_USER_MSG, - chatMsg); - } - } -} - -void PartyRecv::processPartyInviteResponse(Net::MessageIn &msg) -{ - if (partyTab == nullptr) - return; - - const std::string nick = msg.readString(24, "nick"); - - switch (msg.readInt32("result")) - { - case 0: - NotifyManager::notify(NotifyTypes::PARTY_INVITE_ALREADY_MEMBER, - nick); - break; - case 1: - NotifyManager::notify(NotifyTypes::PARTY_INVITE_REFUSED, nick); - break; - case 2: - NotifyManager::notify(NotifyTypes::PARTY_INVITE_DONE, nick); - break; - case 3: - NotifyManager::notify(NotifyTypes::PARTY_INVITE_PARTY_FULL, - nick); - break; - case 4: - NotifyManager::notify(NotifyTypes::PARTY_INVITE_PARTY_SAME_ACCOUNT, - nick); - break; - case 5: - NotifyManager::notify( - NotifyTypes::PARTY_INVITE_PARTY_BLOCKED_INVITE, - nick); - break; - case 7: - NotifyManager::notify(NotifyTypes::PARTY_INVITE_PARTY_NOT_ONLINE, - nick); - break; - default: - NotifyManager::notify(NotifyTypes::PARTY_INVITE_ERROR, nick); - break; - } -} - -void PartyRecv::processPartyItemPickup(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // +++ probably need add option to show pickup notifications - // in party tab - msg.readBeingId("account id"); - msg.readInt16("item id"); - msg.readUInt8("identify"); - msg.readUInt8("attribute"); - msg.readUInt8("refine"); - for (int f = 0; f < maxCards; f++) - msg.readUInt16("card"); - msg.readInt16("equip location"); - msg.readUInt8("item type"); - // for color can be used ItemColorManager -} - -void PartyRecv::processPartyLeader(Net::MessageIn &msg) -{ - PartyMember *const oldMember = Ea::taParty->getMember( - msg.readBeingId("old leder id")); - PartyMember *const newMember = Ea::taParty->getMember( - msg.readBeingId("new leder id")); - if (oldMember != nullptr) - oldMember->setLeader(false); - if (newMember != nullptr) - newMember->setLeader(true); -} - -void PartyRecv::processPartyInvited(Net::MessageIn &msg) -{ - if (socialWindow == nullptr) - { - msg.readInt32("party id"); - msg.readString(24, "party name"); - return; - } - const int id = msg.readInt32("party id"); - const std::string partyName = msg.readString(24, "party name"); - - if (socialWindow != nullptr) - socialWindow->showPartyInvite(partyName, std::string(), id); -} - -void PartyRecv::processPartyAutoItemSettingsContinue(Net::MessageIn &msg, - const PartyShareT item) -{ - switch (item) - { - case PartyShare::YES: - if (mShareAutoItems == PartyShare::YES) - break; - mShareAutoItems = PartyShare::YES; - NotifyManager::notify(NotifyTypes::PARTY_ITEM_SHARE_ON); - break; - case PartyShare::NO: - if (mShareAutoItems == PartyShare::NO) - break; - mShareAutoItems = PartyShare::NO; - NotifyManager::notify(NotifyTypes::PARTY_ITEM_SHARE_OFF); - break; - case PartyShare::NOT_POSSIBLE: - if (mShareAutoItems == PartyShare::NOT_POSSIBLE) - break; - mShareAutoItems = PartyShare::NOT_POSSIBLE; - NotifyManager::notify(NotifyTypes::PARTY_ITEM_SHARE_ERROR); - break; - default: - case PartyShare::UNKNOWN: - UNIMPLEMENTEDPACKETFIELD(CAST_S32(item)); - break; - } -} - -} // namespace EAthena diff --git a/src/net/eathena/partyrecv.h b/src/net/eathena/partyrecv.h deleted file mode 100644 index d89413297..000000000 --- a/src/net/eathena/partyrecv.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_PARTYRECV_H -#define NET_EATHENA_PARTYRECV_H - -#include "enums/net/partyshare.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace PartyRecv - { - extern PartyShareT mShareAutoItems; - - void processPartySettings(Net::MessageIn &msg); - void processPartyInvitationStats(Net::MessageIn &msg); - void processPartyMemberInfo(Net::MessageIn &msg); - void processPartyInfo(Net::MessageIn &msg); - void processPartyMessage(Net::MessageIn &msg); - void processPartyInviteResponse(Net::MessageIn &msg); - void processPartyItemPickup(Net::MessageIn &msg); - void processPartyLeader(Net::MessageIn &msg); - void processPartyInvited(Net::MessageIn &msg); - void processPartyMemberJobLevel(Net::MessageIn &msg); - - void processPartyAutoItemSettingsContinue(Net::MessageIn &msg, - const PartyShareT item); - } // namespace PartyRecv -} // namespace EAthena - -#endif // NET_EATHENA_PARTYRECV_H diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp deleted file mode 100644 index 28624e285..000000000 --- a/src/net/eathena/pethandler.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2013-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/pethandler.h" - -#include "being/playerinfo.h" - -#include "net/serverfeatures.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -namespace EAthena -{ - -PetHandler::PetHandler() -{ - petHandler = this; -} - -PetHandler::~PetHandler() -{ - petHandler = nullptr; -} - -void PetHandler::move(const int x, - const int y) const -{ - if (!serverFeatures->haveMovePet()) - return; - createOutPacket(CMSG_PET_MOVE_TO); - outMsg.writeInt32(0, "pet id"); - outMsg.writeInt16(CAST_S16(x), "x"); - outMsg.writeInt16(CAST_S16(y), "y"); -} - -void PetHandler::emote(const uint8_t emoteId) -{ - createOutPacket(CMSG_PET_EMOTE); - outMsg.writeInt8(emoteId, "emote id"); -} - -void PetHandler::catchPet(const Being *const being) const -{ - if (being == nullptr) - return; - - createOutPacket(CMSG_PET_CATCH); - outMsg.writeBeingId(being->getId(), "monster id"); -} - -void PetHandler::sendPetMessage(const int data) const -{ - createOutPacket(CMSG_PET_SEND_MESSAGE); - outMsg.writeInt32(data, "param"); -} - -void PetHandler::setName(const std::string &name) const -{ - createOutPacket(CMSG_PET_SET_NAME); - outMsg.writeString(name, 24, "name"); -} - -void PetHandler::requestStatus() const -{ - createOutPacket(CMSG_PET_MENU_ACTION); - outMsg.writeInt8(0, "action"); -} - -void PetHandler::feed() const -{ - createOutPacket(CMSG_PET_MENU_ACTION); - outMsg.writeInt8(1, "action"); -} - -void PetHandler::dropLoot() const -{ - createOutPacket(CMSG_PET_MENU_ACTION); - outMsg.writeInt8(2, "action"); // performance -} - -void PetHandler::returnToEgg() const -{ - createOutPacket(CMSG_PET_MENU_ACTION); - outMsg.writeInt8(3, "action"); - PlayerInfo::setPet(nullptr); -} - -void PetHandler::unequip() const -{ - createOutPacket(CMSG_PET_MENU_ACTION); - outMsg.writeInt8(4, "action"); -} - -void PetHandler::setDirection(const unsigned char type) const -{ - if (!serverFeatures->haveMovePet()) - return; - createOutPacket(CMSG_PET_DIRECTION); - outMsg.writeInt32(0, "pet id"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(type), - "pet direction"); -} - -} // namespace EAthena diff --git a/src/net/eathena/pethandler.h b/src/net/eathena/pethandler.h deleted file mode 100644 index 9785ade7d..000000000 --- a/src/net/eathena/pethandler.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2013-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_PETHANDLER_H -#define NET_EATHENA_PETHANDLER_H - -#include "net/pethandler.h" - -namespace EAthena -{ - -class PetHandler final : public Net::PetHandler -{ - public: - PetHandler(); - - A_DELETE_COPY(PetHandler) - - ~PetHandler(); - - void move(const int x, - const int y) const override final; - - void emote(const uint8_t emoteId) override final; - - void catchPet(const Being *const being) const override final; - - void sendPetMessage(const int data) const override final; - - void setName(const std::string &name) const override final; - - void requestStatus() const override final; - - void feed() const override final; - - void dropLoot() const override final; - - void returnToEgg() const override final; - - void unequip() const override final; - - void setDirection(const unsigned char type) const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_PETHANDLER_H diff --git a/src/net/eathena/petrecv.cpp b/src/net/eathena/petrecv.cpp deleted file mode 100644 index f2cf65a28..000000000 --- a/src/net/eathena/petrecv.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2013-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/petrecv.h" - -#include "actormanager.h" -#include "notifymanager.h" - -#include "being/petinfo.h" -#include "being/playerinfo.h" - -#include "const/net/inventory.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/eggselectiondialog.h" - -#include "gui/widgets/createwidget.h" - -#include "net/inventoryhandler.h" -#include "net/messagein.h" - -#include "net/eathena/menu.h" - -#include "debug.h" - -namespace EAthena -{ - -void PetRecv::processPetMessage(Net::MessageIn &msg) -{ - // techinally this is hercules pet emote, - // but it may send also hungry level on connect - // for both exists other packets. - msg.readBeingId("pet id"); - msg.readInt32("param"); -} - -void PetRecv::processPetRoulette(Net::MessageIn &msg) -{ - const uint8_t data = msg.readUInt8("data"); - switch (data) - { - case 0: - NotifyManager::notify(NotifyTypes::PET_CATCH_FAILED); - break; - case 1: - NotifyManager::notify(NotifyTypes::PET_CATCH_SUCCESS); - break; - default: - NotifyManager::notify(NotifyTypes::PET_CATCH_UNKNOWN, data); - break; - } -} - -void PetRecv::processEggsList(Net::MessageIn &msg) -{ - const int count = (msg.readInt16("len") - 4) / 2; - const Inventory *const inv = PlayerInfo::getInventory(); - if (inv == nullptr) - return; - menu = MenuType::Eggs; - - if (count == 1) - { - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const Item *const item = inv->getItem(index); - inventoryHandler->selectEgg(item); - return; - } - SellDialog *const dialog = CREATEWIDGETR0(EggSelectionDialog); - - for (int f = 0; f < count; f ++) - { - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const Item *const item = inv->getItem(index); - - if (item != nullptr) - dialog->addItem(item, 0); - } -} - -void PetRecv::processPetData(Net::MessageIn &msg) -{ - const int cmd = msg.readUInt8("type"); - const BeingId id = msg.readBeingId("pet id"); - Being *const dstBeing = actorManager->findBeing(id); - const int data = msg.readInt32("data"); - if (cmd == 0) // pre init - { - PetInfo *const info = new PetInfo; - info->id = id; - PlayerInfo::setPet(info); - PlayerInfo::setPetBeing(dstBeing); - return; - } - PetInfo *const info = PlayerInfo::getPet(); - if (info == nullptr) - return; - switch (cmd) - { - case 1: // intimacy - info->intimacy = data; - break; - case 2: // hunger - info->hungry = data; - break; - case 3: // accesory - info->equip = data; - break; - case 4: // performance - info->performance = data; - break; - case 5: // hair style - info->hairStyle = data; - break; - default: - break; - } -} - -void PetRecv::processPetStatus(Net::MessageIn &msg) -{ - const std::string name = msg.readString(24, "pet name"); - msg.readUInt8("rename flag"); - const int level = msg.readInt16("level"); - const int hungry = msg.readInt16("hungry"); - const int intimacy = msg.readInt16("intimacy"); - const int equip = msg.readInt16("equip"); - -// Being *const being = PlayerInfo::getPetBeing(); -// if (being) -// being->setLevel(level); - - PetInfo *const info = PlayerInfo::getPet(); - if (info == nullptr) - return; - info->name = name; - info->level = level; - info->hungry = hungry; - info->intimacy = intimacy; - info->equip = equip; - if (msg.getVersion() >= 20081126) - info->race = msg.readInt16("class"); - else - info->race = 0; -} - -void PetRecv::processPetFood(Net::MessageIn &msg) -{ - const int result = msg.readUInt8("result"); - msg.readInt16("food id"); - if (result != 0) - NotifyManager::notify(NotifyTypes::PET_FEED_OK); - else - NotifyManager::notify(NotifyTypes::PET_FEED_ERROR); -} - -void PetRecv::processPetCatchProcess(Net::MessageIn &msg A_UNUSED) -{ - NotifyManager::notify(NotifyTypes::PET_CATCH_PROCESS); -} - -} // namespace EAthena diff --git a/src/net/eathena/petrecv.h b/src/net/eathena/petrecv.h deleted file mode 100644 index a520ca107..000000000 --- a/src/net/eathena/petrecv.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2013-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_PETRECV_H -#define NET_EATHENA_PETRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace PetRecv - { - void processPetMessage(Net::MessageIn &msg); - void processPetRoulette(Net::MessageIn &msg); - void processEggsList(Net::MessageIn &msg); - void processPetData(Net::MessageIn &msg); - void processPetStatus(Net::MessageIn &msg); - void processPetFood(Net::MessageIn &msg); - void processPetCatchProcess(Net::MessageIn &msg); - } // namespace PetRecv -} // namespace EAthena - -#endif // NET_EATHENA_PETRECV_H diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp deleted file mode 100644 index a16984cfa..000000000 --- a/src/net/eathena/playerhandler.cpp +++ /dev/null @@ -1,718 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/playerhandler.h" - -#include "notifymanager.h" -#include "party.h" - -#include "being/localplayer.h" -#include "being/playerinfo.h" - -#include "const/net/nostat.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/skilldialog.h" -#include "gui/windows/statuswindow.h" - -#include "net/ea/inventoryhandler.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" -#include "net/eathena/sp.h" - -#include "resources/db/unitsdb.h" - -#include "debug.h" - -extern int packetVersion; -extern int serverVersion; - -namespace EAthena -{ - -PlayerHandler::PlayerHandler() : - Ea::PlayerHandler() -{ - playerHandler = this; -} - -PlayerHandler::~PlayerHandler() -{ - playerHandler = nullptr; -} - -void PlayerHandler::attack(const BeingId id, - const Keep keep) const -{ - createOutPacket(CMSG_PLAYER_CHANGE_ACT); - outMsg.writeBeingId(id, "target id"); - if (keep == Keep_true) - outMsg.writeInt8(7, "action"); - else - outMsg.writeInt8(0, "action"); -} - -void PlayerHandler::stopAttack() const -{ - createOutPacket(CMSG_PLAYER_STOP_ATTACK); -} - -void PlayerHandler::emote(const uint8_t emoteId) const -{ - createOutPacket(CMSG_PLAYER_EMOTE); - outMsg.writeInt8(emoteId, "emote id"); -} - -void PlayerHandler::increaseAttribute(const AttributesT attr, - const int amount) const -{ - if (attr >= Attributes::PLAYER_STR && attr <= Attributes::PLAYER_LUK) - { - createOutPacket(CMSG_STAT_UPDATE_REQUEST); - outMsg.writeInt16(CAST_S16(attr), "attribute id"); - outMsg.writeInt8(CAST_S8(amount), "increase"); - } -} - -void PlayerHandler::increaseSkill(const uint16_t skillId) const -{ - if (PlayerInfo::getAttribute(Attributes::PLAYER_SKILL_POINTS) <= 0) - return; - - createOutPacket(CMSG_SKILL_LEVELUP_REQUEST); - outMsg.writeInt16(skillId, "skill id"); -} - -void PlayerHandler::pickUp(const FloorItem *const floorItem) const -{ - if (floorItem == nullptr) - return; - - createOutPacket(CMSG_ITEM_PICKUP); - const BeingId id = floorItem->getId(); - if (packetVersion >= 20101124) - { - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20080827) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20070212) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20070108) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20050719) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20050718) - { - outMsg.writeInt8(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20050628) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20050509) - { - outMsg.writeInt16(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20050110) - { - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20041129) - { - outMsg.writeInt8(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20041025) - { - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20041005) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20040920) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20040906) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20040809) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else if (packetVersion >= 20040713) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeBeingId(id, "object id"); - } - else - { - outMsg.writeBeingId(id, "object id"); - } - - Ea::InventoryHandler::pushPickup(floorItem->getId()); -} - -void PlayerHandler::setDirection(const unsigned char direction) const -{ - createOutPacket(CMSG_PLAYER_CHANGE_DIR); - if (packetVersion >= 20101124) - { - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20080827) - { - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20070212) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20070108) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20060327) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20050719) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20050718) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20050628) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20050509) - { - outMsg.writeInt8(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20050110) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20041129) - { - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20041025) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20041005) - { - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20040920) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20040906) - { - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20040809) - { - outMsg.writeInt16(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else if (packetVersion >= 20040713) - { - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } - else - { - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); - } -} - -void PlayerHandler::setDestination(const int x, const int y, - const int direction) const -{ - createOutPacket(CMSG_PLAYER_CHANGE_DEST); - if (packetVersion >= 20080827 && packetVersion < 20101124) - outMsg.writeInt32(0, "unused"); - outMsg.writeCoordinates(CAST_U16(x), - CAST_U16(y), - CAST_U8(direction), "destination"); -} - -void PlayerHandler::changeAction(const BeingActionT &action) const -{ - unsigned char type; - switch (action) - { - case BeingAction::SIT: - type = 2; - break; - case BeingAction::STAND: - case BeingAction::PRESTAND: - type = 3; - break; - default: - case BeingAction::MOVE: - case BeingAction::ATTACK: - case BeingAction::DEAD: - case BeingAction::HURT: - case BeingAction::SPAWN: - case BeingAction::CAST: - return; - } - - createOutPacket(CMSG_PLAYER_CHANGE_ACT); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt8(type, "action"); -} - -void PlayerHandler::respawn() const -{ - createOutPacket(CMSG_PLAYER_RESTART); - outMsg.writeInt8(0, "action"); -} - -void PlayerHandler::requestOnlineList() const -{ - createOutPacket(CMSG_ONLINE_LIST); -} - -void PlayerHandler::updateStatus(const uint8_t status) const -{ - createOutPacket(CMSG_SET_STATUS); - outMsg.writeInt8(status, "status"); - outMsg.writeInt8(0, "unused"); -} - -void PlayerHandler::setShortcut(const int idx, - const uint8_t type, - const int id, - const int level) const -{ - createOutPacket(CMSG_SET_SHORTCUTS); - outMsg.writeInt16(CAST_S16(idx), "index"); - outMsg.writeInt8(CAST_S8(type), "type"); - outMsg.writeInt32(id, "id"); - outMsg.writeInt16(CAST_S16(level), "level"); -} - -void PlayerHandler::shortcutShiftRow(const int row) const -{ - if (packetVersion < 20140129) - return; - createOutPacket(CMSG_SHORTCUTS_ROW_SHIFT); - outMsg.writeInt8(CAST_S8(row), "row"); -} - -void PlayerHandler::removeOption() const -{ - createOutPacket(CMSG_REMOVE_OPTION); -} - -void PlayerHandler::changeCart(const int type) const -{ - createOutPacket(CMSG_CHANGE_CART); - outMsg.writeInt16(CAST_S16(type), "type"); -} - -void PlayerHandler::setMemo() const -{ - createOutPacket(CMSG_PLAYER_SET_MEMO); -} - -void PlayerHandler::doriDori() const -{ - createOutPacket(CMSG_DORI_DORI); -} - -void PlayerHandler::explosionSpirits() const -{ - createOutPacket(CMSG_EXPLOSION_SPIRITS); -} - -void PlayerHandler::requestPvpInfo() const -{ - createOutPacket(CMSG_PVP_INFO); - outMsg.writeInt32(0, "char id"); - outMsg.writeInt32(0, "account id"); -} - -void PlayerHandler::revive() const -{ - createOutPacket(CMSG_PLAYER_AUTO_REVIVE); -} - -void PlayerHandler::setViewEquipment(const bool allow) const -{ - createOutPacket(CMSG_PLAYER_SET_EQUIPMENT_VISIBLE); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(allow ? 1 : 0, "allow"); -} - -#define setStatComplex(stat) \ - PlayerInfo::setStatBase(stat, base, notify); \ - if (mod != NoStat) \ - PlayerInfo::setStatMod(stat, mod) - -void PlayerHandler::setStat(Net::MessageIn &msg, - const int type, - const int base, - const int mod, - const Notify notify) const -{ - switch (type) - { - case Sp::SPEED: - localPlayer->setWalkSpeed(base); - PlayerInfo::setStatBase(Attributes::PLAYER_WALK_SPEED, base); - PlayerInfo::setStatMod(Attributes::PLAYER_WALK_SPEED, 0); - break; - case Sp::BASEEXP: - PlayerInfo::setAttribute(Attributes::PLAYER_EXP, base); - break; - case Sp::JOBEXP: - PlayerInfo::setAttribute(Attributes::PLAYER_JOB_EXP, base); - break; - case Sp::KARMA: - PlayerInfo::setStatBase(Attributes::PLAYER_KARMA, base); - PlayerInfo::setStatMod(Attributes::PLAYER_KARMA, 0); - break; - case Sp::MANNER: - PlayerInfo::setStatBase(Attributes::PLAYER_MANNER, base); - PlayerInfo::setStatMod(Attributes::PLAYER_MANNER, 0); - break; - case Sp::HP: - PlayerInfo::setAttribute(Attributes::PLAYER_HP, base); - if (localPlayer->isInParty() && (Party::getParty(1) != nullptr)) - { - PartyMember *const m = Party::getParty(1) - ->getMember(localPlayer->getId()); - if (m != nullptr) - { - m->setHp(base); - m->setMaxHp(PlayerInfo::getAttribute( - Attributes::PLAYER_MAX_HP)); - } - } - break; - case Sp::MAXHP: - PlayerInfo::setAttribute(Attributes::PLAYER_MAX_HP, base); - - if (localPlayer->isInParty() && (Party::getParty(1) != nullptr)) - { - PartyMember *const m = Party::getParty(1)->getMember( - localPlayer->getId()); - if (m != nullptr) - { - m->setHp(PlayerInfo::getAttribute(Attributes::PLAYER_HP)); - m->setMaxHp(base); - } - } - break; - case Sp::SP: - PlayerInfo::setAttribute(Attributes::PLAYER_MP, base); - break; - case Sp::MAXSP: - PlayerInfo::setAttribute(Attributes::PLAYER_MAX_MP, base); - break; - case Sp::STATUSPOINT: - PlayerInfo::setAttribute(Attributes::PLAYER_CHAR_POINTS, base); - break; - case Sp::BASELEVEL: - PlayerInfo::setAttribute(Attributes::PLAYER_BASE_LEVEL, base); - if (localPlayer != nullptr) - { - localPlayer->setLevel(base); - localPlayer->updateName(); - } - break; - case Sp::SKILLPOINT: - PlayerInfo::setAttribute(Attributes::PLAYER_SKILL_POINTS, base); - if (skillDialog != nullptr) - skillDialog->update(); - break; - case Sp::STR: - setStatComplex(Attributes::PLAYER_STR); - break; - case Sp::AGI: - setStatComplex(Attributes::PLAYER_AGI); - break; - case Sp::VIT: - setStatComplex(Attributes::PLAYER_VIT); - break; - case Sp::INT: - setStatComplex(Attributes::PLAYER_INT); - break; - case Sp::DEX: - setStatComplex(Attributes::PLAYER_DEX); - break; - case Sp::LUK: - setStatComplex(Attributes::PLAYER_LUK); - break; - case Sp::ZENY: - { - const int oldMoney = PlayerInfo::getAttribute(Attributes::MONEY); - const int newMoney = base; - if (newMoney > oldMoney) - { - NotifyManager::notify(NotifyTypes::MONEY_GET, - UnitsDb::formatCurrency(newMoney - oldMoney)); - } - else if (newMoney < oldMoney) - { - NotifyManager::notify(NotifyTypes::MONEY_SPENT, - UnitsDb::formatCurrency(oldMoney - newMoney).c_str()); - } - - PlayerInfo::setAttribute(Attributes::MONEY, newMoney); - break; - } - case Sp::NEXTBASEEXP: - PlayerInfo::setAttribute(Attributes::PLAYER_EXP_NEEDED, base); - break; - case Sp::NEXTJOBEXP: - PlayerInfo::setAttribute(Attributes::PLAYER_JOB_EXP_NEEDED, base); - break; - case Sp::WEIGHT: - PlayerInfo::setAttribute(Attributes::TOTAL_WEIGHT, base); - break; - case Sp::MAXWEIGHT: - PlayerInfo::setAttribute(Attributes::MAX_WEIGHT, base); - break; - case Sp::USTR: - statusWindow->setPointsNeeded(Attributes::PLAYER_STR, base); - break; - case Sp::UAGI: - statusWindow->setPointsNeeded(Attributes::PLAYER_AGI, base); - break; - case Sp::UVIT: - statusWindow->setPointsNeeded(Attributes::PLAYER_VIT, base); - break; - case Sp::UINT: - statusWindow->setPointsNeeded(Attributes::PLAYER_INT, base); - break; - case Sp::UDEX: - statusWindow->setPointsNeeded(Attributes::PLAYER_DEX, base); - break; - case Sp::ULUK: - statusWindow->setPointsNeeded(Attributes::PLAYER_LUK, base); - break; - - case Sp::ATK1: - PlayerInfo::setStatBase(Attributes::PLAYER_ATK, base); - PlayerInfo::updateAttrs(); - break; - case Sp::ATK2: - PlayerInfo::setStatMod(Attributes::PLAYER_ATK, base); - PlayerInfo::updateAttrs(); - break; - case Sp::MATK1: - PlayerInfo::setStatBase(Attributes::PLAYER_MATK, base); - break; - case Sp::MATK2: - PlayerInfo::setStatMod(Attributes::PLAYER_MATK, base); - break; - case Sp::DEF1: - PlayerInfo::setStatBase(Attributes::PLAYER_DEF, base); - break; - case Sp::DEF2: - PlayerInfo::setStatMod(Attributes::PLAYER_DEF, base); - break; - case Sp::MDEF1: - PlayerInfo::setStatBase(Attributes::PLAYER_MDEF, base); - break; - case Sp::MDEF2: - PlayerInfo::setStatMod(Attributes::PLAYER_MDEF, base); - break; - case Sp::HIT: - PlayerInfo::setStatBase(Attributes::PLAYER_HIT, base); - break; - case Sp::FLEE1: - PlayerInfo::setStatBase(Attributes::PLAYER_FLEE, base); - break; - case Sp::FLEE2: - PlayerInfo::setStatMod(Attributes::PLAYER_FLEE, base); - break; - case Sp::CRITICAL: - PlayerInfo::setStatBase(Attributes::PLAYER_CRIT, base); - break; - case Sp::ASPD: - localPlayer->setAttackSpeed(base); - PlayerInfo::setStatBase(Attributes::PLAYER_ATTACK_DELAY, base); - PlayerInfo::setStatMod(Attributes::PLAYER_ATTACK_DELAY, 0); - PlayerInfo::updateAttrs(); - break; - case Sp::JOBLEVEL: - PlayerInfo::setAttribute(Attributes::PLAYER_JOB_LEVEL, base); - break; - - default: - UNIMPLEMENTEDPACKETFIELD(type); - break; - } -} - -#undef setStatComplex - -} // namespace EAthena diff --git a/src/net/eathena/playerhandler.h b/src/net/eathena/playerhandler.h deleted file mode 100644 index 1b000025c..000000000 --- a/src/net/eathena/playerhandler.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_PLAYERHANDLER_H -#define NET_EATHENA_PLAYERHANDLER_H - -#include "net/ea/playerhandler.h" - -namespace EAthena -{ - -class PlayerHandler final : public Ea::PlayerHandler -{ - public: - PlayerHandler(); - - A_DELETE_COPY(PlayerHandler) - - ~PlayerHandler(); - - void attack(const BeingId id, - const Keep keep) const override final; - void stopAttack() const override final; - void emote(const uint8_t emoteId) const override final; - - void increaseAttribute(const AttributesT attr, - const int amount) const override final; - void increaseSkill(const uint16_t skillId) const override final; - - void pickUp(const FloorItem *const floorItem) const override final; - void setDirection(const unsigned char direction) const override final; - void setDestination(const int x, const int y, - const int direction) const override final; - void changeAction(const BeingActionT &action) - const override final; - void updateStatus(const uint8_t status) const override final; - - void requestOnlineList() const override final; - void respawn() const override final; - void setShortcut(const int idx, - const uint8_t type, - const int id, - const int level) const override final; - void shortcutShiftRow(const int row) const override final; - void removeOption() const override final; - void changeCart(const int type) const override final; - void setMemo() const override final; - void doriDori() const override final; - void explosionSpirits() const override final; - void requestPvpInfo() const override final; - void revive() const override final; - void setViewEquipment(const bool allow) const override final; - - void setStat(Net::MessageIn &msg, - const int type, - const int base, - const int mod, - const Notify notify) const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_PLAYERHANDLER_H diff --git a/src/net/eathena/playerrecv.cpp b/src/net/eathena/playerrecv.cpp deleted file mode 100644 index a630bf9b7..000000000 --- a/src/net/eathena/playerrecv.cpp +++ /dev/null @@ -1,498 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/playerrecv.h" - -#include "actormanager.h" -#include "configuration.h" -#include "notifymanager.h" -#include "party.h" - -#include "being/beingflag.h" -#include "being/localplayer.h" -#include "being/playerinfo.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/onlineplayer.h" - -#include "gui/windows/statuswindow.h" -#include "gui/windows/whoisonline.h" - -#include "gui/widgets/tabs/chat/chattab.h" - -#include "net/eathena/sp.h" -#include "net/messagein.h" - -#include "utils/gettext.h" - -#include "debug.h" - -namespace EAthena -{ - -void PlayerRecv::processPlayerShortcuts(Net::MessageIn &msg) -{ - // +++ player shortcuts ignored. It also disabled on server side. - // may be in future better use it? - if (msg.getVersion() >= 20141022) - msg.readUInt8("rotate"); - for (int f = 0; f < 27; f ++) - { - msg.readUInt8("type 0: item, 1: skill"); - msg.readInt32("item or skill id"); - msg.readInt16("skill level"); - } - msg.skip(77, "unused"); -} - -void PlayerRecv::processPlayerShowEquip(Net::MessageIn &msg) -{ - // +++ for now server allow only switch this option but not using it. - msg.readUInt8("show equip"); // 1 mean need open "equipment" window -} - -void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) -{ - BLOCK_START("PlayerRecv::processPlayerStatUpdate5") - PlayerInfo::setAttribute(Attributes::PLAYER_CHAR_POINTS, - msg.readInt16("char points")); - - unsigned int val = msg.readUInt8("str"); - PlayerInfo::setStatBase(Attributes::PLAYER_STR, val); - if (statusWindow != nullptr) - { - statusWindow->setPointsNeeded(Attributes::PLAYER_STR, - msg.readUInt8("str cost")); - } - else - { - msg.readUInt8("str need"); - } - - val = msg.readUInt8("agi"); - PlayerInfo::setStatBase(Attributes::PLAYER_AGI, val); - if (statusWindow != nullptr) - { - statusWindow->setPointsNeeded(Attributes::PLAYER_AGI, - msg.readUInt8("agi cost")); - } - else - { - msg.readUInt8("agi cost"); - } - - val = msg.readUInt8("vit"); - PlayerInfo::setStatBase(Attributes::PLAYER_VIT, val); - if (statusWindow != nullptr) - { - statusWindow->setPointsNeeded(Attributes::PLAYER_VIT, - msg.readUInt8("vit cost")); - } - else - { - msg.readUInt8("vit cost"); - } - - val = msg.readUInt8("int"); - PlayerInfo::setStatBase(Attributes::PLAYER_INT, val); - if (statusWindow != nullptr) - { - statusWindow->setPointsNeeded(Attributes::PLAYER_INT, - msg.readUInt8("int cost")); - } - else - { - msg.readUInt8("int cost"); - } - - val = msg.readUInt8("dex"); - PlayerInfo::setStatBase(Attributes::PLAYER_DEX, val); - if (statusWindow != nullptr) - { - statusWindow->setPointsNeeded(Attributes::PLAYER_DEX, - msg.readUInt8("dex cost")); - } - else - { - msg.readUInt8("dex cost"); - } - - val = msg.readUInt8("luk"); - PlayerInfo::setStatBase(Attributes::PLAYER_LUK, val); - if (statusWindow != nullptr) - { - statusWindow->setPointsNeeded(Attributes::PLAYER_LUK, - msg.readUInt8("luk cost")); - } - else - { - msg.readUInt8("luk cost"); - } - - PlayerInfo::setStatBase(Attributes::PLAYER_ATK, - msg.readInt16("left atk"), Notify_false); - PlayerInfo::setStatMod(Attributes::PLAYER_ATK, - msg.readInt16("right atk")); - PlayerInfo::updateAttrs(); - - val = msg.readInt16("right matk"); - PlayerInfo::setStatBase(Attributes::PLAYER_MATK, val, Notify_false); - - val = msg.readInt16("left matk"); - PlayerInfo::setStatMod(Attributes::PLAYER_MATK, val); - - PlayerInfo::setStatBase(Attributes::PLAYER_DEF, - msg.readInt16("left def"), Notify_false); - PlayerInfo::setStatMod(Attributes::PLAYER_DEF, - msg.readInt16("right def")); - - PlayerInfo::setStatBase(Attributes::PLAYER_MDEF, - msg.readInt16("left mdef"), Notify_false); - PlayerInfo::setStatMod(Attributes::PLAYER_MDEF, - msg.readInt16("right mdef")); - - PlayerInfo::setStatBase(Attributes::PLAYER_HIT, - msg.readInt16("hit")); - - PlayerInfo::setStatBase(Attributes::PLAYER_FLEE, - msg.readInt16("flee"), Notify_false); - PlayerInfo::setStatMod(Attributes::PLAYER_FLEE, - msg.readInt16("flee2/10")); - - PlayerInfo::setStatBase(Attributes::PLAYER_CRIT, - msg.readInt16("crit/10")); - - PlayerInfo::setAttribute(Attributes::PLAYER_ATTACK_DELAY, - msg.readInt16("attack speed")); - msg.readInt16("plus speed = 0"); - - BLOCK_END("PlayerRecv::processPlayerStatUpdate5") -} - -void PlayerRecv::processPlayerGetExp(Net::MessageIn &msg) -{ - if (localPlayer == nullptr) - return; - const BeingId id = msg.readBeingId("player id"); - const int exp = msg.readInt32("exp amount"); - const int stat = msg.readInt16("exp type"); - const bool fromQuest = msg.readInt16("is from quest") != 0; - if (!fromQuest && id == localPlayer->getId()) - { - if (stat == 1) - localPlayer->addXpMessage(exp); - else if (stat == 2) - localPlayer->addJobMessage(exp); - else - UNIMPLEMENTEDPACKETFIELD(stat); - } - // need show particle depend on isQuest flag, for now ignored -} - -void PlayerRecv::processWalkResponse(Net::MessageIn &msg) -{ - BLOCK_START("PlayerRecv::processWalkResponse") - /* - * This client assumes that all walk messages succeed, - * and that the server will send a correction notice - * otherwise. - */ - uint16_t srcX, srcY, dstX, dstY; - msg.readInt32("tick"); - msg.readCoordinatePair(srcX, srcY, dstX, dstY, "move path"); - msg.readUInt8("(sx<<4) | (sy&0x0f)"); - if (localPlayer != nullptr) - localPlayer->setRealPos(dstX, dstY); - BLOCK_END("PlayerRecv::processWalkResponse") -} - -void PlayerRecv::processWalkError(Net::MessageIn &msg) -{ - msg.readInt32("tick"); - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - if (localPlayer != nullptr) - localPlayer->failMove(x, y); -} - -void PlayerRecv::processPvpInfo(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("char id"); - msg.readBeingId("account id"); - msg.readInt32("pvp won"); - msg.readInt32("pvp lost"); - msg.readInt32("pvp point"); -} - -void PlayerRecv::processPlayerHeal(Net::MessageIn &msg) -{ - if (localPlayer == nullptr) - return; - - const int type = msg.readInt16("var id"); - int amount; - if (msg.getVersion() >= 20150513) - amount = msg.readInt32("value"); - else - amount = msg.readInt16("value"); - if (type == Sp::HP) - { - const int base = PlayerInfo::getAttribute(Attributes::PLAYER_HP) + - amount; - PlayerInfo::setAttribute(Attributes::PLAYER_HP, base); - if (localPlayer->isInParty() && (Party::getParty(1) != nullptr)) - { - PartyMember *const m = Party::getParty(1) - ->getMember(localPlayer->getId()); - if (m != nullptr) - { - m->setHp(base); - m->setMaxHp(PlayerInfo::getAttribute( - Attributes::PLAYER_MAX_HP)); - } - } - localPlayer->addHpMessage(amount); - } - else if (type == Sp::SP) - { - localPlayer->addSpMessage(amount); - } -} - -void PlayerRecv::processPlayerSkillMessage(Net::MessageIn &msg) -{ - const int message = msg.readInt32("type"); - switch (message) - { - case 0x15: - NotifyManager::notify(NotifyTypes::SKILL_END_ALL_NEGATIVE_STATUS); - break; - case 0x16: - NotifyManager::notify(NotifyTypes::SKILL_IMMUNITY_TO_ALL_STATUSES); - break; - case 0x17: - NotifyManager::notify(NotifyTypes::SKILL_MAX_HP); - break; - case 0x18: - NotifyManager::notify(NotifyTypes::SKILL_MAX_SP); - break; - case 0x19: - NotifyManager::notify(NotifyTypes::SKILL_ALL_STATUS_PLUS_20); - break; - case 0x1c: - NotifyManager::notify(NotifyTypes::SKILL_ENCHANT_WEAPON_HOLY); - break; - case 0x1d: - NotifyManager::notify(NotifyTypes::SKILL_ENCHANT_ARMOR_HOLY); - break; - case 0x1e: - NotifyManager::notify(NotifyTypes::SKILL_DEF_PLUS_25); - break; - case 0x1f: - NotifyManager::notify(NotifyTypes::SKILL_ATTACK_PLUS_100); - break; - case 0x20: - NotifyManager::notify(NotifyTypes::SKILL_FLEE_PLUS_50); - break; - case 0x28: - NotifyManager::notify(NotifyTypes::SKILL_FULL_STRIP_FAILED); - break; - default: - NotifyManager::notify(NotifyTypes::SKILL_MESSAGE_UNKNOWN); - break; - } -} - -void PlayerRecv::processNotifyMapInfo(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("type"); -} - -void PlayerRecv::processPlayerFameBlacksmith(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("points"); - msg.readInt32("total points"); -} - -void PlayerRecv::processPlayerFameAlchemist(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("points"); - msg.readInt32("total points"); -} - -void PlayerRecv::processPlayerUpgradeMessage(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("result"); - msg.readInt16("item id"); -} - -void PlayerRecv::processPlayerFameTaekwon(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("points"); - msg.readInt32("total points"); -} - -void PlayerRecv::processPlayerReadBook(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("book id"); - msg.readInt32("page"); -} - -void PlayerRecv::processPlayerEquipTickAck(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt32("unused"); - msg.readInt32("flag"); -} - -void PlayerRecv::processPlayerAutoShadowSpellList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - const int count = (msg.readInt16("len") - 8) / 2; - for (int f = 0; f < count; f ++) - msg.readInt16("skill id"); -} - -void PlayerRecv::processPlayerRankPoints(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("type"); - msg.readInt32("points"); - msg.readInt32("fame"); -} - -void PlayerRecv::processOnlineList(Net::MessageIn &msg) -{ - if (whoIsOnline == nullptr) - return; - - BLOCK_START("PlayerRecv::processOnlineList") - const int size = msg.readInt16("len") - 4; - STD_VECTOR<OnlinePlayer*> arr; - - if (size == 0) - { - if (whoIsOnline != nullptr) - whoIsOnline->loadList(arr); - BLOCK_END("PlayerRecv::processOnlineList") - return; - } - - char *const start = reinterpret_cast<char*>(msg.readBytes(size, "nicks")); - if (start == nullptr) - { - BLOCK_END("PlayerRecv::processOnlineList") - return; - } - - const char *buf = start; - - int addVal = 3; - - while (buf - start + 1 < size - && (*(buf + CAST_SIZE(addVal)) != 0)) - { - const unsigned char status = *buf; - buf ++; - const unsigned char level = *buf; - buf ++; - const unsigned char ver = *buf; - buf ++; - - GenderT gender = Gender::UNSPECIFIED; - if (config.getBoolValue("showgender")) - { - if ((status & BeingFlag::GENDER_MALE) != 0) - gender = Gender::MALE; - else if ((status & BeingFlag::GENDER_OTHER) != 0) - gender = Gender::OTHER; - else - gender = Gender::FEMALE; - } - arr.push_back(new OnlinePlayer(static_cast<const char*>(buf), - status, level, gender, ver)); - buf += strlen(buf) + 1; - } - - if (whoIsOnline != nullptr) - whoIsOnline->loadList(arr); - delete [] start; - BLOCK_END("PlayerRecv::processOnlineList") -} - -void PlayerRecv::processDressRoomOpen(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("view"); -} - -void PlayerRecv::processKilledBy(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("killer id"); - const Being *const dstBeing = actorManager->findBeing(id); - if (id == BeingId_zero) - { - debugMsg( - // TRANSLATORS: player killed message - _("You were killed by unknown source.")); - } - else - { - std::string name; - if (dstBeing != nullptr) - name = dstBeing->getName(); - else - name = strprintf("?%u", CAST_U32(id)); - debugMsg(strprintf( - // TRANSLATORS: player killed message - _("You were killed by %s."), - name.c_str())); - } -} - -void PlayerRecv::processPlayerAttrs(Net::MessageIn &msg) -{ - const int len = msg.readInt16("len"); - if (len < 8) - return; - - const int groupId = msg.readInt32("group id"); - - if (localPlayer == nullptr) - return; - - localPlayer->setGroupId(groupId); - if (groupId > 0) - localPlayer->setGM(true); - else - localPlayer->setGM(false); -} - -} // namespace EAthena diff --git a/src/net/eathena/playerrecv.h b/src/net/eathena/playerrecv.h deleted file mode 100644 index eb38684b8..000000000 --- a/src/net/eathena/playerrecv.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_PLAYERRECV_H -#define NET_EATHENA_PLAYERRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace PlayerRecv - { - void processPlayerShortcuts(Net::MessageIn &msg); - void processPlayerShowEquip(Net::MessageIn &msg); - void processPlayerStatUpdate5(Net::MessageIn &msg); - void processPlayerGetExp(Net::MessageIn &msg); - void processPvpInfo(Net::MessageIn &msg); - void processPlayerHeal(Net::MessageIn &msg); - void processPlayerSkillMessage(Net::MessageIn &msg); - void processWalkResponse(Net::MessageIn &msg); - void processWalkError(Net::MessageIn &msg); - void processNotifyMapInfo(Net::MessageIn &msg); - void processPlayerFameBlacksmith(Net::MessageIn &msg); - void processPlayerFameAlchemist(Net::MessageIn &msg); - void processPlayerUpgradeMessage(Net::MessageIn &msg); - void processPlayerFameTaekwon(Net::MessageIn &msg); - void processPlayerReadBook(Net::MessageIn &msg); - void processPlayerEquipTickAck(Net::MessageIn &msg); - void processPlayerAutoShadowSpellList(Net::MessageIn &msg); - void processPlayerRankPoints(Net::MessageIn &msg); - void processOnlineList(Net::MessageIn &msg); - void processDressRoomOpen(Net::MessageIn &msg); - void processKilledBy(Net::MessageIn &msg); - void processPlayerAttrs(Net::MessageIn &msg); - } // namespace PlayerRecv -} // namespace EAthena - -#endif // NET_EATHENA_PLAYERRECV_H diff --git a/src/net/eathena/protocolout.cpp b/src/net/eathena/protocolout.cpp deleted file mode 100644 index 154dacf6c..000000000 --- a/src/net/eathena/protocolout.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -extern int evolPacketOffset; - -namespace EAthena -{ -#include "net/protocoloutdefine.h" -#include "net/eathena/packetsout.inc" -#undef packet -PROTOCOLOUT_VOID -PACKETSOUT_VOID -} // namespace EAthena - -#include "debug.h" diff --git a/src/net/eathena/protocolout.h b/src/net/eathena/protocolout.h deleted file mode 100644 index d6be65703..000000000 --- a/src/net/eathena/protocolout.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_PROTOCOLOUT_H -#define NET_EATHENA_PROTOCOLOUT_H - -#include "net/protocoloutinclude.h" - -#define PROTOCOLOUT_VOID - -namespace EAthena -{ -#include "net/eathena/packetsout.inc" -PACKETSOUT_VOID -} // namespace EAthena - -#undef packet -#undef packet2 -#undef startCondition -#undef endCondition -#undef PACKETSOUT_VOID - -#endif // NET_EATHENA_PROTOCOLOUT_H diff --git a/src/net/eathena/questhandler.cpp b/src/net/eathena/questhandler.cpp deleted file mode 100644 index 0db26ebf4..000000000 --- a/src/net/eathena/questhandler.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/questhandler.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -namespace EAthena -{ - -QuestHandler::QuestHandler() : - Net::QuestHandler() -{ - questHandler = this; -} - -QuestHandler::~QuestHandler() -{ - questHandler = nullptr; -} - -void QuestHandler::setQeustActiveState(const int questId, - const bool active) const -{ - createOutPacket(CMSG_QUEST_ACTIVATE); - outMsg.writeInt32(questId, "quest id"); - outMsg.writeInt8(CAST_S8(active ? 1 : 0), "activate"); -} - -} // namespace EAthena diff --git a/src/net/eathena/questhandler.h b/src/net/eathena/questhandler.h deleted file mode 100644 index 2c5f18b67..000000000 --- a/src/net/eathena/questhandler.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_QUESTHANDLER_H -#define NET_EATHENA_QUESTHANDLER_H - -#include "net/questhandler.h" - -namespace EAthena -{ - -class QuestHandler final : public Net::QuestHandler -{ - public: - QuestHandler(); - - A_DELETE_COPY(QuestHandler) - - ~QuestHandler(); - - void setQeustActiveState(const int questId, - const bool active) const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_QUESTHANDLER_H diff --git a/src/net/eathena/questrecv.cpp b/src/net/eathena/questrecv.cpp deleted file mode 100644 index 69ad93541..000000000 --- a/src/net/eathena/questrecv.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/questrecv.h" - -#include "gui/windows/skilldialog.h" -#include "gui/windows/questswindow.h" - -#include "net/messagein.h" - -#include "const/resources/skill.h" - -#include "debug.h" - -namespace EAthena -{ - -void QuestRecv::processAddQuest(Net::MessageIn &msg) -{ - const int var = msg.readInt32("quest id"); - const int val = msg.readUInt8("state"); - msg.readUInt8("time diff"); - msg.readInt32("time"); - const int num = msg.readInt16("objectives count"); - for (int f = 0; f < num; f ++) - { - // need use in quests kills list - msg.readInt32("monster id"); - msg.readInt16("count"); - msg.readString(24, "monster name"); - } - - msg.skipToEnd("unused"); - - if (questsWindow != nullptr) - { - questsWindow->updateQuest(var, val, 0, 0, 0); - questsWindow->rebuild(true); - } - if (skillDialog != nullptr) - { - skillDialog->updateQuest(var, val, 0, 0, 0); - skillDialog->playUpdateEffect(var + SKILL_VAR_MIN_ID); - } -} - -void QuestRecv::processAddQuest2(Net::MessageIn &msg) -{ - const int var = msg.readInt32("quest id"); - msg.readUInt8("state"); - const int val1 = msg.readInt32("count1"); - const int val2 = msg.readInt32("count2"); - const int val3 = msg.readInt32("count3"); - const int time = msg.readInt32("time"); - - if (questsWindow != nullptr) - { - questsWindow->updateQuest(var, val1, val2, val3, time); - questsWindow->rebuild(true); - } - if (skillDialog != nullptr) - { - skillDialog->updateQuest(var, val1, val2, val3, time); - skillDialog->playUpdateEffect(var + SKILL_VAR_MIN_ID); - } -} - -void QuestRecv::processAddQuests(Net::MessageIn &msg) -{ - msg.readInt16("len"); - const int num = msg.readInt32("quests count"); - for (int f = 0; f < num; f ++) - { - const int var = msg.readInt32("quest id"); - const int val = msg.readUInt8("state"); - if (msg.getVersion() >= 20141022) - { - msg.readInt32("time diff"); - msg.readInt32("time"); - msg.readInt16("objectives count"); - } - if (questsWindow != nullptr) - questsWindow->updateQuest(var, val, 0, 0, 0); - if (skillDialog != nullptr) - skillDialog->updateQuest(var, val, 0, 0, 0); - } - - if (questsWindow != nullptr) - questsWindow->rebuild(false); -} - -void QuestRecv::processAddQuests2(Net::MessageIn &msg) -{ - msg.readInt16("len"); - const int num = msg.readInt32("quests count"); - for (int f = 0; f < num; f ++) - { - const int var = msg.readInt32("quest id"); - msg.readUInt8("state"); - const int val1 = msg.readInt32("count1"); - const int val2 = msg.readInt32("count2"); - const int val3 = msg.readInt32("count3"); - const int time = msg.readInt32("time"); - if (questsWindow != nullptr) - questsWindow->updateQuest(var, val1, val2, val3, time); - if (skillDialog != nullptr) - skillDialog->updateQuest(var, val1, val2, val3, time); - } - - if (questsWindow != nullptr) - questsWindow->rebuild(false); -} - -void QuestRecv::processAddQuestsObjectives(Net::MessageIn &msg) -{ - msg.readInt16("len"); - const int quests = msg.readInt32("quests count"); - for (int f = 0; f < quests; f ++) - { - msg.readInt32("quest id"); - msg.readInt32("time diff"); - msg.readInt32("time"); - const int num = msg.readInt16("objectives count"); - for (int d = 0; d < num; d ++) - { - // need use in quests kills list - msg.readInt32("monster id"); - msg.readInt16("count"); - msg.readString(24, "monster name"); - } - } - msg.skipToEnd("unused"); -} - -void QuestRecv::processUpdateQuestsObjectives(Net::MessageIn &msg) -{ - // ignored - msg.readInt16("len"); - const int num = msg.readInt16("objectives count"); - for (int f = 0; f < num; f ++) - { - msg.readInt32("quest id"); - msg.readInt32("monster id"); - msg.readInt16("count old"); - msg.readInt16("count new"); - } -} - -void QuestRecv::processRemoveQuest(Net::MessageIn &msg) -{ - const int var = msg.readInt32("quest id"); - const int val = -1; - - // not removing quest, because this is impossible, - // but changing status to -1 - if (questsWindow != nullptr) - { - questsWindow->updateQuest(var, val, 0, 0, 0); - questsWindow->rebuild(true); - } - if (skillDialog != nullptr) - { - skillDialog->updateQuest(var, val, 0, 0, 0); - skillDialog->playUpdateEffect(var + SKILL_VAR_MIN_ID); - } -} - -void QuestRecv::processActivateQuest(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // +++ need enable/disable quests depend on this packet - msg.readInt32("quest id"); - msg.readUInt8("activate"); -} - -void QuestRecv::processNpcQuestEffect(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // this packed mostly useless, because manaplus can show any - // kind of effects based on quest states. - msg.readInt32("npc id"); - msg.readInt16("x"); - msg.readInt16("y"); - msg.readInt16("state"); - msg.readInt16("color"); -} - -} // namespace EAthena diff --git a/src/net/eathena/questrecv.h b/src/net/eathena/questrecv.h deleted file mode 100644 index aff969a59..000000000 --- a/src/net/eathena/questrecv.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_QUESTRECV_H -#define NET_EATHENA_QUESTRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace QuestRecv - { - void processAddQuest(Net::MessageIn &msg); - void processAddQuest2(Net::MessageIn &msg); - void processAddQuests(Net::MessageIn &msg); - void processAddQuests2(Net::MessageIn &msg); - void processAddQuestsObjectives(Net::MessageIn &msg); - void processUpdateQuestsObjectives(Net::MessageIn &msg); - void processRemoveQuest(Net::MessageIn &msg); - void processActivateQuest(Net::MessageIn &msg); - void processNpcQuestEffect(Net::MessageIn &msg); - } // namespace QuestRecv -} // namespace EAthena - -#endif // NET_EATHENA_QUESTRECV_H diff --git a/src/net/eathena/recvpackets.inc b/src/net/eathena/recvpackets.inc deleted file mode 100644 index 32032296c..000000000 --- a/src/net/eathena/recvpackets.inc +++ /dev/null @@ -1,32 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_RECVPACKETS_H -#define NET_EATHENA_RECVPACKETS_H - -#define RECVPACKETS_VOID - -#include "net/recvpacketdefine.h" - -#include "net/eathena/packetsin.inc" - -#undef packet - -#endif // NET_EATHENA_RECVPACKETS_H diff --git a/src/net/eathena/roulettehandler.cpp b/src/net/eathena/roulettehandler.cpp deleted file mode 100644 index b0d9d2829..000000000 --- a/src/net/eathena/roulettehandler.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/roulettehandler.h" - -#include "debug.h" - -namespace EAthena -{ - -RouletteHandler::RouletteHandler() : - Net::RouletteHandler() -{ - rouletteHandler = this; -} - -RouletteHandler::~RouletteHandler() -{ - rouletteHandler = nullptr; -} - -} // namespace EAthena diff --git a/src/net/eathena/roulettehandler.h b/src/net/eathena/roulettehandler.h deleted file mode 100644 index 861f54582..000000000 --- a/src/net/eathena/roulettehandler.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_ROULETTEHANDLER_H -#define NET_EATHENA_ROULETTEHANDLER_H - -#include "net/roulettehandler.h" - -namespace EAthena -{ -class RouletteHandler final : public Net::RouletteHandler -{ - public: - RouletteHandler(); - - A_DELETE_COPY(RouletteHandler) - - ~RouletteHandler(); -}; - -} // namespace EAthena - -#endif // NET_EATHENA_ROULETTEHANDLER_H diff --git a/src/net/eathena/rouletterecv.cpp b/src/net/eathena/rouletterecv.cpp deleted file mode 100644 index 2422fbcda..000000000 --- a/src/net/eathena/rouletterecv.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/rouletterecv.h" - -#include "logger.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace EAthena -{ - -void RouletteRecv::processRouletteInfoAckType(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - const int count = (msg.readInt16("len") - 8) / 8; - msg.readInt32("serial"); - - for (int f = 0; f < count; f ++) - { - msg.readInt16("row"); - msg.readInt16("position"); - msg.readInt16("item id"); - msg.readInt16("count"); - } -} - -void RouletteRecv::processRouletteItemAck(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readUInt8("result"); - msg.readInt16("item id"); -} - -void RouletteRecv::processRouletteGenerateAckType(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readUInt8("result"); - msg.readInt16("step"); - msg.readInt16("idx"); - msg.readInt16("item id"); - msg.readInt32("remain gold"); - msg.readInt32("remain silver"); - msg.readInt32("remain bronze"); -} - -void RouletteRecv::processRouletteOpenAck(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readUInt8("result"); - msg.readInt32("serial"); - msg.readUInt8("step"); - msg.readUInt8("idx"); - msg.readInt16("additional item id"); - msg.readInt32("gold point"); - msg.readInt32("silver point"); - msg.readInt32("bronze point"); -} - -} // namespace EAthena diff --git a/src/net/eathena/rouletterecv.h b/src/net/eathena/rouletterecv.h deleted file mode 100644 index e922a8b02..000000000 --- a/src/net/eathena/rouletterecv.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_ROULETTERECV_H -#define NET_EATHENA_ROULETTERECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace RouletteRecv - { - void processRouletteInfoAckType(Net::MessageIn &msg); - void processRouletteItemAck(Net::MessageIn &msg); - void processRouletteGenerateAckType(Net::MessageIn &msg); - void processRouletteOpenAck(Net::MessageIn &msg); - } // namespace RouletteRecv -} // namespace EAthena - -#endif // NET_EATHENA_ROULETTERECV_H diff --git a/src/net/eathena/searchstorehandler.cpp b/src/net/eathena/searchstorehandler.cpp deleted file mode 100644 index c8cd43d2d..000000000 --- a/src/net/eathena/searchstorehandler.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/searchstorehandler.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -SearchStoreHandler::SearchStoreHandler() : - Net::SearchStoreHandler() -{ - searchStoreHandler = this; -} - -SearchStoreHandler::~SearchStoreHandler() -{ - searchStoreHandler = nullptr; -} - -void SearchStoreHandler::search(const StoreSearchTypeT type, - const int minPrice, - const int maxPrice, - const int itemId) const -{ - if (packetVersion < 20100601) - return; - - createOutPacket(CMSG_SEARCHSTORE_SEARCH); - outMsg.writeInt16(23, "len"); - outMsg.writeInt8(CAST_U8(type), "search type"); - outMsg.writeInt32(maxPrice, "max price"); - outMsg.writeInt32(minPrice, "min price"); - outMsg.writeInt32(1, "items count"); - outMsg.writeInt32(0, "cards count"); - outMsg.writeInt16(CAST_S16(itemId), "item id"); -} - -void SearchStoreHandler::nextPage() const -{ - if (packetVersion < 20100608) - return; - createOutPacket(CMSG_SEARCHSTORE_NEXT_PAGE); -} - -void SearchStoreHandler::close() const -{ - if (packetVersion < 20100608) - return; - createOutPacket(CMSG_SEARCHSTORE_CLOSE); -} - -void SearchStoreHandler::select(const int accountId, - const int storeId, - const int itemId) const -{ - if (packetVersion < 20100608) - return; - createOutPacket(CMSG_SEARCHSTORE_CLICK); - outMsg.writeInt32(accountId, "account id"); - outMsg.writeInt32(storeId, "store id"); - outMsg.writeInt16(CAST_S16(itemId), "item id"); -} - -} // namespace EAthena diff --git a/src/net/eathena/searchstorehandler.h b/src/net/eathena/searchstorehandler.h deleted file mode 100644 index 5e425e6e5..000000000 --- a/src/net/eathena/searchstorehandler.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_SEARCHSTOREHANDLER_H -#define NET_EATHENA_SEARCHSTOREHANDLER_H - -#include "net/searchstorehandler.h" - -namespace EAthena -{ -class SearchStoreHandler final : public Net::SearchStoreHandler -{ - public: - SearchStoreHandler(); - - A_DELETE_COPY(SearchStoreHandler) - - ~SearchStoreHandler(); - - void search(const StoreSearchTypeT type, - const int minPrice, - const int maxPrice, - const int itemId) const override final; - - void nextPage() const override final; - - void close() const override final; - - void select(const int accountId, - const int storeId, - const int itemId) const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_SEARCHSTOREHANDLER_H diff --git a/src/net/eathena/searchstorerecv.cpp b/src/net/eathena/searchstorerecv.cpp deleted file mode 100644 index 9f8904f7c..000000000 --- a/src/net/eathena/searchstorerecv.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/searchstorerecv.h" - -#include "logger.h" -#include "notifymanager.h" - -#include "const/resources/item/cards.h" - -#include "enums/resources/notifytypes.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace EAthena -{ - -void SearchStoreRecv::processSearchAck(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - const int count = (msg.readInt16("len") - 7) / 106; - msg.readUInt8("is first page"); - msg.readUInt8("is next page"); - msg.readUInt8("remain uses"); - for (int f = 0; f < count; f ++) - { - msg.readInt32("store id"); - msg.readInt32("aoount id"); - msg.readString(80, "store name"); - msg.readInt16("item id"); - msg.readUInt8("item type"); - msg.readInt32("price"); - msg.readInt16("amount"); - msg.readUInt8("refine"); - for (int d = 0; d < maxCards; d++) - msg.readUInt16("card"); - - // +++ need use ItemColorManager for colors - } -} - -void SearchStoreRecv::processSearchFailed(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - const int result = msg.readUInt8("result"); - switch (result) - { - case 0: - NotifyManager::notify( - NotifyTypes::SEARCH_STORE_FAILED_NO_STORES); - break; - case 1: - NotifyManager::notify( - NotifyTypes::SEARCH_STORE_FAILED_MANY_RESULTS); - break; - case 2: - NotifyManager::notify( - NotifyTypes::SEARCH_STORE_FAILED_CANT_SEARCH_ANYMORE); - break; - case 3: - NotifyManager::notify( - NotifyTypes::SEARCH_STORE_FAILED_CANT_SEARCH_YET); - break; - case 4: - NotifyManager::notify( - NotifyTypes::SEARCH_STORE_FAILED_NO_INFORMATION); - break; - default: - NotifyManager::notify( - NotifyTypes::SEARCH_STORE_FAILED); - break; - } -} - -void SearchStoreRecv::processSearchOpen(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("effect"); - if (msg.getVersion() >= 20100701) - msg.readUInt8("uses"); -} - -void SearchStoreRecv::processSearchClickAck(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readInt16("x"); - msg.readInt16("y"); -} - -} // namespace EAthena diff --git a/src/net/eathena/searchstorerecv.h b/src/net/eathena/searchstorerecv.h deleted file mode 100644 index 916c26ad2..000000000 --- a/src/net/eathena/searchstorerecv.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_SEARCHSTORERECV_H -#define NET_EATHENA_SEARCHSTORERECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace SearchStoreRecv - { - void processSearchAck(Net::MessageIn &msg); - void processSearchFailed(Net::MessageIn &msg); - void processSearchOpen(Net::MessageIn &msg); - void processSearchClickAck(Net::MessageIn &msg); - } // namespace SearchStoreRecv -} // namespace EAthena - -#endif // NET_EATHENA_SEARCHSTORERECV_H diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp deleted file mode 100644 index ff6133eb1..000000000 --- a/src/net/eathena/serverfeatures.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/serverfeatures.h" - -#include "net/net.h" - -#include "debug.h" - -extern int serverVersion; - -namespace EAthena -{ - -ServerFeatures::ServerFeatures() : - Net::ServerFeatures() -{ - serverFeatures = this; -} - -bool ServerFeatures::haveServerOnlineList() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveServerHp() const -{ - return true; -} - -bool ServerFeatures::havePlayerStatusUpdate() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveIncompleteChatMessages() const -{ - return false; -} - -bool ServerFeatures::haveRaceSelection() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveLookSelection() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveMove3() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveCharOtherGender() const -{ - return true; -} - -bool ServerFeatures::haveMonsterAttackRange() const -{ - return false; -} - -bool ServerFeatures::haveEmailOnRegister() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveEmailOnDelete() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveServerVersion() const -{ - return Net::getNetworkType() == ServerType::EVOL2; -} - -bool ServerFeatures::haveMapServerVersion() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveNpcGender() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveJoinChannel() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveCreateCharGender() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveTalkPet() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveMovePet() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveServerWarpNames() const -{ - return serverVersion == 0; -} - -bool ServerFeatures::haveExtendedRiding() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveExtendedDropsPosition() const -{ - return serverVersion >= 12; -} - -bool ServerFeatures::haveMoveWhileSit() const -{ - return serverVersion > 0; -} - -bool ServerFeatures::haveKillerId() const -{ - return serverVersion >= 14; -} - -} // namespace EAthena diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h deleted file mode 100644 index f60f6e741..000000000 --- a/src/net/eathena/serverfeatures.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_SERVERFEATURES_H -#define NET_EATHENA_SERVERFEATURES_H - -#include "net/serverfeatures.h" - -#include "localconsts.h" - -namespace EAthena -{ -class ServerFeatures final : public Net::ServerFeatures -{ - public: - ServerFeatures(); - - A_DELETE_COPY(ServerFeatures) - - bool haveServerOnlineList() const override final; - - bool haveServerHp() const override final A_CONST; - - bool havePlayerStatusUpdate() const override final; - - bool haveIncompleteChatMessages() const override final A_CONST; - - bool haveRaceSelection() const override final; - - bool haveLookSelection() const override final; - - bool haveMove3() const override final; - - bool haveCharOtherGender() const override final; - - bool haveMonsterAttackRange() const override final A_CONST; - - bool haveEmailOnRegister() const override final; - - bool haveEmailOnDelete() const override final; - - bool haveServerVersion() const override final; - - bool haveMapServerVersion() const override final; - - bool haveNpcGender() const override final; - - bool haveJoinChannel() const override final; - - bool haveCreateCharGender() const override final; - - bool haveTalkPet() const override final; - - bool haveMovePet() const override final; - - bool haveServerWarpNames() const override final; - - bool haveExtendedRiding() const override final; - - bool haveExtendedDropsPosition() const override final; - - bool haveMoveWhileSit() const override final; - - bool haveKillerId() const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_SERVERFEATURES_H diff --git a/src/net/eathena/skillhandler.cpp b/src/net/eathena/skillhandler.cpp deleted file mode 100644 index ec8176eef..000000000 --- a/src/net/eathena/skillhandler.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/skillhandler.h" - -#include "net/eathena/menu.h" -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -extern int packetVersion; - -namespace EAthena -{ - -SkillHandler::SkillHandler() : - Ea::SkillHandler() -{ - skillHandler = this; -} - -SkillHandler::~SkillHandler() -{ - skillHandler = nullptr; -} - -void SkillHandler::useBeing(const int id, const int level, - const BeingId beingId) const -{ - createOutPacket(CMSG_SKILL_USE_BEING); - outMsg.writeInt16(CAST_S16(level), "skill level"); - outMsg.writeInt16(CAST_S16(id), "skill id"); - outMsg.writeInt32(toInt(beingId, int), "target id"); -} - -void SkillHandler::usePos(const int id, const int level, - const int x, const int y) const -{ - createOutPacket(CMSG_SKILL_USE_POSITION); - if (packetVersion >= 20080827 && packetVersion < 20101124) - { - outMsg.writeInt32(0, "unused"); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt16(CAST_S16(level), "skill level"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt16(CAST_S16(id), "skill id"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt16(CAST_S16(x), "x"); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt16(CAST_S16(y), "y"); - } - else - { - outMsg.writeInt16(CAST_S16(level), "skill level"); - outMsg.writeInt16(CAST_S16(id), "skill id"); - outMsg.writeInt16(CAST_S16(x), "x"); - outMsg.writeInt16(CAST_S16(y), "y"); - } -} - -void SkillHandler::usePos(const int id, const int level, - const int x, const int y, - const std::string &text) const -{ - createOutPacket(CMSG_SKILL_USE_POSITION_MORE); - outMsg.writeInt16(CAST_S16(level), "level"); - outMsg.writeInt16(CAST_S16(id), "id"); - outMsg.writeInt16(CAST_S16(x), "x"); - outMsg.writeInt16(CAST_S16(y), "y"); - outMsg.writeString(text, 80, "text"); -} - -void SkillHandler::useMap(const int id, const std::string &map) const -{ - createOutPacket(CMSG_SKILL_USE_MAP); - outMsg.writeInt16(CAST_S16(id), "skill id"); - outMsg.writeString(map, 16, "map name"); -} - -void SkillHandler::getAlchemistRanks() const -{ - if (packetVersion >= 20041108) - { - createOutPacket(CMSG_ALCHEMIST_RANKS); - } -} - -void SkillHandler::getBlacksmithRanks() const -{ - if (packetVersion >= 20041108) - { - createOutPacket(CMSG_BLACKSMITH_RANKS); - } -} - -void SkillHandler::getPkRanks() const -{ - if (packetVersion >= 20050530) - { - createOutPacket(CMSG_PK_RANKS); - } -} - -void SkillHandler::getTaekwonRanks() const -{ - if (packetVersion >= 20050328) - { - createOutPacket(CMSG_TAEKWON_RANKS); - } -} - -void SkillHandler::feelSaveOk(const int which) const -{ - if (packetVersion >= 20050817) - { - createOutPacket(CMSG_SKILL_FEEL_SAVE_OK); - outMsg.writeInt8(CAST_S8(which), "which"); - menu = MenuType::Unknown; - } -} - -void SkillHandler::lessEffects(const bool isLess) const -{ - if (packetVersion >= 20041115) - { - createOutPacket(CMSG_PLAYER_LESS_EFFECTS); - outMsg.writeInt32(isLess ? 1 : 0, "state"); - } -} - -} // namespace EAthena diff --git a/src/net/eathena/skillhandler.h b/src/net/eathena/skillhandler.h deleted file mode 100644 index d615dac77..000000000 --- a/src/net/eathena/skillhandler.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_SKILLHANDLER_H -#define NET_EATHENA_SKILLHANDLER_H - -#include "net/ea/skillhandler.h" - -namespace EAthena -{ - -class SkillHandler final : public Ea::SkillHandler -{ - public: - SkillHandler(); - - A_DELETE_COPY(SkillHandler) - - ~SkillHandler(); - - void useBeing(const int id, - const int level, - const BeingId beingId) const override final; - - void usePos(const int id, - const int level, - const int x, const int y) const override final; - - void usePos(const int id, - const int level, - const int x, const int y, - const std::string &text) const override final; - - void useMap(const int id, const std::string &map) const override final; - - void getAlchemistRanks() const override final; - - void getBlacksmithRanks() const override final; - - void getPkRanks() const override final; - - void getTaekwonRanks() const override final; - - void feelSaveOk(const int which) const override final; - - void lessEffects(const bool isLess) const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_SKILLHANDLER_H diff --git a/src/net/eathena/skillrecv.cpp b/src/net/eathena/skillrecv.cpp deleted file mode 100644 index e4b71a076..000000000 --- a/src/net/eathena/skillrecv.cpp +++ /dev/null @@ -1,529 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/skillrecv.h" - -#include "notifymanager.h" - -#include "being/localplayer.h" -#include "being/playerinfo.h" - -#include "const/net/skill.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/widgets/createwidget.h" - -#include "gui/windows/skilldialog.h" -#include "gui/windows/textselectdialog.h" - -#include "listeners/skillwarplistener.h" - -#include "net/messagein.h" - -#include "net/eathena/menu.h" - -#include "resources/iteminfo.h" - -#include "resources/db/itemdb.h" - -#include "resources/skill/skillinfo.h" - -#include "utils/gettext.h" -#include "utils/stringutils.h" - -#include "debug.h" - -static const unsigned int RFAIL = 10; -static const unsigned int RFAIL_SUMMON = 19; -static const unsigned int RFAIL_NEED_ITEM = 71; -static const unsigned int RFAIL_NEED_EQUIPMENT = 72; -static const unsigned int RFAIL_SPIRITS = 74; - -extern int serverVersion; - -namespace EAthena -{ - -void SkillRecv::processPlayerSkills(Net::MessageIn &msg) -{ - msg.readInt16("len"); - const int sz = (serverVersion >= 15) ? 41 : 37; - const int skillCount = (msg.getLength() - 4) / sz; - int updateSkill = 0; - - if (skillDialog != nullptr) - skillDialog->hideSkills(SkillOwner::Player); - for (int k = 0; k < skillCount; k++) - { - const int skillId = msg.readInt16("skill id"); - const SkillType::SkillType inf = static_cast<SkillType::SkillType>( - msg.readInt32("inf")); - if (serverVersion >= 15) - msg.readInt32("inf2"); - const int level = msg.readInt16("skill level"); - const int sp = msg.readInt16("sp"); - const int range = msg.readInt16("range"); - const std::string name = msg.readString(24, "skill name"); - const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); - const int oldLevel = PlayerInfo::getSkillLevel(skillId); - if ((oldLevel != 0) && oldLevel != level) - updateSkill = skillId; - PlayerInfo::setSkillLevel(skillId, level); - if (skillDialog != nullptr) - { - if (!skillDialog->updateSkill(skillId, range, up, inf, sp)) - { - skillDialog->addSkill(SkillOwner::Player, - skillId, name, level, range, up, inf, sp); - } - } - } - if (skillDialog != nullptr) - { - skillDialog->update(); - if (updateSkill != 0) - skillDialog->playUpdateEffect(updateSkill); - } -} - -void SkillRecv::processSkillAdd(Net::MessageIn &msg) -{ - int updateSkill = 0; - const int skillId = msg.readInt16("skill id"); - const SkillType::SkillType inf = static_cast<SkillType::SkillType>( - msg.readInt32("inf")); - const int level = msg.readInt16("skill level"); - const int sp = msg.readInt16("sp"); - const int range = msg.readInt16("range"); - const std::string name = msg.readString(24, "skill name"); - const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); - const int oldLevel = PlayerInfo::getSkillLevel(skillId); - if ((oldLevel != 0) && oldLevel != level) - updateSkill = skillId; - PlayerInfo::setSkillLevel(skillId, level); - if (skillDialog != nullptr) - { - if (!skillDialog->updateSkill(skillId, range, up, inf, sp)) - { - skillDialog->addSkill(SkillOwner::Player, - skillId, name, level, range, up, inf, sp); - } - skillDialog->update(); - if (updateSkill != 0) - skillDialog->playUpdateEffect(updateSkill); - } -} - -void SkillRecv::processSkillAdd2(Net::MessageIn &msg) -{ - int updateSkill = 0; - msg.readInt16("len"); // for now unused - const int skillId = msg.readInt16("skill id"); - const SkillType::SkillType inf = static_cast<SkillType::SkillType>( - msg.readInt32("inf")); - msg.readInt32("inf2"); - const int level = msg.readInt16("skill level"); - const int sp = msg.readInt16("sp"); - const int range = msg.readInt16("range"); - const std::string name = msg.readString(24, "skill name"); - const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); - const int oldLevel = PlayerInfo::getSkillLevel(skillId); - if ((oldLevel != 0) && oldLevel != level) - updateSkill = skillId; - PlayerInfo::setSkillLevel(skillId, level); - if (skillDialog != nullptr) - { - if (!skillDialog->updateSkill(skillId, range, up, inf, sp)) - { - skillDialog->addSkill(SkillOwner::Player, - skillId, name, level, range, up, inf, sp); - } - skillDialog->update(); - if (updateSkill != 0) - skillDialog->playUpdateEffect(updateSkill); - } -} - -void SkillRecv::processSkillUpdate(Net::MessageIn &msg) -{ - int updateSkill = 0; - const int skillId = msg.readInt16("skill id"); - const SkillType::SkillType inf = static_cast<SkillType::SkillType>( - msg.readInt32("inf")); - const int level = msg.readInt16("skill level"); - const int sp = msg.readInt16("sp"); - const int range = msg.readInt16("range"); - const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); - const int oldLevel = PlayerInfo::getSkillLevel(skillId); - if ((oldLevel != 0) && oldLevel != level) - updateSkill = skillId; - PlayerInfo::setSkillLevel(skillId, level); - if (skillDialog != nullptr) - { - if (!skillDialog->updateSkill(skillId, range, up, inf, sp)) - { - skillDialog->addSkill(SkillOwner::Player, - skillId, "", level, range, up, inf, sp); - } - skillDialog->update(); - if (updateSkill != 0) - skillDialog->playUpdateEffect(updateSkill); - } -} - -void SkillRecv::processSkillUpdate2(Net::MessageIn &msg) -{ - int updateSkill = 0; - msg.readInt16("len"); // for now unused - const int skillId = msg.readInt16("skill id"); - const SkillType::SkillType inf = static_cast<SkillType::SkillType>( - msg.readInt32("inf")); - msg.readInt32("inf2"); - const int level = msg.readInt16("skill level"); - const int sp = msg.readInt16("sp"); - const int range = msg.readInt16("range"); - const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); - const int oldLevel = PlayerInfo::getSkillLevel(skillId); - if ((oldLevel != 0) && oldLevel != level) - updateSkill = skillId; - PlayerInfo::setSkillLevel(skillId, level); - if (skillDialog != nullptr) - { - if (!skillDialog->updateSkill(skillId, range, up, inf, sp)) - { - skillDialog->addSkill(SkillOwner::Player, - skillId, "", level, range, up, inf, sp); - } - skillDialog->update(); - if (updateSkill != 0) - skillDialog->playUpdateEffect(updateSkill); - } -} - -void SkillRecv::processSkillDelete(Net::MessageIn &msg) -{ - int updateSkill = 0; - const int skillId = msg.readInt16("skill id"); - const int oldLevel = PlayerInfo::getSkillLevel(skillId); - if (oldLevel != 0) - updateSkill = skillId; - PlayerInfo::setSkillLevel(skillId, 0); - if (skillDialog != nullptr) - { - skillDialog->removeSkill(skillId); - skillDialog->update(); - if (updateSkill != 0) - skillDialog->playRemoveEffect(updateSkill); - } -} - -void SkillRecv::processSkillCoolDown(Net::MessageIn &msg) -{ - const int skillId = msg.readInt16("skill id"); - const int duration = msg.readInt32("duration"); - if (skillDialog != nullptr) - skillDialog->setSkillDuration(SkillOwner::Player, skillId, duration); -} - -void SkillRecv::processSkillCoolDownList(Net::MessageIn &msg) -{ - int packetLen; - if (msg.getVersion() >= 20120604) - packetLen = 10; - else - packetLen = 6; - const int count = (msg.readInt16("len") - 4) / packetLen; - for (int f = 0; f < count; f ++) - { - const int skillId = msg.readInt16("skill id"); - if (msg.getVersion() >= 20120604) - msg.readInt32("total"); - const int duration = msg.readInt32("duration"); - if (skillDialog != nullptr) - { - skillDialog->setSkillDuration(SkillOwner::Player, - skillId, duration); - } - } -} - -void SkillRecv::processSkillFailed(Net::MessageIn &msg) -{ - // Action failed (ex. sit because you have not reached the - // right level) - const int skillId = msg.readInt16("skill id"); - const int bskill = msg.readInt32("btype"); - const signed char success = msg.readUInt8("success"); - const signed char reason = msg.readUInt8("reason"); - if (success != CAST_S32(SKILL_FAILED) - && bskill == CAST_S32(BSKILL_EMOTE)) - { - logger->log("Action: %d/%d", bskill, success); - } - - if (localPlayer != nullptr) - localPlayer->stopCast(true); - std::string txt; - if (success == CAST_S32(SKILL_FAILED) && bskill != 0) - { - if ((localPlayer != nullptr) && bskill == CAST_S32(BSKILL_EMOTE) - && reason == CAST_S32(RFAIL_SKILLDEP)) - { - localPlayer->stopAdvert(); - } - - const SkillInfo *const info = skillDialog->getSkill(bskill); - if (info != nullptr) - { - txt = info->errorText; - } - else - { - // TRANSLATORS: skill error message - txt = strprintf(_("Unknown skill error: %d"), bskill); - } - } - else - { - const SkillInfo *const info = skillDialog->getSkill(skillId); - if (info != nullptr) - { - txt = info->errorText + "."; - } - else - { - // TRANSLATORS: skill error message - txt = strprintf(_("Unknown skill error: %d."), skillId); - } - } - - txt.append(" "); - switch (reason) - { - case RFAIL_SKILLDEP: - // TRANSLATORS: error message - txt.append(_("You have not yet reached a high enough lvl!")); - break; - case RFAIL_INSUFHP: - // TRANSLATORS: error message - txt.append(_("Insufficient HP!")); - break; - case RFAIL_INSUFSP: - // TRANSLATORS: error message - txt.append(_("Insufficient SP!")); - break; - case RFAIL_NOMEMO: - // TRANSLATORS: error message - txt.append(_("You have no memos!")); - break; - case RFAIL_SKILLDELAY: - // TRANSLATORS: error message - txt.append(_("You cannot do that right now!")); - break; - case RFAIL_ZENY: - // TRANSLATORS: error message - txt.append(_("Seems you need more money... ;-)")); - break; - case RFAIL_WEAPON: - // TRANSLATORS: error message - txt.append(_("You cannot use this skill with that " - "kind of weapon!")); - break; - case RFAIL_REDGEM: - // TRANSLATORS: error message - txt.append(_("You need another red gem!")); - break; - case RFAIL_BLUEGEM: - // TRANSLATORS: error message - txt.append(_("You need another blue gem!")); - break; - case RFAIL_OVERWEIGHT: - // TRANSLATORS: error message - txt.append(_("You're carrying to much to do this!")); - break; - case RFAIL_SUMMON: - // TRANSLATORS: error message - txt.append(_("Fail summon.")); - break; - case RFAIL_SPIRITS: - // TRANSLATORS: error message - txt.append(_("Need spirits.")); - break; - case RFAIL_NEED_EQUIPMENT: - { - const int itemId = bskill >> 16U; - const int amount = bskill & 0xFFFFU; - const ItemInfo &info = ItemDB::get(itemId); - if (amount == 1) - { - // TRANSLATORS: skill error message - txt.append(strprintf(_("Need equipment %s."), - info.getLink().c_str())); - } - else - { - // TRANSLATORS: skill error message - txt.append(strprintf(_("Need equipment %s and amount %d"), - info.getLink().c_str(), - amount)); - } - break; - } - case RFAIL_NEED_ITEM: - { - const int itemId = bskill >> 16U; - const int amount = bskill & 0xFFFFU; - const ItemInfo &info = ItemDB::get(itemId); - if (amount == 1) - { - // TRANSLATORS: skill error message - txt.append(strprintf(_("Need item %s."), - info.getLink().c_str())); - } - else - { - // TRANSLATORS: skill error message - txt.append(strprintf(_("Need item %s and amount %d"), - info.getLink().c_str(), - amount)); - } - break; - } - case RFAIL: - { - // TRANSLATORS: error message - txt.append(_("Skill failed!")); - break; - } - - default: - UNIMPLEMENTEDPACKETFIELD(reason); - break; - } - - NotifyManager::notify(NotifyTypes::SKILL_FAIL_MESSAGE, txt); -} - -void SkillRecv::processSkillWarpPoint(Net::MessageIn &msg) -{ - const int skillId = msg.readInt16("skill id"); - - TextSelectDialog *const dialog = CREATEWIDGETR(TextSelectDialog, - // TRANSLATORS: warp select window name - _("Select warp target"), - // TRANSLATORS: warp select button - _("Warp"), - AllowQuit_false); - skillWarpListener.setDialog(dialog); - skillWarpListener.setSkill(skillId); - dialog->addActionListener(&skillWarpListener); - for (int f = 0; f < 4; f ++) - dialog->addText(msg.readString(16, "map name")); -} - -void SkillRecv::processSkillMemoMessage(Net::MessageIn &msg) -{ - const int type = msg.readUInt8("type"); - switch (type) - { - case 0: - NotifyManager::notify(NotifyTypes::SKILL_MEMO_SAVED); - break; - case 1: - NotifyManager::notify(NotifyTypes::SKILL_MEMO_ERROR_LEVEL); - break; - case 2: - NotifyManager::notify(NotifyTypes::SKILL_MEMO_ERROR_SKILL); - break; - default: - UNIMPLEMENTEDPACKETFIELD(type); - break; - } -} - -void SkillRecv::processSkillProduceMixList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - const int count = (msg.readInt16("len") - 8) / 8; - for (int f = 0; f < count; f ++) - { - msg.readInt16("item id"); - for (int d = 0; d < 3; d ++) - msg.readInt16("material id"); - } -} - -void SkillRecv::processSkillProduceEffect(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readInt16("flag"); - msg.readInt16("item id"); -} - -void SkillRecv::processSkillUnitUpdate(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readBeingId("being id"); -} - -void SkillRecv::processSkillArrowCreateList(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - const int count = (msg.readInt16("len") - 4) / 2; - for (int f = 0; f < count; f ++) - msg.readInt16("item id"); -} - -void SkillRecv::processSkillAutoSpells(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - for (int f = 0; f < 7; f ++) - msg.readInt32("skill id"); - - menu = MenuType::AutoSpell; -} - -void SkillRecv::processSkillDevotionEffect(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readBeingId("being id"); - for (int f = 0; f < 5; f ++) - msg.readInt32("devotee id"); - msg.readInt16("range"); -} - -void SkillRecv::processSkillItemListWindow(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - - msg.readInt32("skill level"); - msg.readInt32("unused"); -} - -} // namespace EAthena diff --git a/src/net/eathena/skillrecv.h b/src/net/eathena/skillrecv.h deleted file mode 100644 index 5facd510d..000000000 --- a/src/net/eathena/skillrecv.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_SKILLRECV_H -#define NET_EATHENA_SKILLRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace SkillRecv - { - void processSkillFailed(Net::MessageIn &msg); - void processPlayerSkills(Net::MessageIn &msg); - void processSkillCoolDown(Net::MessageIn &msg); - void processSkillCoolDownList(Net::MessageIn &msg); - void processSkillAdd(Net::MessageIn &msg); - void processSkillAdd2(Net::MessageIn &msg); - void processSkillUpdate(Net::MessageIn &msg); - void processSkillUpdate2(Net::MessageIn &msg); - void processSkillDelete(Net::MessageIn &msg); - void processSkillWarpPoint(Net::MessageIn &msg); - void processSkillMemoMessage(Net::MessageIn &msg); - void processSkillProduceMixList(Net::MessageIn &msg); - void processSkillProduceEffect(Net::MessageIn &msg); - void processSkillUnitUpdate(Net::MessageIn &msg); - void processSkillArrowCreateList(Net::MessageIn &msg); - void processSkillAutoSpells(Net::MessageIn &msg); - void processSkillDevotionEffect(Net::MessageIn &msg); - void processSkillItemListWindow(Net::MessageIn &msg); - } // namespace SkillRecv -} // namespace EAthena - -#endif // NET_EATHENA_SKILLRECV_H diff --git a/src/net/eathena/sp.h b/src/net/eathena/sp.h deleted file mode 100644 index 1d983e0ea..000000000 --- a/src/net/eathena/sp.h +++ /dev/null @@ -1,271 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_SP_H -#define NET_EATHENA_SP_H - -namespace Sp -{ - enum - { - SPEED = 0, - BASEEXP = 1, - JOBEXP = 2, - KARMA = 3, - MANNER = 4, - HP = 5, - MAXHP = 6, - SP = 7, - MAXSP = 8, - STATUSPOINT = 9, - VAL10 = 10, - BASELEVEL = 11, - SKILLPOINT = 12, - STR = 13, - AGI = 14, - VIT = 15, - INT = 16, - DEX = 17, - LUK = 18, - CLASS = 19, - ZENY = 20, - SEX = 21, - NEXTBASEEXP = 22, - NEXTJOBEXP = 23, - WEIGHT = 24, - MAXWEIGHT = 25, - VAL26 = 26, - VAL27 = 27, - VAL28 = 28, - VAL29 = 29, - VAL30 = 30, - VAL31 = 31, - USTR = 32, - UAGI = 33, - UVIT = 34, - UINT = 35, - UDEX = 36, - ULUK = 37, - VAL38 = 38, - VAL39 = 39, - VAL40 = 40, - ATK1 = 41, - ATK2 = 42, - MATK1 = 43, - MATK2 = 44, - DEF1 = 45, - DEF2 = 46, - MDEF1 = 47, - MDEF2 = 48, - HIT = 49, - FLEE1 = 50, - FLEE2 = 51, - CRITICAL = 52, - ASPD = 53, - VAL54 = 54, - JOBLEVEL = 55, - UPPER = 56, - PARTNER = 57, - CART = 58, - FAME = 59, - UNBREAKABLE = 60, - - CARTINFO = 99, - - BASEJOB = 119, - BASECLASS = 120, - KILLERRID = 121, - KILLEDRID = 122, - SLOTCHANGE = 123, - CHARRENAME = 124, - MOD_EXP = 125, - MOD_DROP = 126, - MOD_DEATH = 127, - - MERCFLEE = 165, - - MERCKILLS = 189, - MERCFAITH = 190, - - ATTACKRANGE = 1000, - ATKELE = 1001, - DEFELE = 1002, - CASTRATE = 1003, - MAXHPRATE = 1004, - MAXSPRATE = 1005, - SPRATE = 1006, - - ADDELE = 1007, - ADDRACE = 1008, - ADDSIZE = 1009, - SUBELE = 1010, - SUBRACE = 1011, - ADDEFF = 1012, - RESEFF = 1013, - BASE_ATK = 1014, - ASPD_RATE = 1015, - HP_RECOV_RATE = 1016, - RECOV_RATE = 1017, - SPEED_RATE = 1018, - CRITICAL_DEF = 1019, - NEAR_ATK_DEF = 1020, - LONG_ATK_DEF = 1021, - DOUBLE_RATE = 1022, - DOUBLE_ADD_RATE = 1023, - SKILL_HEAL = 1024, - MATK_RATE = 1025, - IGNORE_DEF_ELE = 1026, - IGNORE_DEF_RACE = 1027, - ATK_RATE = 1028, - SPEED_ADDRATE = 1029, - REGEN_RATE = 1030, - MAGIC_ATK_DEF = 1031, - MISC_ATK_DEF = 1032, - IGNORE_MDEF_ELE = 1033, - IGNORE_MDEF_RACE = 1034, - MAGIC_ADDELE = 1035, - MAGIC_ADDRACE = 1036, - MAGIC_ADDSIZE = 1037, - PERFECT_HIT_RATE = 1038, - PERFECT_HIT_ADD_RATE = 1039, - CRITICAL_RATE = 1040, - GET_ZENY_NUM = 1041, - ADD_GET_ZENY_NUM = 1042, - ADD_DAMAGE_CLASS = 1043, - ADD_MAGIC_DAMAGE_CLASS = 1044, - ADD_DEF_CLASS = 1045, - ADD_MDEF_CLASS = 1046, - ADD_MONSTER_DROP_ITEM = 1047, - DEF_RATIO_ATK_ELE = 1048, - DEF_RATIO_ATK_RACE = 1049, - UNBREAKABLE_GARMENT = 1050, - HIT_RATE = 1051, - FLEE_RATE = 1052, - FLEE2_RATE = 1053, - DEF_RATE = 1054, - DEF2_RATE = 1055, - MDEF_RATE = 1056, - MDEF2_RATE = 1057, - SPLASH_RANGE = 1058, - SPLASH_ADD_RANGE = 1059, - AUTOSPELL = 1060, - HP_DRAIN_RATE = 1061, - DRAIN_RATE = 1062, - SHORT_WEAPON_DAMAGE_RETURN = 1063, - LONG_WEAPON_DAMAGE_RETURN = 1064, - WEAPON_COMA_ELE = 1065, - WEAPON_COMA_RACE = 1066, - ADDEFF2 = 1067, - BREAK_WEAPON_RATE = 1068, - BREAK_ARMOR_RATE = 1069, - ADD_STEAL_RATE = 1070, - MAGIC_DAMAGE_RETURN = 1071, - - ALL_STATS = 1073, - AGI_VIT = 1074, - AGI_DEX_STR = 1075, - PERFECT_HIDE = 1076, - NO_KNOCKBACK = 1077, - CLASSCHANGE = 1078, - HP_DRAIN_VALUE = 1079, - DRAIN_VALUE = 1080, - WEAPON_ATK = 1081, - WEAPON_ATK_RATE = 1082, - DELAYRATE = 1083, - HP_DRAIN_RATE_RACE = 1084, - DRAIN_RATE_RACE = 1085, - IGNORE_MDEF_RATE = 1086, - IGNORE_DEF_RATE = 1087, - SKILL_HEAL2 = 1088, - ADDEFF_ONSKILL = 1089, - ADD_HEAL_RATE = 1090, - ADD_HEAL2_RATE = 1091, - HP_VANISH_RATE = 1092, - - RESTART_FULL_RECOVER = 2000, - NO_CASTCANCEL = 2001, - NO_SIZEFIX = 2002, - NO_MAGIC_DAMAGE = 2003, - NO_WEAPON_DAMAGE = 2004, - NO_GEMSTONE = 2005, - NO_CASTCANCEL2 = 2006, - NO_MISC_DAMAGE = 2007, - UNBREAKABLE_WEAPON = 2008, - UNBREAKABLE_ARMOR = 2009, - UNBREAKABLE_HELM = 2010, - UNBREAKABLE_SHIELD = 2011, - LONG_ATK_RATE = 2012, - - CRIT_ATK_RATE = 2013, - CRITICAL_ADDRACE = 2014, - NO_REGEN = 2015, - ADDEFF_WHENHIT = 2016, - AUTOSPELL_WHENHIT = 2017, - SKILL_ATK = 2018, - UNSTRIPABLE = 2019, - AUTOSPELL_ONSKILL = 2020, - GAIN_VALUE = 2021, - HP_REGEN_RATE = 2022, - HP_LOSS_RATE = 2023, - ADDRACE2 = 2024, - HP_GAIN_VALUE = 2025, - SUBSIZE = 2026, - HP_DRAIN_VALUE_RACE = 2027, - ADD_ITEM_HEAL_RATE = 2028, - DRAIN_VALUE_RACE = 2029, - EXP_ADDRACE = 2030, - GAIN_RACE = 2031, - SUBRACE2 = 2032, - UNBREAKABLE_SHOES = 2033, - UNSTRIPABLE_WEAPON = 2034, - UNSTRIPABLE_ARMOR = 2035, - UNSTRIPABLE_HELM = 2036, - UNSTRIPABLE_SHIELD = 2037, - INTRAVISION = 2038, - ADD_MONSTER_DROP_CHAINITEM = 2039, - LOSS_RATE = 2040, - ADD_SKILL_BLOW = 2041, - VANISH_RATE = 2042, - MAGIC_GAIN_VALUE = 2043, - MAGIC_HP_GAIN_VALUE = 2044, - ADD_CLASS_DROP_ITEM = 2045, - EMATK = 2046, - GAIN_RACE_ATTACK = 2047, - HP_GAIN_RACE_ATTACK = 2048, - SKILL_USE_RATE = 2049, - SKILL_COOLDOWN = 2050, - SKILL_FIXEDCAST = 2051, - SKILL_VARIABLECAST = 2052, - FIXCASTRATE = 2053, - VARCASTRATE = 2054, - SKILL_USE_SP = 2055, - MAGIC_ATK_ELE = 2056, - ADD_FIXEDCAST = 2057, - ADD_VARIABLECAST = 2058, - SET_DEF_RACE = 2059, - SET_MDEF_RACE = 2060, - RACE_TOLERANCE = 2061, - ADDMAXWEIGHT = 2062 - }; -} // namespace Sp - -#endif // NET_EATHENA_SP_H diff --git a/src/net/eathena/sprite.h b/src/net/eathena/sprite.h deleted file mode 100644 index ff259251b..000000000 --- a/src/net/eathena/sprite.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_SPRITE_H -#define NET_EATHENA_SPRITE_H - -enum -{ - SPRITE_BASE = 0, - SPRITE_HAIR = 1, - SPRITE_WEAPON = 2, - SPRITE_HEAD_BOTTOM = 3, - SPRITE_HEAD_TOP = 4, - SPRITE_HEAD_MID = 5, - SPRITE_HAIR_COLOR = 6, - SPRITE_CLOTHES_COLOR = 7, - SPRITE_SHIELD = 8, - SPRITE_SHOES = 9, - SPRITE_BODY = 10, - SPRITE_FLOOR = 11, - SPRITE_ROBE = 12, - SPRITE_EVOL2 = 13, // in new versions also BODY2 - SPRITE_EVOL3 = 14, - SPRITE_EVOL4 = 15, - SPRITE_EVOL5 = 16, - SPRITE_EVOL6 = 17, - SPRITE_VECTOREND -}; - -#endif // NET_EATHENA_SPRITE_H diff --git a/src/net/eathena/tradehandler.cpp b/src/net/eathena/tradehandler.cpp deleted file mode 100644 index 5c6877f5e..000000000 --- a/src/net/eathena/tradehandler.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/tradehandler.h" - -#include "being/playerinfo.h" - -#include "const/net/inventory.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" -#include "net/eathena/traderecv.h" - -#include "resources/item/item.h" - -#include "debug.h" - -namespace EAthena -{ - -TradeHandler::TradeHandler() : - Ea::TradeHandler() -{ - tradeHandler = this; - TradeRecv::mItemIndex = -1; - TradeRecv::mQuantity = 0; -} - -TradeHandler::~TradeHandler() -{ - tradeHandler = nullptr; -} - -void TradeHandler::request(const Being *const being) const -{ - if (being == nullptr) - return; - - createOutPacket(CMSG_TRADE_REQUEST); - outMsg.writeBeingId(being->getId(), "player id"); -} - -void TradeHandler::respond(const bool accept) const -{ - if (!accept) - PlayerInfo::setTrading(Trading_false); - - createOutPacket(CMSG_TRADE_RESPONSE); - outMsg.writeInt8(CAST_S8(accept ? 3 : 4), "accept"); -} - -void TradeHandler::addItem(const Item *const item, const int amount) const -{ - if (item == nullptr) - return; - - TradeRecv::mItemIndex = item->getInvIndex(); - TradeRecv::mQuantity = amount; - createOutPacket(CMSG_TRADE_ITEM_ADD_REQUEST); - outMsg.writeInt16(CAST_S16( - TradeRecv::mItemIndex + INVENTORY_OFFSET), - "index"); - outMsg.writeInt32(amount, "amount"); -} - -void TradeHandler::setMoney(const int amount) const -{ - createOutPacket(CMSG_TRADE_ITEM_ADD_REQUEST); - outMsg.writeInt16(0, "index"); - outMsg.writeInt32(amount, "amount"); -} - -void TradeHandler::confirm() const -{ - createOutPacket(CMSG_TRADE_ADD_COMPLETE); -} - -void TradeHandler::finish() const -{ - createOutPacket(CMSG_TRADE_OK); -} - -void TradeHandler::cancel() const -{ - createOutPacket(CMSG_TRADE_CANCEL_REQUEST); -} - -} // namespace EAthena diff --git a/src/net/eathena/tradehandler.h b/src/net/eathena/tradehandler.h deleted file mode 100644 index 0bf5b2eb2..000000000 --- a/src/net/eathena/tradehandler.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_TRADEHANDLER_H -#define NET_EATHENA_TRADEHANDLER_H - -#include "net/ea/tradehandler.h" - -namespace EAthena -{ - -class TradeHandler final : public Ea::TradeHandler -{ - public: - TradeHandler(); - - A_DELETE_COPY(TradeHandler) - - ~TradeHandler(); - - void request(const Being *const being) const override final; - - void respond(const bool accept) const override final; - - void addItem(const Item *const item, - const int amount) const override final; - - void setMoney(const int amount) const override final; - - void confirm() const override final; - - void finish() const override final; - - void cancel() const override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_TRADEHANDLER_H diff --git a/src/net/eathena/traderecv.cpp b/src/net/eathena/traderecv.cpp deleted file mode 100644 index ac64d4fb0..000000000 --- a/src/net/eathena/traderecv.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/traderecv.h" - -#include "itemcolormanager.h" -#include "notifymanager.h" - -#include "being/playerinfo.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/tradewindow.h" - -#include "net/messagein.h" - -#include "net/ea/traderecv.h" - -#include "resources/inventory/inventory.h" - -#include "resources/item/item.h" -#include "resources/item/itemoptionslist.h" - -#include "debug.h" - -extern int serverVersion; - -namespace EAthena -{ - -namespace TradeRecv -{ - int mQuantity = 0; - int mItemIndex = -1; -} // namespace TradeRecv - -void TradeRecv::processTradeRequest(Net::MessageIn &msg) -{ - const std::string &partner = msg.readString(24, "name"); - if (msg.getVersion() >= 6) - { - msg.readInt32("char id"); - msg.readInt16("base level"); - } - Ea::TradeRecv::processTradeRequestContinue(partner); -} - -void TradeRecv::processTradeResponse(Net::MessageIn &msg) -{ - const uint8_t type = msg.readUInt8("type"); - msg.readInt32("char id"); - msg.readInt16("base level"); - Ea::TradeRecv::processTradeResponseContinue(type); -} - -void TradeRecv::processTradeItemAdd(Net::MessageIn &msg) -{ - const int type = msg.readInt16("type"); - ItemTypeT itemType = ItemType::Unknown; - if (msg.getVersion() >= 20100223) - { - itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - } - const int amount = msg.readInt32("amount"); - const uint8_t identify = msg.readUInt8("identify"); - const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); - const uint8_t refine = msg.readUInt8("refine"); - int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - ItemOptionsList *options = nullptr; - if (msg.getVersion() >= 20150226) - { - options = new ItemOptionsList; - for (int f = 0; f < 5; f ++) - { - const uint16_t idx = msg.readInt16("option index"); - const uint16_t val = msg.readInt16("option value"); - msg.readUInt8("option param"); - options->add(idx, val); - } - } - - if (tradeWindow != nullptr) - { - if (type == 0) - { - tradeWindow->setMoney(amount); - } - else - { - tradeWindow->addItem2(type, - itemType, - cards, - options, - 4, - false, - amount, - refine, - ItemColorManager::getColorFromCards(&cards[0]), - fromBool(identify, Identified), - damaged, - Favorite_false, - Equipm_false); - } - } - delete options; -} - -void TradeRecv::processTradeItemAddResponse(Net::MessageIn &msg) -{ - msg.readInt16("index"); - const uint8_t res = msg.readUInt8("fail"); - switch (res) - { - case 0: // Successfully added item - case 9: // silent added item - { - Item *const item = PlayerInfo::getInventory()->getItem( - mItemIndex); - if (item == nullptr) - return; - if (tradeWindow != nullptr) - { - tradeWindow->addItem2(item->getId(), - item->getType(), - item->getCards(), - item->getOptions(), - 4, - true, - mQuantity, - item->getRefine(), - item->getColor(), - item->getIdentified(), - item->getDamaged(), - item->getFavorite(), - item->isEquipment()); - } - item->increaseQuantity(-mQuantity); - mItemIndex = -1; - mQuantity = 0; - break; - } - case 1: - // Add item failed - player overweighted - NotifyManager::notify(NotifyTypes:: - TRADE_ADD_PARTNER_OVER_WEIGHT); - break; - case 2: - NotifyManager::notify(NotifyTypes::TRADE_ADD_ERROR); - break; - default: - NotifyManager::notify(NotifyTypes::TRADE_ADD_ERROR); - UNIMPLEMENTEDPACKETFIELD(res); - break; - } -} - -void TradeRecv::processTradeUndo(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - // +++ here need clear trade window from partner side? -} - -} // namespace EAthena diff --git a/src/net/eathena/traderecv.h b/src/net/eathena/traderecv.h deleted file mode 100644 index 2c06db5ae..000000000 --- a/src/net/eathena/traderecv.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_TRADERECV_H -#define NET_EATHENA_TRADERECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace TradeRecv - { - extern int mQuantity; - extern int mItemIndex; - - void processTradeRequest(Net::MessageIn &msg); - void processTradeResponse(Net::MessageIn &msg); - void processTradeUndo(Net::MessageIn &msg); - void processTradeItemAdd(Net::MessageIn &msg); - void processTradeItemAddResponse(Net::MessageIn &msg); - } // namespace TradeRecv - -} // namespace EAthena - -#endif // NET_EATHENA_TRADERECV_H diff --git a/src/net/eathena/updateprotocol.cpp b/src/net/eathena/updateprotocol.cpp deleted file mode 100644 index ce9148d1e..000000000 --- a/src/net/eathena/updateprotocol.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/updateprotocol.h" - -#include "logger.h" - -#include "net/eathena/network.h" -#include "net/eathena/protocolout.h" - -#include "debug.h" - -extern int packetVersion; -extern int serverVersion; -extern int evolPacketOffset; - -namespace EAthena -{ - -void updateProtocol() -{ - logger->log("packet version: %d", packetVersion); -#define PACKETS_UPDATE -#include "net/protocoloutupdate.h" -#include "net/eathena/packetsout.inc" -#undef packet - Network *const network = Network::mInstance; - if (network != nullptr) - { - network->clearHandlers(); - network->registerHandlers(); - network->registerFakeHandlers(); - } -} - -PACKETSOUT_VOID -PROTOCOLOUTUPDATE_VOID -PROTOCOLOUT_VOID - -} // namespace EAthena diff --git a/src/net/eathena/updateprotocol.h b/src/net/eathena/updateprotocol.h deleted file mode 100644 index 17960d0e6..000000000 --- a/src/net/eathena/updateprotocol.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_UPDATEPROTOCOL_H -#define NET_EATHENA_UPDATEPROTOCOL_H - -namespace EAthena -{ - void updateProtocol(); -} // namespace EAthena - -#endif // NET_EATHENA_UPDATEPROTOCOL_H diff --git a/src/net/eathena/vendinghandler.cpp b/src/net/eathena/vendinghandler.cpp deleted file mode 100644 index 73fa5d12b..000000000 --- a/src/net/eathena/vendinghandler.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/vendinghandler.h" - -#include "being/being.h" -#include "being/playerinfo.h" - -#include "const/net/inventory.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocolout.h" -#include "net/eathena/vendingrecv.h" - -#include "utils/foreach.h" - -#include "resources/item/shopitem.h" - -#include "debug.h" - -namespace EAthena -{ - -VendingHandler::VendingHandler() -{ - vendingHandler = this; - VendingRecv::mBuyDialog = nullptr; -} - -VendingHandler::~VendingHandler() -{ - vendingHandler = nullptr; -} - -void VendingHandler::close() const -{ - createOutPacket(CMSG_VENDING_CLOSE); - PlayerInfo::enableVending(false); -} - -void VendingHandler::open(const Being *const being) const -{ - if (being == nullptr) - return; - - createOutPacket(CMSG_VENDING_LIST_REQ); - outMsg.writeBeingId(being->getId(), "account id"); -} - -void VendingHandler::buy(const Being *const being, - const int index, - const int amount) const -{ - if (being == nullptr) - return; - - createOutPacket(CMSG_VENDING_BUY); - outMsg.writeInt16(12, "len"); - outMsg.writeBeingId(being->getId(), "account id"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - outMsg.writeInt16(CAST_S16(index), "index"); -} - -void VendingHandler::buyItems(const Being *const being, - const STD_VECTOR<ShopItem*> &items) const -{ - int cnt = 0; - const int pairSize = 4; - - FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) - { - ShopItem *const item = *it; - const int usedQuantity = item->getUsedQuantity(); - if (usedQuantity == 0) - continue; - cnt ++; - } - - if (cnt > 100) - return; - - createOutPacket(CMSG_VENDING_BUY); - outMsg.writeInt16(CAST_S16(4 + 4 + pairSize * cnt), "len"); - outMsg.writeBeingId(being->getId(), "account id"); - FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) - { - ShopItem *const item = *it; - const int usedQuantity = item->getUsedQuantity(); - if (usedQuantity == 0) - continue; - item->increaseQuantity(usedQuantity); - item->increaseUsedQuantity(-usedQuantity); - item->update(); - outMsg.writeInt16(CAST_S16(usedQuantity), "amount"); - outMsg.writeInt16(CAST_S16(item->getInvIndex()), "index"); - } -} - -void VendingHandler::buy2(const Being *const being, - const int vendId, - const int index, - const int amount) const -{ - if (being == nullptr) - return; - - createOutPacket(CMSG_VENDING_BUY2); - outMsg.writeInt16(16, "len"); - outMsg.writeBeingId(being->getId(), "account id"); - outMsg.writeInt32(vendId, "vend id"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - outMsg.writeInt16(CAST_S16(index), "index"); -} - -void VendingHandler::createShop(const std::string &name, - const bool flag, - const STD_VECTOR<ShopItem*> &items) const -{ - createOutPacket(CMSG_VENDING_CREATE_SHOP); - outMsg.writeInt16(CAST_S16(85 + items.size() * 8), "len"); - outMsg.writeString(name, 80, "shop name"); - outMsg.writeInt8(CAST_S8(flag ? 1 : 0), "flag"); - FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) - { - const ShopItem *const item = *it; - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); - outMsg.writeInt16(CAST_S16(item->getQuantity()), "amount"); - outMsg.writeInt32(item->getPrice(), "price"); - } -} - -} // namespace EAthena diff --git a/src/net/eathena/vendinghandler.h b/src/net/eathena/vendinghandler.h deleted file mode 100644 index 7929a6d19..000000000 --- a/src/net/eathena/vendinghandler.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_VENDINGHANDLER_H -#define NET_EATHENA_VENDINGHANDLER_H - -#include "net/vendinghandler.h" - -namespace EAthena -{ -class VendingHandler final : public Net::VendingHandler -{ - public: - VendingHandler(); - - A_DELETE_COPY(VendingHandler) - - ~VendingHandler(); - - void close() const override final; - - void open(const Being *const being) const override final; - - void buy(const Being *const being, - const int index, - const int amount) const override final; - - void buy2(const Being *const being, - const int vendId, - const int index, - const int amount) const override final; - - void buyItems(const Being *const being, - const STD_VECTOR<ShopItem*> &items) const - override final; - - void createShop(const std::string &name, - const bool flag, - const STD_VECTOR<ShopItem*> &items) const - override final; -}; - -} // namespace EAthena - -#endif // NET_EATHENA_VENDINGHANDLER_H diff --git a/src/net/eathena/vendingrecv.cpp b/src/net/eathena/vendingrecv.cpp deleted file mode 100644 index d4f14bc87..000000000 --- a/src/net/eathena/vendingrecv.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/eathena/vendingrecv.h" - -#include "actormanager.h" -#include "itemcolormanager.h" -#include "notifymanager.h" - -#include "const/resources/currency.h" - -#include "being/localplayer.h" -#include "being/playerinfo.h" - -#include "const/net/inventory.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/buydialog.h" - -#include "gui/widgets/createwidget.h" - -#include "listeners/vendingmodelistener.h" -#include "listeners/vendingslotslistener.h" - -#include "net/messagein.h" - -#include "resources/iteminfo.h" - -#include "resources/db/unitsdb.h" - -#include "resources/inventory/inventory.h" - -#include "resources/item/itemoptionslist.h" -#include "resources/item/shopitem.h" - -#include "utils/gettext.h" -#include "utils/stringutils.h" - -#include "debug.h" - -extern int packetVersion; -extern int serverVersion; - -namespace EAthena -{ - -namespace VendingRecv -{ - BuyDialog *mBuyDialog = nullptr; -} // namespace VendingRecv - -void VendingRecv::processOpenReq(Net::MessageIn &msg) -{ - VendingSlotsListener::distributeEvent(msg.readInt16("slots allowed")); -} - -void VendingRecv::processShowBoard(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("owner id"); - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing != nullptr) - { - dstBeing->setSellBoard(msg.readString(80, "shop name")); - } - else - { - msg.readString(80, "shop name"); - } -} - -void VendingRecv::processHideBoard(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("owner id"); - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing != nullptr) - dstBeing->setSellBoard(std::string()); - if (dstBeing == localPlayer) - { - PlayerInfo::enableVending(false); - VendingModeListener::distributeEvent(false); - } -} - -void VendingRecv::processItemsList(Net::MessageIn &msg) -{ - int packetLen = 22; - if (msg.getVersion() >= 20160921) - packetLen = 53; - else if (msg.getVersion() >= 20150226) - packetLen = 47; - int offset = 8; - if (msg.getVersion() >= 20100105) - offset += 4; - - const int count = (msg.readInt16("len") - offset) / packetLen; - const BeingId id = msg.readBeingId("id"); - const Being *const being = actorManager->findBeing(id); - if (being == nullptr) - return; - int cards[maxCards]; - CREATEWIDGETV(mBuyDialog, BuyDialog, being, DEFAULT_CURRENCY); - mBuyDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY)); - if (msg.getVersion() >= 20100105) - msg.readInt32("vender id"); - for (int f = 0; f < count; f ++) - { - const int value = msg.readInt32("price"); - const int amount = msg.readInt16("amount"); - const int index = msg.readInt16("inv index"); - const ItemTypeT type = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - const int itemId = msg.readInt16("item id"); - msg.readUInt8("identify"); - msg.readUInt8("attribute"); - msg.readUInt8("refine"); - for (int d = 0; d < maxCards; d ++) - cards[d] = msg.readUInt16("card"); - ItemOptionsList *options = nullptr; - if (msg.getVersion() >= 20150226) - { - options = new ItemOptionsList; - for (int d = 0; d < 5; d ++) - { - const uint16_t idx = msg.readInt16("option index"); - const uint16_t val = msg.readInt16("option value"); - msg.readUInt8("option param"); - options->add(idx, val); - } - } - if (msg.getVersion() >= 20160921) - { - msg.readInt32("equip type?"); - msg.readInt16("look"); - } - - const ItemColor color = ItemColorManager::getColorFromCards(&cards[0]); - ShopItem *const item = mBuyDialog->addItem(itemId, type, - color, amount, value); - if (item != nullptr) - { - item->setInvIndex(index); - item->setOptions(options); - } - delete options; - } - mBuyDialog->sort(); -} - -void VendingRecv::processBuyAck(Net::MessageIn &msg) -{ - msg.readInt16("inv index"); - msg.readInt16("amount"); - const int flag = msg.readUInt8("flag"); - switch (flag) - { - case 0: - break; - case 1: - NotifyManager::notify(NotifyTypes::BUY_FAILED_NO_MONEY); - break; - case 2: - NotifyManager::notify(NotifyTypes::BUY_FAILED_OVERWEIGHT); - break; - case 4: - NotifyManager::notify(NotifyTypes::BUY_FAILED_TOO_MANY_ITEMS); - break; - case 5: - NotifyManager::notify(NotifyTypes::BUY_TRADE_FAILED); - break; - case 6: // +++ probably need show exact error messages? - case 7: - NotifyManager::notify(NotifyTypes::BUY_FAILED); - break; - default: - NotifyManager::notify(NotifyTypes::BUY_FAILED); - UNIMPLEMENTEDPACKETFIELD(flag); - break; - } -} - -void VendingRecv::processOpen(Net::MessageIn &msg) -{ - int packetLen = 22; - if (msg.getVersion() >= 20150226) - packetLen += 25; - - const int count = (msg.readInt16("len") - 8) / packetLen; - msg.readInt32("id"); - for (int f = 0; f < count; f ++) - { - msg.readInt32("price"); - msg.readInt16("inv index"); - msg.readInt16("amount"); - msg.readUInt8("item type"); - msg.readInt16("item id"); - msg.readUInt8("identify"); - msg.readUInt8("attribute"); - msg.readUInt8("refine"); - for (int d = 0; d < maxCards; d ++) - msg.readUInt16("card"); - if (msg.getVersion() >= 20150226) - { - for (int d = 0; d < 5; d ++) - { - msg.readInt16("option index"); - msg.readInt16("option value"); - msg.readUInt8("option param"); - } - } - } - PlayerInfo::enableVending(true); - VendingModeListener::distributeEvent(true); -} - -void VendingRecv::processReport(Net::MessageIn &msg) -{ - const int index = msg.readInt16("inv index") - INVENTORY_OFFSET; - const int amount = msg.readInt16("amount"); - int money = 0; - if (msg.getVersion() >= 20141016) - { - msg.readInt32("char id"); - msg.readInt32("time"); - money = msg.readInt32("zeny"); - } - const Inventory *const inventory = PlayerInfo::getCartInventory(); - if (inventory == nullptr) - return; - const Item *const item = inventory->getItem(index); - if (item == nullptr) - return; - - const ItemInfo &info = item->getInfo(); - std::string str; - if (money != 0) - { - // TRANSLATORS: vending sold item message - str = strprintf(_("Sold item %s amount %d. You got: %s"), - info.getLink().c_str(), - amount, - UnitsDb::formatCurrency(money).c_str()); - } - else - { - // TRANSLATORS: vending sold item message - str = strprintf(_("Sold item %s amount %d"), - info.getLink().c_str(), - amount); - } - NotifyManager::notify(NotifyTypes::VENDING_SOLD_ITEM, str); -} - -void VendingRecv::processOpenStatus(Net::MessageIn &msg) -{ - UNIMPLEMENTEDPACKET; - msg.readUInt8("result"); -} - -} // namespace EAthena diff --git a/src/net/eathena/vendingrecv.h b/src/net/eathena/vendingrecv.h deleted file mode 100644 index 1424cd3be..000000000 --- a/src/net/eathena/vendingrecv.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_EATHENA_VENDINGRECV_H -#define NET_EATHENA_VENDINGRECV_H - -class BuyDialog; - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace EAthena -{ - namespace VendingRecv - { - extern BuyDialog *mBuyDialog; - - void processOpenReq(Net::MessageIn &msg); - void processShowBoard(Net::MessageIn &msg); - void processHideBoard(Net::MessageIn &msg); - void processItemsList(Net::MessageIn &msg); - void processBuyAck(Net::MessageIn &msg); - void processOpen(Net::MessageIn &msg); - void processReport(Net::MessageIn &msg); - void processOpenStatus(Net::MessageIn &msg); - } // namespace VendingRecv -} // namespace EAthena - -#endif // NET_EATHENA_VENDINGRECV_H diff --git a/src/net/elementalhandler.h b/src/net/elementalhandler.h deleted file mode 100644 index 8318de106..000000000 --- a/src/net/elementalhandler.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_ELEMENTALHANDLER_H -#define NET_ELEMENTALHANDLER_H - -#include "localconsts.h" - -namespace Net -{ - -class ElementalHandler notfinal -{ - public: - ElementalHandler() - { } - - A_DELETE_COPY(ElementalHandler) - - virtual ~ElementalHandler() - { } -}; - -} // namespace Net - -extern Net::ElementalHandler *elementalHandler; - -#endif // NET_ELEMENTALHANDLER_H diff --git a/src/net/familyhandler.h b/src/net/familyhandler.h deleted file mode 100644 index b213c4824..000000000 --- a/src/net/familyhandler.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_FAMILYHANDLER_H -#define NET_FAMILYHANDLER_H - -#include "localconsts.h" - -class Being; - -namespace Net -{ - -class FamilyHandler notfinal -{ - public: - FamilyHandler() - { } - - A_DELETE_COPY(FamilyHandler) - - virtual ~FamilyHandler() - { } - - virtual void askForChild(const Being *const being) const = 0; - - virtual void askForChildReply(const bool accept) const = 0; -}; - -} // namespace Net - -extern Net::FamilyHandler *familyHandler; - -#endif // NET_FAMILYHANDLER_H diff --git a/src/net/friendshandler.h b/src/net/friendshandler.h deleted file mode 100644 index 6b9f29a13..000000000 --- a/src/net/friendshandler.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_FRIENDSHANDLER_H -#define NET_FRIENDSHANDLER_H - -#include <string> - -#include "localconsts.h" - -namespace Net -{ - -class FriendsHandler notfinal -{ - public: - FriendsHandler() - { } - - A_DELETE_COPY(FriendsHandler) - - virtual void invite(const std::string &name) const = 0; - - virtual void inviteResponse(const int accountId, - const int charId, - const bool accept) const = 0; - - virtual void remove(const int accountId, const int charId) const = 0; - - virtual ~FriendsHandler() - { } -}; - -} // namespace Net - -extern Net::FriendsHandler *friendsHandler; - -#endif // NET_FRIENDSHANDLER_H diff --git a/src/net/gamehandler.h b/src/net/gamehandler.h deleted file mode 100644 index 5bd4bca92..000000000 --- a/src/net/gamehandler.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_GAMEHANDLER_H -#define NET_GAMEHANDLER_H - -#include "net/logindata.h" - -namespace Net -{ - -class GameHandler notfinal -{ - public: - GameHandler() - { } - - A_DELETE_COPY(GameHandler) - - virtual ~GameHandler() - {} - - virtual void connect() const = 0; - - virtual bool isConnected() const = 0; - - virtual void disconnect() const = 0; - - virtual void who() const = 0; - - virtual void quit() const = 0; - - virtual void ping(const int tick) const = 0; - - virtual bool removeDeadBeings() const = 0; - - virtual void disconnect2() const = 0; - - virtual bool mustPing() const A_WARN_UNUSED = 0; - - virtual void mapLoadedEvent() const = 0; - - virtual void initEngines() const = 0; - - virtual void clear() const = 0; -}; - -} // namespace Net - -extern Net::GameHandler *gameHandler; - -#endif // NET_GAMEHANDLER_H diff --git a/src/net/generalhandler.h b/src/net/generalhandler.h deleted file mode 100644 index 480b50948..000000000 --- a/src/net/generalhandler.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_GENERALHANDLER_H -#define NET_GENERALHANDLER_H - -#include "localconsts.h" - -namespace Net -{ - -class GeneralHandler notfinal -{ - public: - GeneralHandler() - { } - - A_DELETE_COPY(GeneralHandler) - - virtual ~GeneralHandler() - { } - - virtual void load() const = 0; - - virtual void reload() const = 0; - - virtual void unload() const = 0; - - virtual void flushNetwork() const = 0; - - virtual void flushSend() const = 0; - - virtual void clearHandlers() const = 0; - - virtual void reloadPartially() const = 0; - - virtual void gameStarted() const = 0; - - virtual void gameEnded() const = 0; -}; - -} // namespace Net - -extern Net::GeneralHandler *generalHandler; - -#endif // NET_GENERALHANDLER_H diff --git a/src/net/guildhandler.h b/src/net/guildhandler.h deleted file mode 100644 index 2b1997f92..000000000 --- a/src/net/guildhandler.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_GUILDHANDLER_H -#define NET_GUILDHANDLER_H - -#include "guild.h" - -#include "gui/widgets/tabs/chat/chattab.h" - -class Being; - -namespace Net -{ - -class GuildHandler notfinal -{ - public: - GuildHandler() - { } - - A_DELETE_COPY(GuildHandler) - - virtual ~GuildHandler() - { } - - virtual void create(const std::string &name) const = 0; - - virtual void invite(const std::string &name) const = 0; - - virtual void invite(const Being *const being) const = 0; - - virtual void inviteResponse(const int guildId, - const bool response) const = 0; - - virtual void leave(const int guildId) const = 0; - - virtual void kick(const GuildMember *restrict const member, - const std::string &restrict reason) const = 0; - - virtual void chat(const std::string &text) const = 0; - - virtual void memberList() const = 0; - - virtual void info() const = 0; - - virtual void changeMemberPostion(const GuildMember *const member, - const int level) const = 0; - - virtual void changePostionInfo(const int posId, - const int mode, - const int ranking, - const int payRate, - const std::string &name) const = 0; - - virtual void requestAlliance(const Being *const being) const = 0; - - virtual void requestOpposition(const Being *const being) const = 0; - - virtual void requestAllianceResponse(const int beingId, - const bool accept) const = 0; - - virtual void endAlliance(const int guildId, - const int flag) const = 0; - - virtual void changeNotice(const int guildId, - const std::string &restrict msg1, - const std::string &restrict msg2) const = 0; - - virtual void checkMaster() const = 0; - - virtual void breakGuild(const std::string &name) const = 0; - - virtual void changeEmblem(std::string emblem) const = 0; - - virtual void requestEmblem(const int guildId) const = 0; - - virtual void clear() const = 0; - - virtual ChatTab *getTab() const = 0; -}; - -} // namespace Net - -extern Net::GuildHandler *guildHandler; - -#endif // NET_GUILDHANDLER_H diff --git a/src/net/homunculushandler.h b/src/net/homunculushandler.h deleted file mode 100644 index c5a997b61..000000000 --- a/src/net/homunculushandler.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_HOMUNCULUSHANDLER_H -#define NET_HOMUNCULUSHANDLER_H - -#include "enums/simpletypes/beingid.h" -#include "enums/simpletypes/keep.h" - -#include <string> - -#include "localconsts.h" - -namespace Net -{ - -class HomunculusHandler notfinal -{ - public: - HomunculusHandler() - { } - - A_DELETE_COPY(HomunculusHandler) - - virtual ~HomunculusHandler() - { } - - virtual void setName(const std::string &name) const = 0; - - virtual void moveToMaster() const = 0; - - virtual void move(const int x, const int y) const = 0; - - virtual void attack(const BeingId targetId, - const Keep keep) const = 0; - - virtual void feed() const = 0; - - virtual void fire() const = 0; - - virtual void talk(const std::string &restrict text) const = 0; - - virtual void emote(const uint8_t emoteId) const = 0; - - virtual void setDirection(const unsigned char type) const = 0; -}; - -} // namespace Net - -extern Net::HomunculusHandler *homunculusHandler; - -#endif // NET_HOMUNCULUSHANDLER_H diff --git a/src/net/hostsgroup.h b/src/net/hostsgroup.h deleted file mode 100644 index ba2b9c05d..000000000 --- a/src/net/hostsgroup.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2016-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_HOSTSGROUP_H -#define NET_HOSTSGROUP_H - -#include "utils/stringvector.h" - -#include "localconsts.h" - -struct HostsGroup final -{ - HostsGroup() : - name(), - hosts() - { - } - - A_DEFAULT_COPY(HostsGroup) - - std::string name; - StringVect hosts; -}; - -#endif // NET_HOSTSGROUP_H diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h deleted file mode 100644 index aaa4d6f67..000000000 --- a/src/net/inventoryhandler.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_INVENTORYHANDLER_H -#define NET_INVENTORYHANDLER_H - -#include "enums/simpletypes/beingid.h" - -#include "utils/vector.h" - -#include "resources/inventory/inventory.h" - -namespace Net -{ - -class InventoryHandler notfinal -{ - public: - InventoryHandler() - { } - - A_DELETE_COPY(InventoryHandler) - - virtual ~InventoryHandler() - { } - - virtual void clear() const = 0; - - virtual void equipItem(const Item *const item) const = 0; - - virtual void unequipItem(const Item *const item) const = 0; - - virtual void useItem(const Item *const item) const = 0; - - virtual void useItem(const Item *const item, - const int16_t useType) const = 0; - - virtual void dropItem(const Item *const item, - const int amount) const = 0; - - virtual bool canSplit(const Item *const item) const = 0; - - virtual void splitItem(const Item *const item, - const int amount) const = 0; - - virtual void moveItem(const int oldIndex, - const int newIndex) const = 0; - - virtual void closeStorage() const = 0; - - virtual void moveItem2(const InventoryTypeT source, - const int slot, - const int amount, - const InventoryTypeT destination) const = 0; - - virtual size_t getSize(const InventoryTypeT type) const - A_WARN_UNUSED = 0; - - virtual Inventory *getStorage() const = 0; - - virtual void destroyStorage() const = 0; - - virtual void forgotStorage() const = 0; - - virtual int convertFromServerSlot(const int eAthenaSlot) const = 0; - - virtual void useCard(const Item *const item) = 0; - - virtual void insertCard(const int cardIndex, - const int itemIndex) const = 0; - - virtual void favoriteItem(const Item *const item, - const bool favorite) const = 0; - - virtual void selectEgg(const Item *const item) const = 0; - - virtual int getProjectileSlot() const = 0; - - virtual int getItemIndex() const A_WARN_UNUSED = 0; - - virtual void selectCart(const BeingId accountId, - const int type) const = 0; - - virtual void identifyItem(const Item *const item) const = 0; - - virtual void mergeItemsAck(const STD_VECTOR<Item*> &items) const = 0; - - virtual void mergetItemsCancel() const = 0; -}; - -} // namespace Net - -extern Net::InventoryHandler *inventoryHandler; - -#endif // NET_INVENTORYHANDLER_H diff --git a/src/net/ipc.cpp b/src/net/ipc.cpp deleted file mode 100644 index 2f910eaed..000000000 --- a/src/net/ipc.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/ipc.h" - -#include "gui/windows/chatwindow.h" - -#ifndef DYECMD -#include "input/inputmanager.h" -#endif // DYECMD - -#include "utils/delete2.h" -#include "utils/foreach.h" -#include "utils/sdlhelper.h" -#include "utils/stringutils.h" - -#include "debug.h" - -IPC *ipc = nullptr; - -IPC::IPC() : - mNumReqs(0), - mSocket(nullptr), - mDelayedCommands(), - mThread(nullptr), - mMutex(SDL_CreateMutex()), - mPort(44007U), - mThreadLocked(false), - mListen(false) -{ -} - -IPC::~IPC() -{ - mListen = false; - if (mSocket != nullptr) - { - TcpNet::closeSocket(mSocket); - mSocket = nullptr; - } - SDL_DestroyMutex(mMutex); - mMutex = nullptr; - SDL::WaitThread(mThread); - mThread = nullptr; -} - -bool IPC::init() -{ - IPaddress ip; - - if (TcpNet::resolveHost(&ip, nullptr, mPort) == -1) - { - logger->log("IPC: resolveHost error: %s\n", TcpNet::getError()); - return false; - } - - mSocket = TcpNet::open(&ip); - if (mSocket == nullptr) - { - logger->log("IPC: open error: %s", TcpNet::getError()); - return false; - } - - mThread = SDL::createThread(&acceptLoop, "ipc", this); - if (mThread == nullptr) - { - logger->log("IPC: unable to create acceptLoop thread"); - return false; - } - return true; -} - -int IPC::acceptLoop(void *ptr) -{ - if (ptr == nullptr) - return 1; - - IPC *const ipc1 = reinterpret_cast<IPC*>(ptr); - const int max_length = 1024; - const TcpNet::SocketSet set = TcpNet::allocSocketSet(1); - TcpNet::addSocket(set, ipc1->mSocket); - ipc1->mListen = true; - while (ipc1->mListen) - { - TcpNet::checkSockets(set, 250); - if (TcpNet::socketReady(ipc1->mSocket) == 0) - continue; - - const TcpNet::Socket sock = TcpNet::accept(ipc1->mSocket); - if (sock == nullptr) - { - logger->log_r("IPC: unable to accept connection"); - continue; - } - char data[max_length] = {0}; - int result = TcpNet::recv(sock, data, max_length); - if (result <= 0) - { - logger->log_r("IPC: unable to accept connection"); - TcpNet::closeSocket(sock); - continue; - } - - std::string req(data); - trim(req); - logger->log_r("IPC command: %s", req.c_str()); - - ipc1->mThreadLocked = true; - SDL_mutexP(ipc1->mMutex); - ipc1->mDelayedCommands.push_back(req); - SDL_mutexV(ipc1->mMutex); - ipc1->mThreadLocked = false; - - ipc1->mNumReqs ++; - const std::string resp = strprintf("[%u] %s\n", - ipc1->mNumReqs, req.c_str()); - - const char *const respc = resp.c_str(); - const int len = CAST_S32(strlen(respc)) + 1; - result = TcpNet::send(sock, respc, len); - if (result < len) - { - logger->log_r("IPC: send error: %s\n", TcpNet::getError()); - TcpNet::closeSocket(sock); - continue; - } - TcpNet::closeSocket(sock); - } - TcpNet::closeSocket(ipc1->mSocket); - TcpNet::freeSocketSet(set); - ipc1->mSocket = nullptr; - ipc1->mThread = nullptr; - return 0; -} - -void IPC::stop() -{ - if (ipc == nullptr) - return; - - logger->log("Stopping IPC..."); - delete2(ipc); -} - -void IPC::start() -{ - if (ipc != nullptr) - return; - - unsigned short port(44007); - const char *const portStr = getenv("IPC_PORT"); - if (portStr != nullptr) - port = static_cast<unsigned short>(atoi(portStr)); - - logger->log("Starting IPC..."); - ipc = new IPC; - for (int f = port; f < 65535; f ++) - { - ipc->setPort(static_cast<unsigned short>(f)); - logger->log(" -> trying port %d...", f); - if (ipc->init()) - { - logger->log(" -> Port %d selected", f); - return; - } - - port ++; - } - delete2(ipc); -} - -void IPC::flush() -{ - if (!mThreadLocked) - { - SDL_mutexP(mMutex); -#ifndef DYECMD -// probably need enable only commands in tool - if (chatWindow != nullptr) - { - FOR_EACH (STD_VECTOR<std::string>::const_iterator, it, - mDelayedCommands) - { - chatWindow->chatInput(*it); - } - } - else - { - FOR_EACH (STD_VECTOR<std::string>::const_iterator, it, - mDelayedCommands) - { - std::string msg = *it; - if (msg.empty() || msg[0] != '/') - continue; - msg = msg.substr(1); - const size_t pos = msg.find(' '); - const std::string type(msg, 0, pos); - std::string args(msg, - pos == std::string::npos ? msg.size() : pos + 1); - args = trim(args); - inputManager.executeChatCommand(type, args, nullptr); - } - } -#endif // DYECMD - - mDelayedCommands.clear(); - SDL_mutexV(mMutex); - } -} diff --git a/src/net/ipc.h b/src/net/ipc.h deleted file mode 100644 index a858e924a..000000000 --- a/src/net/ipc.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_IPC_H -#define NET_IPC_H - -#include "localconsts.h" - -PRAGMACLANG6GCC(GCC diagnostic push) -PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast") -#include "net/sdltcpnet.h" -PRAGMACLANG6GCC(GCC diagnostic pop) - -#include "utils/vector.h" - -#include <string> - -class IPC final -{ - public: - /** - * Constructor. - */ - IPC(); - - A_DELETE_COPY(IPC) - - /** - * Destructor. - */ - ~IPC(); - - bool init(); - - unsigned short getPort() const A_WARN_UNUSED - { return mPort; } - - void flush(); - - static int acceptLoop(void *ptr); - - static void start(); - - static void stop(); - - private: - void setPort(const unsigned short port) - { mPort = port; } - - unsigned int mNumReqs; - TcpNet::Socket mSocket; - STD_VECTOR<std::string> mDelayedCommands; - SDL_Thread *mThread; - SDL_mutex *mMutex; - unsigned short mPort; - volatile bool mThreadLocked; - bool mListen; -}; - -extern IPC *ipc; - -#endif // NET_IPC_H diff --git a/src/net/logindata.h b/src/net/logindata.h deleted file mode 100644 index 1d80b9519..000000000 --- a/src/net/logindata.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_LOGINDATA_H -#define NET_LOGINDATA_H - -#include "enums/being/gender.h" - -#include "enums/net/updatetype.h" - -#include "utils/stringvector.h" - -#include "localconsts.h" - -class LoginData final -{ - public: - LoginData() : - username(), - password(), - newPassword(), - updateHost(), - updateHosts(), - lastLogin(), - updateType(UpdateType::Normal), - email(), - captchaResponse(), - registerUrl(), - gender(Gender::UNSPECIFIED), - packetVersion(0), - remember(false), - registerLogin(false), - characterSlots(9) - { - } - - A_DELETE_COPY(LoginData) - - std::string username; - std::string password; - std::string newPassword; - std::string updateHost; - StringVect updateHosts; - std::string lastLogin; - UpdateTypeT updateType; - - std::string email; - std::string captchaResponse; - std::string registerUrl; - - GenderT gender; - - int packetVersion; - bool remember; // Whether to store the username. - bool registerLogin; // Whether an account is being registered. - - uint16_t characterSlots; // The number of character slots - - void clear() - { - username.clear(); - password.clear(); - newPassword.clear(); - updateHost.clear(); - updateHosts.clear(); - updateType = UpdateType::Normal; - email.clear(); - captchaResponse.clear(); - registerUrl.clear(); - gender = Gender::UNSPECIFIED; - packetVersion = 0; - lastLogin.clear(); - resetCharacterSlots(); - } - - void clearUpdateHost() - { - updateHost.clear(); - updateHosts.clear(); - } - - /** - * Initialize character slots to 3 for TmwAthena compatibility - */ - void resetCharacterSlots() - { - characterSlots = 9; // Default value, used for TmwAthena. - } -}; - -#endif // NET_LOGINDATA_H diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h deleted file mode 100644 index b10d8430f..000000000 --- a/src/net/loginhandler.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_LOGINHANDLER_H -#define NET_LOGINHANDLER_H - -#include "net/serverinfo.h" -#include "net/worldinfo.h" - -class LoginData; - -namespace Net -{ - -class LoginHandler notfinal -{ - public: - A_DELETE_COPY(LoginHandler) - - void setServer(const ServerInfo &server) - { mServer = server; } - - const ServerInfo &getServer() const A_WARN_UNUSED - { return mServer; } - - virtual void connect() const = 0; - - virtual bool isConnected() const A_WARN_UNUSED = 0; - - virtual void disconnect() const = 0; - - virtual bool isRegistrationEnabled() const A_WARN_UNUSED = 0; - - virtual void getRegistrationDetails() const = 0; - - virtual unsigned int getMinUserNameLength() const A_WARN_UNUSED - { return 4; } - - virtual unsigned int getMaxUserNameLength() const A_WARN_UNUSED - { return 25; } - - virtual unsigned int getMinPasswordLength() const A_WARN_UNUSED - { return 4; } - - virtual unsigned int getMaxPasswordLength() const A_WARN_UNUSED - { return 255; } - - virtual void loginAccount(LoginData *const loginData) const = 0; - - virtual void logout() const = 0; - - virtual void changeEmail(const std::string &email) const = 0; - - virtual void changePassword(const std::string &restrict oldPassword, - const std::string &restrict newPassword) - const = 0; - - virtual void chooseServer(unsigned int server, - const bool persistentIp) const = 0; - - virtual void registerAccount(const LoginData *const loginData) - const = 0; - - virtual void unregisterAccount(const std::string &username, - const std::string &password) const = 0; - - virtual const Worlds &getWorlds() const A_WARN_UNUSED = 0; - - virtual void clearWorlds() const = 0; - - virtual void loginOrRegister(LoginData *const data) const = 0; - - virtual void sendVersion() const = 0; - - virtual void ping() const = 0; - - virtual void updatePacketVersion() const = 0; - - virtual ~LoginHandler() - { } - - protected: - LoginHandler() : - mServer() - { - } - - ServerInfo mServer; -}; - -} // namespace Net - -extern Net::LoginHandler *loginHandler; - -#endif // NET_LOGINHANDLER_H diff --git a/src/net/mail2handler.h b/src/net/mail2handler.h deleted file mode 100644 index 55c238b46..000000000 --- a/src/net/mail2handler.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_MAIL2HANDLER_H -#define NET_MAIL2HANDLER_H - -#include "enums/net/mailopentype.h" - -#include "enums/resources/mailqueuetype.h" - -#include <string> - -#include "localconsts.h" - -class Item; - -namespace Net -{ - -class Mail2Handler notfinal -{ - public: - Mail2Handler() - { } - - A_DELETE_COPY(Mail2Handler) - - virtual ~Mail2Handler() - { } - - virtual void openWriteMail(const std::string &receiver) const = 0; - - virtual void addItem(const Item *const item, - const int amount) const = 0; - - virtual void removeItem(const int index, - const int amount) const = 0; - - virtual void sendMail(const std::string &to, - const std::string &title, - const std::string &body, - const int64_t &money) const = 0; - - virtual void queueCheckName(const MailQueueTypeT type, - const std::string &to, - const std::string &title, - const std::string &body, - const int64_t &money) const = 0; - - virtual void nextPage(const MailOpenTypeT openType, - const int64_t mailId) const = 0; - - virtual void readMail(const MailOpenTypeT openType, - const int64_t mailId) const = 0; - - virtual void deleteMail(const MailOpenTypeT openType, - const int64_t mailId) const = 0; - - virtual void requestMoney(const MailOpenTypeT openType, - const int64_t mailId) const = 0; - - virtual void requestItems(const MailOpenTypeT openType, - const int64_t mailId) const = 0; - - virtual void refreshMailList(const MailOpenTypeT openType, - const int64_t mailId) const = 0; - - virtual void openMailBox(const MailOpenTypeT openType) const = 0; - - virtual void closeMailBox() const = 0; - - virtual void cancelWriteMail() const = 0; - - virtual void requestCheckName(const std::string &name) const = 0; - - virtual std::string getCheckedName() const = 0; -}; - -} // namespace Net - -extern Net::Mail2Handler *mail2Handler; - -#endif // NET_MAIL2HANDLER_H diff --git a/src/net/mailhandler.h b/src/net/mailhandler.h deleted file mode 100644 index ebe8fc72c..000000000 --- a/src/net/mailhandler.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_MAILHANDLER_H -#define NET_MAILHANDLER_H - -#include <string> - -#include "localconsts.h" - -namespace Net -{ - -class MailHandler notfinal -{ - public: - MailHandler() - { } - - A_DELETE_COPY(MailHandler) - - virtual ~MailHandler() - { } - - virtual void refresh() const = 0; - - virtual void readMessage(const int msgId) const = 0; - - virtual void getAttach(const int msgId) const = 0; - - virtual void deleteMessage(const int msgId) const = 0; - - virtual void returnMessage(const int msgId) const = 0; - - virtual void setAttach(const int index, const int amount) const = 0; - - virtual void setAttachMoney(const int money) const = 0; - - virtual void resetAttach(const int flag) const = 0; - - virtual void send(const std::string &name, - const std::string &title, - std::string message) const = 0; -}; - -} // namespace Net - -extern Net::MailHandler *mailHandler; - -#endif // NET_MAILHANDLER_H diff --git a/src/net/maphandler.h b/src/net/maphandler.h deleted file mode 100644 index b68fe19f1..000000000 --- a/src/net/maphandler.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_MAPHANDLER_H -#define NET_MAPHANDLER_H - -#include "localconsts.h" - -namespace Net -{ - -class MapHandler notfinal -{ - public: - MapHandler() - { } - - A_DELETE_COPY(MapHandler) - - virtual ~MapHandler() - { } -}; - -} // namespace Net - -extern Net::MapHandler *mapHandler; - -#endif // NET_MAPHANDLER_H diff --git a/src/net/markethandler.h b/src/net/markethandler.h deleted file mode 100644 index f4b43cccd..000000000 --- a/src/net/markethandler.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_MARKETHANDLER_H -#define NET_MARKETHANDLER_H - -#include "enums/resources/item/itemtype.h" - -#include "enums/simpletypes/itemcolor.h" - -#include "utils/vector.h" - -#include "localconsts.h" - -class ShopItem; - -namespace Net -{ - -class MarketHandler notfinal -{ - public: - MarketHandler() - { } - - A_DELETE_COPY(MarketHandler) - - virtual ~MarketHandler() - { } - - virtual void close() const = 0; - - virtual void buyItem(const int itemId, - const ItemTypeT type, - const ItemColor color, - const int amount) const = 0; - - virtual void buyItems(const STD_VECTOR<ShopItem*> &items) const = 0; -}; - -} // namespace Net - -extern Net::MarketHandler *marketHandler; - -#endif // NET_MARKETHANDLER_H diff --git a/src/net/mercenaryhandler.h b/src/net/mercenaryhandler.h deleted file mode 100644 index 2fcd4790f..000000000 --- a/src/net/mercenaryhandler.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_MERCENARYHANDLER_H -#define NET_MERCENARYHANDLER_H - -#include "enums/simpletypes/beingid.h" -#include "enums/simpletypes/keep.h" - -#include <string> - -#include "localconsts.h" - -namespace Net -{ - -class MercenaryHandler notfinal -{ - public: - MercenaryHandler() - { } - - A_DELETE_COPY(MercenaryHandler) - - virtual ~MercenaryHandler() - { } - - virtual void fire() const = 0; - - virtual void moveToMaster() const = 0; - - virtual void move(const int x, const int y) const = 0; - - virtual void attack(const BeingId targetId, - const Keep keep) const = 0; - - virtual void talk(const std::string &restrict text) const = 0; - - virtual void emote(const uint8_t emoteId) const = 0; - - virtual void setDirection(const unsigned char type) const = 0; -}; - -} // namespace Net - -extern Net::MercenaryHandler *mercenaryHandler; - -#endif // NET_MERCENARYHANDLER_H diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp deleted file mode 100644 index f474da086..000000000 --- a/src/net/messagein.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/messagein.h" - -#include "net/packetcounters.h" - -#include "utils/cast.h" -#include "utils/stringutils.h" - -#include "logger.h" - -#include "debug.h" - -#define MAKEWORD(low, high) \ - (CAST_U16((CAST_U8(low)) | \ - (CAST_U16(CAST_U8(high))) << 8)) - -namespace Net -{ - -MessageIn::MessageIn(const char *const data, - const unsigned int length) : - mData(data), - mLength(length), - mPos(0), - mVersion(0), - mId(0), - mIgnore(false) -{ - PacketCounters::incInPackets(); -} - -MessageIn::~MessageIn() -{ - if (mLength != 0u) - { - if (mPos != mLength && mPos != 2) - { - logger->log("Wrong actual or planned inbound packet size!"); - logger->log(" packet id: %u 0x%x", - CAST_U32(mId), - CAST_U32(mId)); - logger->log(" planned size: %u", mLength); - logger->log(" read size: %u", mPos); - WRONGPACKETSIZE; - } - } - else - { - logger->log("Zero packet size: %d", CAST_S32(mId)); - } -} - -unsigned char MessageIn::readUInt8(const char *const str) -{ - unsigned char value = CAST_U8(-1); - if (mPos < mLength) - value = CAST_U8(mData[mPos]); - - DEBUGLOG2("readUInt8: " + toStringPrint(CAST_U32(value)), - mPos, str); - mPos += 1; - PacketCounters::incInBytes(1); - return value; -} - -signed char MessageIn::readInt8(const char *const str) -{ - signed char value = CAST_S8(-1); - if (mPos < mLength) - value = CAST_S8(mData[mPos]); - - DEBUGLOG2("readInt8: " + toStringPrint(CAST_U32( - CAST_U8(value))), - mPos, str); - mPos += 1; - PacketCounters::incInBytes(1); - return value; -} - -uint8_t MessageIn::fromServerDirection(const uint8_t serverDir) -{ - // Translate from eAthena format - switch (serverDir) - { - case 0: - return 1; - case 1: - return 3; - case 2: - return 2; - case 3: - return 6; - case 4: - return 4; - case 5: - return 12; - case 6: - return 8; - case 7: - return 9; - case 8: - return 8; - default: - logger->log("incorrect direction: %d", - CAST_S32(serverDir)); - return 0; - } -} - -void MessageIn::readCoordinates(uint16_t &restrict x, - uint16_t &restrict y, - uint8_t &restrict direction, - const char *const str) -{ - if (mPos + 3 <= mLength) - { - const char *const data = mData + CAST_SIZE(mPos); - uint16_t temp = MAKEWORD(data[1] & 0x00c0, data[0] & 0x00ff); - x = CAST_U16(temp >> 6); - temp = MAKEWORD(data[2] & 0x00f0, data[1] & 0x003f); - y = CAST_U16(temp >> 4); - - const uint8_t serverDir = CAST_U8(data[2] & 0x000f); - direction = fromServerDirection(serverDir); - - DEBUGLOG2(std::string("readCoordinates: ").append(toString( - CAST_S32(x))).append(",").append(toString( - CAST_S32(y))).append(",").append(toString( - CAST_S32(serverDir))), mPos, str); - } - else - { - x = 0; - y = 0; - direction = 0; - logger->log("error: wrong readCoordinates packet"); - } - mPos += 3; - PacketCounters::incInBytes(3); -} - -void MessageIn::readCoordinatePair(uint16_t &restrict srcX, - uint16_t &restrict srcY, - uint16_t &restrict dstX, - uint16_t &restrict dstY, - const char *const str) -{ - if (mPos + 5 <= mLength) - { - const char *const data = mData + CAST_SIZE(mPos); - uint16_t temp = MAKEWORD(data[3], data[2] & 0x000f); - dstX = CAST_U16(temp >> 2); - - dstY = MAKEWORD(data[4], data[3] & 0x0003); - - temp = MAKEWORD(data[1], data[0]); - srcX = CAST_U16(temp >> 6); - - temp = MAKEWORD(data[2], data[1] & 0x003f); - srcY = CAST_U16(temp >> 4); - - DEBUGLOG2(std::string("readCoordinatePair: ").append(toString( - CAST_S32(srcX))).append(",").append(toString( - CAST_S32(srcY))).append(" ").append(toString( - CAST_S32(dstX))).append(",").append(toString( - CAST_S32(dstY))), mPos, str); - } - else - { - srcX = 0; - srcY = 0; - dstX = 0; - dstY = 0; - logger->log("error: wrong readCoordinatePair packet"); - } - mPos += 5; - PacketCounters::incInBytes(5); -} - -void MessageIn::skip(const unsigned int length, const char *const str) -{ - DEBUGLOG2("skip: " + toString(CAST_S32(length)), mPos, str); - mPos += length; - PacketCounters::incInBytes(length); -} - -void MessageIn::skipToEnd(const char *const str) -{ - const int diff = CAST_S32(mLength - mPos); - if (diff != 0) - { - DEBUGLOG2("skip: " + toString(diff), mPos, str); - mPos = mLength; - PacketCounters::incInBytes(diff); - } -} - -std::string MessageIn::readString(int length, const char *const dstr) -{ - // Get string length - if (length < 0) - length = readInt16("len"); - - // Make sure the string isn't erroneous - if (length < 0 || mPos + length > mLength) - { - DEBUGLOG2("readString error", mPos, dstr); - mPos = mLength + 1; - return ""; - } - - // Read the string - const char *const stringBeg = mData + CAST_SIZE(mPos); - const char *const stringEnd - = static_cast<const char *>(memchr(stringBeg, '\0', length)); - - const std::string str(stringBeg, stringEnd != nullptr - ? stringEnd - stringBeg : CAST_SIZE(length)); - DEBUGLOG2("readString: " + str, mPos, dstr); - mPos += length; - PacketCounters::incInBytes(length); - return str; -} - -std::string MessageIn::readRawString(int length, const char *const dstr) -{ - // Get string length - if (length < 0) - length = readInt16("len"); - - // Make sure the string isn't erroneous - if (length < 0 || mPos + length > mLength) - { - mPos = mLength + 1; - return ""; - } - - // Read the string - const char *const stringBeg = mData + CAST_SIZE(mPos); - const char *const stringEnd - = static_cast<const char *>(memchr(stringBeg, '\0', length)); - std::string str(stringBeg, stringEnd != nullptr - ? stringEnd - stringBeg : CAST_SIZE(length)); - - DEBUGLOG2("readString: " + str, mPos, dstr); - - if (stringEnd != nullptr) - { - const size_t len2 = CAST_SIZE(length) - - (stringEnd - stringBeg) - 1; - const char *const stringBeg2 = stringEnd + 1; - const char *const stringEnd2 - = static_cast<const char *>(memchr(stringBeg2, '\0', len2)); - const std::string hiddenPart = std::string(stringBeg2, - stringEnd2 != nullptr ? stringEnd2 - stringBeg2 : len2); - if (hiddenPart.length() > 0) - { - DEBUGLOG2("readString2: " + hiddenPart, mPos, dstr); - return str.append("|").append(hiddenPart); - } - } - mPos += length; - PacketCounters::incInBytes(length); - - return str; -} - -unsigned char *MessageIn::readBytes(int length, const char *const dstr) -{ - // Get string length - if (length < 0) - length = readInt16("len"); - - // Make sure the string isn't erroneous - if (length < 0 || mPos + length > mLength) - { - DEBUGLOG2("readBytesString error", mPos, dstr); - mPos = mLength + 1; - return nullptr; - } - - unsigned char *const buf - = new unsigned char[CAST_SIZE(length + 2)]; - - memcpy(buf, mData + CAST_SIZE(mPos), length); - buf[length] = 0; - buf[length + 1] = 0; - mPos += length; - -#ifdef ENABLEDEBUGLOG - std::string str; - for (int f = 0; f < length; f ++) - str.append(strprintf("%02x", CAST_U32(buf[f]))); - str += " "; - for (int f = 0; f < length; f ++) - { - if (buf[f] != 0u) - str.append(strprintf("%c", buf[f])); - else - str.append("_"); - } - if (dstr != nullptr) - logger->dlog(dstr); - logger->dlog("ReadBytes: " + str); -#endif // ENABLEDEBUGLOG - - PacketCounters::incInBytes(length); - return buf; -} - -} // namespace Net diff --git a/src/net/messagein.h b/src/net/messagein.h deleted file mode 100644 index 0b3d0be67..000000000 --- a/src/net/messagein.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_MESSAGEIN_H -#define NET_MESSAGEIN_H - -#include "enums/simpletypes/beingid.h" - -#include <string> - -#include "localconsts.h" - -namespace Net -{ - -/** - * Used for parsing an incoming message. - * - * \ingroup Network - */ -class MessageIn notfinal -{ - public: - A_DELETE_COPY(MessageIn) - - virtual ~MessageIn(); - - /** - * Returns the message ID. - */ - int getId() const noexcept2 A_WARN_UNUSED - { return mId; } - - /** - * Returns the message length. - */ - unsigned int getLength() const noexcept2 A_WARN_UNUSED - { return mLength; } - - /** - * Returns the length of unread data. - */ - unsigned int getUnreadLength() const noexcept2 A_WARN_UNUSED - { return mLength > mPos ? mLength - mPos : 0; } - - /**< Reads a byte. */ - virtual unsigned char readUInt8(const char *const str); - - /**< Reads a byte. */ - virtual signed char readInt8(const char *const str); - - /**< Reads a short. */ - virtual int16_t readInt16(const char *const str) = 0; - - virtual uint16_t readUInt16(const char *const str) = 0; - - /**< Reads a long. */ - virtual int32_t readInt32(const char *const str) = 0; - - virtual int64_t readInt64(const char *const str) = 0; - - virtual BeingId readBeingId(const char *const str) = 0; - - /** - * Reads a special 3 byte block used by eAthena, containing x and y - * coordinates and direction. - */ - virtual void readCoordinates(uint16_t &restrict x, - uint16_t &restrict y, - uint8_t &restrict direction, - const char *const str); - - /** - * Reads a special 5 byte block used by eAthena, containing a source - * and destination coordinate pair. - */ - virtual void readCoordinatePair(uint16_t &restrict srcX, - uint16_t &restrict srcY, - uint16_t &restrict dstX, - uint16_t &restrict dstY, - const char *const str); - - /** - * Skips a given number of bytes. - */ - virtual void skip(const unsigned int length, - const char *const str); - - void skipToEnd(const char *const str); - - /** - * Reads a string. If a length is not given (-1), it is assumed - * that the length of the string is stored in a short at the - * start of the string. - */ - virtual std::string readString(int length, - const char *const dstr); - - virtual std::string readRawString(int length, - const char *const dstr); - - unsigned char *readBytes(int length, - const char *const dstr); - - static uint8_t fromServerDirection(const uint8_t serverDir) - A_WARN_UNUSED; - - unsigned int getVersion() const noexcept2 A_WARN_UNUSED - { return mVersion; } - - protected: - /** - * Constructor. - */ - MessageIn(const char *const data, const unsigned int length); - - const char *mData; /**< The message data. */ - unsigned int mLength; /**< The length of the data. */ - - /** - * Actual position in the packet. From 0 to packet->length. - * A value bigger than packet->length means EOP was reached when - * reading it. - */ - unsigned int mPos; - unsigned int mVersion; - uint16_t mId; /**< The message ID. */ - bool mIgnore; -}; - -} // namespace Net - -#endif // NET_MESSAGEIN_H diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp deleted file mode 100644 index f37af859e..000000000 --- a/src/net/messageout.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/messageout.h" - -#include "logger.h" - -#include "net/net.h" -#include "net/packetcounters.h" - -#include "utils/stringutils.h" - -#include "debug.h" - -namespace Net -{ - -MessageOut::MessageOut(const int16_t id) : - mData(nullptr), - mDataSize(0), - mPos(0), - mId(id), - mIgnore(false) -{ - PacketCounters::incOutPackets(); - IGNOREDEBUGLOG; - DEBUGLOG2("Send packet", 0, "MessageOut"); -} - -void MessageOut::writeInt8(const int8_t value, const char *const str) -{ - expand(1); - mData[mPos] = value; - DEBUGLOG2("writeInt8: " + toStringPrint(CAST_U32( - CAST_U8(value))), - mPos, str); - mPos += 1; - PacketCounters::incOutBytes(1); -} - -void MessageOut::writeString(const std::string &string, - int length, - const char *const str) -{ - int stringLength = CAST_S32(string.length()); - if (length < 0) - { - // Write the length at the start if not fixed - writeInt16(CAST_S16(stringLength), "len"); - length = stringLength; - } - else if (length < stringLength) - { - // Make sure the length of the string is no longer than specified - stringLength = length; - } - expand(length); - - // Write the actual string - memcpy(mData + CAST_SIZE(mPos), string.c_str(), stringLength); - - // Pad remaining space with zeros - if (length > stringLength) - { - memset(mData + CAST_SIZE(mPos + stringLength), - '\0', - length - stringLength); - } - - DEBUGLOG2("writeString: " + string, mPos, str); - mPos += length; - PacketCounters::incOutBytes(length); -} - -void MessageOut::writeStringNoLog(const std::string &string, - int length, - const char *const str) -{ - int stringLength = CAST_S32(string.length()); - if (length < 0) - { - // Write the length at the start if not fixed - writeInt16(CAST_S16(stringLength), "len"); - length = stringLength; - } - else if (length < stringLength) - { - // Make sure the length of the string is no longer than specified - stringLength = length; - } - expand(length); - - // Write the actual string - memcpy(mData + CAST_SIZE(mPos), string.c_str(), stringLength); - - // Pad remaining space with zeros - if (length > stringLength) - { - memset(mData + CAST_SIZE(mPos + stringLength), - '\0', - length - stringLength); - } - - DEBUGLOG2("writeString: ***", mPos, str); - mPos += length; - PacketCounters::incOutBytes(length); -} - -const char *MessageOut::getData() const -{ - return mData; -} - -unsigned int MessageOut::getDataSize() const -{ - return mDataSize; -} - -unsigned char MessageOut::toServerDirection(unsigned char direction) -{ - // Translate direction to eAthena format - switch (direction) - { - case 1: // DOWN - direction = 0; - break; - case 3: // DOWN | LEFT - direction = 1; - break; - case 2: // LEFT - direction = 2; - break; - case 6: // LEFT | UP - direction = 3; - break; - case 4: // UP - direction = 4; - break; - case 12: // UP | RIGHT - direction = 5; - break; - case 8: // RIGHT - direction = 6; - break; - case 9: // RIGHT + DOWN - direction = 7; - break; - default: - // OOPSIE! Impossible or unknown - direction = CAST_U8(-1); - break; - } - return direction; -} - -} // namespace Net diff --git a/src/net/messageout.h b/src/net/messageout.h deleted file mode 100644 index 3e07ee28b..000000000 --- a/src/net/messageout.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_MESSAGEOUT_H -#define NET_MESSAGEOUT_H - -#include "enums/simpletypes/beingid.h" - -#include "utils/cast.h" - -#include <string> - -#include "localconsts.h" - -UTILS_CAST_H - -#define createOutPacket(name) MessageOut outMsg(name); \ - outMsg.writeInt16(CAST_S16(name), #name) - -namespace Net -{ - -/** - * Used for building an outgoing message. - * - * \ingroup Network - */ -class MessageOut notfinal -{ - public: - A_DELETE_COPY(MessageOut) - - /**< Writes a byte. */ - virtual void writeInt8(const int8_t value, - const char *const str); - - /**< Writes a short. */ - virtual void writeInt16(const int16_t value, - const char *const str) = 0; - - /**< Writes a long. */ - virtual void writeInt32(const int32_t value, - const char *const str) = 0; - - virtual void writeBeingId(const BeingId value, - const char *const str) = 0; - - /** - * Writes a string. If a fixed length is not given (-1), it is stored - * as a short at the start of the string. - */ - virtual void writeString(const std::string &string, - int length, - const char *const str); - - /** - * Writes a string. If a fixed length is not given (-1), it is stored - * as a short at the start of the string. - */ - virtual void writeStringNoLog(const std::string &string, - int length, - const char *const str); - - /** - * Returns the content of the message. - */ - virtual const char *getData() const A_WARN_UNUSED; - - /** - * Returns the length of the data. - */ - virtual unsigned int getDataSize() const A_WARN_UNUSED; - - virtual ~MessageOut() - { } - - static unsigned char toServerDirection(unsigned char direction) - A_CONST; - - protected: - /** - * Constructor. - */ - explicit MessageOut(const int16_t id); - - /** - * Expand the packet data to be able to hold more data. - * - * NOTE: For performance enhancements this method could allocate extra - * memory in advance instead of expanding size every time more data is - * added. - */ - virtual void expand(size_t size) const = 0; - - char *mData; /**< Data building up. */ - unsigned int mDataSize; /**< Size of data. */ - unsigned int mPos; /**< Position in the data. */ - uint16_t mId; - bool mIgnore; -}; - -} // namespace Net - -#endif // NET_MESSAGEOUT_H diff --git a/src/net/net.cpp b/src/net/net.cpp deleted file mode 100644 index ebc654563..000000000 --- a/src/net/net.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/net.h" - -#include "configuration.h" - -#include "net/loginhandler.h" - -#ifdef TMWA_SUPPORT -#include "net/tmwa/generalhandler.h" -#endif // TMWA_SUPPORT - -#include "net/eathena/generalhandler.h" - -#include "utils/delete2.h" - -#include "debug.h" - -int evolPacketOffset = 0; - -namespace Net -{ - class AuctionHandler; - class BankHandler; - class BattleGroundHandler; - class BuyingStoreHandler; - class CashShopHandler; - class ElementalHandler; - class FamilyHandler; - class FriendsHandler; - class HomunculusHandler; - class Mail2Handler; - class MailHandler; - class MapHandler; - class MarketHandler; - class MercenaryHandler; - class SearchStoreHandler; - class RouletteHandler; - class VendingHandler; - class AdminHandler; - class BeingHandler; - class BuySellHandler; - class CharServerHandler; - class ChatHandler; - class GameHandler; - class GuildHandler; - class InventoryHandler; - class NpcHandler; - class PartyHandler; - class PetHandler; - class PlayerHandler; - class QuestHandler; - class ServerFeatures; - class SkillHandler; - class TradeHandler; -} // namespace Net - -Net::AdminHandler *adminHandler = nullptr; -Net::CharServerHandler *charServerHandler = nullptr; -Net::ChatHandler *chatHandler = nullptr; -Net::GeneralHandler *generalHandler = nullptr; -Net::InventoryHandler *inventoryHandler = nullptr; -Net::LoginHandler *loginHandler = nullptr; -Net::GameHandler *gameHandler = nullptr; -Net::GuildHandler *guildHandler = nullptr; -Net::NpcHandler *npcHandler = nullptr; -Net::PartyHandler *partyHandler = nullptr; -Net::PetHandler *petHandler = nullptr; -Net::PlayerHandler *playerHandler = nullptr; -Net::SkillHandler *skillHandler = nullptr; -Net::TradeHandler *tradeHandler = nullptr; -Net::BeingHandler *beingHandler = nullptr; -Net::BuySellHandler *buySellHandler = nullptr; -Net::ServerFeatures *serverFeatures = nullptr; -Net::AuctionHandler *auctionHandler = nullptr; -Net::BankHandler *bankHandler = nullptr; -Net::BattleGroundHandler *battleGroundHandler = nullptr; -Net::BuyingStoreHandler *buyingStoreHandler = nullptr; -Net::CashShopHandler *cashShopHandler = nullptr; -Net::ElementalHandler *elementalHandler = nullptr; -Net::FamilyHandler *familyHandler = nullptr; -Net::FriendsHandler *friendsHandler = nullptr; -Net::HomunculusHandler *homunculusHandler = nullptr; -Net::Mail2Handler *mail2Handler = nullptr; -Net::MailHandler *mailHandler = nullptr; -Net::MapHandler *mapHandler = nullptr; -Net::MarketHandler *marketHandler = nullptr; -Net::MercenaryHandler *mercenaryHandler = nullptr; -Net::RouletteHandler *rouletteHandler = nullptr; -Net::SearchStoreHandler *searchStoreHandler = nullptr; -Net::VendingHandler *vendingHandler = nullptr; -Net::QuestHandler *questHandler = nullptr; - -namespace Net -{ -ServerTypeT networkType = ServerType::UNKNOWN; -std::set<int> ignorePackets; - -void connectToServer(const ServerInfo &server) -{ - BLOCK_START("Net::connectToServer") - if (networkType == server.type && - generalHandler != nullptr) - { - generalHandler->reload(); - } - else - { - if (networkType != ServerType::UNKNOWN && - generalHandler != nullptr) - { - generalHandler->unload(); - delete2(generalHandler); - } - - switch (server.type) - { - case ServerType::EATHENA: - case ServerType::EVOL2: - new EAthena::GeneralHandler; - break; - case ServerType::TMWATHENA: - case ServerType::UNKNOWN: - default: -#ifdef TMWA_SUPPORT - new TmwAthena::GeneralHandler; -#else // TMWA_SUPPORT - - new EAthena::GeneralHandler; -#endif // TMWA_SUPPORT - - break; - } - - if (generalHandler != nullptr) - generalHandler->load(); - - networkType = server.type; - } - - if (loginHandler != nullptr) - { - loginHandler->setServer(server); - loginHandler->connect(); - } - BLOCK_END("Net::connectToServer") -} - -void unload() -{ - const GeneralHandler *const handler = generalHandler; - if (handler != nullptr) - handler->unload(); - ignorePackets.clear(); - delete2(generalHandler); -} - -ServerTypeT getNetworkType() -{ - return networkType; -} - -void loadIgnorePackets() -{ - const std::string str = config.getStringValue("ignorelogpackets"); - splitToIntSet(ignorePackets, str, ','); -} - -bool isIgnorePacket(const int id) -{ - return ignorePackets.find(id) != ignorePackets.end(); -} - -} // namespace Net diff --git a/src/net/net.h b/src/net/net.h deleted file mode 100644 index f7c05adf0..000000000 --- a/src/net/net.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_NET_H -#define NET_NET_H - -/** - * \namespace Net - * - * The network communication layer. It is composed of a host of interfaces that - * interact with different aspects of the game. They have different - * implementations depending on the type of server the client is connecting to. - */ - -#include "enums/net/servertype.h" - -class ServerInfo; - -namespace Net -{ - -ServerTypeT getNetworkType() A_WARN_UNUSED; - -/** - * Handles server detection and connection - */ -void connectToServer(const ServerInfo &server); - -void unload(); - -void loadIgnorePackets(); - -bool isIgnorePacket(const int id); - -} // namespace Net - -#endif // NET_NET_H diff --git a/src/net/npchandler.h b/src/net/npchandler.h deleted file mode 100644 index 1e41c1144..000000000 --- a/src/net/npchandler.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_NPCHANDLER_H -#define NET_NPCHANDLER_H - -#include <iosfwd> - -#include "enums/being/cookingtype.h" - -#include "enums/net/npcaction.h" - -#include "enums/simpletypes/beingid.h" -#include "enums/simpletypes/itemcolor.h" - -#include "utils/vector.h" - -#include "localconsts.h" - -class Being; -class NpcDialog; -class ShopItem; - -namespace Net -{ - -class MessageIn; - -class NpcHandler notfinal -{ - public: - NpcHandler() - { } - - A_DELETE_COPY(NpcHandler) - - virtual ~NpcHandler() - { } - - virtual BeingId getNpc(Net::MessageIn &msg, - const NpcActionT action) = 0; - - virtual void talk(const Being *const being) const = 0; - - virtual void nextDialog(const BeingId npcId) const = 0; - - virtual void closeDialog(const BeingId npcId) = 0; - - virtual void listInput(const BeingId npcId, - const unsigned char value) const = 0; - - virtual void integerInput(const BeingId npcId, - const int value) const = 0; - - virtual void stringInput(const BeingId npcId, - const std::string &value) const = 0; - - virtual void buy(const Being *const being) const = 0; - - virtual void buy(const BeingId beingId) const = 0; - - virtual void sell(const BeingId beingId) const = 0; - - virtual void buyItem(const BeingId beingId, - const int itemId, - const ItemColor color, - const int amount) const = 0; - - virtual void buyItems(STD_VECTOR<ShopItem*> &items) const = 0; - - virtual void sellItem(const BeingId beingId, - const int itemId, - const int amount) const = 0; - - virtual void sellItems(STD_VECTOR<ShopItem*> &items) const = 0; - - virtual void completeProgressBar() const = 0; - - virtual void produceMix(const int nameId, - const int materialId1, - const int materialId2, - const int materialId3) const = 0; - - virtual void cooking(const CookingTypeT type, - const int nameId) const = 0; - - virtual void repair(const int index) const = 0; - - virtual void refine(const int index) const = 0; - - virtual void identify(const int index) const = 0; - - virtual void selectArrow(const int nameId) const = 0; - - virtual void selectAutoSpell(const int skillId) const = 0; - - virtual NpcDialog *getCurrentNpcDialog() const = 0; -}; - -} // namespace Net - -extern Net::NpcHandler *npcHandler; - -#endif // NET_NPCHANDLER_H diff --git a/src/net/packetcounters.cpp b/src/net/packetcounters.cpp deleted file mode 100644 index 6d0a8bbf6..000000000 --- a/src/net/packetcounters.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/packetcounters.h" - -#include "utils/cast.h" - -#include "debug.h" - -extern volatile time_t cur_time; -extern volatile bool runCounters; - -int PacketCounters::mInCurrentSec = 0; -int PacketCounters::mInBytes = 0; -int PacketCounters::mInBytesCalc = 0; -int PacketCounters::mInPackets = 0; -int PacketCounters::mInPacketsCalc = 0; -int PacketCounters::mOutCurrentSec = 0; -int PacketCounters::mOutBytes = 0; -int PacketCounters::mOutBytesCalc = 0; -int PacketCounters::mOutPackets = 0; -int PacketCounters::mOutPacketsCalc = 0; - -void PacketCounters::incInBytes(const int cnt) -{ - if (!runCounters) - return; - - updateCounter(PacketCounters::mInCurrentSec, PacketCounters::mInBytesCalc, - PacketCounters::mInBytes); - - PacketCounters::mInBytes += cnt; -} - -void PacketCounters::incInPackets() -{ - if (!runCounters) - return; - - updateCounter(PacketCounters::mInCurrentSec, - PacketCounters::mInPacketsCalc, PacketCounters::mInPackets); - - PacketCounters::mInPackets ++; -} - -int PacketCounters::getInBytes() -{ - return PacketCounters::mInBytesCalc; -} - -int PacketCounters::getInPackets() -{ - return PacketCounters::mInPacketsCalc; -} - -void PacketCounters::incOutBytes(const int cnt) -{ - if (!runCounters) - return; - - updateCounter(PacketCounters::mOutCurrentSec, - PacketCounters::mOutBytesCalc, PacketCounters::mOutBytes); - - PacketCounters::mOutBytes += cnt; -} - -void PacketCounters::incOutPackets() -{ - if (!runCounters) - return; - - updateCounter(PacketCounters::mOutCurrentSec, - PacketCounters::mOutPacketsCalc, - PacketCounters::mOutPackets); - - PacketCounters::mOutPackets ++; -} - -int PacketCounters::getOutBytes() -{ - return PacketCounters::mOutBytesCalc; -} - -int PacketCounters::getOutPackets() -{ - return PacketCounters::mOutPacketsCalc; -} - - -void PacketCounters::updateCounter(int &restrict currentSec, - int &restrict calc, - int &restrict counter) -{ - const int idx = CAST_S32(cur_time % 60); - if (currentSec != idx) - { - currentSec = idx; - calc = counter; - counter = 0; - } -} - -void PacketCounters::update() -{ - if (!runCounters) - return; - - BLOCK_START("PacketCounters::update") - updateCounter(PacketCounters::mInCurrentSec, PacketCounters::mInBytesCalc, - PacketCounters::mInBytes); - updateCounter(PacketCounters::mInCurrentSec, - PacketCounters::mInPacketsCalc, PacketCounters::mInPackets); - updateCounter(PacketCounters::mOutCurrentSec, - PacketCounters::mOutBytesCalc, PacketCounters::mOutBytes); - updateCounter(PacketCounters::mOutCurrentSec, - PacketCounters::mOutPacketsCalc, PacketCounters::mOutPackets); - BLOCK_END("PacketCounters::update") -} diff --git a/src/net/packetcounters.h b/src/net/packetcounters.h deleted file mode 100644 index 6c3e0d8f9..000000000 --- a/src/net/packetcounters.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_PACKETCOUNTERS_H -#define NET_PACKETCOUNTERS_H - -#include "localconsts.h" - -class PacketCounters final -{ - public: - PacketCounters() - { } - - A_DELETE_COPY(PacketCounters) - - static void incInBytes(const int cnt); - - static void incInPackets(); - - static int getInBytes() A_WARN_UNUSED; - - static int getInPackets() A_WARN_UNUSED; - - static void incOutBytes(const int cnt); - - static void incOutPackets(); - - static int getOutBytes() A_WARN_UNUSED; - - static int getOutPackets() A_WARN_UNUSED; - - static void update(); - - static int mInCurrentSec; - static int mInBytes; - static int mInBytesCalc; - static int mInPackets; - static int mInPacketsCalc; - static int mOutCurrentSec; - static int mOutBytes; - static int mOutBytesCalc; - static int mOutPackets; - static int mOutPacketsCalc; - - private: - static void updateCounter(int &restrict currentSec, - int &restrict calc, - int &restrict counter); -}; - -#endif // NET_PACKETCOUNTERS_H diff --git a/src/net/packetfunction.h b/src/net/packetfunction.h deleted file mode 100644 index 832545ca3..000000000 --- a/src/net/packetfunction.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_PACKETFUNCTION_H -#define NET_PACKETFUNCTION_H - -#include "localconsts.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -typedef void (*PacketFuncPtr) (Net::MessageIn &msg); - -#endif // NET_PACKETFUNCTION_H diff --git a/src/net/packetinfo.h b/src/net/packetinfo.h deleted file mode 100644 index 555314e5a..000000000 --- a/src/net/packetinfo.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_PACKETINFO_H -#define NET_PACKETINFO_H - -#include "net/packetfunction.h" - -#include "localconsts.h" - -struct PacketInfo final -{ - PacketInfo() : - name(nullptr), - func(nullptr), - len(0), - version(0) - { - } - - A_DELETE_COPY(PacketInfo) - - const char *name; - PacketFuncPtr func; - int len; - int version; -}; - -#endif // NET_PACKETINFO_H diff --git a/src/net/packetlimiter.cpp b/src/net/packetlimiter.cpp deleted file mode 100644 index ba87badc7..000000000 --- a/src/net/packetlimiter.cpp +++ /dev/null @@ -1,323 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/packetlimiter.h" - -#include "configuration.h" -#include "settings.h" - -#include "utils/cast.h" -#include "utils/checkutils.h" -#include "utils/timer.h" - -#include <sys/stat.h> - -#include "debug.h" - -struct PacketLimit final -{ - A_DEFAULT_COPY(PacketLimit) - - int lastTime; - int timeLimit; - int cnt; - int cntLimit; -}; - -PacketLimit mPacketLimits[CAST_SIZE(PacketType::PACKET_SIZE) + 1]; - -void PacketLimiter::initPacketLimiter() -{ - // here i setting packet limits. but current server is broken, - // and this limits may not help. - - mPacketLimits[CAST_SIZE( - PacketType::PACKET_CHAT)].timeLimit = 10 + 5; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_CHAT)].lastTime = 0; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_CHAT)].cntLimit = 1; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_CHAT)].cnt = 0; - - // 10 - mPacketLimits[CAST_SIZE( - PacketType::PACKET_PICKUP)].timeLimit = 10 + 5; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_PICKUP)].lastTime = 0; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_PICKUP)].cntLimit = 1; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_PICKUP)].cnt = 0; - - // 10 5 - mPacketLimits[CAST_SIZE( - PacketType::PACKET_DROP)].timeLimit = 5; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_DROP)].lastTime = 0; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_DROP)].cntLimit = 1; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_DROP)].cnt = 0; - - // 100 - mPacketLimits[CAST_SIZE( - PacketType::PACKET_NPC_NEXT)].timeLimit = 0; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_NPC_NEXT)].lastTime = 0; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_NPC_NEXT)].cntLimit = 1; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_NPC_NEXT)].cnt = 0; - - mPacketLimits[CAST_SIZE( - PacketType::PACKET_NPC_INPUT)].timeLimit = 100; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_NPC_INPUT)].lastTime = 0; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_NPC_INPUT)].cntLimit = 1; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_NPC_INPUT)].cnt = 0; - - // 50 - mPacketLimits[CAST_SIZE( - PacketType::PACKET_NPC_TALK)].timeLimit = 60; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_NPC_TALK)].lastTime = 0; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_NPC_TALK)].cntLimit = 1; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_NPC_TALK)].cnt = 0; - - // 10 - mPacketLimits[CAST_SIZE( - PacketType::PACKET_EMOTE)].timeLimit = 10 + 5; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_EMOTE)].lastTime = 0; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_EMOTE)].cntLimit = 1; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_EMOTE)].cnt = 0; - - // 100 - mPacketLimits[CAST_SIZE( - PacketType::PACKET_SIT)].timeLimit = 100; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_SIT)].lastTime = 0; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_SIT)].cntLimit = 1; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_SIT)].cnt = 0; - - mPacketLimits[CAST_SIZE( - PacketType::PACKET_DIRECTION)].timeLimit = 50; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_DIRECTION)].lastTime = 0; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_DIRECTION)].cntLimit = 1; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_DIRECTION)].cnt = 0; - - // 2+ - mPacketLimits[CAST_SIZE( - PacketType::PACKET_ATTACK)].timeLimit = 2 + 10; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_ATTACK)].lastTime = 0; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_ATTACK)].cntLimit = 1; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_ATTACK)].cnt = 0; - - mPacketLimits[CAST_SIZE( - PacketType::PACKET_STOPATTACK)].timeLimit = 2 + 10; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_STOPATTACK)].lastTime = 0; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_STOPATTACK)].cntLimit = 1; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_STOPATTACK)].cnt = 0; - - mPacketLimits[CAST_SIZE( - PacketType::PACKET_ONLINELIST)].timeLimit = 1800; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_ONLINELIST)].lastTime = 0; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_ONLINELIST)].cntLimit = 1; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_ONLINELIST)].cnt = 0; - - // 300ms + 50 fix - mPacketLimits[CAST_SIZE( - PacketType::PACKET_WHISPER)].timeLimit = 30 + 5; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_WHISPER)].lastTime = 0; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_WHISPER)].cntLimit = 1; - mPacketLimits[CAST_SIZE( - PacketType::PACKET_WHISPER)].cnt = 0; - - if (!settings.serverConfigDir.empty()) - { - const std::string packetLimitsName = settings.serverConfigDir - + "/packetlimiter.txt"; - - std::ifstream inPacketFile; - struct stat statbuf; - - if ((stat(packetLimitsName.c_str(), &statbuf) != 0) - || !S_ISREG(statbuf.st_mode)) - { - // wtiting new file - writePacketLimits(packetLimitsName); - } - else - { // reading existent file - inPacketFile.open(packetLimitsName.c_str(), std::ios::in); - char line[101]; - - if (!inPacketFile.is_open() || !inPacketFile.getline(line, 100)) - { - inPacketFile.close(); - return; - } - - const int ver = atoi(line); - - for (int f = 0; - f < CAST_S32(PacketType::PACKET_SIZE); - f ++) - { - if (!inPacketFile.getline(line, 100)) - break; - - if (!(ver == 1 && - (static_cast<PacketTypeT>(f) == PacketType::PACKET_DROP || - static_cast<PacketTypeT>(f) - == PacketType::PACKET_NPC_NEXT))) - { - mPacketLimits[f].timeLimit = atoi(line); - } - } - inPacketFile.close(); - if (ver < 5) - writePacketLimits(packetLimitsName); - } - } -} - -void PacketLimiter::writePacketLimits(const std::string &packetLimitsName) -{ - std::ofstream outPacketFile; - outPacketFile.open(packetLimitsName.c_str(), std::ios::out); - if (!outPacketFile.is_open()) - { - reportAlways("Error opening file for writing: %s", - packetLimitsName.c_str()); - outPacketFile.close(); - return; - } - outPacketFile << "4" << std::endl; - for (int f = 0; f < CAST_S32(PacketType::PACKET_SIZE); f ++) - { - outPacketFile << toString(mPacketLimits[f].timeLimit) - << std::endl; - } - - outPacketFile.close(); -} - -bool PacketLimiter::checkPackets(const PacketTypeT type) -{ - if (type > PacketType::PACKET_SIZE) - return false; - - if (!serverConfig.getValueBool("enableBuggyServers", true)) - return true; - - const PacketLimit &limit = mPacketLimits[CAST_SIZE(type)]; - const int timeLimit = limit.timeLimit; - - if (timeLimit == 0) - return true; - - const int time = tick_time; - const int lastTime = limit.lastTime; - const int cnt = limit.cnt; - const int cntLimit = limit.cntLimit; - - if (lastTime > tick_time) - { -// instance()->mPacketLimits[type].lastTime = time; -// instance()->mPacketLimits[type].cnt = 0; - - return true; - } - else if (lastTime + timeLimit > time) - { - if (cnt >= cntLimit) - { - return false; - } -// instance()->mPacketLimits[type].cnt ++; - return true; - } -// instance()->mPacketLimits[type].lastTime = time; -// instance()->mPacketLimits[type].cnt = 1; - return true; -} - -bool PacketLimiter::limitPackets(const PacketTypeT type) -{ - if (CAST_S32(type) < 0 || type > PacketType::PACKET_SIZE) - return false; - - if (!serverConfig.getValueBool("enableBuggyServers", true)) - return true; - - PacketLimit &pack = mPacketLimits[CAST_SIZE(type)]; - const int timeLimit = pack.timeLimit; - - if (timeLimit == 0) - return true; - - const int time = tick_time; - const int lastTime = pack.lastTime; - const int cnt = pack.cnt; - const int cntLimit = pack.cntLimit; - - if (lastTime > tick_time) - { - pack.lastTime = time; - pack.cnt = 0; - return true; - } - else if (lastTime + timeLimit > time) - { - if (cnt >= cntLimit) - { - return false; - } - pack.cnt ++; - return true; - } - pack.lastTime = time; - pack.cnt = 1; - return true; -} diff --git a/src/net/packetlimiter.h b/src/net/packetlimiter.h deleted file mode 100644 index ec8aa7b79..000000000 --- a/src/net/packetlimiter.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_PACKETLIMITER_H -#define NET_PACKETLIMITER_H - -#include "enums/net/packettype.h" - -#include <string> - -#include "localconsts.h" - -namespace PacketLimiter -{ - void initPacketLimiter(); - - void writePacketLimits(const std::string &packetLimitsName); - - bool limitPackets(const PacketTypeT type) A_WARN_UNUSED; - - bool checkPackets(const PacketTypeT type) A_WARN_UNUSED; -} // namespace PacketLimiter - -#endif // NET_PACKETLIMITER_H diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h deleted file mode 100644 index 9e3e8763d..000000000 --- a/src/net/partyhandler.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_PARTYHANDLER_H -#define NET_PARTYHANDLER_H - -#include "localconsts.h" - -#include "enums/net/partyshare.h" - -#include "gui/widgets/tabs/chat/chattab.h" - -class Being; - -namespace Net -{ - -class PartyHandler notfinal -{ - public: - PartyHandler() - { } - - A_DELETE_COPY(PartyHandler) - - virtual ~PartyHandler() - { } - - virtual void create(const std::string &name) const = 0; - - virtual void join(const int partyId) const = 0; - - virtual void invite(const std::string &name) const = 0; - - virtual void leave() const = 0; - - virtual void kick(const Being *const player) const = 0; - - virtual void kick(const std::string &name) const = 0; - - virtual void chat(const std::string &text) const = 0; - - virtual PartyShareT getShareExperience() const A_WARN_UNUSED = 0; - - virtual void setShareExperience(const PartyShareT share) const = 0; - - virtual PartyShareT getShareItems() const A_WARN_UNUSED = 0; - - virtual void setShareItems(const PartyShareT share) const = 0; - - virtual PartyShareT getShareAutoItems() const A_WARN_UNUSED = 0; - - virtual void setShareAutoItems(const PartyShareT share) const = 0; - - virtual void changeLeader(const std::string &name) const = 0; - - virtual void allowInvite(const bool allow) const = 0; - - virtual void clear() const = 0; - - virtual void inviteResponse(const int partyId, - const bool accept) const = 0; - - virtual ChatTab *getTab() const = 0; -}; - -} // namespace Net - -extern Net::PartyHandler *partyHandler; - -#endif // NET_PARTYHANDLER_H diff --git a/src/net/pethandler.h b/src/net/pethandler.h deleted file mode 100644 index 2520d56ee..000000000 --- a/src/net/pethandler.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2013-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_PETHANDLER_H -#define NET_PETHANDLER_H - -#include "being/being.h" - -namespace Net -{ - -class PetHandler notfinal -{ - public: - PetHandler() - { } - - A_DELETE_COPY(PetHandler) - - virtual ~PetHandler() - { } - - virtual void move(const int x, - const int y) const = 0; - - virtual void emote(const uint8_t emoteId) = 0; - - virtual void catchPet(const Being *const being) const = 0; - - virtual void sendPetMessage(const int data) const = 0; - - virtual void setName(const std::string &name) const = 0; - - virtual void requestStatus() const = 0; - - virtual void feed() const = 0; - - virtual void dropLoot() const = 0; - - virtual void returnToEgg() const = 0; - - virtual void unequip() const = 0; - - virtual void setDirection(const unsigned char type) const = 0; -}; - -} // namespace Net - -extern Net::PetHandler *petHandler; - -#endif // NET_PETHANDLER_H diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h deleted file mode 100644 index 72cf8c9de..000000000 --- a/src/net/playerhandler.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_PLAYERHANDLER_H -#define NET_PLAYERHANDLER_H - -#include "being/flooritem.h" - -#include "enums/being/attributes.h" -#include "enums/being/beingaction.h" - -#include "enums/simpletypes/keep.h" -#include "enums/simpletypes/notify.h" - -#include "net/messagein.h" - -namespace Net -{ - -class PlayerHandler notfinal -{ - public: - PlayerHandler() - { } - - A_DELETE_COPY(PlayerHandler) - - virtual ~PlayerHandler() - { } - - virtual void attack(const BeingId id, - const Keep keep) const = 0; - - virtual void stopAttack() const = 0; - - virtual void emote(const uint8_t emoteId) const = 0; - - virtual void increaseAttribute(const AttributesT attr, - const int amount) const = 0; - - virtual void increaseSkill(const uint16_t skillId) const = 0; - - virtual void pickUp(const FloorItem *const floorItem) const = 0; - - virtual void setDirection(const unsigned char direction) const = 0; - - virtual void setDestination(const int x, const int y, - const int direction) const = 0; - - virtual void changeAction(const BeingActionT &action) const = 0; - - virtual void respawn() const = 0; - - virtual void ignorePlayer(const std::string &player, - const bool ignore) const = 0; - - virtual void ignoreAll(const bool ignore) const = 0; - - virtual bool canUseMagic() const = 0; - - virtual int getDefaultWalkSpeed() const A_WARN_UNUSED = 0; - - virtual void requestOnlineList() const = 0; - - virtual void updateStatus(const uint8_t status) const = 0; - - virtual void setShortcut(const int idx, - const uint8_t type, - const int id, - const int level) const = 0; - - virtual void shortcutShiftRow(const int row) const = 0; - - virtual void removeOption() const = 0; - - virtual void changeCart(const int type) const = 0; - - virtual void setMemo() const = 0; - - virtual void doriDori() const = 0; - - virtual void explosionSpirits() const = 0; - - virtual void requestPvpInfo() const = 0; - - virtual void revive() const = 0; - - virtual void setViewEquipment(const bool allow) const = 0; - - virtual void setStat(Net::MessageIn &msg, - const int type, - const int base, - const int mod, - const Notify notify) const = 0; -}; - -} // namespace Net - -extern Net::PlayerHandler *playerHandler; - -#endif // NET_PLAYERHANDLER_H diff --git a/src/net/protocoloutdefine.h b/src/net/protocoloutdefine.h deleted file mode 100644 index b8ab72064..000000000 --- a/src/net/protocoloutdefine.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_PROTOCOLOUTDEFINE_H -#define NET_PROTOCOLOUTDEFINE_H - -#define packet(name, id, sz, comment) int name = id -#define packet2(name, id, sz, comment) int name = id + evolPacketOffset -#define PROTOCOLOUT_VOID - -#endif // NET_PROTOCOLOUTDEFINE_H diff --git a/src/net/protocoloutinclude.h b/src/net/protocoloutinclude.h deleted file mode 100644 index 08dddbf95..000000000 --- a/src/net/protocoloutinclude.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_PROTOCOLOUTINCLUDE_H -#define NET_PROTOCOLOUTINCLUDE_H - -#define packet(name, id, sz, comment) extern int name -#define packet2(name, id, sz, comment) extern int name - -#endif // NET_PROTOCOLOUTINCLUDE_H diff --git a/src/net/protocoloutupdate.h b/src/net/protocoloutupdate.h deleted file mode 100644 index ea142a69d..000000000 --- a/src/net/protocoloutupdate.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_PROTOCOLOUTUPDATE_H -#define NET_PROTOCOLOUTUPDATE_H - -#define packet(name, id, sz, comment) name = id -#define packet2(name, id, sz, comment) name = (id) + evolPacketOffset -#define PROTOCOLOUTUPDATE_VOID - -#endif // NET_PROTOCOLOUTUPDATE_H diff --git a/src/net/questhandler.h b/src/net/questhandler.h deleted file mode 100644 index 37aefbae2..000000000 --- a/src/net/questhandler.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_QUESTHANDLER_H -#define NET_QUESTHANDLER_H - -#include "localconsts.h" - -namespace Net -{ - -class QuestHandler notfinal -{ - public: - QuestHandler() - { } - - A_DELETE_COPY(QuestHandler) - - virtual ~QuestHandler() - { } - - virtual void setQeustActiveState(const int questId, - const bool active) const = 0; -}; - -} // namespace Net - -extern Net::QuestHandler *questHandler; - -#endif // NET_QUESTHANDLER_H diff --git a/src/net/recvpacketdefine.h b/src/net/recvpacketdefine.h deleted file mode 100644 index 1ba7bba58..000000000 --- a/src/net/recvpacketdefine.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_RECVPACKETDEFINE_H -#define NET_RECVPACKETDEFINE_H - -#define packet(pname, pid, sz, pfunc, ver) \ - mPackets[pid].name = #pname; \ - mPackets[pid].len = sz; \ - mPackets[pid].func = pfunc; \ - mPackets[pid].version = ver - -#define packet2(pname, pid, sz, pfunc, ver) \ - mPackets[pid + evolPacketOffset].name = #pname; \ - mPackets[pid + evolPacketOffset].len = sz; \ - mPackets[pid + evolPacketOffset].func = pfunc; \ - mPackets[pid + evolPacketOffset].version = ver - -#endif // NET_RECVPACKETDEFINE_H diff --git a/src/net/roulettehandler.h b/src/net/roulettehandler.h deleted file mode 100644 index 6a88acdca..000000000 --- a/src/net/roulettehandler.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_ROULETTEHANDLER_H -#define NET_ROULETTEHANDLER_H - -#include "localconsts.h" - -namespace Net -{ - -class RouletteHandler notfinal -{ - public: - RouletteHandler() - { } - - A_DELETE_COPY(RouletteHandler) - - virtual ~RouletteHandler() - { } -}; - -} // namespace Net - -extern Net::RouletteHandler *rouletteHandler; - -#endif // NET_ROULETTEHANDLER_H diff --git a/src/net/sdltcpnet.cpp b/src/net/sdltcpnet.cpp deleted file mode 100644 index dbfa2d5d6..000000000 --- a/src/net/sdltcpnet.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2013-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "logger.h" - -#if defined __linux__ || defined __linux - -#include <sys/socket.h> - -#if defined(M_TCPOK) && !defined(ANDROID) -#include <netinet/in.h> -#include <netdb.h> -#include <linux/tcp.h> -#else // defined(M_TCPOK) && !defined(ANDROID) -#include <netinet/in.h> -#include <netinet/tcp.h> -#include <netdb.h> -#include <netinet/tcp.h> -// Use linear timeouts for thin streams -#define TCP_THIN_LINEAR_TIMEOUTS 16 -// Fast retrans. after 1 dupack -#define TCP_THIN_DUPACK 17 -#endif // defined(M_TCPOK) && !defined(ANDROID) - -#endif // defined __linux__ || defined __linux - -PRAGMACLANG6GCC(GCC diagnostic push) -PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast") -#include "net/sdltcpnet.h" -PRAGMACLANG6GCC(GCC diagnostic pop) - -#include "debug.h" - -#if !defined(__native_client__) \ - && (defined(TCP_THIN_LINEAR_TIMEOUTS) \ - || defined(TCP_THIN_DUPACK)) -// because actual struct is hidden in SDL_net we reinroducing it here -struct TCPsocketHack final -{ - TCPsocketHack() : - ready(0), - channel(0), - remoteAddress(), - localAddress(), - sflag() - { } - - A_DELETE_COPY(TCPsocketHack) - - int ready; - int channel; - IPaddress remoteAddress; - IPaddress localAddress; - int sflag; -}; -#endif // !defined(__native_client__) - // && (defined(TCP_THIN_LINEAR_TIMEOUTS) - // || defined(TCP_THIN_DUPACK)) - -void TcpNet::init() -{ - SDLNet_Init(); -} - -void TcpNet::quit() -{ - SDLNet_Quit(); -} - -void TcpNet::closeSocket(const TcpNet::Socket socket) -{ - SDLNet_TCP_Close(socket); -} - -int TcpNet::send(const TcpNet::Socket sock, const void *const data, - const int len) -{ - return SDLNet_TCP_Send(sock, data, len); -} - -const char *TcpNet::getError() -{ - return SDL_GetError(); -} - -int TcpNet::resolveHost(IPaddress *const address, const char *const host, - const Uint16 port) -{ - return SDLNet_ResolveHost(address, host, port); -} - -TcpNet::Socket TcpNet::open(IPaddress *const ip) -{ - const TcpNet::Socket sock = SDLNet_TCP_Open(ip); -#if !defined(__native_client__) \ - && (defined(TCP_THIN_LINEAR_TIMEOUTS) \ - || defined(TCP_THIN_DUPACK)) - if ((sock != nullptr) && (ip != nullptr)) - { - const TCPsocketHack *const hack - = reinterpret_cast<const TCPsocketHack *>(sock); - // here we using some magic to compare TCPsocket and own padding - // because actual struct TCPsocket not in headers - if (hack != nullptr) - { - const IPaddress &addr = hack->remoteAddress; - if (addr.host == ip->host && addr.port == ip->port) - { - const int val = 1; -#ifdef TCP_THIN_LINEAR_TIMEOUTS - if (setsockopt(hack->channel, IPPROTO_TCP, - TCP_THIN_LINEAR_TIMEOUTS, &val, sizeof(val)) != 0) - { - logger->log_r("error on set TCP_THIN_LINEAR_TIMEOUTS"); - } -#endif // TCP_THIN_LINEAR_TIMEOUTS -#ifdef TCP_THIN_DUPACK - if (setsockopt(hack->channel, IPPROTO_TCP, - TCP_THIN_DUPACK, &val, sizeof(val)) != 0) - { - logger->log_r("error on set TCP_THIN_DUPACK"); - } -#endif // TCP_THIN_DUPACK - } - } - } -#endif // !defined(__native_client__) - // && (defined(TCP_THIN_LINEAR_TIMEOUTS) - // || defined(TCP_THIN_DUPACK)) - return sock; -} - -TcpNet::SocketSet TcpNet::allocSocketSet(const int maxsockets) -{ - return SDLNet_AllocSocketSet(maxsockets); -} - -int TcpNet::addSocket(const TcpNet::SocketSet set, const TcpNet::Socket sock) -{ - PRAGMACLANG6GCC(GCC diagnostic push) - PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast") - return SDLNet_TCP_AddSocket(set, sock); - PRAGMACLANG6GCC(GCC diagnostic pop) -} - -int TcpNet::socketReady(const TcpNet::Socket sock) -{ - PRAGMACLANG6GCC(GCC diagnostic push) - PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast") - return SDLNet_SocketReady(sock); - PRAGMACLANG6GCC(GCC diagnostic pop) -} - -int TcpNet::checkSockets(const TcpNet::SocketSet set, const Uint32 timeout) -{ - return SDLNet_CheckSockets(set, timeout); -} - -int TcpNet::recv(const TcpNet::Socket sock, void *const data, const int maxlen) -{ - return SDLNet_TCP_Recv(sock, data, maxlen); -} - -int TcpNet::delSocket(const TcpNet::SocketSet set, const TcpNet::Socket sock) -{ - PRAGMACLANG6GCC(GCC diagnostic push) - PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast") - return SDLNet_TCP_DelSocket(set, sock); - PRAGMACLANG6GCC(GCC diagnostic pop) -} - -void TcpNet::freeSocketSet(const TcpNet::SocketSet set) -{ - SDLNet_FreeSocketSet(set); -} - -TcpNet::Socket TcpNet::accept(const TcpNet::Socket sock) -{ - return SDLNet_TCP_Accept(sock); -} diff --git a/src/net/sdltcpnet.h b/src/net/sdltcpnet.h deleted file mode 100644 index daedb2b73..000000000 --- a/src/net/sdltcpnet.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2013-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_SDLTCPNET_H -#define NET_SDLTCPNET_H - -#include "localconsts.h" - -PRAGMA48(GCC diagnostic push) -PRAGMA48(GCC diagnostic ignored "-Wshadow") -#include <SDL_net.h> -PRAGMA48(GCC diagnostic pop) - -namespace TcpNet -{ - typedef ::SDLNet_SocketSet SocketSet; - typedef ::TCPsocket Socket; - - void init(); - - void quit(); - - void closeSocket(const TcpNet::Socket socket); - - int send(const TcpNet::Socket sock, const void *const data, const int len); - - const char *getError(); - - int resolveHost(IPaddress *const address, const char *const host, - const Uint16 port); - - TcpNet::Socket open(IPaddress *const ip); - - SocketSet allocSocketSet(const int maxsockets); - - int addSocket(const TcpNet::SocketSet set, const TcpNet::Socket sock); - - int socketReady(const TcpNet::Socket sock); - - int checkSockets(const TcpNet::SocketSet set, const Uint32 timeout); - - int recv(const TcpNet::Socket sock, void *const data, const int maxlen); - - int delSocket(const TcpNet::SocketSet set, const TcpNet::Socket sock); - - void freeSocketSet(const TcpNet::SocketSet set); - - TcpNet::Socket accept(const TcpNet::Socket sock); -} // namespace TcpNet - -#endif // NET_SDLTCPNET_H diff --git a/src/net/searchstorehandler.h b/src/net/searchstorehandler.h deleted file mode 100644 index 56bcc1ce7..000000000 --- a/src/net/searchstorehandler.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_SEARCHSTOREHANDLER_H -#define NET_SEARCHSTOREHANDLER_H - -#include "enums/net/storesearchtype.h" - -#include "localconsts.h" - -namespace Net -{ - -class SearchStoreHandler notfinal -{ - public: - SearchStoreHandler() - { } - - A_DELETE_COPY(SearchStoreHandler) - - virtual ~SearchStoreHandler() - { } - - virtual void search(const StoreSearchTypeT type, - const int minPrice, - const int maxPrice, - const int itemId) const = 0; - - virtual void nextPage() const = 0; - - virtual void close() const = 0; - - virtual void select(const int accountId, - const int storeId, - const int itemId) const = 0; -}; - -} // namespace Net - -extern Net::SearchStoreHandler *searchStoreHandler; - -#endif // NET_SEARCHSTOREHANDLER_H diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h deleted file mode 100644 index aed1948c8..000000000 --- a/src/net/serverfeatures.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_SERVERFEATURES_H -#define NET_SERVERFEATURES_H - -#include "localconsts.h" - -namespace Net -{ -class ServerFeatures notfinal -{ - public: - ServerFeatures() - { } - - A_DELETE_COPY(ServerFeatures) - - virtual ~ServerFeatures() - { } - - virtual bool haveServerOnlineList() const = 0; - - virtual bool haveServerHp() const = 0; - - virtual bool havePlayerStatusUpdate() const = 0; - - virtual bool haveIncompleteChatMessages() const = 0; - - virtual bool haveRaceSelection() const = 0; - - virtual bool haveLookSelection() const = 0; - - virtual bool haveMove3() const = 0; - - virtual bool haveCharOtherGender() const = 0; - - virtual bool haveMonsterAttackRange() const = 0; - - virtual bool haveEmailOnRegister() const = 0; - - virtual bool haveEmailOnDelete() const = 0; - - virtual bool haveServerVersion() const = 0; - - virtual bool haveMapServerVersion() const = 0; - - virtual bool haveNpcGender() const = 0; - - virtual bool haveJoinChannel() const = 0; - - virtual bool haveCreateCharGender() const = 0; - - virtual bool haveTalkPet() const = 0; - - virtual bool haveMovePet() const = 0; - - virtual bool haveServerWarpNames() const = 0; - - virtual bool haveExtendedRiding() const = 0; - - virtual bool haveExtendedDropsPosition() const = 0; - - virtual bool haveMoveWhileSit() const = 0; - - virtual bool haveKillerId() const = 0; -}; - -} // namespace Net - -extern Net::ServerFeatures *serverFeatures; - -#endif // NET_SERVERFEATURES_H diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h deleted file mode 100644 index 2bdec0251..000000000 --- a/src/net/serverinfo.h +++ /dev/null @@ -1,228 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_SERVERINFO_H -#define NET_SERVERINFO_H - -#include "enums/net/serverfreetype.h" -#include "enums/net/servertype.h" - -#include "net/hostsgroup.h" -#include "net/serverurlinfo.h" - -#include "utils/stringutils.h" - -#include "localconsts.h" - -class ServerInfo final -{ - public: - typedef std::pair<int, std::string> VersionString; - - ServerTypeT type; - ServerFreeTypeT freeType; - std::string name; - std::string hostname; - std::string althostname; - std::string description; - std::string registerUrl; - std::string onlineListUrl; - std::string supportUrl; - std::string serverUrl; - std::string defaultHostName; - STD_VECTOR<std::string> updateMirrors; - STD_VECTOR<HostsGroup> updateHosts; - STD_VECTOR<ServerUrlInfo> freeSources; - STD_VECTOR<ServerUrlInfo> nonFreeSources; - STD_VECTOR<ServerUrlInfo> docs; - uint16_t port; - VersionString version; - int packetVersion; - bool save; - bool persistentIp; - - ServerInfo() : - type(ServerType::TMWATHENA), - freeType(ServerFreeType::NotSet), - name(), - hostname(), - althostname(), - description(), - registerUrl(), - onlineListUrl(), - supportUrl(), - serverUrl(), - defaultHostName(), - updateMirrors(), - updateHosts(), - freeSources(), - nonFreeSources(), - docs(), -#ifdef TMWA_SUPPORT - port(6901), -#else // TMWA_SUPPORT - port(6900), -#endif // TMWA_SUPPORT - version(), - packetVersion(), - save(false), - persistentIp(true) - { - version.first = 0; - } - - ServerInfo(const ServerInfo &info) : - type(info.type), - freeType(info.freeType), - name(info.name), - hostname(info.hostname), - althostname(info.althostname), - description(info.description), - registerUrl(info.registerUrl), - onlineListUrl(info.onlineListUrl), - supportUrl(info.supportUrl), - serverUrl(info.serverUrl), - defaultHostName(info.defaultHostName), - updateMirrors(info.updateMirrors), - updateHosts(info.updateHosts), - freeSources(info.freeSources), - nonFreeSources(info.nonFreeSources), - docs(info.docs), - port(info.port), - version(), - packetVersion(info.packetVersion), - save(info.save), - persistentIp(info.persistentIp) - { - version.first = info.version.first; - version.second = info.version.second; - } - - A_DEFAULT_COPY(ServerInfo) - - ServerInfo &operator=(const ServerInfo &info) - { - type = info.type; - freeType = info.freeType; - name = info.name; - hostname = info.hostname; - althostname = info.althostname; - description = info.description; - registerUrl = info.registerUrl; - onlineListUrl = info.onlineListUrl; - supportUrl = info.supportUrl; - serverUrl = info.serverUrl; - defaultHostName = info.defaultHostName; - updateMirrors = info.updateMirrors; - updateHosts = info.updateHosts; - freeSources = info.freeSources; - nonFreeSources = info.nonFreeSources; - docs = info.docs; - port = info.port; - save = info.save; - persistentIp = info.persistentIp; - version.first = info.version.first; - version.second = info.version.second; - packetVersion = info.packetVersion; - return *this; - } - - bool isValid() const noexcept2 A_WARN_UNUSED - { - return !(hostname.empty() - || port == 0 - || type == ServerType::UNKNOWN); - } - - void clear() - { - type = ServerType::UNKNOWN; - name.clear(); - hostname.clear(); - althostname.clear(); - port = 0; - description.clear(); - registerUrl.clear(); - onlineListUrl.clear(); - supportUrl.clear(); - serverUrl.clear(); - defaultHostName.clear(); - updateMirrors.clear(); - updateHosts.clear(); - freeSources.clear(); - nonFreeSources.clear(); - docs.clear(); - version.first = 0; - version.second.clear(); - packetVersion = 0; - save = false; - persistentIp = true; - freeType = ServerFreeType::Unknown; - } - - bool operator==(const ServerInfo &other) const - { - return name == other.name && - hostname == other.hostname && - port == other.port; - } - - bool operator!=(const ServerInfo &other) const - { - return name != other.name || - hostname != other.hostname || - port != other.port; - } - - static ServerTypeT parseType(const std::string &serverType) - A_WARN_UNUSED - { -#ifdef TMWA_SUPPORT - if (compareStrI(serverType, "tmwathena") == 0) - return ServerType::TMWATHENA; - else -#endif // TMWA_SUPPORT - if (compareStrI(serverType, "eathena") == 0) - return ServerType::EATHENA; - else if (compareStrI(serverType, "hercules") == 0) - return ServerType::EATHENA; - else if (compareStrI(serverType, "evol2") == 0) - return ServerType::EVOL2; - return ServerType::UNKNOWN; - } - - static ServerFreeTypeT parseFreeType(const std::string &serverFreeType) - A_WARN_UNUSED - { - if (compareStrI(serverFreeType, "free") == 0) - return ServerFreeType::Free; - else if (compareStrI(serverFreeType, "nonfree") == 0) - return ServerFreeType::NonFree; - else if (compareStrI(serverFreeType, "unknown") == 0) - return ServerFreeType::Unknown; - return ServerFreeType::NotSet; - } -}; - -typedef STD_VECTOR<ServerInfo> ServerInfos; - -#endif // NET_SERVERINFO_H diff --git a/src/net/serverurlinfo.h b/src/net/serverurlinfo.h deleted file mode 100644 index ea04a8c2f..000000000 --- a/src/net/serverurlinfo.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2016-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_SERVERURLINFO_H -#define NET_SERVERURLINFO_H - -#include "localconsts.h" - -#include <string> - -struct ServerUrlInfo final -{ - ServerUrlInfo() : - name(), - url() - { - } - - ServerUrlInfo(const std::string &name0, - const std::string &url0) : - name(name0), - url(url0) - { - } - - A_DEFAULT_COPY(ServerUrlInfo) - - std::string name; - std::string url; -}; - -#endif // NET_SERVERURLINFO_H diff --git a/src/net/skillhandler.h b/src/net/skillhandler.h deleted file mode 100644 index 299eb633a..000000000 --- a/src/net/skillhandler.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_SKILLHANDLER_H -#define NET_SKILLHANDLER_H - -#include "enums/simpletypes/beingid.h" - -#include <iosfwd> - -#include "localconsts.h" - -namespace Net -{ -class SkillHandler notfinal -{ - public: - SkillHandler() - { } - - A_DELETE_COPY(SkillHandler) - - virtual ~SkillHandler() - { } - - virtual void useBeing(const int id, - const int level, - const BeingId beingId) const = 0; - - virtual void usePos(const int id, - const int level, - const int x, const int y) const = 0; - - virtual void usePos(const int id, - const int level, - const int x, const int y, - const std::string &text) const = 0; - - virtual void useMap(const int id, const std::string &map) const = 0; - - virtual void getAlchemistRanks() const = 0; - - virtual void getBlacksmithRanks() const = 0; - - virtual void getPkRanks() const = 0; - - virtual void getTaekwonRanks() const = 0; - - virtual void feelSaveOk(const int which) const = 0; - - virtual void lessEffects(const bool isLess) const = 0; -}; - -} // namespace Net - -extern Net::SkillHandler *skillHandler; - -#endif // NET_SKILLHANDLER_H diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp deleted file mode 100644 index b0d2ebfa3..000000000 --- a/src/net/tmwa/adminhandler.cpp +++ /dev/null @@ -1,299 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/adminhandler.h" - -#include "game.h" - -#include "net/tmwa/messageout.h" -#include "net/tmwa/protocolout.h" - -#include "utils/gmfunctions.h" -#include "utils/stringutils.h" - -#include "debug.h" - -namespace TmwAthena -{ - -AdminHandler::AdminHandler() : - Ea::AdminHandler() -{ - adminHandler = this; -} - -AdminHandler::~AdminHandler() -{ - adminHandler = nullptr; -} - -void AdminHandler::announce(const std::string &text) const -{ - createOutPacket(CMSG_ADMIN_ANNOUNCE); - outMsg.writeInt16(CAST_S16(text.length() + 4), "len"); - outMsg.writeString(text, CAST_S32(text.length()), "message"); -} - -void AdminHandler::localAnnounce(const std::string &text) const -{ - createOutPacket(CMSG_ADMIN_LOCAL_ANNOUNCE); - outMsg.writeInt16(CAST_S16(text.length() + 4), "len"); - outMsg.writeString(text, CAST_S32(text.length()), "message"); -} - -void AdminHandler::hide(const bool h A_UNUSED) const -{ - createOutPacket(CMSG_ADMIN_HIDE); - outMsg.writeInt32(0, "unused"); -} - -void AdminHandler::kick(const BeingId playerId) const -{ - createOutPacket(CMSG_ADMIN_KICK); - outMsg.writeBeingId(playerId, "account id"); -} - -void AdminHandler::kickAll() const -{ -} - -void AdminHandler::warp(const std::string &map, const int x, const int y) const -{ - Gm::runCommand("warp", - strprintf("%s %d %d", map.c_str(), x, y)); -} - -void AdminHandler::resetStats() const -{ -} - -void AdminHandler::resetSkills() const -{ -} - -void AdminHandler::gotoName(const std::string &name) const -{ - Gm::runCommand("goto", name); -} - -void AdminHandler::recallName(const std::string &name) const -{ - Gm::runCommand("recall", name); -} - -void AdminHandler::mute(const Being *const being A_UNUSED, - const int type A_UNUSED, - const int limit A_UNUSED) const -{ -} - -void AdminHandler::muteName(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::requestLogin(const Being *const being A_UNUSED) const -{ -} - -void AdminHandler::setTileType(const int x A_UNUSED, const int y A_UNUSED, - const int type A_UNUSED) const -{ -} - -void AdminHandler::unequipAll(const Being *const being A_UNUSED) const -{ -} - -void AdminHandler::requestStats(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::monsterInfo(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::itemInfo(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::whoDrops(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::mobSearch(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::mobSpawnSearch(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::playerGmCommands(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::playerCharGmCommands(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::showLevel(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::showStats(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::showStorageList(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::showCartList(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::showInventoryList(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::locatePlayer(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::showAccountInfo(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::spawnSlave(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::spawnClone(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::spawnSlaveClone(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::spawnEvilClone(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::savePosition(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::loadPosition(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::randomWarp(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::gotoNpc(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::killer(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::killable(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::heal(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::alive(const std::string &name) const -{ - Gm::runCommand("revive", name); -} - -void AdminHandler::disguise(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::immortal(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::hide(const std::string &name A_UNUSED) const -{ - Gm::runCommand("hide"); -} - -void AdminHandler::nuke(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::kill(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::jail(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::unjail(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::npcMove(const std::string &name A_UNUSED, - const int x A_UNUSED, - const int y A_UNUSED) const -{ -} - -void AdminHandler::hideNpc(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::showNpc(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::changePartyLeader(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::partyRecall(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::breakGuild(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::guildRecall(const std::string &name A_UNUSED) const -{ -} - -void AdminHandler::slide(const int x, const int y) const -{ - warp(Game::instance()->getCurrentMapName(), x, y); -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h deleted file mode 100644 index 01e7adcac..000000000 --- a/src/net/tmwa/adminhandler.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_ADMINHANDLER_H -#define NET_TMWA_ADMINHANDLER_H - -#include "net/ea/adminhandler.h" - -namespace TmwAthena -{ - -class AdminHandler final : public Ea::AdminHandler -{ - public: - AdminHandler(); - - A_DELETE_COPY(AdminHandler) - - ~AdminHandler(); - - void announce(const std::string &text) const override final; - - void localAnnounce(const std::string &text) const override final; - - void hide(const bool h) const override final; - - void kick(const BeingId playerId) const override final; - - void kickAll() const override final A_CONST; - - void warp(const std::string &map, - const int x, const int y) const override final; - - void resetStats() const override final A_CONST; - - void resetSkills() const override final A_CONST; - - void gotoName(const std::string &name) const override final; - - void recallName(const std::string &name) const override final; - - void mute(const Being *const being, - const int type, - const int limit) const override final A_CONST; - - void muteName(const std::string &name) const override final A_CONST; - - void requestLogin(const Being *const being) const override final - A_CONST; - - void setTileType(const int x, const int y, - const int type) const override final A_CONST; - - void unequipAll(const Being *const being) const override final A_CONST; - - void requestStats(const std::string &name) const override final - A_CONST; - - void monsterInfo(const std::string &name) const override final A_CONST; - - void itemInfo(const std::string &name) const override final A_CONST; - - void whoDrops(const std::string &name) const override final A_CONST; - - void mobSearch(const std::string &name) const override final A_CONST; - - void mobSpawnSearch(const std::string &name) const override final - A_CONST; - - void playerGmCommands(const std::string &name) const override final - A_CONST; - - void playerCharGmCommands(const std::string &name) const override final - A_CONST; - - void showLevel(const std::string &name) const override final A_CONST; - - void showStats(const std::string &name) const override final A_CONST; - - void showStorageList(const std::string &name) const override final - A_CONST; - - void showCartList(const std::string &name) const override final - A_CONST; - - void showInventoryList(const std::string &name) const override final - A_CONST; - - void locatePlayer(const std::string &name) const override final - A_CONST; - - void showAccountInfo(const std::string &name) const override final - A_CONST; - - void spawnSlave(const std::string &name) const override final A_CONST; - - void spawnClone(const std::string &name) const override final A_CONST; - - void spawnSlaveClone(const std::string &name) const override final - A_CONST; - - void spawnEvilClone(const std::string &name) const override final - A_CONST; - - void savePosition(const std::string &name) const override final - A_CONST; - - void loadPosition(const std::string &name) const override final - A_CONST; - - void randomWarp(const std::string &name) const override final A_CONST; - - void gotoNpc(const std::string &name) const override final A_CONST; - - void killer(const std::string &name) const override final A_CONST; - - void killable(const std::string &name) const override final A_CONST; - - void heal(const std::string &name) const override final A_CONST; - - void alive(const std::string &name) const override final; - - void disguise(const std::string &name) const override final A_CONST; - - void immortal(const std::string &name) const override final A_CONST; - - void hide(const std::string &name) const override final; - - void nuke(const std::string &name) const override final A_CONST; - - void kill(const std::string &name) const override final A_CONST; - - void jail(const std::string &name) const override final A_CONST; - - void unjail(const std::string &name) const override final A_CONST; - - void npcMove(const std::string &name, - const int x, - const int y) const override final A_CONST; - - void hideNpc(const std::string &name) const override final A_CONST; - - void showNpc(const std::string &name) const override final A_CONST; - - void changePartyLeader(const std::string &name) const override final - A_CONST; - - void partyRecall(const std::string &name) const override final A_CONST; - - void breakGuild(const std::string &name) const override final A_CONST; - - void guildRecall(const std::string &name) const override final A_CONST; - - void slide(const int x, const int y) const override final; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_ADMINHANDLER_H diff --git a/src/net/tmwa/auctionhandler.cpp b/src/net/tmwa/auctionhandler.cpp deleted file mode 100644 index 1a45e4135..000000000 --- a/src/net/tmwa/auctionhandler.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/auctionhandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -AuctionHandler::AuctionHandler() -{ - auctionHandler = this; -} - -AuctionHandler::~AuctionHandler() -{ - auctionHandler = nullptr; -} - -void AuctionHandler::cancelReg() const -{ -} - -void AuctionHandler::setItem(const Item *const item A_UNUSED, - const int amount A_UNUSED) const -{ -} - -void AuctionHandler::reg(const int currentPrice A_UNUSED, - const int maxPrice A_UNUSED, - const int hours A_UNUSED) const -{ -} - -void AuctionHandler::cancel(const int auctionId A_UNUSED) const -{ -} - -void AuctionHandler::close(const int auctionId A_UNUSED) const -{ -} - -void AuctionHandler::bid(const int auctionId A_UNUSED, - const int money A_UNUSED) const -{ -} - -void AuctionHandler::search(const AuctionSearchTypeT type A_UNUSED, - const int auctionId A_UNUSED, - const std::string &text A_UNUSED, - const int page A_UNUSED) const -{ -} - -void AuctionHandler::buy() const -{ -} - -void AuctionHandler::sell() const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/auctionhandler.h b/src/net/tmwa/auctionhandler.h deleted file mode 100644 index 9e88e603d..000000000 --- a/src/net/tmwa/auctionhandler.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_AUCTIONHANDLER_H -#define NET_TMWA_AUCTIONHANDLER_H - -#include "net/auctionhandler.h" - -namespace TmwAthena -{ -class AuctionHandler final : public Net::AuctionHandler -{ - public: - AuctionHandler(); - - A_DELETE_COPY(AuctionHandler) - - ~AuctionHandler(); - - void cancelReg() const override final A_CONST; - - void setItem(const Item *const item, - const int amount) const override final A_CONST; - - void reg(const int currentPrice, - const int maxPrice, - const int hours) const override final A_CONST; - - void cancel(const int auctionId) const override final A_CONST; - - void close(const int auctionId) const override final A_CONST; - - void bid(const int auctionId, - const int money) const override final A_CONST; - - void search(const AuctionSearchTypeT type, - const int auctionId, - const std::string &text, - const int page) const override final A_CONST; - - void buy() const override final A_CONST; - - void sell() const override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_AUCTIONHANDLER_H diff --git a/src/net/tmwa/bankhandler.cpp b/src/net/tmwa/bankhandler.cpp deleted file mode 100644 index cacab379f..000000000 --- a/src/net/tmwa/bankhandler.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/bankhandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -BankHandler::BankHandler() : - Net::BankHandler() -{ - bankHandler = this; -} - -BankHandler::~BankHandler() -{ - bankHandler = nullptr; -} - -void BankHandler::deposit(const int money A_UNUSED) const -{ -} - -void BankHandler::withdraw(const int money A_UNUSED) const -{ -} - -void BankHandler::check() const -{ -} - -void BankHandler::open() const -{ -} - -void BankHandler::close() const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/bankhandler.h b/src/net/tmwa/bankhandler.h deleted file mode 100644 index a99b7d50d..000000000 --- a/src/net/tmwa/bankhandler.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_BANKHANDLER_H -#define NET_TMWA_BANKHANDLER_H - -#include "net/bankhandler.h" - -namespace TmwAthena -{ - -class BankHandler final : public Net::BankHandler -{ - public: - BankHandler(); - - A_DELETE_COPY(BankHandler) - - ~BankHandler(); - - void deposit(const int money) const override final A_CONST; - - void withdraw(const int money) const override final A_CONST; - - void check() const override final A_CONST; - - void open() const override final A_CONST; - - void close() const override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_BANKHANDLER_H diff --git a/src/net/tmwa/battlegroundhandler.cpp b/src/net/tmwa/battlegroundhandler.cpp deleted file mode 100644 index b8631da1b..000000000 --- a/src/net/tmwa/battlegroundhandler.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/battlegroundhandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -BattleGroundHandler::BattleGroundHandler() -{ - battleGroundHandler = this; -} - -BattleGroundHandler::~BattleGroundHandler() -{ - battleGroundHandler = nullptr; -} - -void BattleGroundHandler::registerBg(const BattleGroundTypeT &type - A_UNUSED, - const std::string &name A_UNUSED) const -{ -} - -void BattleGroundHandler::rekoveRequest(const std::string &name A_UNUSED) const -{ -} - -void BattleGroundHandler::beginAck(const bool result A_UNUSED, - const std::string &bgName A_UNUSED, - const std::string &gameName A_UNUSED) const -{ -} - -void BattleGroundHandler::checkState(const std::string &name A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/battlegroundhandler.h b/src/net/tmwa/battlegroundhandler.h deleted file mode 100644 index 2a1126589..000000000 --- a/src/net/tmwa/battlegroundhandler.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_BATTLEGROUNDHANDLER_H -#define NET_TMWA_BATTLEGROUNDHANDLER_H - -#include "net/battlegroundhandler.h" - -namespace TmwAthena -{ - -class BattleGroundHandler final : public Net::BattleGroundHandler -{ - public: - BattleGroundHandler(); - - A_DELETE_COPY(BattleGroundHandler) - - ~BattleGroundHandler(); - - void registerBg(const BattleGroundTypeT &type, - const std::string &name) const override final A_CONST; - - void rekoveRequest(const std::string &name) const override final - A_CONST; - - void beginAck(const bool result, - const std::string &bgName, - const std::string &gameName) const override final - A_CONST; - - void checkState(const std::string &name) const override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_BATTLEGROUNDHANDLER_H diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp deleted file mode 100644 index c4e57627e..000000000 --- a/src/net/tmwa/beinghandler.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/beinghandler.h" - -#include "net/tmwa/messageout.h" -#include "net/tmwa/protocolout.h" -#include "net/tmwa/sprite.h" - -#include "debug.h" - -namespace TmwAthena -{ - -BeingHandler::BeingHandler(const bool enableSync) : - Ea::BeingHandler(enableSync) -{ - beingHandler = this; -} - -BeingHandler::~BeingHandler() -{ - beingHandler = nullptr; -} - -void BeingHandler::requestNameById(const BeingId id) const -{ - createOutPacket(CMSG_NAME_REQUEST); - outMsg.writeBeingId(id, "being id"); -} - -void BeingHandler::undress(Being *const being) const -{ - if (being == nullptr) - return; - being->unSetSprite(SPRITE_WEAPON); - being->unSetSprite(SPRITE_HEAD_BOTTOM); - being->unSetSprite(SPRITE_CLOTHES_COLOR); - being->unSetSprite(SPRITE_HAIR); - being->unSetSprite(SPRITE_SHOES); -} - -void BeingHandler::requestRanks(const RankT rank A_UNUSED) const -{ -} - -void BeingHandler::viewPlayerEquipment(const Being *const being A_UNUSED) const -{ -} - -void BeingHandler::requestNameByCharId(const int id A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/beinghandler.h b/src/net/tmwa/beinghandler.h deleted file mode 100644 index 04cced3ed..000000000 --- a/src/net/tmwa/beinghandler.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_BEINGHANDLER_H -#define NET_TMWA_BEINGHANDLER_H - -#include "net/ea/beinghandler.h" - -namespace TmwAthena -{ - -class BeingHandler final : public Ea::BeingHandler -{ - public: - explicit BeingHandler(const bool enableSync); - - A_DELETE_COPY(BeingHandler) - - ~BeingHandler(); - - void requestNameById(const BeingId id) const override final; - - void undress(Being *const being) const override final; - - void requestRanks(const RankT rank A_UNUSED) const override final - A_CONST; - - void viewPlayerEquipment(const Being *const being) const override final - A_CONST; - - void requestNameByCharId(const int id) const override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_BEINGHANDLER_H diff --git a/src/net/tmwa/beingrecv.cpp b/src/net/tmwa/beingrecv.cpp deleted file mode 100644 index bb165789d..000000000 --- a/src/net/tmwa/beingrecv.cpp +++ /dev/null @@ -1,1517 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/beingrecv.h" - -#include "actormanager.h" -#include "configuration.h" -#include "effectmanager.h" -#include "guild.h" -#include "party.h" - -#include "being/localplayer.h" - -#include "particle/particleengine.h" - -#include "input/keyboardconfig.h" - -#include "gui/windows/okdialog.h" -#include "gui/windows/outfitwindow.h" -#include "gui/windows/socialwindow.h" - -#include "net/beinghandler.h" -#include "net/serverfeatures.h" - -#include "net/messagein.h" - -#include "net/ea/beingrecv.h" - -#include "net/tmwa/guildmanager.h" -#include "net/tmwa/sprite.h" - -#include "resources/iteminfo.h" - -#include "resources/db/itemdb.h" - -#include "utils/timer.h" - -#include "debug.h" - -extern OkDialog *deathNotice; - -namespace TmwAthena -{ - -static void setGm(Being *const dstBeing, - const uint16_t gmstatus) -{ - if (dstBeing != localPlayer) - { - if ((gmstatus & 0x80) != 0) - { - dstBeing->setGroupId(paths.getIntValue("gmDefaultLevel")); - dstBeing->setGM(true); - } - else - { - dstBeing->setGroupId(0); - dstBeing->setGM(false); - } - } - else - { - if ((gmstatus & 0x80) != 0) - dstBeing->setGM(true); - else - dstBeing->setGM(false); - } -} - -void BeingRecv::processBeingChangeLook(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingChangeLook") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processBeingChangeLook") - return; - } - - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - - const uint8_t type = msg.readUInt8("type"); - const int16_t id = CAST_S16(msg.readUInt8("id")); - const int id2 = 1; - - if ((localPlayer == nullptr) || (dstBeing == nullptr)) - { - BLOCK_END("BeingRecv::processBeingChangeLook") - return; - } - processBeingChangeLookContinue(msg, dstBeing, type, id, id2); - BLOCK_END("BeingRecv::processBeingChangeLook") -} - -void BeingRecv::processBeingChangeLook2(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingChangeLook") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processBeingChangeLook") - return; - } - - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - - const uint8_t type = msg.readUInt8("type"); - int id2 = 0; - - const int16_t id = msg.readInt16("id1"); - if (type == 2) - { - id2 = msg.readInt16("id2"); - } - else - { - msg.readInt16("id2"); - id2 = 1; - } - - if ((localPlayer == nullptr) || (dstBeing == nullptr)) - { - BLOCK_END("BeingRecv::processBeingChangeLook") - return; - } - processBeingChangeLookContinue(msg, dstBeing, type, id, id2); - BLOCK_END("BeingRecv::processBeingChangeLook") -} - -void BeingRecv::processBeingChangeLookContinue(const Net::MessageIn &msg, - Being *const dstBeing, - const uint8_t type, - const int id, - const int id2) -{ - if (dstBeing->getType() == ActorType::Player) - dstBeing->setOtherTime(); - - switch (type) - { - case 0: // change race - dstBeing->setSubtype(fromInt(id, BeingTypeId), - dstBeing->getLook()); - break; - case 1: // eAthena LOOK_HAIR - { - const uint16_t look = CAST_U16(id / 256); - const int hair = id % 256; - dstBeing->setHairStyle(SPRITE_HAIR_COLOR, hair * -1); - dstBeing->setLook(look); - break; - } - case 2: // Weapon ID in id, Shield ID in id2 - dstBeing->setSpriteId(SPRITE_BODY, - id); - dstBeing->setWeaponId(id); - dstBeing->setSpriteId(SPRITE_FLOOR, - id2); - localPlayer->imitateOutfit(dstBeing, SPRITE_FLOOR); - break; - case 3: // Change lower headgear for eAthena, pants for us - dstBeing->setSpriteId(SPRITE_WEAPON, - id); - localPlayer->imitateOutfit(dstBeing, SPRITE_WEAPON); - break; - case 4: // Change upper headgear for eAthena, hat for us - dstBeing->setSpriteId(SPRITE_CLOTHES_COLOR, - id); - localPlayer->imitateOutfit(dstBeing, SPRITE_CLOTHES_COLOR); - break; - case 5: // Change middle headgear for eathena, armor for us - dstBeing->setSpriteId(SPRITE_HEAD_BOTTOM, - id); - localPlayer->imitateOutfit(dstBeing, SPRITE_HEAD_BOTTOM); - break; - case 6: // eAthena LOOK_HAIR_COLOR - dstBeing->setHairColor(SPRITE_HAIR_COLOR, - fromInt(id, ItemColor)); - break; - case 7: // Clothes color - // ignoring it - break; - case 8: // eAthena LOOK_SHIELD - dstBeing->setSpriteId(SPRITE_FLOOR, - id); - localPlayer->imitateOutfit(dstBeing, SPRITE_FLOOR); - break; - case 9: // eAthena LOOK_SHOES - dstBeing->setSpriteId(SPRITE_HAIR, - id); - localPlayer->imitateOutfit(dstBeing, SPRITE_HAIR); - break; - case 10: // LOOK_GLOVES - dstBeing->setSpriteId(SPRITE_SHOES, - id); - localPlayer->imitateOutfit(dstBeing, SPRITE_SHOES); - break; - case 11: // LOOK_CAPE - dstBeing->setSpriteId(SPRITE_SHIELD, - id); - localPlayer->imitateOutfit(dstBeing, SPRITE_SHIELD); - break; - case 12: - dstBeing->setSpriteId(SPRITE_HEAD_TOP, - id); - localPlayer->imitateOutfit(dstBeing, SPRITE_HEAD_TOP); - break; - case 13: - dstBeing->setSpriteId(SPRITE_HEAD_MID, - id); - localPlayer->imitateOutfit(dstBeing, SPRITE_HEAD_MID); - break; - case 14: - dstBeing->setSpriteId(SPRITE_ROBE, - id); - localPlayer->imitateOutfit(dstBeing, SPRITE_ROBE); - break; - case 15: - dstBeing->setSpriteId(SPRITE_EVOL2, - id); - localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL2); - break; - case 16: - dstBeing->setLook(CAST_U16(id)); - break; - default: - UNIMPLEMENTEDPACKETFIELD(type); - break; - } -} - -void BeingRecv::processPlayerUpdate1(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processPlayerMoveUpdate") - if ((actorManager == nullptr) || (localPlayer == nullptr)) - { - BLOCK_END("BeingRecv::processPlayerMoveUpdate") - return; - } - - // An update about a player, potentially including movement. - const BeingId id = msg.readBeingId("account id"); - const int16_t speed = msg.readInt16("speed"); - const uint32_t opt1 = msg.readInt16("opt1"); - const uint32_t opt2 = msg.readInt16("opt2"); - const uint32_t option = msg.readInt16("option"); - const int16_t job = msg.readInt16("job"); - int disguiseId = 0; - if (toInt(id, int) < 110000000 && job >= 1000) - disguiseId = job; - - Being *dstBeing = actorManager->findBeing(id); - if (dstBeing == nullptr) - { - if (actorManager->isBlocked(id) == true) - { - BLOCK_END("BeingRecv::processPlayerMoveUpdate") - return; - } - - dstBeing = Ea::BeingRecv::createBeing(id, job); - - if (dstBeing == nullptr) - { - BLOCK_END("BeingRecv::processPlayerMoveUpdate") - return; - } - } - else if (disguiseId != 0) - { - actorManager->undelete(dstBeing); - beingHandler->requestNameById(id); - } - - uint8_t dir = dstBeing->getDirectionDelayed(); - if (dir != 0u) - { - if (dir != dstBeing->getDirection()) - dstBeing->setDirection(dir); - } - - if (Party *const party = localPlayer->getParty()) - { - if (party->isMember(id)) - dstBeing->setParty(party); - } - - dstBeing->setWalkSpeed(speed); - - const uint8_t hairStyle = msg.readUInt8("hair style"); - const uint16_t look = msg.readUInt8("look"); - dstBeing->setSubtype(fromInt(job, BeingTypeId), look); - const uint16_t weapon = msg.readInt16("weapon"); - const uint16_t shield = msg.readInt16("shield"); - const uint16_t headBottom = msg.readInt16("head bottom"); - - const uint16_t headTop = msg.readInt16("head top"); - const uint16_t headMid = msg.readInt16("head mid"); - const ItemColor hairColor = fromInt( - msg.readUInt8("hair color"), ItemColor); - msg.readUInt8("unused"); - msg.readInt32("unused"); - - const int guild = msg.readInt32("guild"); - - if ((guildManager == nullptr) || !GuildManager::getEnableGuildBot()) - { - if (guild == 0) - dstBeing->clearGuilds(); - else - dstBeing->setGuild(Guild::getGuild(CAST_S16(guild))); - } - - msg.readInt16("emblem"); - dstBeing->setManner(msg.readInt16("manner")); - const uint32_t opt3 = msg.readInt16("opt3"); - dstBeing->setKarma(msg.readUInt8("karma")); - // reserving bit for future usage - dstBeing->setGender(Being::intToGender( - CAST_U8(msg.readUInt8("gender") & 3))); - - if (disguiseId == 0) - { - // Set these after the gender, as the sprites may be gender-specific - dstBeing->updateSprite(SPRITE_BODY, - weapon, - ""); - dstBeing->setWeaponId(weapon); - dstBeing->updateSprite(SPRITE_FLOOR, shield); - dstBeing->updateSprite(SPRITE_WEAPON, headBottom); - dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid); - dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop); - if (hairStyle == 0) - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, - 0, - std::string()); - } - else - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, - hairStyle * -1, - ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); - } - dstBeing->setHairColor(hairColor); - } - localPlayer->imitateOutfit(dstBeing); - - uint16_t x, y; - msg.readCoordinates(x, y, dir, "position"); - dstBeing->setTileCoords(x, y); - dstBeing->setDirection(dir); - - localPlayer->imitateDirection(dstBeing, dir); - - const uint16_t gmstatus = msg.readInt16("gm status"); - - setGm(dstBeing, gmstatus); - - applyPlayerAction(msg, dstBeing, msg.readUInt8("action type")); - const int level = CAST_S32(msg.readUInt8("level")); - if (level != 0) - dstBeing->setLevel(level); - - msg.readUInt8("unused"); - - dstBeing->setActionTime(tick_time); - - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2, - opt3); - - BLOCK_END("BeingRecv::processPlayerMoveUpdate") -} - -void BeingRecv::processPlayerUpdate2(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processPlayerMoveUpdate") - if ((actorManager == nullptr) || (localPlayer == nullptr)) - { - BLOCK_END("BeingRecv::processPlayerMoveUpdate") - return; - } - - // An update about a player, potentially including movement. - const BeingId id = msg.readBeingId("account id"); - const int16_t speed = msg.readInt16("speed"); - const uint32_t opt1 = msg.readInt16("opt1"); - const uint32_t opt2 = msg.readInt16("opt2"); - const uint32_t option = msg.readInt16("option"); - const int16_t job = msg.readInt16("job"); - int disguiseId = 0; - if (toInt(id, int) < 110000000 && job >= 1000) - disguiseId = job; - - Being *dstBeing = actorManager->findBeing(id); - if (dstBeing == nullptr) - { - if (actorManager->isBlocked(id) == true) - { - BLOCK_END("BeingRecv::processPlayerMoveUpdate") - return; - } - - dstBeing = Ea::BeingRecv::createBeing(id, job); - - if (dstBeing == nullptr) - { - BLOCK_END("BeingRecv::processPlayerMoveUpdate") - return; - } - } - else if (disguiseId != 0) - { - actorManager->undelete(dstBeing); - beingHandler->requestNameById(id); - } - - uint8_t dir = dstBeing->getDirectionDelayed(); - if (dir != 0u) - { - if (dir != dstBeing->getDirection()) - dstBeing->setDirection(dir); - } - - if (Party *const party = localPlayer->getParty()) - { - if (party->isMember(id)) - dstBeing->setParty(party); - } - - dstBeing->setWalkSpeed(speed); - - const uint8_t hairStyle = msg.readUInt8("hair style"); - const uint16_t look = msg.readUInt8("look"); - dstBeing->setSubtype(fromInt(job, BeingTypeId), look); - const uint16_t weapon = msg.readInt16("weapon"); - const uint16_t shield = msg.readInt16("shield"); - const uint16_t headBottom = msg.readInt16("head bottom"); - const uint16_t headTop = msg.readInt16("head top"); - const uint16_t headMid = msg.readInt16("head mid"); - const ItemColor hairColor = fromInt( - msg.readUInt8("hair color"), ItemColor); - msg.readUInt8("unused"); - msg.readInt32("unused"); - - const int guild = msg.readInt32("guild"); - - if ((guildManager == nullptr) || !GuildManager::getEnableGuildBot()) - { - if (guild == 0) - dstBeing->clearGuilds(); - else - dstBeing->setGuild(Guild::getGuild(CAST_S16(guild))); - } - - msg.readInt16("emblem"); - dstBeing->setManner(msg.readInt16("manner")); - const uint32_t opt3 = msg.readInt16("opt3"); - dstBeing->setKarma(msg.readUInt8("karma")); - // reserving bit for future usage - dstBeing->setGender(Being::intToGender( - CAST_U8(msg.readUInt8("gender") & 3))); - - if (disguiseId == 0) - { - // Set these after the gender, as the sprites may be gender-specific - dstBeing->updateSprite(SPRITE_BODY, - weapon, - ""); - dstBeing->setWeaponId(weapon); - dstBeing->updateSprite(SPRITE_FLOOR, shield); - dstBeing->updateSprite(SPRITE_WEAPON, headBottom); - dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid); - dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop); - if (hairStyle == 0) - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, - 0, - std::string()); - } - else - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, - hairStyle * -1, - ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); - } - dstBeing->setHairColor(hairColor); - } - localPlayer->imitateOutfit(dstBeing); - - uint16_t x, y; - msg.readCoordinates(x, y, dir, "position"); - dstBeing->setTileCoords(x, y); - dstBeing->setDirection(dir); - - localPlayer->imitateDirection(dstBeing, dir); - - const uint16_t gmstatus = msg.readInt16("gm status"); - - setGm(dstBeing, gmstatus); - - applyPlayerAction(msg, dstBeing, msg.readUInt8("action type")); - const int level = CAST_S32(msg.readUInt8("level")); - if (level != 0) - dstBeing->setLevel(level); - - dstBeing->setActionTime(tick_time); - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2, - opt3); - - BLOCK_END("BeingRecv::processPlayerMoveUpdate") -} - -void BeingRecv::processPlayerMove(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processPlayerMoveUpdate") - if ((actorManager == nullptr) || (localPlayer == nullptr)) - { - BLOCK_END("BeingRecv::processPlayerMoveUpdate") - return; - } - - // An update about a player, potentially including movement. - const BeingId id = msg.readBeingId("account id"); - const int16_t speed = msg.readInt16("speed"); - const uint32_t opt1 = msg.readInt16("opt1"); - const uint32_t opt2 = msg.readInt16("opt2"); - const uint32_t option = msg.readInt16("option"); - const int16_t job = msg.readInt16("job"); - int disguiseId = 0; - if (toInt(id, int) < 110000000 && job >= 1000) - disguiseId = job; - - Being *dstBeing = actorManager->findBeing(id); - if (dstBeing == nullptr) - { - if (actorManager->isBlocked(id) == true) - { - BLOCK_END("BeingRecv::processPlayerMoveUpdate") - return; - } - - dstBeing = Ea::BeingRecv::createBeing(id, job); - - if (dstBeing == nullptr) - { - BLOCK_END("BeingRecv::processPlayerMoveUpdate") - return; - } - } - else if (disguiseId != 0) - { - actorManager->undelete(dstBeing); - beingHandler->requestNameById(id); - } - - const uint8_t dir = dstBeing->getDirectionDelayed(); - if (dir != 0u) - { - if (dir != dstBeing->getDirection()) - dstBeing->setDirection(dir); - } - - if (Party *const party = localPlayer->getParty()) - { - if (party->isMember(id)) - dstBeing->setParty(party); - } - - dstBeing->setWalkSpeed(speed); - - const uint8_t hairStyle = msg.readUInt8("hair style"); - const uint16_t look = msg.readUInt8("look"); - dstBeing->setSubtype(fromInt(job, BeingTypeId), look); - const uint16_t weapon = msg.readInt16("weapon"); - const uint16_t shield = msg.readInt16("shield"); - const uint16_t headBottom = msg.readInt16("head bottom"); - - msg.readInt32("tick"); - - const uint16_t headTop = msg.readInt16("head top"); - const uint16_t headMid = msg.readInt16("head mid"); - const ItemColor hairColor = fromInt( - msg.readUInt8("hair color"), ItemColor); - msg.readUInt8("unused"); - msg.readInt32("unused"); - - const int guild = msg.readInt32("guild"); - - if ((guildManager == nullptr) || !GuildManager::getEnableGuildBot()) - { - if (guild == 0) - dstBeing->clearGuilds(); - else - dstBeing->setGuild(Guild::getGuild(CAST_S16(guild))); - } - - msg.readInt16("emblem"); - dstBeing->setManner(msg.readInt16("manner")); - const uint32_t opt3 = msg.readInt16("opt3"); - dstBeing->setKarma(msg.readUInt8("karma")); - // reserving bit for future usage - dstBeing->setGender(Being::intToGender( - CAST_U8(msg.readUInt8("gender") & 3))); - - if (disguiseId == 0) - { - // Set these after the gender, as the sprites may be gender-specific - dstBeing->updateSprite(SPRITE_BODY, - weapon, - ""); - dstBeing->setWeaponId(weapon); - dstBeing->updateSprite(SPRITE_FLOOR, shield); - dstBeing->updateSprite(SPRITE_WEAPON, headBottom); - dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid); - dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop); - if (hairStyle == 0) - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, - 0, - std::string()); - } - else - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, - hairStyle * -1, - ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); - } - dstBeing->setHairColor(hairColor); - } - localPlayer->imitateOutfit(dstBeing); - - uint16_t srcX, srcY, dstX, dstY; - msg.readCoordinatePair(srcX, srcY, dstX, dstY, "moving path"); - - localPlayer->followMoveTo(dstBeing, srcX, srcY, dstX, dstY); - - dstBeing->setTileCoords(srcX, srcY); - dstBeing->setDestination(dstX, dstY); - - // because server don't send direction in move packet, - // we fixing it - - if (srcX != dstX || srcY != dstY) - { - const int d = dstBeing->calcDirection(dstX, dstY); - - if ((d != 0) && dstBeing->getDirection() != d) - dstBeing->setDirectionDelayed(CAST_U8(d)); - } - - if (localPlayer->getCurrentAction() != BeingAction::STAND) - localPlayer->imitateAction(dstBeing, BeingAction::STAND); - if (localPlayer->getDirection() != dstBeing->getDirection()) - { - localPlayer->imitateDirection(dstBeing, - dstBeing->getDirection()); - } - - const uint16_t gmstatus = msg.readInt16("gm status"); - - setGm(dstBeing, gmstatus); - - msg.readUInt8("unused"); - - const int level = CAST_S32(msg.readUInt8("level")); - if (level != 0) - dstBeing->setLevel(level); - - msg.readUInt8("unused"); - - if (dstBeing->getType() != ActorType::Player) - dstBeing->setActionTime(tick_time); - - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2, - opt3); - - if (dstBeing->getType() == ActorType::Player) - dstBeing->setMoveTime(); - BLOCK_END("BeingRecv::processPlayerMoveUpdate") -} - -void BeingRecv::processBeingVisible(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingVisibleOrMove") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processBeingVisibleOrMove") - return; - } - - BeingId spawnId; - - // Information about a being in range - const BeingId id = msg.readBeingId("being id"); - if (id == Ea::BeingRecv::mSpawnId) - spawnId = Ea::BeingRecv::mSpawnId; - else - spawnId = BeingId_zero; - Ea::BeingRecv::mSpawnId = BeingId_zero; - int16_t speed = msg.readInt16("speed"); - const uint32_t opt1 = msg.readInt16("opt1"); - const uint32_t opt2 = msg.readInt16("opt2"); - const uint32_t option = msg.readInt16("option"); - const int16_t job = msg.readInt16("class"); - int disguiseId = 0; - if (id == localPlayer->getId() && job >= 1000) - disguiseId = job; - - Being *dstBeing = actorManager->findBeing(id); - - if ((dstBeing != nullptr) && dstBeing->getType() == ActorType::Monster - && !dstBeing->isAlive()) - { - actorManager->destroy(dstBeing); - actorManager->erase(dstBeing); - dstBeing = nullptr; - } - - if (dstBeing == nullptr) - { - // Being with id >= 110000000 and job 0 are better - // known as ghosts, so don't create those. - if (job == 0 && toInt(id, int) >= 110000000) - { - BLOCK_END("BeingRecv::processBeingVisibleOrMove") - return; - } - - if (actorManager->isBlocked(id) == true) - { - BLOCK_END("BeingRecv::processBeingVisibleOrMove") - return; - } - - dstBeing = Ea::BeingRecv::createBeing(id, job); - - if (dstBeing == nullptr) - { - BLOCK_END("BeingRecv::processBeingVisibleOrMove") - return; - } - } - else - { - if (dstBeing->getType() == ActorType::Npc) - { - actorManager->undelete(dstBeing); - beingHandler->requestNameById(id); - } - } - - if (dstBeing->getType() == ActorType::Player) - dstBeing->setMoveTime(); - - if (spawnId != BeingId_zero) - { - dstBeing->setAction(BeingAction::SPAWN, 0); - } - else - { - dstBeing->clearPath(); - dstBeing->setActionTime(tick_time); - dstBeing->setAction(BeingAction::STAND, 0); - } - - // Prevent division by 0 when calculating frame - if (speed == 0) - speed = 150; - - const uint8_t hairStyle = msg.readUInt8("hair style"); - const uint16_t look = msg.readUInt8("look"); - dstBeing->setSubtype(fromInt(job, BeingTypeId), look); - if (dstBeing->getType() == ActorType::Monster && (localPlayer != nullptr)) - localPlayer->checkNewName(dstBeing); - dstBeing->setWalkSpeed(speed); - const uint16_t weapon = msg.readInt16("weapon"); - const uint16_t headBottom = msg.readInt16("head bottom"); - - const uint16_t shield = msg.readInt16("shield"); - const uint16_t headTop = msg.readInt16("head top"); - const uint16_t headMid = msg.readInt16("head mid"); - const ItemColor hairColor = fromInt(msg.readUInt8("hair color"), - ItemColor); - msg.readUInt8("unused"); - const uint16_t shoes = msg.readInt16("shoes / clothes color"); - - uint16_t gloves; - if (dstBeing->getType() == ActorType::Monster) - { - if (serverFeatures->haveServerHp()) - { - const int hp = msg.readInt32("hp"); - const int maxHP = msg.readInt32("max hp"); - if ((hp != 0) && (maxHP != 0)) - { - dstBeing->setMaxHP(maxHP); - const int oldHP = dstBeing->getHP(); - if ((oldHP == 0) || oldHP > hp) - dstBeing->setHP(hp); - } - } - else - { - msg.readInt32("unused"); - msg.readInt32("unused"); - } - gloves = 0; - } - else - { - gloves = msg.readInt16("gloves / head dir"); - msg.readInt32("guild"); - msg.readInt16("guild emblem"); - } - - dstBeing->setManner(msg.readInt16("manner")); - const uint32_t opt3 = msg.readInt16("opt3"); - if (serverFeatures->haveMonsterAttackRange() - && dstBeing->getType() == ActorType::Monster) - { - const int attackRange = CAST_S32( - msg.readUInt8("attack range (was karma)")); - dstBeing->setAttackRange(attackRange); - } - else - { - dstBeing->setKarma(msg.readUInt8("karma")); - } - uint8_t gender = msg.readUInt8("gender"); - - if ((disguiseId == 0) && dstBeing->getType() == ActorType::Player) - { - // reserving bits for future usage - gender &= 3; - dstBeing->setGender(Being::intToGender(gender)); - // Set these after the gender, as the sprites may be gender-specific - if (hairStyle == 0) - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, 0); - } - else - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, - hairStyle * -1, - ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); - } - dstBeing->setHairColor(hairColor); - dstBeing->updateSprite(SPRITE_WEAPON, headBottom); - dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid); - dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop); - dstBeing->updateSprite(SPRITE_HAIR, shoes); - dstBeing->updateSprite(SPRITE_SHOES, gloves); - dstBeing->updateSprite(SPRITE_BODY, weapon); - dstBeing->setWeaponId(weapon); - dstBeing->updateSprite(SPRITE_FLOOR, shield); - } - else if (dstBeing->getType() == ActorType::Npc - && serverFeatures->haveNpcGender()) - { - setServerGender(dstBeing, gender); - } - - uint8_t dir; - uint16_t x, y; - msg.readCoordinates(x, y, dir, "position"); - dstBeing->setTileCoords(x, y); - - if (job == 45 && (socialWindow != nullptr) && (outfitWindow != nullptr)) - { - const int num = socialWindow->getPortalIndex(x, y); - if (num >= 0) - { - dstBeing->setName(KeyboardConfig::getKeyShortString( - OutfitWindow::keyName(num))); - } - else - { - dstBeing->setName(""); - } - } - - dstBeing->setDirection(dir); - - msg.readUInt8("unknown"); - msg.readUInt8("unknown"); - msg.readUInt8("unknown"); - msg.readUInt8("unknown"); - msg.readUInt8("unknown"); - - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2, - opt3); - BLOCK_END("BeingRecv::processBeingVisibleOrMove") -} - -void BeingRecv::processBeingMove(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingVisibleOrMove") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processBeingVisibleOrMove") - return; - } - - BeingId spawnId; - - // Information about a being in range - const BeingId id = msg.readBeingId("being id"); - if (id == Ea::BeingRecv::mSpawnId) - spawnId = Ea::BeingRecv::mSpawnId; - else - spawnId = BeingId_zero; - Ea::BeingRecv::mSpawnId = BeingId_zero; - int16_t speed = msg.readInt16("speed"); - const uint32_t opt1 = msg.readInt16("opt1"); - const uint32_t opt2 = msg.readInt16("opt2"); - const uint32_t option = msg.readInt16("option"); - const int16_t job = msg.readInt16("class"); - int disguiseId = 0; - if (id == localPlayer->getId() && job >= 1000) - disguiseId = job; - - Being *dstBeing = actorManager->findBeing(id); - - if ((dstBeing != nullptr) && dstBeing->getType() == ActorType::Monster - && !dstBeing->isAlive()) - { - actorManager->destroy(dstBeing); - actorManager->erase(dstBeing); - dstBeing = nullptr; - } - - if (dstBeing == nullptr) - { - // Being with id >= 110000000 and job 0 are better - // known as ghosts, so don't create those. - if (job == 0 && toInt(id, int) >= 110000000) - { - BLOCK_END("BeingRecv::processBeingVisibleOrMove") - return; - } - - if (actorManager->isBlocked(id) == true) - { - BLOCK_END("BeingRecv::processBeingVisibleOrMove") - return; - } - - dstBeing = Ea::BeingRecv::createBeing(id, job); - - if (dstBeing == nullptr) - { - BLOCK_END("BeingRecv::processBeingVisibleOrMove") - return; - } - } - else - { - if (dstBeing->getType() == ActorType::Npc) - { - actorManager->undelete(dstBeing); - beingHandler->requestNameById(id); - } - } - - if (dstBeing->getType() == ActorType::Player) - dstBeing->setMoveTime(); - - if (spawnId != BeingId_zero) - dstBeing->setAction(BeingAction::SPAWN, 0); - - // Prevent division by 0 when calculating frame - if (speed == 0) - speed = 150; - - const uint8_t hairStyle = msg.readUInt8("hair style"); - const uint16_t look = msg.readUInt8("look"); - dstBeing->setSubtype(fromInt(job, BeingTypeId), look); - if (dstBeing->getType() == ActorType::Monster && (localPlayer != nullptr)) - localPlayer->checkNewName(dstBeing); - dstBeing->setWalkSpeed(speed); - const uint16_t weapon = msg.readInt16("weapon"); - const uint16_t headBottom = msg.readInt16("head bottom"); - - msg.readInt32("tick"); - - const uint16_t shield = msg.readInt16("shield"); - const uint16_t headTop = msg.readInt16("head top"); - const uint16_t headMid = msg.readInt16("head mid"); - const ItemColor hairColor = fromInt( - msg.readUInt8("hair color"), ItemColor); - msg.readUInt8("unused"); - const uint16_t shoes = msg.readInt16("shoes / clothes color"); - - uint16_t gloves; - if (dstBeing->getType() == ActorType::Monster) - { - if (serverFeatures->haveServerHp()) - { - const int hp = msg.readInt32("hp"); - const int maxHP = msg.readInt32("max hp"); - if ((hp != 0) && (maxHP != 0)) - { - dstBeing->setMaxHP(maxHP); - const int oldHP = dstBeing->getHP(); - if ((oldHP == 0) || oldHP > hp) - dstBeing->setHP(hp); - } - } - else - { - msg.readInt32("unused"); - msg.readInt32("unused"); - } - gloves = 0; - } - else - { - gloves = msg.readInt16("gloves / head dir"); - msg.readInt32("guild"); - msg.readInt16("guild emblem"); - } - - dstBeing->setManner(msg.readInt16("manner")); - const uint32_t opt3 = msg.readInt16("opt3"); - if (serverFeatures->haveMonsterAttackRange() - && dstBeing->getType() == ActorType::Monster) - { - const int attackRange = CAST_S32( - msg.readUInt8("attack range (was karma)")); - dstBeing->setAttackRange(attackRange); - } - else - { - dstBeing->setKarma(msg.readUInt8("karma")); - } - uint8_t gender = msg.readUInt8("gender"); - - if ((disguiseId == 0) && dstBeing->getType() == ActorType::Player) - { - // reserving bits for future usage - gender &= 3; - dstBeing->setGender(Being::intToGender(gender)); - // Set these after the gender, as the sprites may be gender-specific - if (hairStyle == 0) - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, 0); - } - else - { - dstBeing->updateSprite(SPRITE_HAIR_COLOR, - hairStyle * -1, - ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); - } - dstBeing->setHairColor(hairColor); - dstBeing->updateSprite(SPRITE_WEAPON, headBottom); - dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid); - dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop); - dstBeing->updateSprite(SPRITE_HAIR, shoes); - dstBeing->updateSprite(SPRITE_SHOES, gloves); - dstBeing->updateSprite(SPRITE_BODY, weapon); - dstBeing->setWeaponId(weapon); - dstBeing->updateSprite(SPRITE_FLOOR, shield); - } - else if (dstBeing->getType() == ActorType::Npc - && serverFeatures->haveNpcGender()) - { - setServerGender(dstBeing, gender); - } - - uint16_t srcX, srcY, dstX, dstY; - msg.readCoordinatePair(srcX, srcY, dstX, dstY, "move path"); - if (disguiseId == 0) - { - dstBeing->setAction(BeingAction::STAND, 0); - dstBeing->setTileCoords(srcX, srcY); - if (serverFeatures->haveMove3()) - dstBeing->setCachedDestination(dstX, dstY); - else - dstBeing->setDestination(dstX, dstY); - } - - msg.readUInt8("unknown"); - msg.readUInt8("unknown"); - msg.readUInt8("unknown"); - msg.readUInt8("unknown"); - msg.readUInt8("unknown"); - - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2, - opt3); - BLOCK_END("BeingRecv::processBeingVisibleOrMove") -} - -void BeingRecv::processBeingSpawn(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingSpawn") - // skipping this packet - Ea::BeingRecv::mSpawnId = msg.readBeingId("being id"); - msg.readInt16("speed"); - msg.readInt16("opt1"); - msg.readInt16("opt2"); - msg.readInt16("option"); - msg.readInt16("disguise"); - msg.skip(25, "unused"); - BLOCK_END("BeingRecv::processBeingSpawn") -} - -void BeingRecv::processSkillCasting(Net::MessageIn &msg) -{ - msg.readInt32("src id"); - msg.readInt32("dst id"); - msg.readInt16("dst x"); - msg.readInt16("dst y"); - msg.readInt16("skill num"); - msg.readInt32("skill get p1"); - msg.readInt32("cast time"); -} - -void BeingRecv::processBeingStatusChange(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingStatusChange") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processBeingStatusChange") - return; - } - - // Status change - const uint16_t status = msg.readInt16("status"); - const BeingId id = msg.readBeingId("being id"); - const Enable flag = fromBool( - msg.readUInt8("flag: 0: stop, 1: start"), Enable); - - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing != nullptr) - { - // dont know on legacy servers is effect really started - // or not. Because this always sending IsStart_true - dstBeing->setStatusEffect(status, flag, IsStart_true); - } - BLOCK_END("BeingRecv::processBeingStatusChange") -} - -void BeingRecv::processBeingMove2(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingMove2") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processBeingMove2") - return; - } - - /* - * A simplified movement packet, used by the - * later versions of eAthena for both mobs and - * players - */ - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - - /* - * This packet doesn't have enough info to actually - * create a new being, so if the being isn't found, - * we'll just pretend the packet didn't happen - */ - - if (dstBeing == nullptr) - { - BLOCK_END("BeingRecv::processBeingMove2") - return; - } - - uint16_t srcX, srcY, dstX, dstY; - msg.readCoordinatePair(srcX, srcY, dstX, dstY, "move path"); - msg.readInt32("tick"); - - dstBeing->setAction(BeingAction::STAND, 0); - dstBeing->setTileCoords(srcX, srcY); - dstBeing->setDestination(dstX, dstY); - if (dstBeing->getType() == ActorType::Player) - dstBeing->setMoveTime(); - BLOCK_END("BeingRecv::processBeingMove2") -} - -void BeingRecv::processBeingChangeDirection(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingChangeDirection") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processBeingChangeDirection") - return; - } - - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - - if (dstBeing == nullptr) - { - DEBUGLOGSTR("invisible player?"); - msg.readInt16("unused"); - msg.readUInt8("direction"); - BLOCK_END("BeingRecv::processBeingChangeDirection"); - return; - } - - msg.readInt16("unused"); - - const uint8_t dir = Net::MessageIn::fromServerDirection( - CAST_U8(msg.readUInt8("direction") & 0x0FU)); - dstBeing->setDirection(dir); - if (localPlayer != nullptr) - localPlayer->imitateDirection(dstBeing, dir); - BLOCK_END("BeingRecv::processBeingChangeDirection") -} - -void BeingRecv::processPlayerStatusChange(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processPlayerStop") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processPlayerStop") - return; - } - - // Change in players' flags - const BeingId id = msg.readBeingId("account id"); - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing == nullptr) - { - DEBUGLOGSTR("invisible player?"); - msg.readInt16("stun mode"); - msg.readInt16("status effect"); - msg.readInt16("opt?"); - msg.readUInt8("Unused?"); - return; - } - - const uint32_t opt1 = msg.readInt16("opt1"); - const uint32_t opt2 = msg.readInt16("opt2"); - const uint32_t option = msg.readInt16("option"); - msg.readUInt8("Unused?"); - - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2); - BLOCK_END("BeingRecv::processPlayerStop") -} - -void BeingRecv::processBeingResurrect(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingResurrect") - if (actorManager == nullptr || localPlayer == nullptr) - { - BLOCK_END("BeingRecv::processBeingResurrect") - return; - } - - // A being changed mortality status - - const BeingId id = msg.readBeingId("being id"); - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing == nullptr) - { - DEBUGLOGSTR("insible player?"); - msg.readInt16("flag?"); - BLOCK_END("BeingRecv::processBeingResurrect") - return; - } - - // If this is player's current target, clear it. - if (dstBeing == localPlayer->getTarget()) - localPlayer->stopAttack(); - if (dstBeing == localPlayer && - deathNotice != nullptr) - { - deathNotice->scheduleDelete(); - deathNotice = nullptr; - } - - if (msg.readInt16("flag?") == 1) - dstBeing->setAction(BeingAction::STAND, 0); - BLOCK_END("BeingRecv::processBeingResurrect") -} - -void BeingRecv::processPlayerGuilPartyInfo(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processPlayerGuilPartyInfo") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processPlayerGuilPartyInfo") - return; - } - - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - - if (dstBeing != nullptr) - { - dstBeing->setPartyName(msg.readString(24, "party name")); - if ((guildManager == nullptr) || !GuildManager::getEnableGuildBot()) - { - dstBeing->setGuildName(msg.readString(24, "guild name")); - dstBeing->setGuildPos(msg.readString(24, "guild pos")); - } - else - { - msg.readString(24, "guild name"); - msg.readString(24, "guild pos"); - } - dstBeing->addToCache(); - msg.readString(24, "?"); - } - else - { - msg.readString(24, "party name"); - msg.readString(24, "guild name"); - msg.readString(24, "guild pos"); - msg.readString(24, "?"); - } - BLOCK_END("BeingRecv::processPlayerGuilPartyInfo") -} - -void BeingRecv::processBeingSelfEffect(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processBeingSelfEffect") - if ((effectManager == nullptr) || (actorManager == nullptr)) - { - BLOCK_END("BeingRecv::processBeingSelfEffect") - return; - } - - const BeingId id = msg.readBeingId("being id"); - Being *const being = actorManager->findBeing(id); - if (being == nullptr) - { - DEBUGLOGSTR("insible player?"); - msg.readInt32("effect type"); - BLOCK_END("BeingRecv::processBeingSelfEffect") - return; - } - - const int effectType = msg.readInt32("effect type"); - - if (ParticleEngine::enabled) - effectManager->trigger(effectType, being); - - // +++ need dehard code effectType == 3 - if (effectType == 3 && being->getType() == ActorType::Player - && (socialWindow != nullptr)) - { // reset received damage - socialWindow->resetDamage(being->getName()); - } - BLOCK_END("BeingRecv::processBeingSelfEffect") -} - -void BeingRecv::processSkillCastCancel(Net::MessageIn &msg) -{ - msg.readInt32("skill id"); -} - -void BeingRecv::processIpResponse(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processIpResponse") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processIpResponse") - return; - } - - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("being id")); - if (dstBeing != nullptr) - { - const std::string ip = ipToString(msg.readInt32("ip address")); - dstBeing->setIp(ip); - } - else - { - msg.readInt32("ip address"); - DEBUGLOGSTR("invisible player?"); - } - - BLOCK_END("BeingRecv::processIpResponse") -} - -void BeingRecv::processPvpSet(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processPvpSet") - const BeingId id = msg.readBeingId("being id"); - const int rank = msg.readInt32("rank"); - int teamId = 0; - teamId = msg.readInt32("team"); - if (actorManager != nullptr) - { - Being *const dstBeing = actorManager->findBeing(id); - if (dstBeing != nullptr) - { - dstBeing->setPvpRank(rank); - dstBeing->setTeamId(CAST_U16(teamId)); - dstBeing->addToCache(); - } - } - BLOCK_END("BeingRecv::processPvpSet") -} - -void BeingRecv::applyPlayerAction(Net::MessageIn &msg, - Being *const being, - const uint8_t type) -{ - if (being == nullptr) - return; - switch (type) - { - case 0: - being->setAction(BeingAction::STAND, 0); - localPlayer->imitateAction(being, BeingAction::STAND); - break; - - case 1: - if (being->getCurrentAction() != BeingAction::DEAD) - { - being->setAction(BeingAction::DEAD, 0); - being->recalcSpritesOrder(); - } - break; - - case 2: - being->setAction(BeingAction::SIT, 0); - localPlayer->imitateAction(being, BeingAction::SIT); - break; - - default: - UNIMPLEMENTEDPACKETFIELD(type); - break; - } -} - -void BeingRecv::processSkillDamage(Net::MessageIn &msg) -{ - BLOCK_START("BeingRecv::processSkillDamage") - if (actorManager == nullptr) - { - BLOCK_END("BeingRecv::processSkillDamage") - return; - } - - const int id = msg.readInt16("skill id"); - Being *const srcBeing = actorManager->findBeing( - msg.readBeingId("src being id")); - Being *const dstBeing = actorManager->findBeing( - msg.readBeingId("dst being id")); - msg.readInt32("tick"); - msg.readInt32("src speed"); - msg.readInt32("dst speed"); - const int param1 = msg.readInt32("damage"); - const int level = msg.readInt16("skill level"); - msg.readInt16("div"); - msg.readUInt8("skill hit/type?"); - if (srcBeing != nullptr) - srcBeing->handleSkill(dstBeing, param1, id, level); - if (dstBeing != nullptr) - dstBeing->takeDamage(srcBeing, param1, AttackType::SKILL, id, level); - BLOCK_END("BeingRecv::processSkillDamage") -} - -void BeingRecv::setServerGender(Being *const being, - const uint8_t gender) -{ - if (being == nullptr) - return; - switch (gender) - { - case 2: - being->setGender(Gender::FEMALE); - break; - case 3: - being->setGender(Gender::MALE); - break; - case 4: - being->setGender(Gender::OTHER); - break; - default: - being->setGender(Gender::UNSPECIFIED); - break; - } -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/beingrecv.h b/src/net/tmwa/beingrecv.h deleted file mode 100644 index 31e63b2f8..000000000 --- a/src/net/tmwa/beingrecv.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_BEINGRECV_H -#define NET_TMWA_BEINGRECV_H - -#if defined(__GXX_EXPERIMENTAL_CXX0X__) -#if defined(__APPLE__) -#include <tr1/cstdint> -#endif // defined(__APPLE__) -#endif // defined(__GXX_EXPERIMENTAL_CXX0X__) - -#include "localconsts.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -class Being; - -namespace TmwAthena -{ - namespace BeingRecv - { - void processBeingChangeLook(Net::MessageIn &msg); - void processBeingChangeLook2(Net::MessageIn &msg); - void processBeingVisible(Net::MessageIn &msg); - void processBeingMove(Net::MessageIn &msg); - void processPlayerUpdate1(Net::MessageIn &msg); - void processPlayerUpdate2(Net::MessageIn &msg); - void processPlayerMove(Net::MessageIn &msg); - void processBeingSpawn(Net::MessageIn &msg); - void processSkillCasting(Net::MessageIn &msg); - void processBeingStatusChange(Net::MessageIn &msg); - void processBeingMove2(Net::MessageIn &msg); - void processBeingChangeDirection(Net::MessageIn &msg); - void processBeingChangeLookContinue(const Net::MessageIn &msg, - Being *const dstBeing, - const uint8_t type, - const int id, - const int id2) A_NONNULL(2); - void processPlayerStatusChange(Net::MessageIn &msg); - void processBeingResurrect(Net::MessageIn &msg); - void processPlayerGuilPartyInfo(Net::MessageIn &msg); - void processBeingSelfEffect(Net::MessageIn &msg); - void processSkillCastCancel(Net::MessageIn &msg); - void processIpResponse(Net::MessageIn &msg); - void processPvpSet(Net::MessageIn &msg); - void processSkillDamage(Net::MessageIn &msg); - void applyPlayerAction(Net::MessageIn &msg, - Being *const being, - const uint8_t type); - void setServerGender(Being *const being, - const uint8_t gender); - } // namespace BeingRecv -} // namespace TmwAthena - -#endif // NET_TMWA_BEINGRECV_H diff --git a/src/net/tmwa/buyingstorehandler.cpp b/src/net/tmwa/buyingstorehandler.cpp deleted file mode 100644 index 4d028f918..000000000 --- a/src/net/tmwa/buyingstorehandler.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/buyingstorehandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -BuyingStoreHandler::BuyingStoreHandler() -{ - buyingStoreHandler = this; -} - -BuyingStoreHandler::~BuyingStoreHandler() -{ - buyingStoreHandler = nullptr; -} - -void BuyingStoreHandler::create(const std::string &name A_UNUSED, - const int maxMoney A_UNUSED, - const bool flag A_UNUSED, - const STD_VECTOR<ShopItem*> &items A_UNUSED) - const -{ -} - -void BuyingStoreHandler::close() const -{ -} - -void BuyingStoreHandler::open(const Being *const being A_UNUSED) const -{ -} - -void BuyingStoreHandler::sell(const Being *const being A_UNUSED, - const int storeId A_UNUSED, - const Item *const item A_UNUSED, - const int amount A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/buyingstorehandler.h b/src/net/tmwa/buyingstorehandler.h deleted file mode 100644 index 584293021..000000000 --- a/src/net/tmwa/buyingstorehandler.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_BUYINGSTOREHANDLER_H -#define NET_TMWA_BUYINGSTOREHANDLER_H - -#include "net/buyingstorehandler.h" - -namespace TmwAthena -{ - -class BuyingStoreHandler final : public Net::BuyingStoreHandler -{ - public: - BuyingStoreHandler(); - - A_DELETE_COPY(BuyingStoreHandler) - - ~BuyingStoreHandler(); - - void create(const std::string &name, - const int maxMoney, - const bool flag, - const STD_VECTOR<ShopItem*> &items) const override final - A_CONST; - - void close() const override final A_CONST; - - void open(const Being *const being) const override final A_CONST; - - void sell(const Being *const being, - const int storeId, - const Item *const item, - const int amount) const override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_BUYINGSTOREHANDLER_H diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp deleted file mode 100644 index 7d69c8a7a..000000000 --- a/src/net/tmwa/buysellhandler.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/buysellhandler.h" - -#include "configuration.h" - -#include "gui/windows/chatwindow.h" -#include "gui/windows/shopwindow.h" - -#include "net/chathandler.h" - -#include "net/ea/buysellrecv.h" - -#include "utils/timer.h" - -#include "debug.h" - -namespace TmwAthena -{ - -BuySellHandler::BuySellHandler() : - Ea::BuySellHandler() -{ - buySellHandler = this; - Ea::BuySellRecv::mBuyDialog = nullptr; -} - -BuySellHandler::~BuySellHandler() -{ - buySellHandler = nullptr; -} - -void BuySellHandler::requestSellList(const std::string &nick) const -{ - if (nick.empty() || shopWindow == nullptr) - return; - - const std::string data("!selllist " + toString(tick_time)); - shopWindow->setAcceptPlayer(nick); - if (config.getBoolValue("hideShopMessages")) - { - chatHandler->privateMessage(nick, data); - } - else - { - if (chatWindow != nullptr) - chatWindow->addWhisper(nick, data, ChatMsgType::BY_PLAYER); - } -} - -void BuySellHandler::requestBuyList(const std::string &nick) const -{ - if (nick.empty() || (shopWindow == nullptr)) - return; - - const std::string data("!buylist " + toString(tick_time)); - shopWindow->setAcceptPlayer(nick); - - if (config.getBoolValue("hideShopMessages")) - { - chatHandler->privateMessage(nick, data); - } - else - { - if (chatWindow != nullptr) - chatWindow->addWhisper(nick, data, ChatMsgType::BY_PLAYER); - } -} - -void BuySellHandler::sendBuyRequest(const std::string &nick, - const ShopItem *const item, - const int amount) const -{ - if ((chatWindow == nullptr) || nick.empty() || (item == nullptr) || - amount < 1 || amount > item->getQuantity()) - { - return; - } - const std::string data = strprintf("!buyitem %d %d %d", - item->getId(), item->getPrice(), amount); - - if (config.getBoolValue("hideShopMessages")) - chatHandler->privateMessage(nick, data); - else - chatWindow->addWhisper(nick, data, ChatMsgType::BY_PLAYER); -} - -void BuySellHandler::sendSellRequest(const std::string &nick, - const ShopItem *const item, - const int amount) const -{ - if ((chatWindow == nullptr) || nick.empty() || (item == nullptr) || - amount < 1 || amount > item->getQuantity()) - { - return; - } - - const std::string data = strprintf("!sellitem %d %d %d", - item->getId(), item->getPrice(), amount); - - if (config.getBoolValue("hideShopMessages")) - chatHandler->privateMessage(nick, data); - else - chatWindow->addWhisper(nick, data, ChatMsgType::BY_PLAYER); -} - -void BuySellHandler::close() const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/buysellhandler.h b/src/net/tmwa/buysellhandler.h deleted file mode 100644 index 461935cda..000000000 --- a/src/net/tmwa/buysellhandler.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_BUYSELLHANDLER_H -#define NET_TMWA_BUYSELLHANDLER_H - -#include "net/ea/buysellhandler.h" - -namespace TmwAthena -{ - -class BuySellHandler final : public Ea::BuySellHandler -{ - public: - BuySellHandler(); - - A_DELETE_COPY(BuySellHandler) - - ~BuySellHandler(); - - void requestSellList(const std::string &nick) - const override final; - - void requestBuyList(const std::string &nick) - const override final; - - void sendBuyRequest(const std::string &nick, - const ShopItem *const item, - const int amount) const override final; - - void sendSellRequest(const std::string &nick, - const ShopItem *const item, - const int amount) const override final; - - void close() const override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_BUYSELLHANDLER_H diff --git a/src/net/tmwa/buysellrecv.cpp b/src/net/tmwa/buysellrecv.cpp deleted file mode 100644 index 004837e50..000000000 --- a/src/net/tmwa/buysellrecv.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/buysellrecv.h" - -#include "notifymanager.h" - -#include "being/playerinfo.h" - -#include "const/resources/currency.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/buydialog.h" - -#include "gui/widgets/createwidget.h" - -#include "net/messagein.h" - -#include "net/ea/buysellrecv.h" - -#include "debug.h" - -namespace TmwAthena -{ - -void BuySellRecv::processNpcBuy(Net::MessageIn &msg) -{ - msg.readInt16("len"); - const unsigned int n_items = (msg.getLength() - 4U) / 11; - CREATEWIDGETV(Ea::BuySellRecv::mBuyDialog, BuyDialog, - Ea::BuySellRecv::mNpcId, - DEFAULT_CURRENCY); - Ea::BuySellRecv::mBuyDialog->setMoney( - PlayerInfo::getAttribute(Attributes::MONEY)); - - for (unsigned int k = 0; k < n_items; k++) - { - const int value = msg.readInt32("price"); - msg.readInt32("dc value?"); - const ItemTypeT type = static_cast<ItemTypeT>(msg.readUInt8("type")); - const int itemId = msg.readInt16("item id"); - const ItemColor color = ItemColor_one; - Ea::BuySellRecv::mBuyDialog->addItem(itemId, type, color, 0, value); - } - Ea::BuySellRecv::mBuyDialog->sort(); -} - -void BuySellRecv::processNpcSellResponse(Net::MessageIn &msg) -{ - switch (msg.readUInt8("result")) - { - case 0: - NotifyManager::notify(NotifyTypes::SOLD); - break; - case 1: - default: - NotifyManager::notify(NotifyTypes::SELL_FAILED); - break; - case 2: - NotifyManager::notify(NotifyTypes::SELL_TRADE_FAILED); - break; - case 3: - NotifyManager::notify(NotifyTypes::SELL_UNSELLABLE_FAILED); - break; - } -} - -void BuySellRecv::processNpcBuyResponse(Net::MessageIn &msg) -{ - const uint8_t response = msg.readUInt8("response"); - if (response == 0U) - { - NotifyManager::notify(NotifyTypes::BUY_DONE); - return; - } - // Reset player money since buy dialog already assumed purchase - // would go fine - if (Ea::BuySellRecv::mBuyDialog != nullptr) - { - Ea::BuySellRecv::mBuyDialog->setMoney( - PlayerInfo::getAttribute(Attributes::MONEY)); - } - switch (response) - { - case 1: - NotifyManager::notify(NotifyTypes::BUY_FAILED_NO_MONEY); - break; - - case 2: - NotifyManager::notify(NotifyTypes::BUY_FAILED_OVERWEIGHT); - break; - - case 3: - NotifyManager::notify(NotifyTypes::BUY_FAILED_TOO_MANY_ITEMS); - break; - - default: - NotifyManager::notify(NotifyTypes::BUY_FAILED); - break; - }; -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/buysellrecv.h b/src/net/tmwa/buysellrecv.h deleted file mode 100644 index fc1613b5d..000000000 --- a/src/net/tmwa/buysellrecv.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_BUYSELLRECV_H -#define NET_TMWA_BUYSELLRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace TmwAthena -{ - namespace BuySellRecv - { - void processNpcBuy(Net::MessageIn &msg); - void processNpcSellResponse(Net::MessageIn &msg); - void processNpcBuyResponse(Net::MessageIn &msg); - } // namespace BuySellRecv -} // namespace TmwAthena - -#endif // NET_TMWA_BUYSELLRECV_H diff --git a/src/net/tmwa/cashshophandler.cpp b/src/net/tmwa/cashshophandler.cpp deleted file mode 100644 index 9477af1cc..000000000 --- a/src/net/tmwa/cashshophandler.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/cashshophandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -CashShopHandler::CashShopHandler() : - Net::CashShopHandler() -{ - cashShopHandler = this; -} - -CashShopHandler::~CashShopHandler() -{ - cashShopHandler = nullptr; -} - -void CashShopHandler::buyItem(const int points A_UNUSED, - const int itemId A_UNUSED, - const ItemColor color A_UNUSED, - const int amount A_UNUSED) const -{ -} - -void CashShopHandler::buyItems(const int points A_UNUSED, - const STD_VECTOR<ShopItem*> &items A_UNUSED) - const -{ -} - -void CashShopHandler::close() const -{ -} - -void CashShopHandler::requestPoints() const -{ -} - -void CashShopHandler::requestTab(const int tab A_UNUSED) const -{ -} - -void CashShopHandler::schedule() const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/cashshophandler.h b/src/net/tmwa/cashshophandler.h deleted file mode 100644 index 31d5872dd..000000000 --- a/src/net/tmwa/cashshophandler.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_CASHSHOPHANDLER_H -#define NET_TMWA_CASHSHOPHANDLER_H - -#include "net/cashshophandler.h" - -namespace TmwAthena -{ - -class CashShopHandler final : public Net::CashShopHandler -{ - public: - CashShopHandler(); - - A_DELETE_COPY(CashShopHandler) - - ~CashShopHandler(); - - void buyItem(const int points, - const int itemId, - const ItemColor color, - const int amount) const override final A_CONST; - - void buyItems(const int points, - const STD_VECTOR<ShopItem*> &items) const override final - A_CONST; - - void close() const override final A_CONST; - - void requestPoints() const override final A_CONST; - - void requestTab(const int tab) const override final A_CONST; - - void schedule() const override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_CASHSHOPHANDLER_H diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp deleted file mode 100644 index 258c1c163..000000000 --- a/src/net/tmwa/charserverhandler.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/charserverhandler.h" - -#include "gui/windows/charcreatedialog.h" - -#include "net/character.h" - -#include "net/ea/token.h" - -#include "net/tmwa/loginhandler.h" -#include "net/tmwa/messageout.h" -#include "net/tmwa/network.h" -#include "net/tmwa/protocolout.h" - -#include "resources/db/chardb.h" - -#include "utils/gettext.h" - -#include "debug.h" - -namespace TmwAthena -{ - -extern ServerInfo mapServer; - -extern ServerInfo charServer; - -CharServerHandler::CharServerHandler() : - Ea::CharServerHandler() -{ - charServerHandler = this; -} - -CharServerHandler::~CharServerHandler() -{ - charServerHandler = nullptr; -} - -void CharServerHandler::chooseCharacter(Net::Character *const character) const -{ - if (character == nullptr) - return; - - mSelectedCharacter = character; - mCharSelectDialog = nullptr; - - createOutPacket(CMSG_CHAR_SELECT); - outMsg.writeInt8(CAST_U8(mSelectedCharacter->slot), - "slot"); -} - -void CharServerHandler::newCharacter(const std::string &name, const int slot, - const GenderT gender A_UNUSED, - const int hairstyle, - const int hairColor, - const unsigned char race A_UNUSED, - const uint16_t look A_UNUSED, - const STD_VECTOR<int> &stats) const -{ - createOutPacket(CMSG_CHAR_CREATE); - outMsg.writeString(name, 24, "name"); - for (int i = 0; i < 6; i++) - outMsg.writeInt8(CAST_U8(stats[i]), "stat"); - - outMsg.writeInt8(CAST_U8(slot), "slot"); - outMsg.writeInt8(CAST_S8(hairColor), "hair color"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(CAST_S8(hairstyle), "hair style"); - outMsg.writeInt8(0, "unused"); -} - -void CharServerHandler::deleteCharacter(Net::Character *const character, - const std::string &email A_UNUSED) - const -{ - if (character == nullptr) - return; - - mSelectedCharacter = character; - - createOutPacket(CMSG_CHAR_DELETE); - outMsg.writeBeingId(mSelectedCharacter->dummy->getId(), "id?"); - outMsg.writeString("a@a.com", 40, "email"); -} - -void CharServerHandler::switchCharacter() const -{ - // This is really a map-server packet - createOutPacket(CMSG_PLAYER_RESTART); - outMsg.writeInt8(1, "flag"); -} - -void CharServerHandler::connect() const -{ - const Token &token = - static_cast<LoginHandler*>(loginHandler)->getToken(); - - if (Network::mInstance == nullptr) - return; - - Network::mInstance->disconnect(); - Network::mInstance->connect(charServer); - createOutPacket(CMSG_CHAR_SERVER_CONNECT); - outMsg.writeBeingId(token.account_ID, "account id"); - outMsg.writeInt32(token.session_ID1, "session id1"); - outMsg.writeInt32(token.session_ID2, "session id2"); - // [Fate] The next word is unused by the old char server, so we squeeze in - // mana client version information - outMsg.writeInt16(CLIENT_PROTOCOL_VERSION, - "client protocol version"); - outMsg.writeInt8(Being::genderToInt(token.sex), "gender"); - - // We get 4 useless bytes before the real answer comes in (what are these?) - Network::mInstance->skip(4); -} - -void CharServerHandler::setCharCreateDialog(CharCreateDialog *const window) - const -{ - mCharCreateDialog = window; - - if (mCharCreateDialog == nullptr) - return; - - StringVect attributes; - // TRANSLATORS: playe stat - attributes.push_back(_("Strength:")); - // TRANSLATORS: playe stat - attributes.push_back(_("Agility:")); - // TRANSLATORS: playe stat - attributes.push_back(_("Vitality:")); - // TRANSLATORS: playe stat - attributes.push_back(_("Intelligence:")); - // TRANSLATORS: playe stat - attributes.push_back(_("Dexterity:")); - // TRANSLATORS: playe stat - attributes.push_back(_("Luck:")); - - const Token &token = static_cast<LoginHandler*>(loginHandler)->getToken(); - - int minStat = CharDB::getMinStat(); - if (minStat == 0) - minStat = 1; - int maxStat = CharDB::getMaxStat(); - if (maxStat == 0) - maxStat = 9; - int sumStat = CharDB::getSumStat(); - if (sumStat == 0) - sumStat = 30; - - mCharCreateDialog->setAttributes(attributes, sumStat, minStat, maxStat); - mCharCreateDialog->setDefaultGender(token.sex); -} - -void CharServerHandler::renameCharacter(const BeingId id A_UNUSED, - const std::string &newName A_UNUSED) - const -{ -} - -void CharServerHandler::changeSlot(const int oldSlot A_UNUSED, - const int newSlot A_UNUSED) const -{ -} - -void CharServerHandler::ping() const -{ -} - -unsigned int CharServerHandler::hatSprite() const -{ - return 7; -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/charserverhandler.h b/src/net/tmwa/charserverhandler.h deleted file mode 100644 index e71fdb1b9..000000000 --- a/src/net/tmwa/charserverhandler.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_CHARSERVERHANDLER_H -#define NET_TMWA_CHARSERVERHANDLER_H - -#include "net/ea/charserverhandler.h" - -namespace TmwAthena -{ - -/** - * Deals with incoming messages from the character server. - */ -class CharServerHandler final : public Ea::CharServerHandler -{ - public: - CharServerHandler(); - - A_DELETE_COPY(CharServerHandler) - - ~CharServerHandler(); - - void chooseCharacter(Net::Character *const character) const - override final; - - void newCharacter(const std::string &name, - const int slot, - const GenderT gender, - const int hairstyle, - const int hairColor, - const unsigned char race, - const uint16_t look, - const STD_VECTOR<int> &stats) const override final; - - void deleteCharacter(Net::Character *const character, - const std::string &email) const override final; - - void renameCharacter(const BeingId id, - const std::string &newName) const override final - A_CONST; - - void switchCharacter() const override final; - - void connect() const override final; - - bool isNeedCreatePin() const override final - { return false; } - - void setNewPincode(const std::string &pin A_UNUSED) const - override final - { } - - /** - * Sets the character create dialog. The handler will clean up this - * dialog when a new character is successfully created, and will unlock - * the dialog when a new character failed to be created. - */ - void setCharCreateDialog(CharCreateDialog *const window) const - override final; - - void changeSlot(const int oldSlot, - const int newSlot) const override final A_CONST; - - void ping() const override final A_CONST; - - unsigned int hatSprite() const override final A_CONST A_WARN_UNUSED; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_CHARSERVERHANDLER_H diff --git a/src/net/tmwa/charserverrecv.cpp b/src/net/tmwa/charserverrecv.cpp deleted file mode 100644 index 8b0f960df..000000000 --- a/src/net/tmwa/charserverrecv.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/charserverrecv.h" - -#include "client.h" -#include "configuration.h" -#include "settings.h" - -#include "gui/windows/charcreatedialog.h" -#include "gui/windows/okdialog.h" - -#include "gui/widgets/createwidget.h" - -#include "net/character.h" -#include "net/charserverhandler.h" -#include "net/messagein.h" -#include "net/serverfeatures.h" - -#include "net/ea/token.h" - -#include "net/tmwa/gamehandler.h" -#include "net/tmwa/loginhandler.h" -#include "net/tmwa/network.h" -#include "net/tmwa/sprite.h" - -#include "resources/iteminfo.h" - -#include "resources/db/itemdb.h" - -#include "utils/dtor.h" -#include "utils/gettext.h" - -#include "debug.h" - -namespace TmwAthena -{ - -extern ServerInfo mapServer; - -extern ServerInfo charServer; - -void CharServerRecv::readPlayerData(Net::MessageIn &msg, - Net::Character *const character) -{ - if (character == nullptr) - return; - - const Token &token = - static_cast<LoginHandler*>(loginHandler)->getToken(); - - LocalPlayer *const tempPlayer = new LocalPlayer( - msg.readBeingId("account id"), BeingTypeId_zero); - - PlayerInfoBackend &data = character->data; - data.mAttributes[Attributes::PLAYER_EXP] = msg.readInt32("base exp"); - data.mAttributes[Attributes::MONEY] = msg.readInt32("money"); - data.mAttributes[Attributes::PLAYER_JOB_EXP] = msg.readInt32("job exp"); - data.mAttributes[Attributes::PLAYER_JOB_LEVEL] = - msg.readInt32("job level"); - - const int shoes = msg.readInt16("shoes"); - const int gloves = msg.readInt16("gloves"); - const int cape = msg.readInt16("cape"); - const int misc1 = msg.readInt16("misc1"); - - msg.readInt32("option"); - tempPlayer->setKarma(msg.readInt32("karma")); - tempPlayer->setManner(msg.readInt32("manner")); - msg.readInt16("character points left"); - - data.mAttributes[Attributes::PLAYER_HP] = msg.readInt16("hp"); - data.mAttributes[Attributes::PLAYER_MAX_HP] = msg.readInt16("max hp"); - data.mAttributes[Attributes::PLAYER_MP] = msg.readInt16("mp"); - data.mAttributes[Attributes::PLAYER_MAX_MP] = msg.readInt16("max mp"); - - msg.readInt16("speed"); - const uint16_t race = msg.readInt16("class"); - const uint8_t hairStyle = msg.readUInt8("hair style"); - const uint16_t look = msg.readUInt8("look"); - tempPlayer->setSubtype(fromInt(race, BeingTypeId), look); - const uint16_t weapon = msg.readInt16("weapon"); - tempPlayer->setSpriteId(SPRITE_BODY, - weapon); - tempPlayer->setWeaponId(weapon); - - data.mAttributes[Attributes::PLAYER_BASE_LEVEL] = msg.readInt16("level"); - - msg.readInt16("skill point"); - const int bottomClothes = msg.readInt16("bottom clothes"); - const int shield = msg.readInt16("shield"); - - const int hat = msg.readInt16("hat"); - const int topClothes = msg.readInt16("top clothes"); - - const ItemColor hairColor = fromInt( - msg.readUInt8("hair color"), ItemColor); - msg.readUInt8("unused"); - if (hairStyle == 0) - { - tempPlayer->unSetSprite(SPRITE_HAIR_COLOR); - } - else - { - tempPlayer->setSpriteColor(SPRITE_HAIR_COLOR, - hairStyle * -1, - ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); - } - tempPlayer->setHairColor(hairColor); - - const int misc2 = msg.readInt16("misc2"); - tempPlayer->setName(msg.readString(24, "name")); - - character->dummy = tempPlayer; - - character->data.mStats[Attributes::PLAYER_STR].base = msg.readUInt8("str"); - character->data.mStats[Attributes::PLAYER_AGI].base = msg.readUInt8("agi"); - character->data.mStats[Attributes::PLAYER_VIT].base = msg.readUInt8("vit"); - character->data.mStats[Attributes::PLAYER_INT].base = msg.readUInt8("int"); - character->data.mStats[Attributes::PLAYER_DEX].base = msg.readUInt8("dex"); - character->data.mStats[Attributes::PLAYER_LUK].base = msg.readUInt8("luk"); - - tempPlayer->setSpriteId(SPRITE_HAIR, - shoes); - tempPlayer->setSpriteId(SPRITE_SHOES, - gloves); - tempPlayer->setSpriteId(SPRITE_SHIELD, - cape); - tempPlayer->setSpriteId(SPRITE_HEAD_TOP, - misc1); - tempPlayer->setSpriteId(SPRITE_WEAPON, - bottomClothes); - tempPlayer->setSpriteId(SPRITE_FLOOR, - shield); - tempPlayer->setSpriteId(SPRITE_CLOTHES_COLOR, - hat); - tempPlayer->setSpriteId(SPRITE_HEAD_BOTTOM, - topClothes); - tempPlayer->setSpriteId(SPRITE_HEAD_MID, - misc2); - - character->slot = msg.readUInt8("slot"); - const uint8_t sex = CAST_U8(msg.readUInt8("gender")); - if (serverFeatures->haveCreateCharGender()) - tempPlayer->setGender(Being::intToGender(sex)); - else - tempPlayer->setGender(token.sex); -} - -void CharServerRecv::processCharLogin(Net::MessageIn &msg) -{ - BLOCK_START("CharServerRecv::processCharLogin") - - msg.readInt16("len"); - const int slots = msg.readInt16("slots"); - if (slots > 0 && slots < 30) - loginData.characterSlots = CAST_U16(slots); - - msg.skip(18, "unused"); - - delete_all(Net::CharServerHandler::mCharacters); - Net::CharServerHandler::mCharacters.clear(); - - // Derive number of characters from message length - const int count = (msg.getLength() - 24) / 106; - - for (int i = 0; i < count; ++i) - { - Net::Character *const character = new Net::Character; - readPlayerData(msg, character); - Net::CharServerHandler::mCharacters.push_back(character); - if (character->dummy != nullptr) - { - logger->log("CharServer: Player: %s (%d)", - character->dummy->getName().c_str(), character->slot); - } - } - - client->setState(State::CHAR_SELECT); - BLOCK_END("CharServerRecv::processCharLogin") -} - -void CharServerRecv::processCharMapInfo(Net::MessageIn &restrict msg) -{ - Network *const network = Network::mInstance; - ServerInfo &server = mapServer; - BLOCK_START("CharServerRecv::processCharMapInfo") - PlayerInfo::setCharId(msg.readInt32("char id?")); - GameHandler::setMap(msg.readString(16, "map name")); - if (config.getBoolValue("usePersistentIP") || settings.persistentIp) - { - msg.readInt32("ip address"); - server.hostname = settings.serverName; - } - else - { - server.hostname = ipToString(msg.readInt32("ip address")); - } - server.port = msg.readInt16("port"); - - // Prevent the selected local player from being deleted - localPlayer = Net::CharServerHandler::mSelectedCharacter->dummy; - PlayerInfo::setBackend(Net::CharServerHandler::mSelectedCharacter->data); - - Net::CharServerHandler::mSelectedCharacter->dummy = nullptr; - - charServerHandler->clear(); - Net::CharServerHandler::updateCharSelectDialog(); - - if (network != nullptr) - network->disconnect(); - client->setState(State::CONNECT_GAME); - BLOCK_END("CharServerRecv::processCharMapInfo") -} - -void CharServerRecv::processChangeMapServer(Net::MessageIn &msg) -{ - Network *const network = Network::mInstance; - ServerInfo &server = mapServer; - BLOCK_START("CharServerRecv::processChangeMapServer") - if (network == nullptr) - { - BLOCK_END("CharServerRecv::processChangeMapServer") - return; - } - GameHandler::setMap(msg.readString(16, "map name")); - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - if (config.getBoolValue("usePersistentIP") || settings.persistentIp) - { - msg.readInt32("ip address"); - server.hostname = settings.serverName; - } - else - { - server.hostname = ipToString(msg.readInt32("ip address")); - } - server.port = msg.readInt16("port"); - - network->disconnect(); - client->setState(State::CHANGE_MAP); - if (localPlayer != nullptr) - { - localPlayer->setTileCoords(x, y); - localPlayer->setMap(nullptr); - } - BLOCK_END("CharServerRecv::processChangeMapServer") -} - -void CharServerRecv::processCharCreate(Net::MessageIn &msg) -{ - BLOCK_START("CharServerRecv::processCharCreate") - Net::Character *const character = new Net::Character; - readPlayerData(msg, character); - Net::CharServerHandler::mCharacters.push_back(character); - - Net::CharServerHandler::updateCharSelectDialog(); - - // Close the character create dialog - Net::CharServerHandler::mCharCreateDialog->scheduleDelete(); - Net::CharServerHandler::mCharCreateDialog = nullptr; - BLOCK_END("CharServerRecv::processCharCreate") -} - -void CharServerRecv::processCharDeleteFailed(Net::MessageIn &msg) -{ - BLOCK_START("CharServerRecv::processCharDeleteFailed") - Net::CharServerHandler::unlockCharSelectDialog(); - msg.readUInt8("error"); - CREATEWIDGET(OkDialog, - // TRANSLATORS: error header - _("Error"), - // TRANSLATORS: error message - _("Failed to delete character."), - // TRANSLATORS: ok dialog button - _("OK"), - DialogType::ERROR, - Modal_true, - ShowCenter_true, - nullptr, - 260); - BLOCK_END("CharServerRecv::processCharDeleteFailed") -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/charserverrecv.h b/src/net/tmwa/charserverrecv.h deleted file mode 100644 index 195c5239c..000000000 --- a/src/net/tmwa/charserverrecv.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_CHARSERVERRECV_H -#define NET_TMWA_CHARSERVERRECV_H - -namespace Net -{ - class MessageIn; - - struct Character; -} // namespace Net - -namespace TmwAthena -{ - namespace CharServerRecv - { - void readPlayerData(Net::MessageIn &msg, - Net::Character *const character); - void processCharCreate(Net::MessageIn &msg); - void processCharDeleteFailed(Net::MessageIn &msg); - void processCharLogin(Net::MessageIn &msg); - void processCharMapInfo(Net::MessageIn &msg); - void processChangeMapServer(Net::MessageIn &msg); - } // namespace CharServerRecv -} // namespace TmwAthena - -#endif // NET_TMWA_CHARSERVERRECV_H diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp deleted file mode 100644 index 2b768ffe2..000000000 --- a/src/net/tmwa/chathandler.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/chathandler.h" - -#include "being/localplayer.h" - -#include "const/gui/chat.h" - -#include "net/ea/chatrecv.h" - -#include "net/tmwa/messageout.h" -#include "net/tmwa/protocolout.h" - -#include "utils/gmfunctions.h" -#include "utils/stringutils.h" - -#include "debug.h" - -extern unsigned int tmwServerVersion; - -namespace TmwAthena -{ - -ChatHandler::ChatHandler() : - Ea::ChatHandler() -{ - chatHandler = this; -} - -ChatHandler::~ChatHandler() -{ - chatHandler = nullptr; -} - -void ChatHandler::talk(const std::string &restrict text, - const std::string &restrict channel A_UNUSED) const -{ - if (localPlayer == nullptr) - return; - - if (tmwServerVersion >= 0x100408) - { - createOutPacket(CMSG_CHAT_MESSAGE); - // Added + 1 in order to let eAthena parse admin commands correctly - outMsg.writeInt16(CAST_S16(text.length() + 4 + 1), "len"); - outMsg.writeString(text, CAST_S32(text.length() + 1), "message"); - } - else - { - const std::string mes = std::string(localPlayer->getName()).append( - " : ").append(text); - - createOutPacket(CMSG_CHAT_MESSAGE); - // Added + 1 in order to let eAthena parse admin commands correctly - outMsg.writeInt16(CAST_S16(mes.length() + 4 + 1), "len"); - outMsg.writeString(mes, CAST_S32(mes.length() + 1), "message"); - } -} - -void ChatHandler::talkRaw(const std::string &mes) const -{ - createOutPacket(CMSG_CHAT_MESSAGE); - outMsg.writeInt16(CAST_S16(mes.length() + 4), "len"); - outMsg.writeString(mes, CAST_S32(mes.length()), "message"); -} - -void ChatHandler::privateMessage(const std::string &restrict recipient, - const std::string &restrict text) const -{ - createOutPacket(CMSG_CHAT_WHISPER); - outMsg.writeInt16(CAST_S16(text.length() + 28), "len"); - outMsg.writeString(recipient, 24, "recipient nick"); - outMsg.writeString(text, CAST_S32(text.length()), "message"); - Ea::ChatRecv::mSentWhispers.push(recipient); -} - -void ChatHandler::channelMessage(const std::string &restrict channel, - const std::string &restrict text) const -{ - if (channel == TRADE_CHANNEL) - talk("\302\202" + text, GENERAL_CHANNEL); - else if (channel == GM_CHANNEL) - Gm::runCommand("wgm", text); -} - -void ChatHandler::who() const -{ - if (tmwServerVersion >= 0x0e0b0b) - return; - - createOutPacket(CMSG_WHO_REQUEST); -} - -void ChatHandler::sendRaw(const std::string &args) const -{ - std::string line = args; - std::string str; - MessageOut *outMsg = nullptr; - - if (line.empty()) - return; - - size_t pos = line.find(' '); - if (pos != std::string::npos) - { - str = line.substr(0, pos); - const int16_t id = CAST_S16(parseNumber(str)); - outMsg = new MessageOut(id); - outMsg->writeInt16(id, "packet id"); - line = line.substr(pos + 1); - pos = line.find(' '); - } - else - { - const int16_t id = CAST_S16(parseNumber(line)); - outMsg = new MessageOut(id); - outMsg->writeInt16(id, "packet id"); - delete outMsg; - return; - } - - while (pos != std::string::npos) - { - str = line.substr(0, pos); - processRaw(*outMsg, str); - line = line.substr(pos + 1); - pos = line.find(' '); - } - if (!line.empty()) - processRaw(*outMsg, line); - delete outMsg; -} - -void ChatHandler::processRaw(MessageOut &restrict outMsg, - const std::string &restrict line) -{ - if (line.size() < 2) - return; - - const uint32_t i = parseNumber(line.substr(1)); - switch (tolower(line[0])) - { - case 'b': - { - outMsg.writeInt8(CAST_U8(i), "raw"); - break; - } - case 'w': - { - outMsg.writeInt16(CAST_S16(i), "raw"); - break; - } - case 'l': - { - outMsg.writeInt32(CAST_S32(i), "raw"); - break; - } - default: - break; - } -} - -void ChatHandler::ignoreAll() const -{ -} - -void ChatHandler::unIgnoreAll() const -{ -} - -void ChatHandler::ignore(const std::string &nick) const -{ - createOutPacket(CMSG_IGNORE_NICK); - outMsg.writeString(nick, 24, "nick"); - outMsg.writeInt8(0, "flag"); -} - -void ChatHandler::unIgnore(const std::string &nick) const -{ - createOutPacket(CMSG_IGNORE_NICK); - outMsg.writeString(nick, 24, "nick"); - outMsg.writeInt8(1, "flag"); -} - -void ChatHandler::requestIgnoreList() const -{ -} - -void ChatHandler::createChatRoom(const std::string &title A_UNUSED, - const std::string &password A_UNUSED, - const int limit A_UNUSED, - const bool isPublic A_UNUSED) const -{ -} - -void ChatHandler::battleTalk(const std::string &text A_UNUSED) const -{ -} - -void ChatHandler::joinChat(const ChatObject *const chat A_UNUSED, - const std::string &password A_UNUSED) const -{ -} - -void ChatHandler::joinChannel(const std::string &channel A_UNUSED) const -{ -} - -void ChatHandler::partChannel(const std::string &channel A_UNUSED) const -{ -} - -void ChatHandler::talkPet(const std::string &restrict text, - const std::string &restrict channel) const -{ - // here need string duplication - std::string action = strprintf("\302\202\303 %s", text.c_str()); - talk(action, channel); -} - -void ChatHandler::leaveChatRoom() const -{ -} - -void ChatHandler::setChatRoomOptions(const int limit A_UNUSED, - const bool isPublict A_UNUSED, - const std::string &passwordt A_UNUSED, - const std::string &titlet A_UNUSED) const -{ -} - -void ChatHandler::setChatRoomOwner(const std::string &nick A_UNUSED) const -{ -} - -void ChatHandler::kickFromChatRoom(const std::string &nick A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h deleted file mode 100644 index 12de8067c..000000000 --- a/src/net/tmwa/chathandler.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_CHATHANDLER_H -#define NET_TMWA_CHATHANDLER_H - -#include "net/ea/chathandler.h" - -namespace TmwAthena -{ -class MessageOut; - -class ChatHandler final : public Ea::ChatHandler -{ - public: - ChatHandler(); - - A_DELETE_COPY(ChatHandler) - - ~ChatHandler(); - - void talk(const std::string &restrict text, - const std::string &restrict channel) const override final; - - void talkRaw(const std::string &text) const override final; - - void privateMessage(const std::string &restrict recipient, - const std::string &restrict text) const - override final; - - void channelMessage(const std::string &restrict channel, - const std::string &restrict text) const - override final; - - void joinChannel(const std::string &channel) const override final - A_CONST; - - void who() const override final; - - void sendRaw(const std::string &args) const override final; - - void ignoreAll() const override final; - - void unIgnoreAll() const override final; - - void createChatRoom(const std::string &title, - const std::string &password, - const int limit, - const bool isPublic) const override final A_CONST; - - void ignore(const std::string &nick) const override final; - - void unIgnore(const std::string &nick) const override final; - - void requestIgnoreList() const override final A_CONST; - - void battleTalk(const std::string &text) const override final A_CONST; - - void joinChat(const ChatObject *const chat, - const std::string &password) const override final - A_CONST; - - void partChannel(const std::string &channel) const override final - A_CONST; - - void talkPet(const std::string &restrict text, - const std::string &restrict channel) const override final; - - void leaveChatRoom() const override final A_CONST; - - void setChatRoomOptions(const int limit, - const bool isPublic, - const std::string &password, - const std::string &title) const override final - A_CONST; - - void setChatRoomOwner(const std::string &nick) const override final - A_CONST; - - void kickFromChatRoom(const std::string &nick) const override final - A_CONST; - - protected: - static void processRaw(MessageOut &restrict outMsg, - const std::string &restrict line); -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_CHATHANDLER_H diff --git a/src/net/tmwa/chatrecv.cpp b/src/net/tmwa/chatrecv.cpp deleted file mode 100644 index afa501004..000000000 --- a/src/net/tmwa/chatrecv.cpp +++ /dev/null @@ -1,377 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/chatrecv.h" - -#include "actormanager.h" -#include "configuration.h" - -#include "being/localplayer.h" -#include "being/playerrelation.h" -#include "being/playerrelations.h" - -#include "const/gui/chat.h" - -#include "gui/widgets/tabs/chat/gmtab.h" - -#include "gui/windows/chatwindow.h" -#include "gui/windows/shopwindow.h" - -#include "net/serverfeatures.h" - -#include "net/ea/chatrecv.h" - -#include "net/messagein.h" - -#include "net/tmwa/guildmanager.h" - -#include "debug.h" - -namespace TmwAthena -{ - -void ChatRecv::processChat(Net::MessageIn &msg) -{ - BLOCK_START("ChatRecv::processChat") - const int chatMsgLength = msg.readInt16("len") - 4; - if (chatMsgLength <= 0) - { - BLOCK_END("ChatRecv::processChat") - return; - } - - processChatContinue(msg.readRawString(chatMsgLength, "message"), ""); -} - -void ChatRecv::processChatContinue(std::string chatMsg, - const std::string &channel) -{ - const size_t pos = chatMsg.find(" : ", 0); - - bool allow(true); - if (chatWindow != nullptr) - { - allow = chatWindow->resortChatLog(chatMsg, - ChatMsgType::BY_PLAYER, - channel, - IgnoreRecord_false, - TryRemoveColors_true); - } - - if (channel.empty()) - { - const std::string senseStr("You sense the following: "); - if ((actorManager != nullptr) && (chatMsg.find(senseStr) == 0u)) - { - actorManager->parseLevels( - chatMsg.substr(senseStr.size())); - } - } - - if (pos == std::string::npos && - !Ea::ChatRecv::mShowMotd && - Ea::ChatRecv::mSkipping && - channel.empty()) - { - // skip motd from "new" tmw server - if (Ea::ChatRecv::mMotdTime == 0) - { - Ea::ChatRecv::mMotdTime = cur_time + 1; - } - else if (Ea::ChatRecv::mMotdTime == cur_time || - Ea::ChatRecv::mMotdTime < cur_time) - { - Ea::ChatRecv::mSkipping = false; - } - BLOCK_END("ChatRecv::processChat") - return; - } - - if (pos != std::string::npos) - chatMsg.erase(0, pos + 3); - - trim(chatMsg); - - if (localPlayer != nullptr) - { - if (((chatWindow != nullptr) || Ea::ChatRecv::mShowMotd) && allow) - localPlayer->setSpeech(chatMsg, channel); - } - BLOCK_END("ChatRecv::processChat") -} - -void ChatRecv::processGmChat(Net::MessageIn &msg) -{ - BLOCK_START("ChatRecv::processChat") - const int chatMsgLength = msg.readInt16("len") - 4; - if (chatMsgLength <= 0) - { - BLOCK_END("ChatRecv::processChat") - return; - } - - if (localChatTab != nullptr && - chatWindow != nullptr) - { - std::string chatMsg = msg.readRawString(chatMsgLength, "message"); - chatWindow->addGlobalMessage(chatMsg); - } - else - { - msg.readRawString(chatMsgLength, "message"); - } - BLOCK_END("ChatRecv::processChat") -} - -void ChatRecv::processWhisper(Net::MessageIn &msg) -{ - BLOCK_START("ChatRecv::processWhisper") - const int chatMsgLength = msg.readInt16("len") - 28; - std::string nick = msg.readString(24, "nick"); - - if (chatMsgLength <= 0) - { - BLOCK_END("ChatRecv::processWhisper") - return; - } - - processWhisperContinue(nick, msg.readString(chatMsgLength, "message")); -} - -void ChatRecv::processWhisperResponse(Net::MessageIn &msg) -{ - BLOCK_START("ChatRecv::processWhisperResponse") - - const uint8_t type = msg.readUInt8("response"); - Ea::ChatRecv::processWhisperResponseContinue(msg, type); -} - -void ChatRecv::processWhisperContinue(const std::string &nick, - std::string chatMsg) -{ - // ignoring future whisper messages - if (chatMsg.find("\302\202G") == 0 || chatMsg.find("\302\202A") == 0) - { - BLOCK_END("ChatRecv::processWhisper") - return; - } - // remove first unicode space if this is may be whisper command. - if (chatMsg.find("\302\202!") == 0) - chatMsg = chatMsg.substr(2); - - if (nick != "Server") - { - if ((guildManager != nullptr) && GuildManager::getEnableGuildBot() - && nick == "guild" && guildManager->processGuildMessage(chatMsg)) - { - BLOCK_END("ChatRecv::processWhisper") - return; - } - - if (playerRelations.hasPermission(nick, PlayerRelation::WHISPER)) - { - const bool tradeBot = config.getBoolValue("tradebot"); - const bool showMsg = !config.getBoolValue("hideShopMessages"); - if (playerRelations.hasPermission(nick, PlayerRelation::TRADE)) - { - if (shopWindow != nullptr) - { // commands to shop from player - if (chatMsg.find("!selllist ") == 0) - { - if (tradeBot) - { - if (showMsg && (chatWindow != nullptr)) - chatWindow->addWhisper(nick, chatMsg); - shopWindow->giveList(nick, ShopWindow::SELL); - } - } - else if (chatMsg.find("!buylist ") == 0) - { - if (tradeBot) - { - if (showMsg && (chatWindow != nullptr)) - chatWindow->addWhisper(nick, chatMsg); - shopWindow->giveList(nick, ShopWindow::BUY); - } - } - else if (chatMsg.find("!buyitem ") == 0) - { - if (showMsg && (chatWindow != nullptr)) - chatWindow->addWhisper(nick, chatMsg); - if (tradeBot) - { - shopWindow->processRequest(nick, chatMsg, - ShopWindow::BUY); - } - } - else if (chatMsg.find("!sellitem ") == 0) - { - if (showMsg && (chatWindow != nullptr)) - chatWindow->addWhisper(nick, chatMsg); - if (tradeBot) - { - shopWindow->processRequest(nick, chatMsg, - ShopWindow::SELL); - } - } - else if (chatMsg.length() > 3 - && chatMsg.find("\302\202") == 0) - { - chatMsg = chatMsg.erase(0, 2); - if (showMsg && (chatWindow != nullptr)) - chatWindow->addWhisper(nick, chatMsg); - if (chatMsg.find("B1") == 0 || chatMsg.find("S1") == 0) - ShopWindow::showList(nick, chatMsg); - } - else if (chatWindow != nullptr) - { - chatWindow->addWhisper(nick, chatMsg); - } - } - else if (chatWindow != nullptr) - { - chatWindow->addWhisper(nick, chatMsg); - } - } - else - { - if (chatWindow != nullptr && - (showMsg || - (chatMsg.find("!selllist") != 0 && - chatMsg.find("!buylist") != 0))) - { - chatWindow->addWhisper(nick, chatMsg); - } - } - } - } - else if (localChatTab != nullptr) - { - if ((gmChatTab != nullptr) && strStartWith(chatMsg, "[GM] ")) - { - chatMsg = chatMsg.substr(5); - const size_t pos = chatMsg.find(": ", 0); - if (pos == std::string::npos) - { - gmChatTab->chatLog(chatMsg, ChatMsgType::BY_SERVER); - } - else - { - gmChatTab->chatLog(chatMsg.substr(0, pos), - chatMsg.substr(pos + 2)); - } - } - else - { - localChatTab->chatLog(chatMsg, ChatMsgType::BY_SERVER); - } - } - BLOCK_END("ChatRecv::processWhisper") -} - -void ChatRecv::processBeingChat(Net::MessageIn &msg) -{ - if (actorManager == nullptr) - return; - - BLOCK_START("ChatRecv::processBeingChat") - const int chatMsgLength = msg.readInt16("len") - 8; - const BeingId beingId = msg.readBeingId("being id"); - Being *const being = actorManager->findBeing(beingId); - - if (chatMsgLength <= 0) - { - BLOCK_END("ChatRecv::processBeingChat") - return; - } - - std::string chatMsg = msg.readRawString(chatMsgLength, "message"); - - if ((being != nullptr) && being->getType() == ActorType::Player) - being->setTalkTime(); - - const size_t pos = chatMsg.find(" : ", 0); - std::string sender_name = ((pos == std::string::npos) - ? "" : chatMsg.substr(0, pos)); - - if (serverFeatures->haveIncompleteChatMessages()) - { - // work around for "new" tmw server - if (being != nullptr) - sender_name = being->getName(); - if (sender_name.empty()) - { - sender_name = "?" + toString(CAST_S32(beingId)); - const std::string name = actorManager->getSeenPlayerById(beingId); - if (!name.empty()) - sender_name.append(" ").append(name); - } - } - else if ((being != nullptr) && - sender_name != being->getName() && - being->getType() == ActorType::Player) - { - if (!being->getName().empty()) - sender_name = being->getName(); - } - else - { - chatMsg.erase(0, pos + 3); - } - - trim(chatMsg); - - bool allow(true); - // We use getIgnorePlayer instead of ignoringPlayer here - // because ignorePlayer' side effects are triggered - // right below for Being::IGNORE_SPEECH_FLOAT. - if ((playerRelations.checkPermissionSilently(sender_name, - PlayerRelation::SPEECH_LOG) != 0u) && - (chatWindow != nullptr)) - { - allow = chatWindow->resortChatLog( - removeColors(sender_name).append(" : ").append(chatMsg), - ChatMsgType::BY_OTHER, - GENERAL_CHANNEL, - IgnoreRecord_false, - TryRemoveColors_true); - } - - if (allow && - (being != nullptr) && - playerRelations.hasPermission(sender_name, - PlayerRelation::SPEECH_FLOAT)) - { - being->setSpeech(chatMsg, GENERAL_CHANNEL); - } - BLOCK_END("ChatRecv::processBeingChat") -} - -void ChatRecv::processScriptMessage(Net::MessageIn &msg) -{ - const int sz = msg.readInt16("len") - 5; - msg.readUInt8("message type"); - const std::string message = msg.readString(sz, "message"); - localChatTab->chatLog(message, ChatMsgType::BY_SERVER); -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/chatrecv.h b/src/net/tmwa/chatrecv.h deleted file mode 100644 index 3e7b58b15..000000000 --- a/src/net/tmwa/chatrecv.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_CHATRECV_H -#define NET_TMWA_CHATRECV_H - -#include <string> - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace TmwAthena -{ - namespace ChatRecv - { - void processChat(Net::MessageIn &msg); - void processChatContinue(std::string chatMsg, - const std::string &channel); - void processGmChat(Net::MessageIn &msg); - void processWhisper(Net::MessageIn &msg); - void processWhisperResponse(Net::MessageIn &msg); - void processWhisperContinue(const std::string &nick, - std::string chatMsg); - void processBeingChat(Net::MessageIn &msg); - void processScriptMessage(Net::MessageIn &msg); - } // namespace ChatRecv -} // namespace TmwAthena - -#endif // NET_TMWA_CHATRECV_H diff --git a/src/net/tmwa/elementalhandler.cpp b/src/net/tmwa/elementalhandler.cpp deleted file mode 100644 index 78230f3df..000000000 --- a/src/net/tmwa/elementalhandler.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/elementalhandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -ElementalHandler::ElementalHandler() : - Net::ElementalHandler() -{ - elementalHandler = this; -} - -ElementalHandler::~ElementalHandler() -{ - elementalHandler = nullptr; -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/elementalhandler.h b/src/net/tmwa/elementalhandler.h deleted file mode 100644 index 5aea5b5d2..000000000 --- a/src/net/tmwa/elementalhandler.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_ELEMENTALHANDLER_H -#define NET_TMWA_ELEMENTALHANDLER_H - -#include "net/elementalhandler.h" - -namespace TmwAthena -{ - class ElementalHandler final : public Net::ElementalHandler - { - public: - ElementalHandler(); - - A_DELETE_COPY(ElementalHandler) - - ~ElementalHandler(); - }; -} // namespace TmwAthena - -#endif // NET_TMWA_ELEMENTALHANDLER_H diff --git a/src/net/tmwa/familyhandler.cpp b/src/net/tmwa/familyhandler.cpp deleted file mode 100644 index 9f5bb7fe9..000000000 --- a/src/net/tmwa/familyhandler.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/familyhandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -FamilyHandler::FamilyHandler() : - Net::FamilyHandler() -{ - familyHandler = this; -} - -FamilyHandler::~FamilyHandler() -{ - familyHandler = nullptr; -} - -void FamilyHandler::askForChild(const Being *const being A_UNUSED) const -{ -} - -void FamilyHandler::askForChildReply(const bool accept A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/familyhandler.h b/src/net/tmwa/familyhandler.h deleted file mode 100644 index b2cc6c96a..000000000 --- a/src/net/tmwa/familyhandler.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_FAMILYHANDLER_H -#define NET_TMWA_FAMILYHANDLER_H - -#include "net/familyhandler.h" - -namespace TmwAthena -{ - -class FamilyHandler final : public Net::FamilyHandler -{ - public: - FamilyHandler(); - - A_DELETE_COPY(FamilyHandler) - - ~FamilyHandler(); - - void askForChild(const Being *const being) const override final - A_CONST; - - void askForChildReply(const bool accept) const override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_FAMILYHANDLER_H diff --git a/src/net/tmwa/friendshandler.cpp b/src/net/tmwa/friendshandler.cpp deleted file mode 100644 index 094952df4..000000000 --- a/src/net/tmwa/friendshandler.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/friendshandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -FriendsHandler::FriendsHandler() -{ - friendsHandler = this; -} - -FriendsHandler::~FriendsHandler() -{ - friendsHandler = nullptr; -} - -void FriendsHandler::invite(const std::string &name A_UNUSED) const -{ -} - -void FriendsHandler::inviteResponse(const int accountId A_UNUSED, - const int charId A_UNUSED, - const bool accept A_UNUSED) const -{ -} - -void FriendsHandler::remove(const int accountId A_UNUSED, - const int charId A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/friendshandler.h b/src/net/tmwa/friendshandler.h deleted file mode 100644 index ef9d05c60..000000000 --- a/src/net/tmwa/friendshandler.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_FRIENDSHANDLER_H -#define NET_TMWA_FRIENDSHANDLER_H - -#include "net/friendshandler.h" - -namespace TmwAthena -{ -class FriendsHandler final : public Net::FriendsHandler -{ - public: - FriendsHandler(); - - A_DELETE_COPY(FriendsHandler) - - ~FriendsHandler(); - - void invite(const std::string &name) const override final A_CONST; - - void inviteResponse(const int accountId, - const int charId, - const bool accept) const override final A_CONST; - - void remove(const int accountId, - const int charId) const override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_FRIENDSHANDLER_H diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp deleted file mode 100644 index d13c46919..000000000 --- a/src/net/tmwa/gamehandler.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/gamehandler.h" - -#include "client.h" - -#include "being/localplayer.h" - -#include "net/ea/token.h" - -#include "net/ea/gamerecv.h" - -#include "net/tmwa/loginhandler.h" -#include "net/tmwa/messageout.h" -#include "net/tmwa/network.h" -#include "net/tmwa/protocolout.h" - -#include "debug.h" - -namespace TmwAthena -{ - -extern ServerInfo mapServer; - -GameHandler::GameHandler() : - Ea::GameHandler() -{ - gameHandler = this; -} - -GameHandler::~GameHandler() -{ - gameHandler = nullptr; -} - -void GameHandler::mapLoadedEvent() const -{ - createOutPacket(CMSG_MAP_LOADED); -} - -void GameHandler::connect() const -{ - if (Network::mInstance == nullptr) - return; - - BLOCK_START("GameHandler::connect") - Network::mInstance->connect(mapServer); - const Token &token = static_cast<LoginHandler*>(loginHandler)->getToken(); - - if (client->getState() == State::CONNECT_GAME) - { - // Change the player's ID to the account ID to match what eAthena uses - if (localPlayer != nullptr) - { - Ea::GameRecv::mCharID = localPlayer->getId(); - localPlayer->setId(token.account_ID); - } - else - { - Ea::GameRecv::mCharID = BeingId_zero; - } - } - - // Send login infos - createOutPacket(CMSG_MAP_SERVER_CONNECT); - outMsg.writeBeingId(token.account_ID, "account id"); - outMsg.writeBeingId(Ea::GameRecv::mCharID, "char id"); - outMsg.writeInt32(token.session_ID1, "session id1"); - outMsg.writeInt32(token.session_ID2, "session id2"); - outMsg.writeInt8(Being::genderToInt(token.sex), "gender"); - -/* - if (localPlayer) - { - // Change the player's ID to the account ID to match what eAthena uses - localPlayer->setId(token.account_ID); - } -*/ - // We get 4 useless bytes before the real answer comes in (what are these?) - Network::mInstance->skip(4); - BLOCK_END("GameHandler::connect") -} - -bool GameHandler::isConnected() const -{ - if (Network::mInstance == nullptr) - return false; - return Network::mInstance->isConnected(); -} - -void GameHandler::disconnect() const -{ - BLOCK_START("GameHandler::disconnect") - if (Network::mInstance != nullptr) - Network::mInstance->disconnect(); - BLOCK_END("GameHandler::disconnect") -} - -void GameHandler::quit() const -{ - createOutPacket(CMSG_CLIENT_QUIT); -} - -void GameHandler::ping(const int tick) const -{ - createOutPacket(CMSG_MAP_PING); - outMsg.writeInt32(tick, "tick"); -} - -void GameHandler::disconnect2() const -{ - createOutPacket(CMSG_CLIENT_DISCONNECT); -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/gamehandler.h b/src/net/tmwa/gamehandler.h deleted file mode 100644 index 78d30e7e3..000000000 --- a/src/net/tmwa/gamehandler.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_GAMEHANDLER_H -#define NET_TMWA_GAMEHANDLER_H - -#include "net/ea/gamehandler.h" - -namespace TmwAthena -{ - -class GameHandler final : public Ea::GameHandler -{ - public: - GameHandler(); - - A_DELETE_COPY(GameHandler) - - ~GameHandler(); - - void connect() const override final; - - bool isConnected() const override final A_WARN_UNUSED; - - void disconnect() const override final; - - void quit() const override final; - - void ping(const int tick) const override final; - - void disconnect2() const override final; - - void mapLoadedEvent() const override final; - - bool mustPing() const override final A_WARN_UNUSED - { return false; } -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_GAMEHANDLER_H diff --git a/src/net/tmwa/gamerecv.cpp b/src/net/tmwa/gamerecv.cpp deleted file mode 100644 index ab13076fb..000000000 --- a/src/net/tmwa/gamerecv.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/gamerecv.h" - -#include "client.h" -#include "logger.h" - -#include "being/localplayer.h" - -#include "net/messagein.h" - -#include "net/tmwa/network.h" - -#include "debug.h" - -namespace TmwAthena -{ - -extern ServerInfo mapServer; - -void GameRecv::processMapLogin(Net::MessageIn &msg) -{ - unsigned char direction; - uint16_t x, y; - msg.readInt32("tick"); - msg.readCoordinates(x, y, direction, "position"); - msg.readInt16("unknown?"); - logger->log("Protocol: Player start position: (%d, %d)," - " Direction: %d", x, y, direction); - - mLastHost &= 0xffffff; - - Network *const network = Network::mInstance; - if (network != nullptr) - network->pauseDispatch(); - - // Switch now or we'll have problems - client->setState(State::GAME); - if (localPlayer != nullptr) - localPlayer->setTileCoords(x, y); -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/gamerecv.h b/src/net/tmwa/gamerecv.h deleted file mode 100644 index eca251fd2..000000000 --- a/src/net/tmwa/gamerecv.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_GAMERECV_H -#define NET_TMWA_GAMERECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace TmwAthena -{ - namespace GameRecv - { - void processMapLogin(Net::MessageIn &msg); - } // namespace GameRecv -} // namespace TmwAthena - -#endif // NET_TMWA_GAMERECV_H diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp deleted file mode 100644 index 0cbaf1c4c..000000000 --- a/src/net/tmwa/generalhandler.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/generalhandler.h" - -#include "client.h" -#include "configuration.h" - -#include "gui/windows/skilldialog.h" -#include "gui/windows/socialwindow.h" - -#include "gui/widgets/tabs/chat/partytab.h" - -#include "net/tmwa/adminhandler.h" -#include "net/tmwa/beinghandler.h" -#include "net/tmwa/buysellhandler.h" -#include "net/tmwa/chathandler.h" -#include "net/tmwa/charserverhandler.h" -#include "net/tmwa/gamehandler.h" -#include "net/tmwa/guildhandler.h" -#include "net/tmwa/inventoryhandler.h" -#include "net/tmwa/itemhandler.h" -#include "net/tmwa/loginhandler.h" -#include "net/tmwa/network.h" -#include "net/tmwa/npchandler.h" -#include "net/tmwa/partyhandler.h" -#include "net/tmwa/pethandler.h" -#include "net/tmwa/playerhandler.h" -#include "net/tmwa/serverfeatures.h" -#include "net/tmwa/tradehandler.h" -#include "net/tmwa/skillhandler.h" -#include "net/tmwa/questhandler.h" - -#include "net/tmwa/auctionhandler.h" -#include "net/tmwa/bankhandler.h" -#include "net/tmwa/battlegroundhandler.h" -#include "net/tmwa/buyingstorehandler.h" -#include "net/tmwa/cashshophandler.h" -#include "net/tmwa/elementalhandler.h" -#include "net/tmwa/familyhandler.h" -#include "net/tmwa/friendshandler.h" -#include "net/tmwa/homunculushandler.h" -#include "net/tmwa/mail2handler.h" -#include "net/tmwa/mailhandler.h" -#include "net/tmwa/maphandler.h" -#include "net/tmwa/markethandler.h" -#include "net/tmwa/mercenaryhandler.h" -#include "net/tmwa/roulettehandler.h" -#include "net/tmwa/searchstorehandler.h" -#include "net/tmwa/vendinghandler.h" - -#include "utils/delete2.h" -#include "utils/gettext.h" - -#include "debug.h" - -namespace TmwAthena -{ - -GeneralHandler::GeneralHandler() : - mAdminHandler(new AdminHandler), - mBeingHandler(new BeingHandler(config.getBoolValue("EnableSync"))), - mBuySellHandler(new BuySellHandler), - mCharServerHandler(new CharServerHandler), - mChatHandler(new ChatHandler), - mGameHandler(new GameHandler), - mGuildHandler(new GuildHandler), - mInventoryHandler(new InventoryHandler), - mItemHandler(new ItemHandler), - mLoginHandler(new LoginHandler), - mNpcHandler(new NpcHandler), - mPartyHandler(new PartyHandler), - mPetHandler(new PetHandler), - mPlayerHandler(new PlayerHandler), - mSkillHandler(new SkillHandler), - mTradeHandler(new TradeHandler), - mQuestHandler(new QuestHandler), - mServerFeatures(new ServerFeatures), - mAuctionHandler(new AuctionHandler), - mBankHandler(new BankHandler), - mBattleGroundHandler(new BattleGroundHandler), - mBuyingStoreHandler(new BuyingStoreHandler), - mCashShopHandler(new CashShopHandler), - mElementalHandler(new ElementalHandler), - mFamilyHandler(new FamilyHandler), - mFriendsHandler(new FriendsHandler), - mHomunculusHandler(new HomunculusHandler), - mMail2Handler(new Mail2Handler), - mMailHandler(new MailHandler), - mMapHandler(new MapHandler), - mMarketHandler(new MarketHandler), - mMercenaryHandler(new MercenaryHandler), - mRouletteHandler(new RouletteHandler), - mSearchStoreHandler(new SearchStoreHandler), - mVendingHandler(new VendingHandler) -{ - generalHandler = this; -} - -GeneralHandler::~GeneralHandler() -{ - delete2(Network::mInstance); - - delete2(mAdminHandler); - delete2(mBeingHandler); - delete2(mBuySellHandler); - delete2(mCharServerHandler); - delete2(mChatHandler); - delete2(mGameHandler); - delete2(mGuildHandler); - delete2(mInventoryHandler); - delete2(mItemHandler); - delete2(mLoginHandler); - delete2(mNpcHandler); - delete2(mPartyHandler); - delete2(mPetHandler); - delete2(mPlayerHandler); - delete2(mSkillHandler); - delete2(mTradeHandler); - delete2(mQuestHandler); - delete2(mServerFeatures); - delete2(mAuctionHandler); - delete2(mBankHandler); - delete2(mBattleGroundHandler); - delete2(mBuyingStoreHandler); - delete2(mCashShopHandler); - delete2(mElementalHandler); - delete2(mFamilyHandler); - delete2(mFriendsHandler); - delete2(mHomunculusHandler); - delete2(mMail2Handler); - delete2(mMailHandler); - delete2(mMapHandler); - delete2(mMarketHandler); - delete2(mMercenaryHandler); - delete2(mRouletteHandler); - delete2(mSearchStoreHandler); - delete2(mVendingHandler); -} - -void GeneralHandler::load() const -{ - new Network; - Network::mInstance->registerHandlers(); -} - -void GeneralHandler::reload() const -{ - if (Network::mInstance != nullptr) - Network::mInstance->disconnect(); - - static_cast<LoginHandler*>(mLoginHandler)->clearWorlds(); - const CharServerHandler *const charHandler = - static_cast<CharServerHandler*>(mCharServerHandler); - charHandler->setCharCreateDialog(nullptr); - charHandler->setCharSelectDialog(nullptr); - PartyHandler::reload(); -} - -void GeneralHandler::reloadPartially() const -{ - PartyHandler::reload(); -} - -void GeneralHandler::unload() const -{ - clearHandlers(); -} - -void GeneralHandler::flushSend() const -{ - if (Network::mInstance == nullptr) - return; - - Network::mInstance->flush(); -} - -void GeneralHandler::flushNetwork() const -{ - if (Network::mInstance == nullptr) - return; - - BLOCK_START("GeneralHandler::flushNetwork 1") - Network::mInstance->flush(); - BLOCK_END("GeneralHandler::flushNetwork 1") - Network::mInstance->dispatchMessages(); - - BLOCK_START("GeneralHandler::flushNetwork 3") - if (Network::mInstance->getState() == Network::NET_ERROR) - { - if (!Network::mInstance->getError().empty()) - { - errorMessage = Network::mInstance->getError(); - } - else - { - // TRANSLATORS: error message - errorMessage = _("Got disconnected from server!"); - } - - client->setState(State::ERROR); - } - BLOCK_END("GeneralHandler::flushNetwork 3") -} - -void GeneralHandler::clearHandlers() const -{ - if (Network::mInstance != nullptr) - Network::mInstance->clearHandlers(); -} - -void GeneralHandler::gameStarted() const -{ - if (skillDialog != nullptr) - skillDialog->loadSkills(); -} - -void GeneralHandler::gameEnded() const -{ - if (socialWindow != nullptr) - socialWindow->removeTab(Ea::taParty); - - delete2(partyTab); -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h deleted file mode 100644 index 818cb4be3..000000000 --- a/src/net/tmwa/generalhandler.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_GENERALHANDLER_H -#define NET_TMWA_GENERALHANDLER_H - -#include "net/generalhandler.h" - -namespace TmwAthena -{ -class AdminHandler; -class BeingHandler; -class BuySellHandler; -class CharServerHandler; -class ChatHandler; -class GameHandler; -class GuildHandler; -class InventoryHandler; -class ItemHandler; -class LoginHandler; -class NpcHandler; -class PartyHandler; -class PetHandler; -class PlayerHandler; -class SkillHandler; -class TradeHandler; -class QuestHandler; -class ServerFeatures; -class AuctionHandler; -class BankHandler; -class BattleGroundHandler; -class BuyingStoreHandler; -class CashShopHandler; -class ElementalHandler; -class FamilyHandler; -class FriendsHandler; -class HomunculusHandler; -class Mail2Handler; -class MailHandler; -class MapHandler; -class MarketHandler; -class MercenaryHandler; -class RouletteHandler; -class SearchStoreHandler; -class VendingHandler; - -class GeneralHandler final : public Net::GeneralHandler -{ - public: - GeneralHandler(); - - A_DELETE_COPY(GeneralHandler) - - ~GeneralHandler(); - - void load() const override final; - - void reload() const override final; - - void unload() const override final; - - void flushNetwork() const override final; - - void flushSend() const override final; - - void clearHandlers() const override final; - - void reloadPartially() const override final; - - void gameStarted() const override final; - - void gameEnded() const override final; - - protected: - AdminHandler *mAdminHandler; - BeingHandler *mBeingHandler; - BuySellHandler *mBuySellHandler; - CharServerHandler *mCharServerHandler; - ChatHandler *mChatHandler; - GameHandler *mGameHandler; - GuildHandler *mGuildHandler; - InventoryHandler *mInventoryHandler; - ItemHandler *mItemHandler; - LoginHandler *mLoginHandler; - NpcHandler *mNpcHandler; - PartyHandler *mPartyHandler; - PetHandler *mPetHandler; - PlayerHandler *mPlayerHandler; - SkillHandler *mSkillHandler; - TradeHandler *mTradeHandler; - QuestHandler *mQuestHandler; - ServerFeatures *mServerFeatures; - AuctionHandler *mAuctionHandler; - BankHandler *mBankHandler; - BattleGroundHandler *mBattleGroundHandler; - BuyingStoreHandler *mBuyingStoreHandler; - CashShopHandler *mCashShopHandler; - ElementalHandler *mElementalHandler; - FamilyHandler *mFamilyHandler; - FriendsHandler *mFriendsHandler; - HomunculusHandler *mHomunculusHandler; - Mail2Handler *mMail2Handler; - MailHandler *mMailHandler; - MapHandler *mMapHandler; - MarketHandler *mMarketHandler; - MercenaryHandler *mMercenaryHandler; - RouletteHandler *mRouletteHandler; - SearchStoreHandler *mSearchStoreHandler; - VendingHandler *mVendingHandler; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_GENERALHANDLER_H diff --git a/src/net/tmwa/generalrecv.cpp b/src/net/tmwa/generalrecv.cpp deleted file mode 100644 index 0bc1c6a4c..000000000 --- a/src/net/tmwa/generalrecv.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/generalrecv.h" - -#include "client.h" -#include "logger.h" - -#include "net/messagein.h" - -#include "utils/cast.h" -#include "utils/gettext.h" - -#include "debug.h" - -namespace TmwAthena -{ - -ServerInfo charServer; -ServerInfo mapServer; - -void GeneralRecv::processConnectionProblem(Net::MessageIn &msg) -{ - const uint8_t code = msg.readUInt8("flag"); - logger->log("Connection problem: %u", CAST_U32(code)); - - switch (code) - { - case 0: - // TRANSLATORS: error message - errorMessage = _("Authentication failed."); - break; - case 1: - // TRANSLATORS: error message - errorMessage = _("No servers available."); - break; - case 2: - if (client->getState() == State::GAME) - { - // TRANSLATORS: error message - errorMessage = _("Someone else is trying to use this " - "account."); - } - else - { - // TRANSLATORS: error message - errorMessage = _("This account is already logged in."); - } - break; - case 3: - // TRANSLATORS: error message - errorMessage = _("Speed hack detected."); - break; - case 8: - // TRANSLATORS: error message - errorMessage = _("Duplicated login."); - break; - default: - // TRANSLATORS: error message - errorMessage = _("Unknown connection error."); - break; - } - client->setState(State::ERROR); -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/generalrecv.h b/src/net/tmwa/generalrecv.h deleted file mode 100644 index 92f0e71f8..000000000 --- a/src/net/tmwa/generalrecv.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_GENERALRECV_H -#define NET_TMWA_GENERALRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace TmwAthena -{ - namespace GeneralRecv - { - void processConnectionProblem(Net::MessageIn &msg); - } // namespace GeneralRecv -} // namespace TmwAthena - -#endif // NET_TMWA_GENERALRECV_H diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp deleted file mode 100644 index 5b41ef49a..000000000 --- a/src/net/tmwa/guildhandler.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/guildhandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -GuildHandler::GuildHandler() : - Net::GuildHandler() -{ - guildHandler = this; -} - -GuildHandler::~GuildHandler() -{ - guildHandler = nullptr; -} - -void GuildHandler::clear() const -{ -} - -ChatTab *GuildHandler::getTab() const -{ - return nullptr; -} - -void GuildHandler::create(const std::string &name A_UNUSED) const -{ -} - -void GuildHandler::invite(const std::string &name A_UNUSED) const -{ -} - -void GuildHandler::invite(const Being *const being A_UNUSED) const -{ -} - -void GuildHandler::inviteResponse(const int guildId A_UNUSED, - const bool response A_UNUSED) const -{ -} - -void GuildHandler::leave(const int guildId A_UNUSED) const -{ -} - -void GuildHandler::kick(const GuildMember *restrict const member A_UNUSED, - const std::string &restrict reason A_UNUSED) const -{ -} - -void GuildHandler::chat(const std::string &text A_UNUSED) const -{ -} - -void GuildHandler::memberList() const -{ -} - -void GuildHandler::info() const -{ -} - -void GuildHandler::changeMemberPostion(const GuildMember *const member - A_UNUSED, - const int level A_UNUSED) const -{ -} - -void GuildHandler::changeNotice(const int guildId A_UNUSED, - const std::string &restrict msg1 A_UNUSED, - const std::string &restrict msg2 A_UNUSED) - const -{ -} - -void GuildHandler::checkMaster() const -{ -} - -void GuildHandler::requestAlliance(const Being *const being A_UNUSED) const -{ -} - -void GuildHandler::requestAllianceResponse(const int beingId A_UNUSED, - const bool accept A_UNUSED) const -{ -} - -void GuildHandler::endAlliance(const int guildId A_UNUSED, - const int flag A_UNUSED) const -{ -} - -void GuildHandler::changePostionInfo(const int posId A_UNUSED, - const int mode A_UNUSED, - const int ranking A_UNUSED, - const int payRate A_UNUSED, - const std::string &name A_UNUSED) const -{ -} - -void GuildHandler::requestOpposition(const Being *const being A_UNUSED) const -{ -} - -void GuildHandler::breakGuild(const std::string &name A_UNUSED) const -{ -} - -void GuildHandler::changeEmblem(std::string emblem A_UNUSED) const -{ -} - -void GuildHandler::requestEmblem(const int guildId A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/guildhandler.h b/src/net/tmwa/guildhandler.h deleted file mode 100644 index dcb9d6b7c..000000000 --- a/src/net/tmwa/guildhandler.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_GUILDHANDLER_H -#define NET_TMWA_GUILDHANDLER_H - -#include "net/guildhandler.h" - -namespace TmwAthena -{ - -class GuildHandler final : public Net::GuildHandler -{ - public: - GuildHandler(); - - A_DELETE_COPY(GuildHandler) - - ~GuildHandler(); - - void clear() const override final; - - ChatTab *getTab() const override final; - - void create(const std::string &name) const override final; - - void invite(const std::string &name) const override final; - - void invite(const Being *const being) const override final; - - void inviteResponse(const int guildId, - const bool response) const override final; - - void leave(const int guildId) const override final; - - void kick(const GuildMember *restrict const member, - const std::string &restrict reason) const override final; - - void chat(const std::string &text) const override final; - - void memberList() const override final; - - void info() const override final; - - void changeMemberPostion(const GuildMember *const member, - const int level) const override final; - - void changeNotice(const int guildId, - const std::string &restrict msg1, - const std::string &restrict msg2) - const override final; - - void checkMaster() const override final; - - void requestAlliance(const Being *const being) const override final - A_CONST; - - void requestAllianceResponse(const int beingId, - const bool accept) const override final - A_CONST; - - void endAlliance(const int guildId, - const int flag) const override final A_CONST; - - void changePostionInfo(const int posId, - const int mode, - const int ranking, - const int payRate, - const std::string &name) const override final - A_CONST; - - void requestOpposition(const Being *const being) const override final - A_CONST; - - void breakGuild(const std::string &name) const override final A_CONST; - - void changeEmblem(std::string emblem) const override final A_CONST; - - void requestEmblem(const int guildId) const override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_GUILDHANDLER_H diff --git a/src/net/tmwa/guildmanager.cpp b/src/net/tmwa/guildmanager.cpp deleted file mode 100644 index 5484f1b51..000000000 --- a/src/net/tmwa/guildmanager.cpp +++ /dev/null @@ -1,543 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifdef TMWA_SUPPORT -#include "net/tmwa/guildmanager.h" - -#include "actormanager.h" -#include "client.h" -#include "configuration.h" -#include "guild.h" -#include "notifymanager.h" - -#include "being/localplayer.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/chatwindow.h" -#include "gui/windows/socialwindow.h" - -#include "gui/widgets/tabs/chat/emulateguildtab.h" - -#include "net/chathandler.h" -#include "net/packetlimiter.h" - -#include "utils/delete2.h" -#include "utils/timer.h" - -#include "debug.h" - -GuildManager *guildManager = nullptr; - -static const int requestTimeout = 5; - -bool GuildManager::mEnableGuildBot = false; - -GuildManager::GuildManager() : - mGotInfo(false), - mGotName(false), - mSentInfoRequest(false), - mSentNameRequest(false), - mHavePower(false), - mTempList(), - mTab(nullptr), - mRequest(false), - mRequestTime(cur_time + 3), - mGotOnlineInfo(false) -{ -} - -GuildManager::~GuildManager() -{ - delete2(mTab); -} - -void GuildManager::init() -{ - int val = serverConfig.getValue("enableGuildBot", -1); - if (val == -1) - { - if (Client::isTmw()) - val = 1; - else - val = 0; - serverConfig.setValue("enableGuildBot", val); - } - mEnableGuildBot = (val != 0); - if (mEnableGuildBot) - { - if (guildManager == nullptr) - guildManager = new GuildManager; - else - guildManager->reload(); - } - else if (guildManager != nullptr) - { - delete2(guildManager); - } -} - -void GuildManager::reload() -{ - mGotInfo = false; - mGotName = false; - mHavePower = false; - mRequest = false; - mSentNameRequest = false; - mSentInfoRequest = false; - mGotOnlineInfo = false; - mRequestTime = 0; - mTempList.clear(); - - if (socialWindow != nullptr) - { - Guild *const guild = Guild::getGuild(1); - if ((guild != nullptr) && (socialWindow != nullptr)) - socialWindow->removeTab(guild); - } - delete2(mTab); -} - -void GuildManager::send(const std::string &msg) -{ - chatHandler->privateMessage("guild", msg); -} - -void GuildManager::chat(const std::string &msg) -{ - if ((localPlayer == nullptr) || (mTab == nullptr)) - return; - - chatHandler->privateMessage("guild", msg); - mTab->chatLog(localPlayer->getName(), msg); -} - -void GuildManager::getNames(StringVect &names) const -{ - const Guild *const guild = createGuild(); - if (guild != nullptr) - guild->getNames(names); -} - -void GuildManager::requestGuildInfo() -{ - if (mRequest && mRequestTime + 15 < cur_time) - return; - - if (!mGotName && !mSentNameRequest) - { - if (!PacketLimiter::limitPackets(PacketType::PACKET_WHISPER)) - return; - send("!info " + toString(tick_time)); - mRequest = true; - mSentNameRequest = true; - mRequestTime = cur_time + requestTimeout; - } - else if (!mGotInfo && !mSentInfoRequest && !mSentNameRequest) - { - if (!PacketLimiter::limitPackets(PacketType::PACKET_WHISPER)) - return; - send("!getonlineinfo " + toString(tick_time)); - mRequest = true; - mSentInfoRequest = true; - mRequestTime = cur_time + requestTimeout; - } -} - -void GuildManager::slowLogic() -{ - if (!mGotOnlineInfo && mGotName && mRequestTime < cur_time) - { - if (!PacketLimiter::limitPackets(PacketType::PACKET_WHISPER)) - return; - send("!getonlineinfo " + toString(tick_time)); - mRequest = true; - mSentInfoRequest = true; - mRequestTime = cur_time + requestTimeout; - } -} - -void GuildManager::updateList() -{ - Guild *const guild = Guild::getGuild(1); - if (guild != nullptr) - { - guild->setServerGuild(false); - StringVectCIter it = mTempList.begin(); - const StringVectCIter it_end = mTempList.end(); - int i = 0; - while (it != it_end) - { - std::string name = *it; - const size_t sz = name.size(); - if (sz > 1) - { - const int status = atoi(name.substr(sz - 1).c_str()); - - name = name.substr(0, sz - 1); - GuildMember *const m = guild->addMember( - fromInt(i, BeingId), 0, name); - if (m != nullptr) - { - m->setOnline((status & 1) != 0); - m->setGender(Gender::UNSPECIFIED); - if ((status & 2) != 0) - m->setPos(10); - else - m->setPos(0); - if (localPlayer != nullptr && - name == localPlayer->getName()) - { - mHavePower = ((status & 2) != 0); - m->setOnline(true); - } - } - } - ++ it; - i ++; - } - guild->sort(); - createTab(guild); - if (actorManager != nullptr) - { - actorManager->updatePlayerGuild(); - actorManager->updatePlayerColors(); - } - if (socialWindow != nullptr) - socialWindow->updateGuildCounter(); - } - mTempList.clear(); - mSentInfoRequest = false; - mGotInfo = true; -} - -void GuildManager::createTab(Guild *const guild) -{ - if (mTab == nullptr) - { - mTab = new EmulateGuildTab(chatWindow); - if (config.getBoolValue("showChatHistory")) - mTab->loadFromLogFile("#Guild"); - if (localPlayer != nullptr) - localPlayer->addGuild(guild); - } -} - -Guild *GuildManager::createGuild() const -{ - Guild *const guild = Guild::getGuild(1); - if (guild == nullptr) - return nullptr; - - guild->setServerGuild(false); - return guild; -} - -bool GuildManager::processGuildMessage(const std::string &msg) -{ - const bool res = process(msg); - - if (!mRequest) - requestGuildInfo(); - - return res; -} - -bool GuildManager::process(std::string msg) -{ - if (msg.size() > 4 && msg[0] == '#' && msg[1] == '#') - msg = msg.substr(3); - - const bool haveNick = (msg.find(": ") != std::string::npos); - - if (!haveNick && findCutLast(msg, " is now Offline.")) - { - Guild *const guild = createGuild(); - if (guild == nullptr) - return false; - if (msg.size() < 4) - return false; - if (msg[0] == '#' && msg[1] == '#') - msg = msg.substr(3); - - GuildMember *const m = guild->addMember(msg); - if (m != nullptr) - m->setOnline(false); - guild->sort(); - mRequest = false; - if (mTab != nullptr) - mTab->showOnline(msg, Online_false); - if (socialWindow != nullptr) - socialWindow->updateGuildCounter(); - return true; - } - else if (!haveNick && findCutLast(msg, " is now Online.")) - { - Guild *const guild = createGuild(); - if (guild == nullptr) - return false; - if (msg.size() < 4) - return false; - if (msg[0] == '#' && msg[1] == '#') - msg = msg.substr(3); - GuildMember *const m = guild->addMember(msg); - if (m != nullptr) - m->setOnline(true); - guild->sort(); - mRequest = false; - if (mTab != nullptr) - mTab->showOnline(msg, Online_true); - if (socialWindow != nullptr) - socialWindow->updateGuildCounter(); - return true; - } - else if (findCutFirst(msg, "Welcome to the ")) - { - Guild *const guild = createGuild(); - if (guild == nullptr) - return false; -// logger->log("welcome message: %s", msg.c_str()); - const size_t pos = msg.find("! ("); - if (pos == std::string::npos) - return false; - msg = msg.substr(0, pos); - guild->setName(msg); - if (localPlayer != nullptr) - localPlayer->setGuildName(msg); - mGotName = true; - mSentNameRequest = false; - mRequest = false; - return true; - } - else if (findCutFirst(msg, "Player name: ")) - { - Guild *const guild = createGuild(); - if (guild == nullptr) - return false; - size_t pos = msg.find("Access Level: "); - if (pos == std::string::npos) - return false; - - msg = msg.substr(pos); - if (!findCutFirst(msg, "Access Level: ")) - return false; - - pos = msg.find(", Guild:"); - if (pos == std::string::npos) - return false; - - const int level = atoi(msg.substr(0, pos).c_str()); - if (level >= 10) - mHavePower = true; - else - mHavePower = false; - - msg = msg.substr(pos + strlen(", Guild:")); - pos = msg.find(", No. Of Online Players: "); - if (pos == std::string::npos) - return false; - - msg = msg.substr(0, pos); -// logger->log("guild name: %s", msg.c_str()); - - guild->setName(msg); - if (localPlayer != nullptr) - localPlayer->setGuildName(msg); - mGotName = true; - mSentNameRequest = false; - mRequest = false; - return true; - } - else if (findCutFirst(msg, "OL#")) - { -// logger->log("OL"); - mTempList.clear(); - splitToStringVector(mTempList, msg, '#'); - if (msg.empty() || msg[msg.size() - 1] != '#') - updateList(); - mRequest = false; - mGotOnlineInfo = true; - return true; - } - else if (findCutFirst(msg, "oL#")) - { -// logger->log("oL"); - splitToStringVector(mTempList, msg, '#'); - if (msg.empty() || msg[msg.size() - 1] != '#') - updateList(); - mRequest = false; - mGotOnlineInfo = true; - return true; - } - else if (msg == "You are currently not in a guild. For more information " - "or to discuss the possibility of adding you own guild " - "please contact Jero.") - { - mRequest = true; - return true; - } - else if (findCutFirst(msg, "You have been invited to the ") - && findCutLast(msg, " guild chat. If you would like to accept " - "this invitation please reply \"yes\" and if not then \"no\" .")) - { - if (socialWindow != nullptr) - socialWindow->showGuildInvite(msg, 1, ""); - return true; - } - else if (!haveNick && (findCutLast(msg, " has been removed " - "from the Guild.") || findCutLast(msg, " has left the Guild."))) - { - Guild *const guild = createGuild(); - if (guild == nullptr) - return false; - if (msg.size() < 4) - return false; - if (msg[0] == '#' && msg[1] == '#') - msg = msg.substr(3); - - if (actorManager != nullptr) - { - Being *const b = actorManager->findBeingByName( - msg, ActorType::Player); - - if (b != nullptr) - { - b->clearGuilds(); - b->setGuildName(""); - b->updateColors(); - } - } - - guild->removeMember(msg); - return true; - } - else if (msg == "You have been removed from the Guild" || - msg == "You have left the Guild") - { - return afterRemove(); - } - Guild *const guild = createGuild(); - if (guild == nullptr) - return false; - if (mTab == nullptr) - { - createTab(guild); - } - if (mTab != nullptr) - { - const size_t pos = msg.find(": ", 0); - if (pos != std::string::npos) - { - const std::string sender_name = msg.substr(0, pos); - if (guild->getMember(sender_name) == nullptr) - { - mTab->chatLog(msg, ChatMsgType::BY_SERVER); - return true; - } - - msg.erase(0, pos + 2); - if (msg.size() > 3 && msg[0] == '#' && msg[1] == '#') - msg.erase(0, 3); - - trim(msg); - mTab->chatLog(sender_name, msg); - } - else - { - mTab->chatLog(msg, ChatMsgType::BY_SERVER); - } - return true; - } - return false; -} - -void GuildManager::kick(const std::string &msg) -{ - send("!remove " + msg); -} - -void GuildManager::invite(const std::string &msg) -{ - send("!invite " + msg); -} - -void GuildManager::leave() -{ - send("!leave"); -} - -void GuildManager::notice(const std::string &msg) -{ - if (msg.empty()) - send("!removemotd"); - else - send("!setmotd " + msg); -} - -void GuildManager::clear() -{ - if (socialWindow != nullptr) - { - Guild *const guild = Guild::getGuild(1); - if (guild != nullptr) - socialWindow->removeTab(guild); - } -} - -void GuildManager::inviteResponse(const bool response) -{ - if (response) - send("yes"); - else - send("no"); -} - -bool GuildManager::afterRemove() -{ - Guild *const guild = createGuild(); - if (guild == nullptr) - return false; - guild->removeFromMembers(); - guild->clearMembers(); - if (localPlayer != nullptr) - { - localPlayer->setGuildName(""); - localPlayer->clearGuilds(); - } - NotifyManager::notify(NotifyTypes::GUILD_LEFT); - delete2(mTab); - - if (socialWindow != nullptr) - socialWindow->removeTab(guild); - if (actorManager != nullptr) - { - actorManager->updatePlayerGuild(); - actorManager->updatePlayerColors(); - } - reload(); - return true; -} - -ChatTab *GuildManager::getTab() -{ - return mTab; -} - -#endif // TMWA_SUPPORT diff --git a/src/net/tmwa/guildmanager.h b/src/net/tmwa/guildmanager.h deleted file mode 100644 index 67f88927d..000000000 --- a/src/net/tmwa/guildmanager.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_GUILDMANAGER_H -#define NET_TMWA_GUILDMANAGER_H - -#ifdef TMWA_SUPPORT - -#include "utils/stringvector.h" - -#include "localconsts.h" - -class ChatTab; -class Guild; -class EmulateGuildTab; - -class GuildManager final -{ - public: - GuildManager(); - - A_DELETE_COPY(GuildManager) - - ~GuildManager(); - - static void init(); - - void chat(const std::string &msg); - - static void send(const std::string &msg); - - void getNames(StringVect &names) const; - - void requestGuildInfo(); - - void updateList(); - - static bool getEnableGuildBot() A_WARN_UNUSED - { return mEnableGuildBot; } - - static void kick(const std::string &msg); - - static void invite(const std::string &msg); - - static void leave(); - - static void notice(const std::string &msg); - - void createTab(Guild *const guild); - - Guild *createGuild() const A_WARN_UNUSED; - - static void clear(); - - void reload(); - - static void inviteResponse(const bool response); - - bool afterRemove(); - - void slowLogic(); - - bool havePower() const A_WARN_UNUSED - { return mHavePower; } - - ChatTab *getTab(); - - bool processGuildMessage(const std::string &msg); - - private: - bool process(std::string msg); - - static bool mEnableGuildBot; - bool mGotInfo; - bool mGotName; - bool mSentInfoRequest; - bool mSentNameRequest; - bool mHavePower; - StringVect mTempList; - EmulateGuildTab *mTab; - bool mRequest; - time_t mRequestTime; - bool mGotOnlineInfo; -}; - -extern GuildManager *guildManager; - -#endif // TMWA_SUPPORT -#endif // NET_TMWA_GUILDMANAGER_H diff --git a/src/net/tmwa/homunculushandler.cpp b/src/net/tmwa/homunculushandler.cpp deleted file mode 100644 index 0d1bb2e62..000000000 --- a/src/net/tmwa/homunculushandler.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/homunculushandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -HomunculusHandler::HomunculusHandler() -{ - homunculusHandler = this; -} - -HomunculusHandler::~HomunculusHandler() -{ - homunculusHandler = nullptr; -} - -void HomunculusHandler::setName(const std::string &name A_UNUSED) const -{ -} - -void HomunculusHandler::moveToMaster() const -{ -} - -void HomunculusHandler::move(const int x A_UNUSED, const int y A_UNUSED) const -{ -} - -void HomunculusHandler::attack(const BeingId targetId A_UNUSED, - const Keep keep A_UNUSED) const -{ -} - -void HomunculusHandler::feed() const -{ -} - -void HomunculusHandler::fire() const -{ -} - -void HomunculusHandler::talk(const std::string &restrict text A_UNUSED) const -{ -} - -void HomunculusHandler::emote(const uint8_t emoteId A_UNUSED) const -{ -} - -void HomunculusHandler::setDirection(const unsigned char type A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/homunculushandler.h b/src/net/tmwa/homunculushandler.h deleted file mode 100644 index bd00927fa..000000000 --- a/src/net/tmwa/homunculushandler.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_HOMUNCULUSHANDLER_H -#define NET_TMWA_HOMUNCULUSHANDLER_H - -#include "net/homunculushandler.h" - -namespace TmwAthena -{ - -class HomunculusHandler final : public Net::HomunculusHandler -{ - public: - HomunculusHandler(); - - A_DELETE_COPY(HomunculusHandler) - - ~HomunculusHandler(); - - void setName(const std::string &name) const override final A_CONST; - - void moveToMaster() const override final A_CONST; - - void move(const int x, const int y) const override final A_CONST; - - void attack(const BeingId targetId, - const Keep keep) const override final A_CONST; - - void feed() const override final A_CONST; - - void fire() const override final A_CONST; - - void talk(const std::string &restrict text) const override final - A_CONST; - - void emote(const uint8_t emoteId) const override final A_CONST; - - void setDirection(const unsigned char type) const override final - A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_HOMUNCULUSHANDLER_H diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp deleted file mode 100644 index 7afbf746e..000000000 --- a/src/net/tmwa/inventoryhandler.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/inventoryhandler.h" - -#include "const/net/inventory.h" - -#include "enums/equipslot.h" - -#include "net/tmwa/messageout.h" -#include "net/tmwa/protocolout.h" - -#include "resources/item/item.h" - -#include "debug.h" - -// missing EQUIP_RING1_SLOT -const EquipSlot::Type EQUIP_CONVERT[] = -{ - EquipSlot::PROJECTILE_SLOT, // 0 0 - EquipSlot::FEET_SLOT, // 1 SPRITE_HAIR - EquipSlot::LEGS_SLOT, // 2 SPRITE_WEAPON - EquipSlot::TORSO_SLOT, // 3 SPRITE_HEAD_BOTTOM - EquipSlot::PROJECTILE_SLOT, // 4 0 - EquipSlot::NECK_SLOT, // 5 SPRITE_RING - EquipSlot::PROJECTILE_SLOT, // 6 0 - EquipSlot::HEAD_SLOT, // 7 SPRITE_CLOTHES_COLOR - EquipSlot::RING2_SLOT, // 8 0 - EquipSlot::GLOVES_SLOT, // 9 SPRITE_SHOES - EquipSlot::FIGHT1_SLOT, // 10 SPRITE_BODY - EquipSlot::FIGHT2_SLOT, // 11 SPRITE_FLOOR - EquipSlot::EVOL_RING1_SLOT, // 12 SPRITE_ROBE - EquipSlot::EVOL_RING2_SLOT, // 13 SPRITE_EVOL2 -}; - -namespace TmwAthena -{ - -InventoryHandler::InventoryHandler() : - Ea::InventoryHandler() -{ - inventoryHandler = this; -} - -InventoryHandler::~InventoryHandler() -{ - inventoryHandler = nullptr; -} - -void InventoryHandler::equipItem(const Item *const item) const -{ - if (item == nullptr) - return; - - createOutPacket(CMSG_PLAYER_EQUIP); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); - outMsg.writeInt16(0, "unused"); -} - -void InventoryHandler::unequipItem(const Item *const item) const -{ - if (item == nullptr) - return; - - createOutPacket(CMSG_PLAYER_UNEQUIP); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); -} - -void InventoryHandler::useItem(const Item *const item) const -{ - if (item == nullptr) - return; - - createOutPacket(CMSG_PLAYER_INVENTORY_USE); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(item->getId(), "item id"); -} - -void InventoryHandler::useItem(const Item *const item, - const int16_t useType A_UNUSED) const -{ - if (item == nullptr) - return; - - createOutPacket(CMSG_PLAYER_INVENTORY_USE); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(item->getId(), "item id"); -} - -void InventoryHandler::dropItem(const Item *const item, const int amount) const -{ - if (item == nullptr) - return; - - createOutPacket(CMSG_PLAYER_INVENTORY_DROP); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); - outMsg.writeInt16(CAST_S16(amount), "amount"); -} - -void InventoryHandler::closeStorage() const -{ - createOutPacket(CMSG_CLOSE_STORAGE); -} - -void InventoryHandler::moveItem2(const InventoryTypeT source, - const int slot, - const int amount, - const InventoryTypeT destination) const -{ - if (source == InventoryType::Inventory && - destination == InventoryType::Storage) - { - createOutPacket(CMSG_MOVE_TO_STORAGE); - outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), - "index"); - outMsg.writeInt32(amount, "amount"); - } - else if (source == InventoryType::Storage && - destination == InventoryType::Inventory) - { - createOutPacket(CMSG_MOVE_FROM_STORAGE); - outMsg.writeInt16(CAST_S16(slot + STORAGE_OFFSET), - "index"); - outMsg.writeInt32(amount, "amount"); - } -} - -void InventoryHandler::useCard(const Item *const item A_UNUSED) -{ -} - -void InventoryHandler::insertCard(const int cardIndex A_UNUSED, - const int itemIndex A_UNUSED) const -{ -} - -void InventoryHandler::favoriteItem(const Item *const item A_UNUSED, - const bool favorite A_UNUSED) const -{ -} - -void InventoryHandler::selectEgg(const Item *const item A_UNUSED) const -{ -} - -int InventoryHandler::convertFromServerSlot(const int serverSlot) const -{ - if (serverSlot < 0 || serverSlot > 13) - return 0; - - return CAST_S32(EQUIP_CONVERT[serverSlot]); -} - -void InventoryHandler::selectCart(const BeingId accountId A_UNUSED, - const int type A_UNUSED) const -{ -} - -void InventoryHandler::identifyItem(const Item *const item A_UNUSED) const -{ -} - -void InventoryHandler::mergeItemsAck(const STD_VECTOR<Item*> &items A_UNUSED) - const -{ -} - -void InventoryHandler::mergetItemsCancel() const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h deleted file mode 100644 index 5bf67f9f1..000000000 --- a/src/net/tmwa/inventoryhandler.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_INVENTORYHANDLER_H -#define NET_TMWA_INVENTORYHANDLER_H - -#include "net/ea/inventoryhandler.h" - -namespace TmwAthena -{ - -class InventoryHandler final : public Ea::InventoryHandler -{ - public: - InventoryHandler(); - - A_DELETE_COPY(InventoryHandler) - - ~InventoryHandler(); - - void equipItem(const Item *const item) const override final; - - void unequipItem(const Item *const item) const override final; - - void useItem(const Item *const item) const override final; - - void useItem(const Item *const item, - const int16_t useType) const override final; - - void dropItem(const Item *const item, - const int amount) const override final; - - void closeStorage() const override final; - - void moveItem2(const InventoryTypeT source, - const int slot, - const int amount, - const InventoryTypeT destination) const override final; - - void useCard(const Item *const item) override final A_CONST; - - void insertCard(const int cardIndex, - const int itemIndex) const override final A_CONST; - - void favoriteItem(const Item *const item, - const bool favorite) const override final A_CONST; - - void selectEgg(const Item *const item) const override final A_CONST; - - int convertFromServerSlot(const int serverSlot) - const override final A_WARN_UNUSED; - - void selectCart(const BeingId accountId, - const int type) const override final; - - void identifyItem(const Item *const item) const override final; - - void mergeItemsAck(const STD_VECTOR<Item*> &items) const - override final; - - void mergetItemsCancel() const override final; - - int getProjectileSlot() const override final - { return 10; } - - int getItemIndex() const override final A_WARN_UNUSED - { return 0; } -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_INVENTORYHANDLER_H diff --git a/src/net/tmwa/inventoryrecv.cpp b/src/net/tmwa/inventoryrecv.cpp deleted file mode 100644 index 1dcc445d7..000000000 --- a/src/net/tmwa/inventoryrecv.cpp +++ /dev/null @@ -1,563 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/inventoryrecv.h" - -#include "notifymanager.h" - -#include "being/localplayer.h" - -#include "const/net/inventory.h" - -#include "enums/equipslot.h" - -#include "enums/resources/notifytypes.h" - -#include "listeners/arrowslistener.h" - -#include "net/inventoryhandler.h" -#include "net/messagein.h" - -#include "net/ea/equipbackend.h" -#include "net/ea/inventoryrecv.h" - -#include "debug.h" - -namespace TmwAthena -{ - -namespace InventoryRecv -{ - const EquipSlot::Type EQUIP_POINTS[EquipSlot::VECTOREND] = - { - EquipSlot::LEGS_SLOT, // Lower Headgear - EquipSlot::FIGHT1_SLOT, // Weapon - EquipSlot::GLOVES_SLOT, // Garment - EquipSlot::RING2_SLOT, // Accessory 1 - EquipSlot::RING1_SLOT, // Armor - EquipSlot::FIGHT2_SLOT, // Shield - EquipSlot::FEET_SLOT, // Footgear - EquipSlot::NECK_SLOT, // Accessory 2 - EquipSlot::HEAD_SLOT, // Upper Headgear - EquipSlot::TORSO_SLOT, // Middle Headgear - EquipSlot::EVOL_RING1_SLOT, // Costume Top Headgear - EquipSlot::EVOL_RING2_SLOT, // Costume Mid Headgear - EquipSlot::PROJECTILE_SLOT, // Costume Low Headgear - EquipSlot::COSTUME_ROBE_SLOT, // Costume Garment/Robe - EquipSlot::MISSING1_SLOT, // Missing slot 1 - EquipSlot::MISSING2_SLOT, // Missing slot 2 - EquipSlot::SHADOW_ARMOR_SLOT, // Shadow Armor - EquipSlot::SHADOW_WEAPON_SLOT, // Shadow Weapon - EquipSlot::SHADOW_SHIELD_SLOT, // Shadow Shield - EquipSlot::SHADOW_SHOES_SLOT, // Shadow Shoes - EquipSlot::SHADOW_ACCESSORY2_SLOT, // Shadow Accessory 2 - EquipSlot::SHADOW_ACCESSORY1_SLOT, // Shadow Accessory 1 - }; -} // namespace InventoryRecv - -void InventoryRecv::processPlayerEquipment(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerEquipment") - Inventory *const inventory = localPlayer != nullptr - ? PlayerInfo::getInventory() : nullptr; - - msg.readInt16("len"); - Equipment *const equipment = PlayerInfo::getEquipment(); - if ((equipment != nullptr) && (equipment->getBackend() == nullptr)) - { // look like SMSG_PLAYER_INVENTORY was not received - Ea::InventoryRecv::mEquips.clear(); - equipment->setBackend(&Ea::InventoryRecv::mEquips); - } - const int number = (msg.getLength() - 4) / 20; - - for (int loop = 0; loop < number; loop++) - { - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - const uint8_t identified = msg.readUInt8("identify"); - msg.readInt16("equip type?"); - const int equipType = msg.readInt16("equip type"); - msg.readUInt8("attribute"); - const uint8_t refine = msg.readUInt8("refine"); - int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - - if (Ea::InventoryRecv::mDebugInventory) - { - logger->log("Index: %d, ID: %d, Type: %d, Identified: %d", - index, itemId, CAST_S32(itemType), identified); - } - - if (inventory != nullptr) - { - inventory->setItem(index, - itemId, - itemType, - 1, - refine, - ItemColor_one, - fromBool(identified, Identified), - Damaged_false, - Favorite_false, - Equipm_true, - Equipped_false); - inventory->setCards(index, cards, maxCards); - } - - if (equipType != 0) - { - Ea::InventoryRecv::mEquips.setEquipment( - InventoryRecv::getSlot(equipType), - index); - } - } - BLOCK_END("InventoryRecv::processPlayerEquipment") -} - -void InventoryRecv::processPlayerInventoryAdd(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerInventoryAdd") - Inventory *const inventory = localPlayer != nullptr - ? PlayerInfo::getInventory() : nullptr; - - if ((PlayerInfo::getEquipment() != nullptr) - && (PlayerInfo::getEquipment()->getBackend() == nullptr)) - { // look like SMSG_PLAYER_INVENTORY was not received - Ea::InventoryRecv::mEquips.clear(); - PlayerInfo::getEquipment()->setBackend(&Ea::InventoryRecv::mEquips); - } - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - int amount = msg.readInt16("amount"); - const int itemId = msg.readInt16("item id"); - const uint8_t identified = msg.readUInt8("identified"); - msg.readUInt8("attribute"); - const uint8_t refine = msg.readUInt8("refine"); - int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - const int equipType = msg.readInt16("equip type"); - const ItemTypeT type = static_cast<ItemTypeT>(msg.readUInt8("item type")); - const unsigned char err = msg.readUInt8("status"); - BeingId floorId; - if (Ea::InventoryRecv::mSentPickups.empty()) - { - floorId = BeingId_zero; - } - else - { - floorId = Ea::InventoryRecv::mSentPickups.front(); - Ea::InventoryRecv::mSentPickups.pop(); - } - - if (err != 0u) - { - PickupT pickup; - switch (err) - { - case 1: - pickup = Pickup::BAD_ITEM; - break; - case 2: - pickup = Pickup::TOO_HEAVY; - break; - case 3: - pickup = Pickup::TOO_FAR; - break; - case 4: - pickup = Pickup::INV_FULL; - break; - case 5: - pickup = Pickup::STACK_FULL; - break; - case 6: - pickup = Pickup::DROP_STEAL; - break; - default: - pickup = Pickup::UNKNOWN; - UNIMPLEMENTEDPACKETFIELD(err); - break; - } - if (localPlayer != nullptr) - { - if (itemId == 0) - { - localPlayer->pickedUp(ItemDB::getEmpty(), - 0, - ItemColor_one, - floorId, - pickup); - } - else - { - localPlayer->pickedUp(ItemDB::get(itemId), - 0, - ItemColor_one, - floorId, - pickup); - } - } - } - else - { - if (localPlayer != nullptr) - { - if (itemId == 0) - { - localPlayer->pickedUp(ItemDB::getEmpty(), - amount, - ItemColor_one, - floorId, - Pickup::OKAY); - } - else - { - localPlayer->pickedUp(ItemDB::get(itemId), - amount, - ItemColor_one, - floorId, - Pickup::OKAY); - } - } - - if (inventory != nullptr) - { - const Item *const item = inventory->getItem(index); - - if ((item != nullptr) && item->getId() == itemId) - amount += item->getQuantity(); - - inventory->setItem(index, - itemId, - type, - amount, - refine, - ItemColor_one, - fromBool(identified, Identified), - Damaged_false, - Favorite_false, - fromBool(equipType, Equipm), - Equipped_false); - inventory->setCards(index, cards, maxCards); - } - ArrowsListener::distributeEvent(); - } - BLOCK_END("InventoryRecv::processPlayerInventoryAdd") -} - -void InventoryRecv::processPlayerInventory(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerInventory") - Inventory *const inventory = localPlayer != nullptr - ? PlayerInfo::getInventory() : nullptr; - - if (PlayerInfo::getEquipment() != nullptr) - { - // Clear inventory - this will be a complete refresh - Ea::InventoryRecv::mEquips.clear(); - PlayerInfo::getEquipment()->setBackend(&Ea::InventoryRecv::mEquips); - } - - if (inventory != nullptr) - inventory->clear(); - - msg.readInt16("len"); - const int number = (msg.getLength() - 4) / 18; - - for (int loop = 0; loop < number; loop++) - { - int cards[maxCards]; - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - const uint8_t identified = msg.readUInt8("identified"); - const int amount = msg.readInt16("amount"); - const int arrow = msg.readInt16("arrow"); - for (int i = 0; i < maxCards; i++) - cards[i] = msg.readUInt16("card"); - - if (Ea::InventoryRecv::mDebugInventory) - { - logger->log("Index: %d, ID: %d, Type: %d, Identified: %d, " - "Qty: %d, Cards: %d, %d, %d, %d", - index, itemId, CAST_S32(itemType), identified, amount, - cards[0], cards[1], cards[2], cards[3]); - } - - // Trick because arrows are not considered equipment - const bool isEquipment = (arrow & 0x8000) != 0; - - if (inventory != nullptr) - { - inventory->setItem(index, - itemId, - itemType, - amount, - 0, - ItemColor_one, - fromBool(identified, Identified), - Damaged_false, - Favorite_false, - fromBool(isEquipment, Equipm), - Equipped_false); - inventory->setCards(index, cards, maxCards); - } - } - BLOCK_END("InventoryRecv::processPlayerInventory") -} - -void InventoryRecv::processPlayerStorage(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerInventory") - Ea::InventoryRecv::mInventoryItems.clear(); - - msg.readInt16("len"); - const int number = (msg.getLength() - 4) / 18; - - for (int loop = 0; loop < number; loop++) - { - int cards[maxCards]; - const int index = msg.readInt16("index") - STORAGE_OFFSET; - const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - const uint8_t identified = msg.readUInt8("identified"); - const int amount = msg.readInt16("amount"); - msg.readInt16("arrow"); - for (int i = 0; i < maxCards; i++) - cards[i] = msg.readUInt16("card"); - - if (Ea::InventoryRecv::mDebugInventory) - { - logger->log("Index: %d, ID: %d, Type: %d, Identified: %d, " - "Qty: %d, Cards: %d, %d, %d, %d", - index, itemId, CAST_S32(itemType), identified, amount, - cards[0], cards[1], cards[2], cards[3]); - } - - Ea::InventoryRecv::mInventoryItems.push_back(Ea::InventoryItem( - index, - itemId, - itemType, - cards, - nullptr, - amount, - 0, - ItemColor_one, - fromBool(identified, Identified), - Damaged_false, - Favorite_false, - Equipm_false)); - } - BLOCK_END("InventoryRecv::processPlayerInventory") -} - -void InventoryRecv::processPlayerEquip(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerEquip") - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int equipType = msg.readInt16("equip type"); - const uint8_t flag = msg.readUInt8("flag"); - - if (flag == 0u) - { - NotifyManager::notify(NotifyTypes::EQUIP_FAILED); - } - else - { - Ea::InventoryRecv::mEquips.setEquipment( - InventoryRecv::getSlot(equipType), - index); - } - BLOCK_END("InventoryRecv::processPlayerEquip") -} - -void InventoryRecv::processPlayerUnEquip(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerUnEquip") - msg.readInt16("index"); - const int equipType = msg.readInt16("equip type"); - const uint8_t flag = msg.readUInt8("flag"); - - if (flag != 0u) - { - Ea::InventoryRecv::mEquips.setEquipment( - InventoryRecv::getSlot(equipType), - -1); - } - if ((equipType & 0x8000) != 0) - ArrowsListener::distributeEvent(); - BLOCK_END("InventoryRecv::processPlayerUnEquip") -} - -void InventoryRecv::processPlayerStorageEquip(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerStorageEquip") - msg.readInt16("len"); - const int number = (msg.getLength() - 4) / 20; - - for (int loop = 0; loop < number; loop++) - { - int cards[maxCards]; - const int index = msg.readInt16("index") - STORAGE_OFFSET; - const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); - const uint8_t identified = msg.readUInt8("identified"); - const int amount = 1; - msg.readInt16("equip point?"); - msg.readInt16("another equip point?"); - msg.readUInt8("attribute (broken)"); - const uint8_t refine = msg.readUInt8("refine"); - for (int i = 0; i < maxCards; i++) - cards[i] = msg.readUInt16("card"); - - if (Ea::InventoryRecv::mDebugInventory) - { - logger->log("Index: %d, ID: %d, Type: %d, Identified: %u, " - "Qty: %d, Cards: %d, %d, %d, %d, Refine: %u", - index, itemId, CAST_S32(itemType), - CAST_U32(identified), amount, - cards[0], cards[1], cards[2], cards[3], - CAST_U32(refine)); - } - - Ea::InventoryRecv::mInventoryItems.push_back(Ea::InventoryItem( - index, - itemId, - itemType, - cards, - nullptr, - amount, - refine, - ItemColor_one, - fromBool(identified, Identified), - Damaged_false, - Favorite_false, - Equipm_false)); - } - BLOCK_END("InventoryRecv::processPlayerStorageEquip") -} - -void InventoryRecv::processPlayerStorageAdd(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerStorageAdd") - // Move an item into storage - const int index = msg.readInt16("index") - STORAGE_OFFSET; - const int amount = msg.readInt32("amount"); - const int itemId = msg.readInt16("item id"); - const unsigned char identified = msg.readUInt8("identified"); - msg.readUInt8("attribute"); - const uint8_t refine = msg.readUInt8("refine"); - int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - - if (Item *const item = Ea::InventoryRecv::mStorage->getItem(index)) - { - item->setId(itemId, ItemColor_one); - item->increaseQuantity(amount); - } - else - { - if (Ea::InventoryRecv::mStorage != nullptr) - { - Ea::InventoryRecv::mStorage->setItem(index, - itemId, - ItemType::Unknown, - amount, - refine, - ItemColor_one, - fromBool(identified, Identified), - Damaged_false, - Favorite_false, - Equipm_false, - Equipped_false); - Ea::InventoryRecv::mStorage->setCards(index, cards, maxCards); - } - } - BLOCK_END("InventoryRecv::processPlayerStorageAdd") -} - -void InventoryRecv::processPlayerStorageRemove(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerStorageRemove") - // Move an item out of storage - const int index = msg.readInt16("index") - STORAGE_OFFSET; - const int amount = msg.readInt32("amount"); - if (Ea::InventoryRecv::mStorage != nullptr) - { - if (Item *const item = Ea::InventoryRecv::mStorage->getItem(index)) - { - item->increaseQuantity(-amount); - if (item->getQuantity() == 0) - Ea::InventoryRecv::mStorage->removeItemAt(index); - } - } - BLOCK_END("InventoryRecv::processPlayerStorageRemove") -} - -void InventoryRecv::processPlayerInventoryRemove(Net::MessageIn &msg) -{ - BLOCK_START("InventoryRecv::processPlayerInventoryRemove") - Inventory *const inventory = localPlayer != nullptr - ? PlayerInfo::getInventory() : nullptr; - - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - const int amount = msg.readInt16("amount"); - if (inventory != nullptr) - { - if (Item *const item = inventory->getItem(index)) - { - item->increaseQuantity(-amount); - if (item->getQuantity() == 0) - inventory->removeItemAt(index); - ArrowsListener::distributeEvent(); - } - } - BLOCK_END("InventoryRecv::processPlayerInventoryRemove") -} - -int InventoryRecv::getSlot(const int eAthenaSlot) -{ - if (eAthenaSlot == 0) - return EquipSlot::VECTOREND; - - if ((eAthenaSlot & 0x8000) != 0) - return inventoryHandler->getProjectileSlot(); - - unsigned int mask = 1; - int position = 0; - while ((eAthenaSlot & mask) == 0u) - { - mask <<= 1; - position++; - } - if (position >= EquipSlot::VECTOREND) - return EquipSlot::VECTOREND; - return CAST_S32(EQUIP_POINTS[position]); -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/inventoryrecv.h b/src/net/tmwa/inventoryrecv.h deleted file mode 100644 index f8e8b8f05..000000000 --- a/src/net/tmwa/inventoryrecv.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_INVENTORYRECV_H -#define NET_TMWA_INVENTORYRECV_H - -#include "localconsts.h" - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace TmwAthena -{ - namespace InventoryRecv - { - void processPlayerEquipment(Net::MessageIn &msg); - void processPlayerInventoryAdd(Net::MessageIn &msg); - void processPlayerInventory(Net::MessageIn &msg); - void processPlayerStorage(Net::MessageIn &msg); - void processPlayerEquip(Net::MessageIn &msg); - void processPlayerUnEquip(Net::MessageIn &msg); - void processPlayerStorageEquip(Net::MessageIn &msg); - void processPlayerStorageAdd(Net::MessageIn &msg); - void processPlayerStorageRemove(Net::MessageIn &msg); - void processPlayerInventoryRemove(Net::MessageIn &msg); - - int getSlot(const int eAthenaSlot) A_WARN_UNUSED; - } // namespace InventoryRecv -} // namespace TmwAthena - -#endif // NET_TMWA_INVENTORYRECV_H diff --git a/src/net/tmwa/itemhandler.cpp b/src/net/tmwa/itemhandler.cpp deleted file mode 100644 index 69590909e..000000000 --- a/src/net/tmwa/itemhandler.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/itemhandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -ItemHandler::ItemHandler() : - Ea::ItemHandler() -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/itemhandler.h b/src/net/tmwa/itemhandler.h deleted file mode 100644 index a824f135b..000000000 --- a/src/net/tmwa/itemhandler.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_ITEMHANDLER_H -#define NET_TMWA_ITEMHANDLER_H - -#include "net/ea/itemhandler.h" - -namespace TmwAthena -{ - -class ItemHandler final : public Ea::ItemHandler -{ - public: - ItemHandler(); - - A_DELETE_COPY(ItemHandler) -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_ITEMHANDLER_H diff --git a/src/net/tmwa/itemrecv.cpp b/src/net/tmwa/itemrecv.cpp deleted file mode 100644 index 53d3a19bc..000000000 --- a/src/net/tmwa/itemrecv.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/itemrecv.h" - -#include "actormanager.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace TmwAthena -{ - -void ItemRecv::processItemDropped(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("item object id"); - const int itemId = msg.readInt16("item id"); - const Identified identify = fromInt(msg.readUInt8("identify"), Identified); - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - const int subX = CAST_S32(msg.readInt8("sub x")); - const int subY = CAST_S32(msg.readInt8("sub y")); - const int amount = msg.readInt16("amount"); - - if (actorManager != nullptr) - { - actorManager->createItem(id, - itemId, - x, y, - ItemType::Unknown, - amount, - 0, - ItemColor_one, - identify, - Damaged_false, - subX, subY, - nullptr); - } -} - -void ItemRecv::processItemVisible(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("item object id"); - const int itemId = msg.readInt16("item id"); - const Identified identified = fromInt( - msg.readUInt8("identify"), Identified); - const int x = msg.readInt16("x"); - const int y = msg.readInt16("y"); - const int amount = msg.readInt16("amount"); - const int subX = CAST_S32(msg.readInt8("sub x")); - const int subY = CAST_S32(msg.readInt8("sub y")); - - if (actorManager != nullptr) - { - actorManager->createItem(id, - itemId, - x, y, - ItemType::Unknown, - amount, - 0, - ItemColor_one, - identified, - Damaged_false, - subX, subY, - nullptr); - } -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/itemrecv.h b/src/net/tmwa/itemrecv.h deleted file mode 100644 index 8fc24b579..000000000 --- a/src/net/tmwa/itemrecv.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_ITEMRECV_H -#define NET_TMWA_ITEMRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace TmwAthena -{ - namespace ItemRecv - { - void processItemDropped(Net::MessageIn &msg); - void processItemVisible(Net::MessageIn &msg); - } // namespace ItemRecv -} // namespace TmwAthena - -#endif // NET_TMWA_ITEMRECV_H diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp deleted file mode 100644 index 566cc5b09..000000000 --- a/src/net/tmwa/loginhandler.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/loginhandler.h" - -#include "net/serverfeatures.h" - -#include "net/ea/loginrecv.h" - -#include "net/tmwa/messageout.h" -#include "net/tmwa/network.h" -#include "net/tmwa/protocolout.h" - -#include "debug.h" - -extern unsigned int tmwServerVersion; - -namespace TmwAthena -{ - -extern ServerInfo charServer; - -LoginHandler::LoginHandler() : - Ea::LoginHandler() -{ - loginHandler = this; -} - -LoginHandler::~LoginHandler() -{ - loginHandler = nullptr; -} - -void LoginHandler::connect() const -{ - if (Network::mInstance == nullptr) - return; - - Network::mInstance->connect(mServer); - if (serverFeatures->haveServerVersion()) - { - createOutPacket(CMSG_SERVER_VERSION_REQUEST); - } -} - -bool LoginHandler::isConnected() const -{ - if (Network::mInstance == nullptr) - return false; - - return Ea::LoginRecv::mVersionResponse && - Network::mInstance->isConnected(); -} - -void LoginHandler::disconnect() const -{ - if (Network::mInstance != nullptr && - Network::mInstance->getServer() == mServer) - { - Network::mInstance->disconnect(); - } -} - -void LoginHandler::changePassword(const std::string &restrict oldPassword, - const std::string &restrict newPassword) - const -{ - createOutPacket(CMSG_CHAR_PASSWORD_CHANGE); - outMsg.writeStringNoLog(oldPassword, 24, "old password"); - outMsg.writeStringNoLog(newPassword, 24, "new password"); -} - -void LoginHandler::sendLoginRegister(const std::string &restrict username, - const std::string &restrict password, - const std::string &restrict email - A_UNUSED) const -{ - createOutPacket(CMSG_LOGIN_REGISTER); - if (tmwServerVersion < 0x100408) - { - // hack to avoid bug in tmwa... - outMsg.writeInt32(5, - "client protocol version"); - } - else - { - outMsg.writeInt32(CLIENT_PROTOCOL_VERSION, - "client protocol version"); - } - outMsg.writeString(username, 24, "login"); - outMsg.writeStringNoLog(password, 24, "password"); - - /* - * eAthena calls the last byte "client version 2", but it isn't used at - * at all. We're retasking it, as a bit mask: - * 0 - can handle the 0x63 "update host" packet - * 1 - defaults to the first char-server (instead of the last) - */ - outMsg.writeInt8(0x03, "flags"); -} - -ServerInfo *LoginHandler::getCharServer() const -{ - return &charServer; -} - -void LoginHandler::requestUpdateHosts() -{ -} - -void LoginHandler::sendVersion() const -{ -} - -void LoginHandler::ping() const -{ -} - -void LoginHandler::updatePacketVersion() const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/loginhandler.h b/src/net/tmwa/loginhandler.h deleted file mode 100644 index dddbd88e9..000000000 --- a/src/net/tmwa/loginhandler.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_LOGINHANDLER_H -#define NET_TMWA_LOGINHANDLER_H - -#include "net/ea/loginhandler.h" - -namespace TmwAthena -{ - -class LoginHandler final : public Ea::LoginHandler -{ - public: - LoginHandler(); - - A_DELETE_COPY(LoginHandler) - - ~LoginHandler(); - - void connect() const override final; - - bool isConnected() const override final A_WARN_UNUSED; - - void disconnect() const override final; - - unsigned int getMaxPasswordLength() const override final A_WARN_UNUSED - { return 24; } - - void changePassword(const std::string &restrict oldPassword, - const std::string &restrict newPassword) - const override final; - - ServerInfo *getCharServer() const override final A_CONST A_WARN_UNUSED; - - void sendVersion() const override final A_CONST; - - void ping() const override final A_CONST; - - void updatePacketVersion() const override final A_CONST; - - static void requestUpdateHosts() A_CONST; - - private: - void sendLoginRegister(const std::string &restrict username, - const std::string &restrict password, - const std::string &restrict email) - const override final; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_LOGINHANDLER_H diff --git a/src/net/tmwa/loginrecv.cpp b/src/net/tmwa/loginrecv.cpp deleted file mode 100644 index 05b4aaba3..000000000 --- a/src/net/tmwa/loginrecv.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/loginrecv.h" - -#include "client.h" -#include "configuration.h" -#include "logger.h" - -#include "being/being.h" - -#include "net/logindata.h" -#include "net/loginhandler.h" -#include "net/messagein.h" - -#include "net/ea/loginrecv.h" - -#include "net/tmwa/updateprotocol.h" - -#include "utils/gettext.h" - -#include "debug.h" - -extern int packetVersion; - -namespace TmwAthena -{ - -extern ServerInfo charServer; - -enum ServerFlags -{ - FLAG_REGISTRATION = 1 -}; - -void LoginRecv::processServerVersion(Net::MessageIn &msg) -{ - packetVersion = 0; - const uint8_t b1 = msg.readUInt8("b1"); // -1 - const uint8_t b2 = msg.readUInt8("b2"); - const uint8_t b3 = msg.readUInt8("b3"); - msg.readUInt8("b4"); - if (b1 == 255) - { // old TMWA - const unsigned int options = msg.readInt32("options"); - Ea::LoginRecv::mRegistrationEnabled = - ((options & FLAG_REGISTRATION) != 0u); - serverVersion = 0; - tmwServerVersion = 0; - } - else if (b1 >= 0x0d) - { // new TMWA - const unsigned int options = msg.readInt32("options"); - Ea::LoginRecv::mRegistrationEnabled = - ((options & FLAG_REGISTRATION) != 0u); - serverVersion = 0; - tmwServerVersion = (b1 << 16) | (b2 << 8) | b3; - } - else - { // eAthena - const unsigned int options = msg.readInt32("options"); - Ea::LoginRecv::mRegistrationEnabled = - ((options & FLAG_REGISTRATION) != 0u); - serverVersion = 0; - tmwServerVersion = 0; - } - if (tmwServerVersion > 0) - logger->log("Tmw server version: x%06x", tmwServerVersion); - else - logger->log("Server without version"); - updateProtocol(); - - if (client->getState() != State::LOGIN) - client->setState(State::LOGIN); - - // Leave this last - Ea::LoginRecv::mVersionResponse = true; -} - -void LoginRecv::processCharPasswordResponse(Net::MessageIn &msg) -{ - // 0: acc not found, 1: success, 2: password mismatch, 3: pass too short - const uint8_t errMsg = msg.readUInt8("result code"); - // Successful pass change - if (errMsg == 1) - { - client->setState(State::CHANGEPASSWORD_SUCCESS); - } - // pass change failed - else - { - switch (errMsg) - { - case 0: - errorMessage = - // TRANSLATORS: error message - _("Account was not found. Please re-login."); - break; - case 2: - // TRANSLATORS: error message - errorMessage = _("Old password incorrect."); - break; - case 3: - // TRANSLATORS: error message - errorMessage = _("New password too short."); - break; - default: - // TRANSLATORS: error message - errorMessage = _("Unknown error."); - break; - } - client->setState(State::ACCOUNTCHANGE_ERROR); - } -} - -void LoginRecv::processLoginData(Net::MessageIn &msg) -{ - msg.readInt16("len"); - - loginHandler->clearWorlds(); - - const int worldCount = (msg.getLength() - 47) / 32; - - Ea::LoginRecv::mToken.session_ID1 = msg.readInt32("session id1"); - Ea::LoginRecv::mToken.account_ID = msg.readBeingId("accound id"); - Ea::LoginRecv::mToken.session_ID2 = msg.readInt32("session id2"); - msg.readInt32("old ip"); - loginData.lastLogin = msg.readString(24, "last login"); - msg.readInt16("unused"); - - // reserve bits for future usage - Ea::LoginRecv::mToken.sex = Being::intToGender(CAST_U8( - msg.readUInt8("gender") & 3U)); - - for (int i = 0; i < worldCount; i++) - { - WorldInfo *const world = new WorldInfo; - - world->address = msg.readInt32("ip address"); - world->port = msg.readInt16("port"); - world->name = msg.readString(20, "name"); - world->online_users = msg.readInt16("online number"); - config.setValue("updatehost", Ea::LoginRecv::mUpdateHost); - world->updateHost = Ea::LoginRecv::mUpdateHost; - msg.readInt16("maintenance"); - msg.readInt16("new"); - - logger->log("Network: Server: %s (%s:%d)", world->name.c_str(), - ipToString(world->address), world->port); - - Ea::LoginRecv::mWorlds.push_back(world); - } - client->setState(State::WORLD_SELECT); -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/loginrecv.h b/src/net/tmwa/loginrecv.h deleted file mode 100644 index fb038da55..000000000 --- a/src/net/tmwa/loginrecv.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_LOGINRECV_H -#define NET_TMWA_LOGINRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace TmwAthena -{ - namespace LoginRecv - { - void processServerVersion(Net::MessageIn &msg); - void processCharPasswordResponse(Net::MessageIn &msg); - void processLoginData(Net::MessageIn &msg); - } // namespace LoginRecv -} // namespace TmwAthena - -#endif // NET_TMWA_LOGINRECV_H diff --git a/src/net/tmwa/mail2handler.cpp b/src/net/tmwa/mail2handler.cpp deleted file mode 100644 index 786a31a6f..000000000 --- a/src/net/tmwa/mail2handler.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/mail2handler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -Mail2Handler::Mail2Handler() -{ - mail2Handler = this; -} - -Mail2Handler::~Mail2Handler() -{ - mail2Handler = nullptr; -} - -void Mail2Handler::openWriteMail(const std::string &receiver A_UNUSED) const -{ -} - -void Mail2Handler::addItem(const Item *const item A_UNUSED, - const int amount A_UNUSED) const -{ -} - -void Mail2Handler::removeItem(const int index A_UNUSED, - const int amount A_UNUSED) const -{ -} - -void Mail2Handler::sendMail(const std::string &to A_UNUSED, - const std::string &title A_UNUSED, - const std::string &body A_UNUSED, - const int64_t &money A_UNUSED) const -{ -} - -void Mail2Handler::queueCheckName(const MailQueueTypeT type A_UNUSED, - const std::string &to A_UNUSED, - const std::string &title A_UNUSED, - const std::string &body A_UNUSED, - const int64_t &money A_UNUSED) const -{ -} - -void Mail2Handler::nextPage(const MailOpenTypeT openType A_UNUSED, - const int64_t mailId A_UNUSED) const -{ -} - -void Mail2Handler::readMail(const MailOpenTypeT openType A_UNUSED, - const int64_t mailId A_UNUSED) const -{ -} - -void Mail2Handler::deleteMail(const MailOpenTypeT openType A_UNUSED, - const int64_t mailId A_UNUSED) const -{ -} - -void Mail2Handler::requestMoney(const MailOpenTypeT openType A_UNUSED, - const int64_t mailId A_UNUSED) const -{ -} - -void Mail2Handler::requestItems(const MailOpenTypeT openType A_UNUSED, - const int64_t mailId A_UNUSED) const -{ -} - -void Mail2Handler::refreshMailList(const MailOpenTypeT openType A_UNUSED, - const int64_t mailId A_UNUSED) const -{ -} - -void Mail2Handler::openMailBox(const MailOpenTypeT openType A_UNUSED) const -{ -} - -void Mail2Handler::closeMailBox() const -{ -} - -void Mail2Handler::cancelWriteMail() const -{ -} - -void Mail2Handler::requestCheckName(const std::string &name A_UNUSED) const -{ -} - -std::string Mail2Handler::getCheckedName() const -{ - return std::string(); -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/mail2handler.h b/src/net/tmwa/mail2handler.h deleted file mode 100644 index 003a29b89..000000000 --- a/src/net/tmwa/mail2handler.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_MAIL2HANDLER_H -#define NET_TMWA_MAIL2HANDLER_H - -#include "net/mail2handler.h" - -namespace TmwAthena -{ - -class Mail2Handler final : public Net::Mail2Handler -{ - public: - Mail2Handler(); - - A_DELETE_COPY(Mail2Handler) - - ~Mail2Handler(); - - void openWriteMail(const std::string &receiver) const override final; - - void addItem(const Item *const item, - const int amount) const override final; - - void removeItem(const int index, - const int amount) const override final; - - void sendMail(const std::string &to, - const std::string &title, - const std::string &body, - const int64_t &money) const override final; - - void queueCheckName(const MailQueueTypeT type, - const std::string &to, - const std::string &title, - const std::string &body, - const int64_t &money) const override final; - - void nextPage(const MailOpenTypeT openType, - const int64_t mailId) const override final; - - void readMail(const MailOpenTypeT openType, - const int64_t mailId) const override final; - - void deleteMail(const MailOpenTypeT openType, - const int64_t mailId) const override final; - - void requestMoney(const MailOpenTypeT openType, - const int64_t mailId) const override final; - - void requestItems(const MailOpenTypeT openType, - const int64_t mailId) const override final; - - void refreshMailList(const MailOpenTypeT openType, - const int64_t mailId) const override final; - - void openMailBox(const MailOpenTypeT openType) const override final; - - void closeMailBox() const override final; - - void cancelWriteMail() const override final; - - void requestCheckName(const std::string &name) const override final; - - std::string getCheckedName() const override final; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_MAIL2HANDLER_H diff --git a/src/net/tmwa/mailhandler.cpp b/src/net/tmwa/mailhandler.cpp deleted file mode 100644 index 2a124e504..000000000 --- a/src/net/tmwa/mailhandler.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/mailhandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -MailHandler::MailHandler() -{ - mailHandler = this; -} - -MailHandler::~MailHandler() -{ - mailHandler = nullptr; -} - -void MailHandler::refresh() const -{ -} - -void MailHandler::readMessage(const int msgId A_UNUSED) const -{ -} - -void MailHandler::getAttach(const int msgId A_UNUSED) const -{ -} - -void MailHandler::deleteMessage(const int msgId A_UNUSED) const -{ -} - -void MailHandler::returnMessage(const int msgId A_UNUSED) const -{ -} - -void MailHandler::setAttach(const int index A_UNUSED, - const int amount A_UNUSED) const -{ -} - -void MailHandler::setAttachMoney(const int money A_UNUSED) const -{ -} - -void MailHandler::resetAttach(const int flag A_UNUSED) const -{ -} - -void MailHandler::send(const std::string &name A_UNUSED, - const std::string &title A_UNUSED, - std::string message A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/mailhandler.h b/src/net/tmwa/mailhandler.h deleted file mode 100644 index 94867a7a7..000000000 --- a/src/net/tmwa/mailhandler.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_MAILHANDLER_H -#define NET_TMWA_MAILHANDLER_H - -#include "net/mailhandler.h" - -namespace TmwAthena -{ - -class MailHandler final : public Net::MailHandler -{ - public: - MailHandler(); - - A_DELETE_COPY(MailHandler) - - ~MailHandler(); - - void refresh() const override final A_CONST; - - void readMessage(const int msgId) const override final A_CONST; - - void getAttach(const int msgId) const override final A_CONST; - - void deleteMessage(const int msgId) const override final A_CONST; - - void returnMessage(const int msgId) const override final A_CONST; - - void setAttach(const int index, - const int amount) const override final A_CONST; - - void setAttachMoney(const int money) const override final A_CONST; - - void resetAttach(const int flag) const override final A_CONST; - - void send(const std::string &name, - const std::string &title, - std::string message) const override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_MAILHANDLER_H diff --git a/src/net/tmwa/maphandler.cpp b/src/net/tmwa/maphandler.cpp deleted file mode 100644 index 642480a4d..000000000 --- a/src/net/tmwa/maphandler.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/maphandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -MapHandler::MapHandler() : - Net::MapHandler() -{ - mapHandler = this; -} - -MapHandler::~MapHandler() -{ - mapHandler = nullptr; -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/maphandler.h b/src/net/tmwa/maphandler.h deleted file mode 100644 index 10382222d..000000000 --- a/src/net/tmwa/maphandler.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_MAPHANDLER_H -#define NET_TMWA_MAPHANDLER_H - -#include "net/maphandler.h" - -namespace TmwAthena -{ - -class MapHandler final : public Net::MapHandler -{ - public: - MapHandler(); - - A_DELETE_COPY(MapHandler) - - ~MapHandler(); -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_MAPHANDLER_H diff --git a/src/net/tmwa/markethandler.cpp b/src/net/tmwa/markethandler.cpp deleted file mode 100644 index 1a2f6b548..000000000 --- a/src/net/tmwa/markethandler.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/markethandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -MarketHandler::MarketHandler() : - Net::MarketHandler() -{ - marketHandler = this; -} - -MarketHandler::~MarketHandler() -{ - marketHandler = nullptr; -} - -void MarketHandler::close() const -{ -} - -void MarketHandler::buyItem(const int itemId A_UNUSED, - const ItemTypeT type A_UNUSED, - const ItemColor color A_UNUSED, - const int amount A_UNUSED) const -{ -} - -void MarketHandler::buyItems(const STD_VECTOR<ShopItem*> &items A_UNUSED) - const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/markethandler.h b/src/net/tmwa/markethandler.h deleted file mode 100644 index 923b697c0..000000000 --- a/src/net/tmwa/markethandler.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_MARKETHANDLER_H -#define NET_TMWA_MARKETHANDLER_H - -#include "net/markethandler.h" - -namespace TmwAthena -{ -class MarketHandler final : public Net::MarketHandler -{ - public: - MarketHandler(); - - A_DELETE_COPY(MarketHandler) - - ~MarketHandler(); - - void close() const override final A_CONST; - - void buyItem(const int itemId, - const ItemTypeT type, - const ItemColor color, - const int amount) const override final A_CONST; - - void buyItems(const STD_VECTOR<ShopItem*> &items) const override final - A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_MARKETHANDLER_H diff --git a/src/net/tmwa/mercenaryhandler.cpp b/src/net/tmwa/mercenaryhandler.cpp deleted file mode 100644 index 7f824180a..000000000 --- a/src/net/tmwa/mercenaryhandler.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/mercenaryhandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -MercenaryHandler::MercenaryHandler() -{ - mercenaryHandler = this; -} - -MercenaryHandler::~MercenaryHandler() -{ - mercenaryHandler = nullptr; -} - -void MercenaryHandler::fire() const -{ -} - -void MercenaryHandler::moveToMaster() const -{ -} - -void MercenaryHandler::move(const int x A_UNUSED, const int y A_UNUSED) const -{ -} - -void MercenaryHandler::attack(const BeingId targetId A_UNUSED, - const Keep keep A_UNUSED) const -{ -} - -void MercenaryHandler::talk(const std::string &restrict text A_UNUSED) const -{ -} - -void MercenaryHandler::emote(const uint8_t emoteId A_UNUSED) const -{ -} - -void MercenaryHandler::setDirection(const unsigned char type A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/mercenaryhandler.h b/src/net/tmwa/mercenaryhandler.h deleted file mode 100644 index eaba1f2fd..000000000 --- a/src/net/tmwa/mercenaryhandler.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_MERCENARYHANDLER_H -#define NET_TMWA_MERCENARYHANDLER_H - -#include "net/mercenaryhandler.h" - -namespace TmwAthena -{ - -class MercenaryHandler final : public Net::MercenaryHandler -{ - public: - MercenaryHandler(); - - A_DELETE_COPY(MercenaryHandler) - - ~MercenaryHandler(); - - void fire() const override final A_CONST; - - void moveToMaster() const override final A_CONST; - - void move(const int x, const int y) const override final A_CONST; - - void attack(const BeingId targetId, - const Keep keep) const override final A_CONST; - - void talk(const std::string &restrict text) const override final - A_CONST; - - void emote(const uint8_t emoteId) const override final A_CONST; - - void setDirection(const unsigned char type) const override final - A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_MERCENARYHANDLER_H diff --git a/src/net/tmwa/messagein.cpp b/src/net/tmwa/messagein.cpp deleted file mode 100644 index 792f88743..000000000 --- a/src/net/tmwa/messagein.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/messagein.h" - -#include "logger.h" - -#include "net/net.h" -#include "net/packetcounters.h" - -#include "utils/cast.h" -#include "utils/stringutils.h" - -PRAGMA48(GCC diagnostic push) -PRAGMA48(GCC diagnostic ignored "-Wshadow") -#ifndef SDL_BIG_ENDIAN -#include <SDL_endian.h> -#endif // SDL_BYTEORDER -PRAGMA48(GCC diagnostic pop) - -#include "debug.h" - -namespace TmwAthena -{ - -MessageIn::MessageIn(const char *const data, - const unsigned int length) : - Net::MessageIn(data, length) -{ -} - -void MessageIn::postInit(const char *const str) -{ - // Read the message ID - mId = readId(); - IGNOREDEBUGLOG; - DEBUGLOG2("Receive packet", 0, "MessageIn"); - readInt16(str); -} - -uint16_t MessageIn::readId() const -{ - int16_t value = -1; - if (mPos + 2 <= mLength) - { -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - int16_t swap; - memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(int16_t)); - value = SDL_Swap16(swap); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(&value, mData + CAST_SIZE(mPos), sizeof(int16_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - } - return value; -} - -int16_t MessageIn::readInt16(const char *const str) -{ - int16_t value = -1; - if (mPos + 2 <= mLength) - { -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - int16_t swap; - memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(int16_t)); - value = SDL_Swap16(swap); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(&value, mData + CAST_SIZE(mPos), sizeof(int16_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - } - DEBUGLOG2("readInt16: " + toStringPrint(CAST_U32( - CAST_U16(value))), - mPos, str); - mPos += 2; - PacketCounters::incInBytes(2); - return value; -} - -uint16_t MessageIn::readUInt16(const char *const str) -{ - uint16_t value = 0xffU; - if (mPos + 2 <= mLength) - { -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - uint16_t swap; - memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(uint16_t)); - value = SDL_Swap16(swap); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(&value, mData + CAST_SIZE(mPos), sizeof(uint16_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - } - DEBUGLOG2("readUInt16: " + toStringPrint(CAST_U32( - CAST_U16(value))), - mPos, str); - mPos += 2; - PacketCounters::incInBytes(2); - return value; -} - -int32_t MessageIn::readInt32(const char *const str) -{ - int32_t value = -1; - if (mPos + 4 <= mLength) - { -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - int32_t swap; - memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(int32_t)); - value = SDL_Swap32(swap); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(&value, mData + CAST_SIZE(mPos), sizeof(int32_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - } - DEBUGLOG2("readInt32: " + toStringPrint(CAST_U32(value)), - mPos, str); - mPos += 4; - PacketCounters::incInBytes(4); - return value; -} - -BeingId MessageIn::readBeingId(const char *const str) -{ - return fromInt(readInt32(str), BeingId); -} - -int64_t MessageIn::readInt64(const char *const str) -{ - int64_t value = -1; - if (mPos + 8 <= mLength) - { -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - int64_t swap; - memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(int64_t)); - value = SDL_Swap64(swap); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(&value, mData + CAST_SIZE(mPos), sizeof(int64_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - } - DEBUGLOG2("readInt64: " + toStringPrint(CAST_U32(value)), - mPos, str); - mPos += 8; - PacketCounters::incInBytes(8); - return value; -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/messagein.h b/src/net/tmwa/messagein.h deleted file mode 100644 index aca246cd6..000000000 --- a/src/net/tmwa/messagein.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_MESSAGEIN_H -#define NET_TMWA_MESSAGEIN_H - -#include "net/messagein.h" - -#include "localconsts.h" - -namespace TmwAthena -{ - -/** - * Used for parsing an incoming message. - * - * \ingroup Network - */ -class MessageIn final : public Net::MessageIn -{ - public: - /** - * Constructor. - */ - MessageIn(const char *const data, - const unsigned int length); - - A_DELETE_COPY(MessageIn) - - void postInit(const char *const str); - - /**< Reads a short. */ - int16_t readInt16(const char *const str) override final; - - uint16_t readUInt16(const char *const str) override final; - - /**< Reads a long. */ - int32_t readInt32(const char *const str) override final; - - int64_t readInt64(const char *const str) override final; - - BeingId readBeingId(const char *const str) override final; - - uint16_t readId() const; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_MESSAGEIN_H diff --git a/src/net/tmwa/messageout.cpp b/src/net/tmwa/messageout.cpp deleted file mode 100644 index 64951642d..000000000 --- a/src/net/tmwa/messageout.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/messageout.h" - -#include "net/packetcounters.h" - -#include "net/tmwa/network.h" - -#include "logger.h" - -#include "debug.h" - -#ifndef SDL_BIG_ENDIAN -#error missing SDL_endian.h -#endif // SDL_BYTEORDER - -namespace TmwAthena -{ - -MessageOut::MessageOut(const int16_t id) : - Net::MessageOut(id), - mNetwork(TmwAthena::Network::instance()) -{ - mNetwork->fixSendBuffer(); - mData = mNetwork->mOutBuffer + CAST_SIZE(mNetwork->mOutSize); -} - -MessageOut::~MessageOut() -{ - DEBUGLOG2("writeEnd: ", mPos, "position after end of packet"); -} - -void MessageOut::expand(const size_t bytes) const -{ - mNetwork->mOutSize += CAST_U32(bytes); - PacketCounters::incOutBytes(CAST_S32(bytes)); -} - -void MessageOut::writeInt16(const int16_t value, const char *const str) -{ - DEBUGLOG2("writeInt16: " + toStringPrint(CAST_U32( - CAST_U16(value))), - mPos, str); - expand(2); -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - int16_t swap = SDL_Swap16(value); - memcpy(mData + CAST_SIZE(mPos), &swap, sizeof(int16_t)); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(mData + CAST_SIZE(mPos), &value, sizeof(int16_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - - mPos += 2; - PacketCounters::incOutBytes(2); -} - -void MessageOut::writeInt32(const int32_t value, const char *const str) -{ - DEBUGLOG2("writeInt32: " + toStringPrint(CAST_U32(value)), - mPos, str); - expand(4); -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - int32_t swap = SDL_Swap32(value); - memcpy(mData + CAST_SIZE(mPos), &swap, sizeof(int32_t)); -#else // SDL_BYTEORDER == SDL_BIG_ENDIAN - - memcpy(mData + CAST_SIZE(mPos), &value, sizeof(int32_t)); -#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN - - mPos += 4; - PacketCounters::incOutBytes(4); -} - -void MessageOut::writeBeingId(const BeingId value, const char *const str) -{ - writeInt32(toInt(value, int32_t), str); -} - -#define LOBYTE(w) (CAST_U8(w)) -#define HIBYTE(w) (CAST_U8(( \ -CAST_U16(w)) >> 8U)) - -void MessageOut::writeCoordinates(const uint16_t x, - const uint16_t y, - unsigned char direction, - const char *const str) -{ - DEBUGLOG2(strprintf("writeCoordinates: %u,%u %u", - CAST_U32(x), static_cast<unsigned>(y), - CAST_U32(direction)), mPos, str); - unsigned char *const data = reinterpret_cast<unsigned char*>(mData) - + CAST_SIZE(mPos); - mNetwork->mOutSize += 3; - mPos += 3; - - uint16_t temp = x; - temp <<= 6; - data[0] = 0; - data[1] = 1; - data[2] = 2; - data[0] = HIBYTE(temp); - data[1] = CAST_U8(temp); - temp = y; - temp <<= 4; - data[1] |= HIBYTE(temp); - data[2] = LOBYTE(temp); - direction = toServerDirection(direction); - data[2] |= direction; - PacketCounters::incOutBytes(3); -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/messageout.h b/src/net/tmwa/messageout.h deleted file mode 100644 index 18346b690..000000000 --- a/src/net/tmwa/messageout.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_MESSAGEOUT_H -#define NET_TMWA_MESSAGEOUT_H - -#include "net/messageout.h" - -#include "localconsts.h" - -namespace TmwAthena -{ - -class Network; - -/** - * Used for building an outgoing message. - * - * \ingroup Network - */ -class MessageOut final : public Net::MessageOut -{ - public: - /** - * Constructor. - */ - explicit MessageOut(const int16_t id); - - A_DELETE_COPY(MessageOut) - - virtual ~MessageOut(); - - /**< Writes a short. */ - void writeInt16(const int16_t value, - const char *const str) override final; - - /**< Writes a long. */ - void writeInt32(const int32_t value, - const char *const str) override final; - - void writeBeingId(const BeingId value, - const char *const str) override final; - - /** - * Encodes coordinates and direction in 3 bytes. - */ - void writeCoordinates(const uint16_t x, - const uint16_t y, - unsigned char direction, - const char *const str); - - void resetPos() - { mPos = 0; } - - private: - void expand(const size_t size) const override final; - - Network *mNetwork; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_MESSAGEOUT_H diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp deleted file mode 100644 index ebc4db9e6..000000000 --- a/src/net/tmwa/network.cpp +++ /dev/null @@ -1,183 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/network.h" - -#include "logger.h" - -#include "net/packetinfo.h" - -#include "net/ea/adminrecv.h" -#include "net/ea/beingrecv.h" -#include "net/ea/buysellrecv.h" -#include "net/ea/charserverrecv.h" -#include "net/ea/chatrecv.h" -#include "net/ea/gamerecv.h" -#include "net/ea/inventoryrecv.h" -#include "net/ea/itemrecv.h" -#include "net/ea/loginrecv.h" -#include "net/ea/maprecv.h" -#include "net/ea/npcrecv.h" -#include "net/ea/partyrecv.h" -#include "net/ea/playerrecv.h" -#include "net/ea/skillrecv.h" -#include "net/ea/traderecv.h" - -#include "net/tmwa/beingrecv.h" -#include "net/tmwa/buysellrecv.h" -#include "net/tmwa/charserverrecv.h" -#include "net/tmwa/chatrecv.h" -#include "net/tmwa/gamerecv.h" -#include "net/tmwa/generalrecv.h" -#include "net/tmwa/inventoryrecv.h" -#include "net/tmwa/itemrecv.h" -#include "net/tmwa/loginrecv.h" -#include "net/tmwa/partyrecv.h" -#include "net/tmwa/playerrecv.h" -#include "net/tmwa/questrecv.h" -#include "net/tmwa/skillrecv.h" -#include "net/tmwa/traderecv.h" - -#include "net/tmwa/messagein.h" - -#include "utils/cast.h" - -#include "debug.h" - -namespace TmwAthena -{ - -static const unsigned int packet_lengths_size = 0xFFFFU; -static const unsigned int messagesSize = 0xFFFFU; -Network *Network::mInstance = nullptr; - -Network::Network() : - Ea::Network() -{ - mInstance = this; - mPackets = new PacketInfo[messagesSize]; -} - -Network::~Network() -{ - clearHandlers(); - mInstance = nullptr; -} - -void Network::registerHandlers() -{ -#include "net/tmwa/recvpackets.inc" - RECVPACKETS_VOID -} - -void Network::clearHandlers() -{ - for (size_t f = 0; f < packet_lengths_size; f ++) - { - mPackets[f].name = ""; - mPackets[f].len = 0; - mPackets[f].func = nullptr; - mPackets[f].version = 0; - } -} - -void Network::dispatchMessages() -{ - BLOCK_START("Network::dispatchMessages 1") - mPauseDispatch = false; - while (messageReady()) - { - SDL_mutexP(mMutexIn); - BLOCK_START("Network::dispatchMessages 2") - const unsigned int msgId = readWord(0); - int len = -1; - if (msgId < packet_lengths_size) - len = mPackets[msgId].len; - - if (len == -1) - len = readWord(2); - - MessageIn msg(mInBuffer, len); - msg.postInit(mPackets[msgId].name); - SDL_mutexV(mMutexIn); - BLOCK_END("Network::dispatchMessages 2") - BLOCK_START("Network::dispatchMessages 3") - - if (len == 0) - { - // need copy data for safty - std::string str = strprintf( - "Wrong packet %u 0x%x received. Exiting.", - msgId, msgId); - logger->safeError(str); - } - - if (msgId < messagesSize) - { - const PacketFuncPtr func = mPackets[msgId].func; - if (func != nullptr) - func(msg); - else - logger->log("Unhandled packet: %u 0x%x", msgId, msgId); - } - - skip(len); - if (mPauseDispatch) - { - BLOCK_END("Network::dispatchMessages 3") - break; - } - BLOCK_END("Network::dispatchMessages 3") - } - BLOCK_END("Network::dispatchMessages 1") -} - -bool Network::messageReady() -{ - int len = -1; - - SDL_mutexP(mMutexIn); - if (mInSize >= 2) - { - const int msgId = readWord(0); - if (msgId >= 0 && CAST_U32(msgId) - < packet_lengths_size) - { - len = mPackets[msgId].len; - } - - if (len == -1 && mInSize > 4) - len = readWord(2); - } - - const bool ret = (mInSize >= CAST_U32(len)); - SDL_mutexV(mMutexIn); - - return ret; -} - -Network *Network::instance() -{ - return mInstance; -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/network.h b/src/net/tmwa/network.h deleted file mode 100644 index 26a2a1650..000000000 --- a/src/net/tmwa/network.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_NETWORK_H -#define NET_TMWA_NETWORK_H - -#include "net/ea/network.h" - -/** - * Protocol version, reported to the tmwa char and mapserver who can adjust - * the protocol accordingly. - */ -#define CLIENT_PROTOCOL_VERSION 7 - -namespace TmwAthena -{ -class Network final : public Ea::Network -{ - public: - Network(); - - A_DELETE_COPY(Network) - - ~Network(); - - void clearHandlers(); - - bool messageReady(); - - void dispatchMessages(); - - void registerHandlers(); - - static Network *mInstance; - - protected: - friend class MessageOut; - - static Network *instance() A_WARN_UNUSED; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_NETWORK_H diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp deleted file mode 100644 index e4a9296fc..000000000 --- a/src/net/tmwa/npchandler.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/npchandler.h" - -#include "being/localplayer.h" - -#include "const/net/inventory.h" - -#include "gui/windows/npcdialog.h" - -#include "gui/widgets/createwidget.h" - -#include "net/messagein.h" - -#include "net/tmwa/messageout.h" -#include "net/tmwa/protocolout.h" - -#include "net/ea/npcrecv.h" - -#include "debug.h" - -namespace TmwAthena -{ - -NpcHandler::NpcHandler() : - Ea::NpcHandler() -{ - npcHandler = this; -} - -NpcHandler::~NpcHandler() -{ - npcHandler = nullptr; -} - -void NpcHandler::talk(const Being *const being) const -{ - if (being == nullptr) - return; - createOutPacket(CMSG_NPC_TALK); - outMsg.writeBeingId(being->getId(), "npc id"); - outMsg.writeInt8(0, "unused"); -} - -void NpcHandler::nextDialog(const BeingId npcId) const -{ - createOutPacket(CMSG_NPC_NEXT_REQUEST); - outMsg.writeBeingId(npcId, "npc id"); -} - -void NpcHandler::closeDialog(const BeingId npcId) -{ - createOutPacket(CMSG_NPC_CLOSE); - outMsg.writeBeingId(npcId, "npc id"); - - const NpcDialogs::iterator it = NpcDialog::mNpcDialogs.find(npcId); - if (it != NpcDialog::mNpcDialogs.end()) - { - NpcDialog *const dialog = (*it).second; - if (dialog != nullptr) - dialog->close(); - if (dialog == Ea::NpcRecv::mDialog) - Ea::NpcRecv::mDialog = nullptr; - NpcDialog::mNpcDialogs.erase(it); - } -} - -void NpcHandler::listInput(const BeingId npcId, - const unsigned char value) const -{ - createOutPacket(CMSG_NPC_LIST_CHOICE); - outMsg.writeBeingId(npcId, "npc id"); - outMsg.writeInt8(value, "value"); -} - -void NpcHandler::integerInput(const BeingId npcId, - const int value) const -{ - createOutPacket(CMSG_NPC_INT_RESPONSE); - outMsg.writeBeingId(npcId, "npc id"); - outMsg.writeInt32(value, "value"); -} - -void NpcHandler::stringInput(const BeingId npcId, - const std::string &value) const -{ - createOutPacket(CMSG_NPC_STR_RESPONSE); - outMsg.writeInt16(CAST_S16(value.length() + 9), "len"); - outMsg.writeBeingId(npcId, "npc id"); - outMsg.writeString(value, CAST_S32(value.length()), "value"); - outMsg.writeInt8(0, "null byte"); -} - -void NpcHandler::buy(const Being *const being) const -{ - if (being == nullptr) - return; - createOutPacket(CMSG_NPC_BUY_SELL_REQUEST); - outMsg.writeBeingId(being->getId(), "npc id"); - outMsg.writeInt8(0, "action"); -} - -void NpcHandler::buy(const BeingId beingId) const -{ - createOutPacket(CMSG_NPC_BUY_SELL_REQUEST); - outMsg.writeBeingId(beingId, "npc id"); - outMsg.writeInt8(0, "action"); -} - -void NpcHandler::sell(const BeingId beingId) const -{ - createOutPacket(CMSG_NPC_BUY_SELL_REQUEST); - outMsg.writeBeingId(beingId, "npc id"); - outMsg.writeInt8(1, "action"); -} - -void NpcHandler::buyItem(const BeingId beingId A_UNUSED, - const int itemId, - const ItemColor color A_UNUSED, - const int amount) const -{ - createOutPacket(CMSG_NPC_BUY_REQUEST); - outMsg.writeInt16(8, "len"); - outMsg.writeInt16(CAST_S16(amount), "amount"); - outMsg.writeInt16(CAST_S16(itemId), "item id"); -} - -void NpcHandler::buyItems(STD_VECTOR<ShopItem*> &items A_UNUSED) const -{ -} - -void NpcHandler::sellItem(const BeingId beingId A_UNUSED, - const int itemId, - const int amount) const -{ - createOutPacket(CMSG_NPC_SELL_REQUEST); - outMsg.writeInt16(8, "len"); - outMsg.writeInt16(CAST_S16( - itemId + INVENTORY_OFFSET), "index"); - outMsg.writeInt16(CAST_S16(amount), "amount"); -} - -void NpcHandler::sellItems(STD_VECTOR<ShopItem*> &items A_UNUSED) const -{ -} - -void NpcHandler::completeProgressBar() const -{ -} - -void NpcHandler::produceMix(const int nameId A_UNUSED, - const int materialId1 A_UNUSED, - const int materialId2 A_UNUSED, - const int materialId3 A_UNUSED) const -{ -} - -void NpcHandler::cooking(const CookingTypeT type A_UNUSED, - const int nameId A_UNUSED) const -{ -} - -void NpcHandler::repair(const int index A_UNUSED) const -{ -} - -void NpcHandler::refine(const int index A_UNUSED) const -{ -} - -void NpcHandler::identify(const int index A_UNUSED) const -{ -} - -void NpcHandler::selectArrow(const int nameId A_UNUSED) const -{ -} - -void NpcHandler::selectAutoSpell(const int skillId A_UNUSED) const -{ -} - -BeingId NpcHandler::getNpc(Net::MessageIn &msg, - const NpcActionT action) -{ - const BeingId npcId = msg.readBeingId("npc id"); - - const NpcDialogs::const_iterator diag = NpcDialog::mNpcDialogs.find(npcId); - Ea::NpcRecv::mDialog = nullptr; - - if (diag == NpcDialog::mNpcDialogs.end()) - { - // +++ must be removed packet id checks from here - // Empty dialogs don't help - if (action == NpcAction::Close) - { - closeDialog(npcId); - return npcId; - } - else if (action == NpcAction::Next) - { - nextDialog(npcId); - return npcId; - } - else - { - CREATEWIDGETV(Ea::NpcRecv::mDialog, NpcDialog, npcId); - Ea::NpcRecv::mDialog->saveCamera(); - if (localPlayer != nullptr) - localPlayer->stopWalking(false); - NpcDialog::mNpcDialogs[npcId] = Ea::NpcRecv::mDialog; - } - } - else - { - NpcDialog *const dialog = diag->second; - if (Ea::NpcRecv::mDialog != nullptr && Ea::NpcRecv::mDialog != dialog) - Ea::NpcRecv::mDialog->restoreCamera(); - Ea::NpcRecv::mDialog = dialog; - if (Ea::NpcRecv::mDialog != nullptr) - Ea::NpcRecv::mDialog->saveCamera(); - } - return npcId; -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/npchandler.h b/src/net/tmwa/npchandler.h deleted file mode 100644 index 14bfefb66..000000000 --- a/src/net/tmwa/npchandler.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_NPCHANDLER_H -#define NET_TMWA_NPCHANDLER_H - -#include "net/ea/npchandler.h" - -namespace TmwAthena -{ - -class NpcHandler final : public Ea::NpcHandler -{ - public: - NpcHandler(); - - A_DELETE_COPY(NpcHandler) - - ~NpcHandler(); - - void talk(const Being *const being) const override final; - - void nextDialog(const BeingId npcId) const override final; - - void closeDialog(const BeingId npcId) override final; - - void listInput(const BeingId npcId, - const unsigned char value) const override final; - - void integerInput(const BeingId npcId, - const int value) const override final; - - void stringInput(const BeingId npcId, - const std::string &value) const override final; - - void buy(const Being *const being) const override final; - - void buy(const BeingId beingId) const override final; - - void sell(const BeingId beingId) const override final; - - void buyItem(const BeingId beingId, - const int itemId, - const ItemColor color, - const int amount) const override final; - - void buyItems(STD_VECTOR<ShopItem*> &items) const override final - A_CONST; - - void sellItem(const BeingId beingId, - const int itemId, - const int amount) const override final; - - void sellItems(STD_VECTOR<ShopItem*> &items) const override final - A_CONST; - - void completeProgressBar() const override final A_CONST; - - BeingId getNpc(Net::MessageIn &msg, - const NpcActionT action) override final; - - void produceMix(const int nameId, - const int materialId1, - const int materialId2, - const int materialId3) const override final A_CONST; - - void cooking(const CookingTypeT type, - const int nameId) const override final A_CONST; - - void repair(const int index) const override final A_CONST; - - void refine(const int index) const override final A_CONST; - - void identify(const int index) const override final A_CONST; - - void selectArrow(const int nameId) const override final A_CONST; - - void selectAutoSpell(const int skillId) const override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_NPCHANDLER_H diff --git a/src/net/tmwa/packetsin.inc b/src/net/tmwa/packetsin.inc deleted file mode 100644 index 633c2b1ad..000000000 --- a/src/net/tmwa/packetsin.inc +++ /dev/null @@ -1,147 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -packet(SMSG_ADMIN_KICK_ACK, 0x00cd, 6, &Ea::AdminRecv::processKickAck, 0); -packet(SMSG_BEING_ACTION, 0x008a, 29, &Ea::BeingRecv::processBeingAction, 0); -packet(SMSG_BEING_CHANGE_DIRECTION, 0x009c, 9, &BeingRecv::processBeingChangeDirection, 0); -packet(SMSG_BEING_CHANGE_LOOKS, 0x00c3, 8, &BeingRecv::processBeingChangeLook, 0); -packet(SMSG_BEING_CHANGE_LOOKS2, 0x01d7, 11, &BeingRecv::processBeingChangeLook2, 0); -packet(SMSG_BEING_CHAT, 0x008d, -1, &ChatRecv::processBeingChat, 0); -packet(SMSG_BEING_EMOTION, 0x00c0, 7, &Ea::BeingRecv::processBeingEmotion, 0); -packet(SMSG_BEING_IP_RESPONSE, 0x020c, 10, &BeingRecv::processIpResponse, 0); -packet(SMSG_BEING_MOVE, 0x007b, 60, &BeingRecv::processBeingMove, 0); -packet(SMSG_BEING_MOVE2, 0x0086, 16, &BeingRecv::processBeingMove2, 0); -packet(SMSG_BEING_MOVE3, 0x0225, -1, &Ea::BeingRecv::processBeingMove3, 0); -packet(SMSG_BEING_NAME_RESPONSE, 0x0095, 30, &Ea::BeingRecv::processNameResponse, 0); -packet(SMSG_BEING_REMOVE, 0x0080, 7, &Ea::BeingRecv::processBeingRemove, 0); -packet(SMSG_BEING_RESURRECT, 0x0148, 8, &BeingRecv::processBeingResurrect, 0); -packet(SMSG_BEING_SELFEFFECT, 0x019b, 10, &BeingRecv::processBeingSelfEffect, 0); -packet(SMSG_BEING_SPAWN, 0x007c, 41, &BeingRecv::processBeingSpawn, 0); -packet(SMSG_BEING_STATUS_CHANGE, 0x0196, 9, &BeingRecv::processBeingStatusChange, 0); -packet(SMSG_BEING_VISIBLE, 0x0078, 54, &BeingRecv::processBeingVisible, 0); -packet(SMSG_CHANGE_MAP_SERVER, 0x0092, 28, &CharServerRecv::processChangeMapServer, 0); -packet(SMSG_CHAR_CREATE_FAILED, 0x006e, 3, &Ea::CharServerRecv::processCharCreateFailed, 0); -packet(SMSG_CHAR_CREATE_SUCCEEDED, 0x006d, 108, &CharServerRecv::processCharCreate, 0); -packet(SMSG_CHAR_DELETE_FAILED, 0x0070, 3, &CharServerRecv::processCharDeleteFailed, 0); -packet(SMSG_CHAR_DELETE_SUCCEEDED, 0x006f, 2, &Ea::CharServerRecv::processCharDelete, 0); -packet(SMSG_CHAR_LOGIN, 0x006b, -1, &CharServerRecv::processCharLogin, 0); -packet(SMSG_CHAR_LOGIN_ERROR, 0x006c, 3, &Ea::CharServerRecv::processCharLoginError, 0); -packet(SMSG_CHAR_MAP_INFO, 0x0071, 28, &CharServerRecv::processCharMapInfo, 0); -packet(SMSG_CHAR_PASSWORD_RESPONSE, 0x0062, 3, &LoginRecv::processCharPasswordResponse, 0); -packet(SMSG_CHAR_SWITCH_RESPONSE, 0x00b3, 3, &Ea::GameRecv::processCharSwitchResponse, 0); -packet(SMSG_CONNECTION_PROBLEM, 0x0081, 3, &GeneralRecv::processConnectionProblem, 0); -packet(SMSG_GM_CHAT, 0x009a, -1, &ChatRecv::processGmChat, 0); -packet(SMSG_IGNORE_ALL_RESPONSE, 0x00d2, 4, &Ea::ChatRecv::processIgnoreAllResponse, 0); -packet(SMSG_ITEM_DROPPED, 0x009e, 17, &ItemRecv::processItemDropped, 0); -packet(SMSG_ITEM_REMOVE, 0x00a1, 6, &Ea::ItemRecv::processItemRemove, 0); -packet(SMSG_ITEM_USE_RESPONSE, 0x00a8, 7, &Ea::InventoryRecv::processItemUseResponse, 0); -packet(SMSG_ITEM_VISIBLE, 0x009d, 17, &ItemRecv::processItemVisible, 0); -packet(SMSG_LOGIN_DATA, 0x0069, -1, &LoginRecv::processLoginData, 0); -packet(SMSG_LOGIN_ERROR, 0x006a, 23, &Ea::LoginRecv::processLoginError, 0); -packet(SMSG_MAP_LOGIN_SUCCESS, 0x0073, 11, &GameRecv::processMapLogin, 0); -packet(SMSG_MAP_MUSIC, 0x0227, -1, &Ea::PlayerRecv::processMapMusic, 0); -packet(SMSG_MAP_QUIT_RESPONSE, 0x018b, 4, &Ea::GameRecv::processMapQuitResponse, 0); -packet(SMSG_MVP_EFFECT, 0x010c, 6, &Ea::ChatRecv::processMVPEffect, 0); -packet(SMSG_NPC_BUY, 0x00c6, -1, &BuySellRecv::processNpcBuy, 0); -packet(SMSG_NPC_BUY_RESPONSE, 0x00ca, 3, &BuySellRecv::processNpcBuyResponse, 0); -packet(SMSG_NPC_BUY_SELL_CHOICE, 0x00c4, 6, &Ea::BuySellRecv::processNpcBuySellChoice, 0); -packet(SMSG_NPC_CHANGETITLE, 0x0228, -1, &Ea::NpcRecv::processChangeTitle, 0); -packet(SMSG_NPC_CHOICE, 0x00b7, -1, &Ea::NpcRecv::processNpcChoice, 0); -packet(SMSG_NPC_CLOSE, 0x00b6, 6, &Ea::NpcRecv::processNpcClose, 0); -packet(SMSG_NPC_COMMAND, 0x0212, 16, &Ea::NpcRecv::processNpcCommand, 0); -packet(SMSG_NPC_INT_INPUT, 0x0142, 6, &Ea::NpcRecv::processNpcIntInput, 0); -packet(SMSG_NPC_MESSAGE, 0x00b4, -1, &Ea::NpcRecv::processNpcMessage, 0); -packet(SMSG_NPC_NEXT, 0x00b5, 6, &Ea::NpcRecv::processNpcNext, 0); -packet(SMSG_NPC_SELL, 0x00c7, -1, &Ea::BuySellRecv::processNpcSell, 0); -packet(SMSG_NPC_SELL_RESPONSE, 0x00cb, 3, &BuySellRecv::processNpcSellResponse, 0); -packet(SMSG_NPC_STR_INPUT, 0x01d4, 6, &Ea::NpcRecv::processNpcStrInput, 0); -packet(SMSG_PARTY_CREATE, 0x00fa, 3, &Ea::PartyRecv::processPartyCreate, 0); -packet(SMSG_PARTY_INFO, 0x00fb, -1, &PartyRecv::processPartyInfo, 0); -packet(SMSG_PARTY_INVITED, 0x00fe, 30, &PartyRecv::processPartyInvited, 0); -packet(SMSG_PARTY_INVITE_RESPONSE, 0x00fd, 27, &PartyRecv::processPartyInviteResponse, 0); -packet(SMSG_PARTY_LEAVE, 0x0105, 31, &Ea::PartyRecv::processPartyLeave, 0); -packet(SMSG_PARTY_MESSAGE, 0x0109, -1, &PartyRecv::processPartyMessage, 0); -packet(SMSG_PARTY_MOVE, 0x0104, 79, &PartyRecv::processPartyMove, 0); -packet(SMSG_PARTY_SETTINGS, 0x0101, 6, &PartyRecv::processPartySettings, 0); -packet(SMSG_PARTY_UPDATE_COORDS, 0x0107, 10, &Ea::PartyRecv::processPartyUpdateCoords, 0); -packet(SMSG_PARTY_UPDATE_HP, 0x0106, 10, &PartyRecv::processPartyUpdateHp, 0); -packet(SMSG_PLAYER_ARROW_EQUIP, 0x013c, 4, &Ea::InventoryRecv::processPlayerArrowEquip, 0); -packet(SMSG_PLAYER_ARROW_MESSAGE, 0x013b, 4, &Ea::PlayerRecv::processPlayerArrowMessage, 0); -packet(SMSG_PLAYER_ATTACK_RANGE, 0x013a, 4, &Ea::InventoryRecv::processPlayerAttackRange, 0); -packet(SMSG_PLAYER_CHAT, 0x008e, -1, &ChatRecv::processChat, 0); -packet(SMSG_PLAYER_EQUIP, 0x00aa, 7, &InventoryRecv::processPlayerEquip, 0); -packet(SMSG_PLAYER_EQUIPMENT, 0x00a4, -1, &InventoryRecv::processPlayerEquipment, 0); -packet(SMSG_PLAYER_GUILD_PARTY_INFO, 0x0195, 102, &BeingRecv::processPlayerGuilPartyInfo, 0); -packet(SMSG_PLAYER_INVENTORY, 0x01ee, -1, &InventoryRecv::processPlayerInventory, 0); -packet(SMSG_PLAYER_INVENTORY_ADD, 0x00a0, 23, &InventoryRecv::processPlayerInventoryAdd, 0); -packet(SMSG_PLAYER_INVENTORY_REMOVE, 0x00af, 6, &InventoryRecv::processPlayerInventoryRemove, 0); -packet(SMSG_PLAYER_INVENTORY_USE, 0x01c8, 13, &Ea::InventoryRecv::processPlayerInventoryUse, 0); -packet(SMSG_PLAYER_MOVE, 0x01da, 60, &BeingRecv::processPlayerMove, 0); -packet(SMSG_PLAYER_MOVE_TO_ATTACK, 0x0139, 16, &Ea::BeingRecv::processPlayerMoveToAttack, 0); -packet(SMSG_PLAYER_SKILLS, 0x010f, -1, &SkillRecv::processPlayerSkills, 0); -packet(SMSG_PLAYER_SKILL_UP, 0x010e, 11, &Ea::SkillRecv::processPlayerSkillUp, 0); -packet(SMSG_PLAYER_STATUS_CHANGE, 0x0119, 13, &BeingRecv::processPlayerStatusChange, 0); -packet(SMSG_PLAYER_STAT_UPDATE_1, 0x00b0, 8, &Ea::PlayerRecv::processPlayerStatUpdate1, 0); -packet(SMSG_PLAYER_STAT_UPDATE_2, 0x00b1, 8, &Ea::PlayerRecv::processPlayerStatUpdate2, 0); -packet(SMSG_PLAYER_STAT_UPDATE_3, 0x0141, 14, &Ea::PlayerRecv::processPlayerStatUpdate3, 0); -packet(SMSG_PLAYER_STAT_UPDATE_4, 0x00bc, 6, &Ea::PlayerRecv::processPlayerStatUpdate4, 0); -packet(SMSG_PLAYER_STAT_UPDATE_5, 0x00bd, 44, &PlayerRecv::processPlayerStatUpdate5, 0); -packet(SMSG_PLAYER_STAT_UPDATE_6, 0x00be, 5, &Ea::PlayerRecv::processPlayerStatUpdate6, 0); -packet(SMSG_PLAYER_STOP, 0x0088, 10, &Ea::BeingRecv::processPlayerStop, 0); -packet(SMSG_PLAYER_STORAGE_ADD, 0x00f4, 21, &InventoryRecv::processPlayerStorageAdd, 0); -packet(SMSG_PLAYER_STORAGE_CLOSE, 0x00f8, 2, &Ea::InventoryRecv::processPlayerStorageClose, 0); -packet(SMSG_PLAYER_STORAGE_EQUIP, 0x00a6, -1, &InventoryRecv::processPlayerStorageEquip, 0); -packet(SMSG_PLAYER_STORAGE_ITEMS, 0x01f0, -1, &InventoryRecv::processPlayerStorage, 0); -packet(SMSG_PLAYER_STORAGE_REMOVE, 0x00f6, 8, &InventoryRecv::processPlayerStorageRemove, 0); -packet(SMSG_PLAYER_STORAGE_STATUS, 0x00f2, 6, &Ea::InventoryRecv::processPlayerStorageStatus, 0); -packet(SMSG_PLAYER_UNEQUIP, 0x00ac, 7, &InventoryRecv::processPlayerUnEquip, 0); -packet(SMSG_PLAYER_UPDATE_1, 0x01d8, 54, &BeingRecv::processPlayerUpdate1, 0); -packet(SMSG_PLAYER_UPDATE_2, 0x01d9, 53, &BeingRecv::processPlayerUpdate2, 0); -packet(SMSG_PLAYER_WARP, 0x0091, 22, &Ea::PlayerRecv::processPlayerWarp, 0); -packet(SMSG_PVP_MAP_MODE, 0x0199, 4, &Ea::BeingRecv::processPvpMapMode, 0); -packet(SMSG_PVP_SET, 0x019a, 14, &BeingRecv::processPvpSet, 0); -packet(SMSG_QUEST_PLAYER_VARS, 0x0215, -1, &QuestRecv::processPlayerQuests, 0); -packet(SMSG_QUEST_SET_VAR, 0x0214, 8, &QuestRecv::processSetQuestVar, 0); -packet(SMSG_SCRIPT_MESSAGE, 0x0229, -1, &ChatRecv::processScriptMessage, 0); -packet(SMSG_SERVER_PING, 0x007f, 6, nullptr, 0); -packet(SMSG_SERVER_VERSION_RESPONSE, 0x7531, 10, &LoginRecv::processServerVersion, 0); -packet(SMSG_SKILL_CASTING, 0x013e, 24, &BeingRecv::processSkillCasting, 0); -packet(SMSG_SKILL_CAST_CANCEL, 0x01b9, 6, &BeingRecv::processSkillCastCancel, 0); -packet(SMSG_SKILL_DAMAGE, 0x01de, 33, &BeingRecv::processSkillDamage, 0); -packet(SMSG_SKILL_FAILED, 0x0110, 10, &SkillRecv::processSkillFailed, 0); -packet(SMSG_SKILL_NO_DAMAGE, 0x011a, 15, &Ea::BeingRecv::processSkillNoDamage, 0); -packet(SMSG_SOLVE_CHAR_NAME, 0x0194, 30, nullptr, 0); -packet(SMSG_TRADE_CANCEL, 0x00ee, 2, &Ea::TradeRecv::processTradeCancel, 0); -packet(SMSG_TRADE_COMPLETE, 0x00f0, 3, &Ea::TradeRecv::processTradeComplete, 0); -packet(SMSG_TRADE_ITEM_ADD, 0x00e9, 19, &TradeRecv::processTradeItemAdd, 0); -packet(SMSG_TRADE_ITEM_ADD_RESPONSE, 0x01b1, 7, &TradeRecv::processTradeItemAddResponse, 0); -packet(SMSG_TRADE_OK, 0x00ec, 3, &Ea::TradeRecv::processTradeOk, 0); -packet(SMSG_TRADE_REQUEST, 0x00e5, 26, &TradeRecv::processTradeRequest, 0); -packet(SMSG_TRADE_RESPONSE, 0x00e7, 3, &TradeRecv::processTradeResponse, 0); -packet(SMSG_UPDATE_HOST, 0x0063, -1, &Ea::LoginRecv::processUpdateHost, 0); -packet(SMSG_WALK_RESPONSE, 0x0087, 12, &PlayerRecv::processWalkResponse, 0); -packet(SMSG_WHISPER, 0x0097, -1, &ChatRecv::processWhisper, 0); -packet(SMSG_WHISPER_RESPONSE, 0x0098, 3, &ChatRecv::processWhisperResponse, 0); -packet(SMSG_WHO_ANSWER, 0x00c2, 6, &Ea::GameRecv::processWhoAnswer, 0); -packet(SMSG_MAP_MASK, 0x0226, 10, &Ea::PlayerRecv::processMapMask, 0); -packet(SMSG_PLAYER_CLIENT_COMMAND, 0x0230, -1, &Ea::PlayerRecv::processPlayerClientCommand, 0); -packet(SMSG_MAP_SET_TILES_TYPE, 0x0231, 34, &Ea::MapRecv::processSetTilesType, 0); diff --git a/src/net/tmwa/packetsout.inc b/src/net/tmwa/packetsout.inc deleted file mode 100644 index 4b93150ed..000000000 --- a/src/net/tmwa/packetsout.inc +++ /dev/null @@ -1,110 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#define PACKETSOUT_VOID - -packet(CMSG_SERVER_VERSION_REQUEST, 0x7530, 0, nullptr); - -packet(CMSG_LOGIN_REGISTER, 0x0064, 0, nullptr); - -packet(CMSG_NAME_REQUEST, 0x0094, 0, nullptr); - -packet(CMSG_CHAR_PASSWORD_CHANGE, 0x0061, 0, nullptr); -packet(CMSG_CHAR_SERVER_CONNECT, 0x0065, 0, nullptr); -packet(CMSG_CHAR_SELECT, 0x0066, 0, nullptr); -packet(CMSG_CHAR_CREATE, 0x0067, 0, nullptr); -packet(CMSG_CHAR_DELETE, 0x0068, 0, nullptr); - -packet(CMSG_MAP_SERVER_CONNECT, 0x0072, 0, nullptr); -packet(CMSG_MAP_PING, 0x007e, 0, nullptr); -packet(CMSG_MAP_LOADED, 0x007d, 0, nullptr); -packet(CMSG_CLIENT_QUIT, 0x018A, 0, nullptr); - -packet(CMSG_CHAT_MESSAGE, 0x008c, 0, nullptr); -packet(CMSG_CHAT_WHISPER, 0x0096, 0, nullptr); -packet(CMSG_CHAT_WHO, 0x00c1, 0, nullptr); - -packet(CMSG_SKILL_LEVELUP_REQUEST, 0x0112, 0, nullptr); -packet(CMSG_STAT_UPDATE_REQUEST, 0x00bb, 0, nullptr); -packet(CMSG_SKILL_USE_BEING, 0x0113, 0, nullptr); -packet(CMSG_SKILL_USE_POSITION, 0x0116, 0, nullptr); -packet(CMSG_SKILL_USE_POSITION_MORE, 0x0190, 0, nullptr); -packet(CMSG_SKILL_USE_MAP, 0x011b, 0, nullptr); - -packet(CMSG_PLAYER_INVENTORY_USE, 0x00a7, 0, nullptr); -packet(CMSG_PLAYER_INVENTORY_DROP, 0x00a2, 0, nullptr); -packet(CMSG_PLAYER_EQUIP, 0x00a9, 0, nullptr); -packet(CMSG_PLAYER_UNEQUIP, 0x00ab, 0, nullptr); - -packet(CMSG_ITEM_PICKUP, 0x009f, 0, nullptr); -packet(CMSG_PLAYER_CHANGE_DIR, 0x009b, 0, nullptr); -packet(CMSG_PLAYER_CHANGE_DEST, 0x0085, 0, nullptr); -packet(CMSG_PLAYER_CHANGE_ACT, 0x0089, 0, nullptr); -packet(CMSG_PLAYER_RESTART, 0x00b2, 0, nullptr); -packet(CMSG_PLAYER_EMOTE, 0x00bf, 0, nullptr); -packet(CMSG_PLAYER_STOP_ATTACK, 0x0118, 0, nullptr); -packet(CMSG_WHO_REQUEST, 0x00c1, 0, nullptr); - -packet(CMSG_NPC_TALK, 0x0090, 0, nullptr); -packet(CMSG_NPC_NEXT_REQUEST, 0x00b9, 0, nullptr); -packet(CMSG_NPC_CLOSE, 0x0146, 0, nullptr); -packet(CMSG_NPC_LIST_CHOICE, 0x00b8, 0, nullptr); -packet(CMSG_NPC_INT_RESPONSE, 0x0143, 0, nullptr); -packet(CMSG_NPC_STR_RESPONSE, 0x01d5, 0, nullptr); -packet(CMSG_NPC_BUY_SELL_REQUEST, 0x00c5, 0, nullptr); -packet(CMSG_NPC_BUY_REQUEST, 0x00c8, 0, nullptr); -packet(CMSG_NPC_SELL_REQUEST, 0x00c9, 0, nullptr); - -packet(CMSG_TRADE_REQUEST, 0x00e4, 0, nullptr); -packet(CMSG_TRADE_RESPONSE, 0x00e6, 0, nullptr); -packet(CMSG_TRADE_ITEM_ADD_REQUEST, 0x00e8, 0, nullptr); -packet(CMSG_TRADE_CANCEL_REQUEST, 0x00ed, 0, nullptr); -packet(CMSG_TRADE_ADD_COMPLETE, 0x00eb, 0, nullptr); -packet(CMSG_TRADE_OK, 0x00ef, 0, nullptr); - -packet(CMSG_PARTY_CREATE, 0x00f9, 0, nullptr); -packet(CMSG_PARTY_INVITE, 0x00fc, 0, nullptr); -packet(CMSG_PARTY_INVITED, 0x00ff, 0, nullptr); -packet(CMSG_PARTY_LEAVE, 0x0100, 0, nullptr); -packet(CMSG_PARTY_SETTINGS, 0x0102, 0, nullptr); -packet(CMSG_PARTY_KICK, 0x0103, 0, nullptr); -packet(CMSG_PARTY_MESSAGE, 0x0108, 0, nullptr); - -packet(CMSG_MOVE_TO_STORAGE, 0x00f3, 0, nullptr); -packet(CMSG_MOVE_FROM_STORAGE, 0x00f5, 0, nullptr); -packet(CMSG_CLOSE_STORAGE, 0x00f7, 0, nullptr); - -packet(CMSG_ADMIN_ANNOUNCE, 0x0099, 0, nullptr); -packet(CMSG_ADMIN_LOCAL_ANNOUNCE, 0x019C, 0, nullptr); -packet(CMSG_ADMIN_HIDE, 0x019D, 0, nullptr); -packet(CMSG_ADMIN_KICK, 0x00CC, 0, nullptr); -packet(CMSG_ADMIN_MUTE, 0x0149, 0, nullptr); - -packet(CMSG_SOLVE_CHAR_NAME, 0x0193, 0, nullptr); -packet(CMSG_IGNORE_NICK, 0x00cf, 0, nullptr); - -packet(CMSG_CLIENT_DISCONNECT, 0x7532, 0, nullptr); -packet(CMSG_IGNORE_ALL, 0x00d0, 0, nullptr); - -#ifdef PACKETS_UPDATE -// condition code here -#endif diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp deleted file mode 100644 index cef9588f7..000000000 --- a/src/net/tmwa/partyhandler.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/partyhandler.h" - -#include "actormanager.h" -#include "notifymanager.h" -#include "party.h" - -#include "being/localplayer.h" - -#include "enums/resources/notifytypes.h" - -#include "net/ea/partyrecv.h" - -#include "net/tmwa/messageout.h" -#include "net/tmwa/protocolout.h" - -#include "debug.h" - -namespace TmwAthena -{ - -PartyHandler::PartyHandler() : - Ea::PartyHandler() -{ - partyHandler = this; -} - -PartyHandler::~PartyHandler() -{ - partyHandler = nullptr; -} - -void PartyHandler::create(const std::string &name) const -{ - createOutPacket(CMSG_PARTY_CREATE); - outMsg.writeString(name.substr(0, 23), 24, "party name"); -} - -void PartyHandler::invite(const std::string &name) const -{ - if (actorManager == nullptr) - return; - - const Being *const being = actorManager->findBeingByName( - name, ActorType::Player); - if (being != nullptr) - { - createOutPacket(CMSG_PARTY_INVITE); - outMsg.writeBeingId(being->getId(), "account id"); - } -} - -void PartyHandler::inviteResponse(const int partyId A_UNUSED, - const bool accept) const -{ - if (localPlayer != nullptr) - { - createOutPacket(CMSG_PARTY_INVITED); - outMsg.writeBeingId(localPlayer->getId(), "account id"); - outMsg.writeInt32(accept ? 1 : 0, "accept"); - } -} - -void PartyHandler::leave() const -{ - createOutPacket(CMSG_PARTY_LEAVE); -} - -void PartyHandler::kick(const Being *const being) const -{ - if (being != nullptr) - { - createOutPacket(CMSG_PARTY_KICK); - outMsg.writeBeingId(being->getId(), "account id"); - outMsg.writeString("", 24, "unused"); - } -} - -void PartyHandler::kick(const std::string &name) const -{ - if (Ea::taParty == nullptr) - return; - - const PartyMember *const m = Ea::taParty->getMember(name); - if (m == nullptr) - { - NotifyManager::notify(NotifyTypes::PARTY_USER_NOT_IN_PARTY, name); - return; - } - - createOutPacket(CMSG_PARTY_KICK); - outMsg.writeBeingId(m->getID(), "member id"); - outMsg.writeString(name, 24, "unused"); -} - -void PartyHandler::chat(const std::string &text) const -{ - createOutPacket(CMSG_PARTY_MESSAGE); - outMsg.writeInt16(CAST_S16(text.length() + 4), "len"); - outMsg.writeString(text, CAST_S32(text.length()), "text"); -} - -void PartyHandler::setShareExperience(const PartyShareT share) const -{ - if (share == PartyShare::NOT_POSSIBLE) - return; - - createOutPacket(CMSG_PARTY_SETTINGS); - outMsg.writeInt16(CAST_S16(share), "share exp"); - outMsg.writeInt16(CAST_S16(Ea::PartyRecv::mShareItems), - "share items"); -} - -void PartyHandler::setShareItems(const PartyShareT share) const -{ - if (share == PartyShare::NOT_POSSIBLE) - return; - - createOutPacket(CMSG_PARTY_SETTINGS); - outMsg.writeInt16(CAST_S16(Ea::PartyRecv::mShareExp), - "share exp"); - outMsg.writeInt16(CAST_S16(share), "share items"); -} - -void PartyHandler::changeLeader(const std::string &name A_UNUSED) const -{ -} - -void PartyHandler::allowInvite(const bool allow A_UNUSED) const -{ -} - -PartyShareT PartyHandler::getShareAutoItems() const -{ - return PartyShare::NOT_POSSIBLE; -} - -void PartyHandler::setShareAutoItems(const PartyShareT share A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/partyhandler.h b/src/net/tmwa/partyhandler.h deleted file mode 100644 index 4942bfc86..000000000 --- a/src/net/tmwa/partyhandler.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_PARTYHANDLER_H -#define NET_TMWA_PARTYHANDLER_H - -#include "net/ea/partyhandler.h" - -namespace TmwAthena -{ - -class PartyHandler final : public Ea::PartyHandler -{ - public: - PartyHandler(); - - A_DELETE_COPY(PartyHandler) - - ~PartyHandler(); - - void create(const std::string &name) const override final; - - void invite(const std::string &name) const override final; - - void inviteResponse(const int partyId, - const bool accept) const override final; - - void leave() const override final; - - void kick(const Being *const being) const override final; - - void kick(const std::string &name) const override final; - - void chat(const std::string &text) const override final; - - void setShareExperience(const PartyShareT share) const override final; - - void setShareItems(const PartyShareT share) const override final; - - void changeLeader(const std::string &name) const override final - A_CONST; - - void allowInvite(const bool allow) const override final A_CONST; - - void setShareAutoItems(const PartyShareT share) const override final; - - PartyShareT getShareAutoItems() const override final A_WARN_UNUSED; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_PARTYHANDLER_H diff --git a/src/net/tmwa/partyrecv.cpp b/src/net/tmwa/partyrecv.cpp deleted file mode 100644 index b25a501c8..000000000 --- a/src/net/tmwa/partyrecv.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/partyrecv.h" - -#include "actormanager.h" -#include "notifymanager.h" -#include "party.h" - -#include "being/localplayer.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/chatwindow.h" -#include "gui/windows/socialwindow.h" - -#include "gui/widgets/tabs/chat/partytab.h" - -#include "net/messagein.h" - -#include "net/ea/partyrecv.h" - -#include "utils/foreach.h" - -#include "debug.h" - -namespace TmwAthena -{ - -void PartyRecv::processPartySettings(Net::MessageIn &msg) -{ - if (partyTab == nullptr) - { - if (chatWindow == nullptr) - return; - - Ea::PartyRecv::createTab(); - } - - // These seem to indicate the sharing mode for exp and items - const PartyShareT exp = static_cast<PartyShareT>( - msg.readInt16("share exp")); - const PartyShareT item = static_cast<PartyShareT>( - msg.readInt16("share items")); - Ea::PartyRecv::processPartyExpSettingsContinue(msg, exp); - Ea::PartyRecv::processPartyItemSettingsContinue(msg, item); -} - -void PartyRecv::processPartyInfo(Net::MessageIn &msg) -{ - bool isOldParty = false; - std::set<std::string> names; - std::set<std::string> onlineNames; - if (Ea::taParty == nullptr) - { - logger->log1("error: party empty in SMSG_PARTY_INFO"); - Ea::taParty = Party::getParty(1); - } - if (Ea::taParty != nullptr) - { - if (Ea::taParty->getNumberOfElements() > 1) - { - isOldParty = true; - Ea::taParty->getNamesSet(names); - const Party::MemberList *const members = Ea::taParty->getMembers(); - FOR_EACHP (Party::MemberList::const_iterator, it, members) - { - if ((*it)->getOnline()) - onlineNames.insert((*it)->getName()); - } - if (localPlayer != nullptr) - onlineNames.insert(localPlayer->getName()); - } - } - - if (localPlayer == nullptr) - logger->log1("error: localPlayer==0 in SMSG_PARTY_INFO"); - - if (Ea::taParty != nullptr) - Ea::taParty->clearMembers(); - - const int length = msg.readInt16("len"); - if (Ea::taParty != nullptr) - Ea::taParty->setName(msg.readString(24, "party name")); - - const int count = (length - 28) / 46; - if ((localPlayer != nullptr) && (Ea::taParty != nullptr)) - { - localPlayer->setParty(Ea::taParty); - localPlayer->setPartyName(Ea::taParty->getName()); - } - - for (int i = 0; i < count; i++) - { - const BeingId id = msg.readBeingId("id"); - std::string nick = msg.readString(24, "nick"); - std::string map = msg.readString(16, "map"); - const bool leader = msg.readUInt8("leader") == 0U; - const bool online = msg.readUInt8("online") == 0U; - - if (Ea::taParty != nullptr) - { - bool joined(false); - - if (isOldParty) - { - if (names.find(nick) == names.end()) - { - NotifyManager::notify(NotifyTypes::PARTY_USER_JOINED, - nick); - joined = true; - } - } - PartyMember *const member = Ea::taParty->addMember(id, nick); - if (member != nullptr) - { - if (!joined && (partyTab != nullptr)) - { - if (!names.empty() && ((onlineNames.find(nick) - == onlineNames.end() && online) - || (onlineNames.find(nick) != onlineNames.end() - && !online))) - { - partyTab->showOnline(nick, fromBool(online, Online)); - } - - member->setLeader(leader); - member->setOnline(online); - member->setMap(map); - } - else - { - member->setLeader(leader); - member->setOnline(online); - member->setMap(map); - } - } - } - } - - if (Ea::taParty != nullptr) - Ea::taParty->sort(); - - if ((localPlayer != nullptr) && (Ea::taParty != nullptr)) - { - localPlayer->setParty(Ea::taParty); - localPlayer->setPartyName(Ea::taParty->getName()); - if (socialWindow != nullptr) - socialWindow->updateParty(); - } -} - -void PartyRecv::processPartyMessage(Net::MessageIn &msg) -{ - const int msgLength = msg.readInt16("len") - 8; - if (msgLength <= 0) - return; - - const BeingId id = msg.readBeingId("id"); - const std::string chatMsg = msg.readString(msgLength, "message"); - - if ((Ea::taParty != nullptr) && (partyTab != nullptr)) - { - const PartyMember *const member = Ea::taParty->getMember(id); - if (member != nullptr) - { - partyTab->chatLog(member->getName(), chatMsg); - } - else - { - NotifyManager::notify(NotifyTypes::PARTY_UNKNOWN_USER_MSG, - chatMsg); - } - } -} - -void PartyRecv::processPartyInviteResponse(Net::MessageIn &msg) -{ - if (partyTab == nullptr) - return; - - const std::string nick = msg.readString(24, "nick"); - - switch (msg.readUInt8("status")) - { - case 0: - NotifyManager::notify(NotifyTypes::PARTY_INVITE_ALREADY_MEMBER, - nick); - break; - case 1: - NotifyManager::notify(NotifyTypes::PARTY_INVITE_REFUSED, nick); - break; - case 2: - NotifyManager::notify(NotifyTypes::PARTY_INVITE_DONE, nick); - break; - case 3: - NotifyManager::notify(NotifyTypes::PARTY_INVITE_PARTY_FULL, - nick); - break; - default: - NotifyManager::notify(NotifyTypes::PARTY_INVITE_ERROR, nick); - break; - } -} - -void PartyRecv::processPartyInvited(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("account id"); - std::string nick; - - if (actorManager != nullptr) - { - const Being *const being = actorManager->findBeing(id); - if (being != nullptr) - { - if (being->getType() == ActorType::Player) - nick = being->getName(); - } - } - - if (socialWindow != nullptr) - { - const std::string partyName = msg.readString(24, "party name"); - socialWindow->showPartyInvite(partyName, nick, 0); - } - else - { - msg.readString(24, "party name"); - } -} - -void PartyRecv::processPartyMove(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("id"); - PartyMember *m = nullptr; - if (Ea::taParty != nullptr) - m = Ea::taParty->getMember(id); - if (m != nullptr) - { - msg.readInt32("unused"); - m->setX(msg.readInt16("x")); - m->setY(msg.readInt16("y")); - const bool online = msg.readUInt8("online") != 0; - if (m->getOnline() != online) - partyTab->showOnline(m->getName(), fromBool(online, Online)); - m->setOnline(online); - msg.readString(24, "party"); - msg.readString(24, "nick"); - m->setMap(msg.readString(16, "map")); - } - else - { - msg.readInt32("unused"); - msg.readInt16("x"); - msg.readInt16("y"); - msg.readUInt8("online"); - msg.readString(24, "party"); - msg.readString(24, "nick"); - msg.readString(16, "map"); - } -} - -void PartyRecv::processPartyUpdateHp(Net::MessageIn &msg) -{ - const BeingId id = msg.readBeingId("id"); - const int hp = msg.readInt16("hp"); - const int maxhp = msg.readInt16("max hp"); - PartyMember *m = nullptr; - if (Ea::taParty != nullptr) - m = Ea::taParty->getMember(id); - if (m != nullptr) - { - m->setHp(hp); - m->setMaxHp(maxhp); - } - - // The server only sends this when the member is in range, so - // lets make sure they get the party hilight. - if ((actorManager != nullptr) && (Ea::taParty != nullptr)) - { - if (Being *const b = actorManager->findBeing(id)) - b->setParty(Ea::taParty); - } -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/partyrecv.h b/src/net/tmwa/partyrecv.h deleted file mode 100644 index 8665df3e8..000000000 --- a/src/net/tmwa/partyrecv.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_PARTYRECV_H -#define NET_TMWA_PARTYRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace TmwAthena -{ - namespace PartyRecv - { - void processPartySettings(Net::MessageIn &msg); - void processPartyInfo(Net::MessageIn &msg); - void processPartyMessage(Net::MessageIn &msg); - void processPartyInviteResponse(Net::MessageIn &msg); - void processPartyInvited(Net::MessageIn &msg); - void processPartyMove(Net::MessageIn &msg); - void processPartyUpdateHp(Net::MessageIn &msg); - } // namespace PartyRecv -} // namespace TmwAthena - -#endif // NET_TMWA_PARTYRECV_H diff --git a/src/net/tmwa/pethandler.cpp b/src/net/tmwa/pethandler.cpp deleted file mode 100644 index c10fd5882..000000000 --- a/src/net/tmwa/pethandler.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2013-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/pethandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -PetHandler::PetHandler() : - mRandCounter(1000) -{ - petHandler = this; -} - -PetHandler::~PetHandler() -{ - petHandler = nullptr; -} - -void PetHandler::move(const int x A_UNUSED, - const int y A_UNUSED) const -{ -} - -void PetHandler::emote(const uint8_t emoteId A_UNUSED) -{ -} - -void PetHandler::catchPet(const Being *const being A_UNUSED) const -{ -} - -void PetHandler::sendPetMessage(const int data A_UNUSED) const -{ -} - -void PetHandler::setName(const std::string &name A_UNUSED) const -{ -} - -void PetHandler::requestStatus() const -{ -} - -void PetHandler::feed() const -{ -} - -void PetHandler::dropLoot() const -{ -} - -void PetHandler::returnToEgg() const -{ -} - -void PetHandler::unequip() const -{ -} - -void PetHandler::setDirection(const unsigned char type A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/pethandler.h b/src/net/tmwa/pethandler.h deleted file mode 100644 index e7a816d21..000000000 --- a/src/net/tmwa/pethandler.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2013-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_PETHANDLER_H -#define NET_TMWA_PETHANDLER_H - -#include "net/pethandler.h" - -namespace TmwAthena -{ - -class PetHandler final : public Net::PetHandler -{ - public: - PetHandler(); - - A_DELETE_COPY(PetHandler) - - ~PetHandler(); - - void move(const int x, - const int y) const override final; - - void emote(const uint8_t emoteId) override final; - - void catchPet(const Being *const being) const override final A_CONST; - - void sendPetMessage(const int data) const override final A_CONST; - - void setName(const std::string &name) const override final A_CONST; - - void requestStatus() const override final A_CONST; - - void feed() const override final A_CONST; - - void dropLoot() const override final A_CONST; - - void returnToEgg() const override final A_CONST; - - void unequip() const override final A_CONST; - - void setDirection(const unsigned char type) const override final; - - protected: - int mRandCounter; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_PETHANDLER_H diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp deleted file mode 100644 index 4d2e5cc33..000000000 --- a/src/net/tmwa/playerhandler.cpp +++ /dev/null @@ -1,422 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/playerhandler.h" - -#include "notifymanager.h" -#include "party.h" - -#include "being/localplayer.h" -#include "being/playerinfo.h" - -#include "const/net/nostat.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/skilldialog.h" -#include "gui/windows/statuswindow.h" - -#include "net/ea/inventoryhandler.h" - -#include "net/tmwa/messageout.h" -#include "net/tmwa/protocolout.h" -#include "net/tmwa/sp.h" - -#include "resources/db/unitsdb.h" - -#include "debug.h" - -namespace TmwAthena -{ - -PlayerHandler::PlayerHandler() : - Ea::PlayerHandler() -{ - playerHandler = this; -} - -PlayerHandler::~PlayerHandler() -{ - playerHandler = nullptr; -} - -void PlayerHandler::attack(const BeingId id, - const Keep keep) const -{ - createOutPacket(CMSG_PLAYER_CHANGE_ACT); - outMsg.writeBeingId(id, "target id"); - if (keep == Keep_true) - outMsg.writeInt8(7, "action"); - else - outMsg.writeInt8(0, "action"); -} - -void PlayerHandler::stopAttack() const -{ - createOutPacket(CMSG_PLAYER_STOP_ATTACK); -} - -void PlayerHandler::emote(const uint8_t emoteId) const -{ - createOutPacket(CMSG_PLAYER_EMOTE); - outMsg.writeInt8(emoteId, "emote id"); -} - -void PlayerHandler::increaseAttribute(const AttributesT attr, - const int amount A_UNUSED) const -{ - if (attr >= Attributes::PLAYER_STR && attr <= Attributes::PLAYER_LUK) - { - createOutPacket(CMSG_STAT_UPDATE_REQUEST); - outMsg.writeInt16(CAST_S16(attr), "attribute id"); - outMsg.writeInt8(1, "increment"); - } -} - -void PlayerHandler::increaseSkill(const uint16_t skillId) const -{ - if (PlayerInfo::getAttribute(Attributes::PLAYER_SKILL_POINTS) <= 0) - return; - - createOutPacket(CMSG_SKILL_LEVELUP_REQUEST); - outMsg.writeInt16(skillId, "skill id"); -} - -void PlayerHandler::pickUp(const FloorItem *const floorItem) const -{ - if (floorItem == nullptr) - return; - - createOutPacket(CMSG_ITEM_PICKUP); - outMsg.writeBeingId(floorItem->getId(), "object id"); - Ea::InventoryHandler::pushPickup(floorItem->getId()); -} - -void PlayerHandler::setDirection(const unsigned char direction) const -{ - createOutPacket(CMSG_PLAYER_CHANGE_DIR); - outMsg.writeInt16(0, "unused"); - outMsg.writeInt8(direction, "direction"); -} - -void PlayerHandler::setDestination(const int x, const int y, - const int direction) const -{ - createOutPacket(CMSG_PLAYER_CHANGE_DEST); - outMsg.writeCoordinates(CAST_U16(x), - CAST_U16(y), - CAST_U8(direction), "destination"); -} - -void PlayerHandler::changeAction(const BeingActionT &action) const -{ - char type; - switch (action) - { - case BeingAction::SIT: - type = 2; - break; - case BeingAction::STAND: - case BeingAction::PRESTAND: - type = 3; - break; - default: - case BeingAction::MOVE: - case BeingAction::ATTACK: - case BeingAction::DEAD: - case BeingAction::HURT: - case BeingAction::SPAWN: - case BeingAction::CAST: - return; - } - - createOutPacket(CMSG_PLAYER_CHANGE_ACT); - outMsg.writeInt32(0, "unused"); - outMsg.writeInt8(type, "action"); -} - -void PlayerHandler::respawn() const -{ - createOutPacket(CMSG_PLAYER_RESTART); - outMsg.writeInt8(0, "action"); -} - -void PlayerHandler::requestOnlineList() const -{ -} - -void PlayerHandler::removeOption() const -{ -} - -void PlayerHandler::changeCart(const int type A_UNUSED) const -{ -} - -void PlayerHandler::setMemo() const -{ -} - -void PlayerHandler::updateStatus(const uint8_t status A_UNUSED) const -{ -} - -void PlayerHandler::setShortcut(const int idx A_UNUSED, - const uint8_t type A_UNUSED, - const int id A_UNUSED, - const int level A_UNUSED) const -{ -} - -void PlayerHandler::doriDori() const -{ -} - -void PlayerHandler::explosionSpirits() const -{ -} - -void PlayerHandler::requestPvpInfo() const -{ -} - -void PlayerHandler::revive() const -{ -} - -void PlayerHandler::shortcutShiftRow(const int row A_UNUSED) const -{ -} - -void PlayerHandler::setViewEquipment(const bool allow A_UNUSED) const -{ -} - -#define setStatComplex(stat) \ - PlayerInfo::setStatBase(stat, base, notify); \ - if (mod != NoStat) \ - PlayerInfo::setStatMod(stat, mod) - -void PlayerHandler::setStat(Net::MessageIn &msg, - const int type, - const int base, - const int mod, - const Notify notify) const -{ - switch (type) - { - case Sp::SPEED: - localPlayer->setWalkSpeed(base); - PlayerInfo::setStatBase(Attributes::PLAYER_WALK_SPEED, base); - PlayerInfo::setStatMod(Attributes::PLAYER_WALK_SPEED, 0); - break; - case Sp::BASEEXP: - PlayerInfo::setAttribute(Attributes::PLAYER_EXP, base); - break; - case Sp::JOBEXP: - PlayerInfo::setAttribute(Attributes::PLAYER_JOB_EXP, base); - break; - case Sp::KARMA: - PlayerInfo::setStatBase(Attributes::PLAYER_KARMA, base); - PlayerInfo::setStatMod(Attributes::PLAYER_KARMA, 0); - break; - case Sp::MANNER: - PlayerInfo::setStatBase(Attributes::PLAYER_MANNER, base); - PlayerInfo::setStatMod(Attributes::PLAYER_MANNER, 0); - break; - case Sp::HP: - PlayerInfo::setAttribute(Attributes::PLAYER_HP, base); - if (localPlayer->isInParty() && (Party::getParty(1) != nullptr)) - { - PartyMember *const m = Party::getParty(1) - ->getMember(localPlayer->getId()); - if (m != nullptr) - { - m->setHp(base); - m->setMaxHp(PlayerInfo::getAttribute( - Attributes::PLAYER_MAX_HP)); - } - } - break; - case Sp::MAXHP: - PlayerInfo::setAttribute(Attributes::PLAYER_MAX_HP, base); - - if (localPlayer->isInParty() && (Party::getParty(1) != nullptr)) - { - PartyMember *const m = Party::getParty(1)->getMember( - localPlayer->getId()); - if (m != nullptr) - { - m->setHp(PlayerInfo::getAttribute(Attributes::PLAYER_HP)); - m->setMaxHp(base); - } - } - break; - case Sp::SP: - PlayerInfo::setAttribute(Attributes::PLAYER_MP, base); - break; - case Sp::MAXSP: - PlayerInfo::setAttribute(Attributes::PLAYER_MAX_MP, base); - break; - case Sp::STATUSPOINT: - PlayerInfo::setAttribute(Attributes::PLAYER_CHAR_POINTS, base); - break; - case Sp::BASELEVEL: - PlayerInfo::setAttribute(Attributes::PLAYER_BASE_LEVEL, base); - if (localPlayer != nullptr) - { - localPlayer->setLevel(base); - localPlayer->updateName(); - } - break; - case Sp::SKILLPOINT: - PlayerInfo::setAttribute(Attributes::PLAYER_SKILL_POINTS, base); - if (skillDialog != nullptr) - skillDialog->update(); - break; - case Sp::STR: - setStatComplex(Attributes::PLAYER_STR); - break; - case Sp::AGI: - setStatComplex(Attributes::PLAYER_AGI); - break; - case Sp::VIT: - setStatComplex(Attributes::PLAYER_VIT); - break; - case Sp::INT: - setStatComplex(Attributes::PLAYER_INT); - break; - case Sp::DEX: - setStatComplex(Attributes::PLAYER_DEX); - break; - case Sp::LUK: - setStatComplex(Attributes::PLAYER_LUK); - break; - case Sp::ZENY: - { - const int oldMoney = PlayerInfo::getAttribute(Attributes::MONEY); - const int newMoney = base; - if (newMoney > oldMoney) - { - NotifyManager::notify(NotifyTypes::MONEY_GET, - UnitsDb::formatCurrency(newMoney - oldMoney)); - } - else if (newMoney < oldMoney) - { - NotifyManager::notify(NotifyTypes::MONEY_SPENT, - UnitsDb::formatCurrency(oldMoney - newMoney).c_str()); - } - - PlayerInfo::setAttribute(Attributes::MONEY, newMoney); - break; - } - case Sp::NEXTBASEEXP: - PlayerInfo::setAttribute(Attributes::PLAYER_EXP_NEEDED, base); - break; - case Sp::JOB_MOD: - PlayerInfo::setAttribute(Attributes::PLAYER_JOB_EXP_NEEDED, base); - break; - case Sp::WEIGHT: - PlayerInfo::setAttribute(Attributes::TOTAL_WEIGHT, base); - break; - case Sp::MAXWEIGHT: - PlayerInfo::setAttribute(Attributes::MAX_WEIGHT, base); - break; - case Sp::USTR: - statusWindow->setPointsNeeded(Attributes::PLAYER_STR, base); - break; - case Sp::UAGI: - statusWindow->setPointsNeeded(Attributes::PLAYER_AGI, base); - break; - case Sp::UVIT: - statusWindow->setPointsNeeded(Attributes::PLAYER_VIT, base); - break; - case Sp::UINT: - statusWindow->setPointsNeeded(Attributes::PLAYER_INT, base); - break; - case Sp::UDEX: - statusWindow->setPointsNeeded(Attributes::PLAYER_DEX, base); - break; - case Sp::ULUK: - statusWindow->setPointsNeeded(Attributes::PLAYER_LUK, base); - break; - - case Sp::ATK1: - PlayerInfo::setStatBase(Attributes::PLAYER_ATK, base); - PlayerInfo::updateAttrs(); - break; - case Sp::ATK2: - PlayerInfo::setStatMod(Attributes::PLAYER_ATK, base); - PlayerInfo::updateAttrs(); - break; - case Sp::MATK1: - PlayerInfo::setStatBase(Attributes::PLAYER_MATK, base); - break; - case Sp::MATK2: - PlayerInfo::setStatMod(Attributes::PLAYER_MATK, base); - break; - case Sp::DEF1: - PlayerInfo::setStatBase(Attributes::PLAYER_DEF, base); - break; - case Sp::DEF2: - PlayerInfo::setStatMod(Attributes::PLAYER_DEF, base); - break; - case Sp::MDEF1: - PlayerInfo::setStatBase(Attributes::PLAYER_MDEF, base); - break; - case Sp::MDEF2: - PlayerInfo::setStatMod(Attributes::PLAYER_MDEF, base); - break; - case Sp::HIT: - PlayerInfo::setStatBase(Attributes::PLAYER_HIT, base); - break; - case Sp::FLEE1: - PlayerInfo::setStatBase(Attributes::PLAYER_FLEE, base); - break; - case Sp::FLEE2: - PlayerInfo::setStatMod(Attributes::PLAYER_FLEE, base); - break; - case Sp::CRITICAL: - PlayerInfo::setStatBase(Attributes::PLAYER_CRIT, base); - break; - case Sp::ASPD: - localPlayer->setAttackSpeed(base); - PlayerInfo::setStatBase(Attributes::PLAYER_ATTACK_DELAY, base); - PlayerInfo::setStatMod(Attributes::PLAYER_ATTACK_DELAY, 0); - PlayerInfo::updateAttrs(); - break; - case Sp::JOBLEVEL: - PlayerInfo::setAttribute(Attributes::PLAYER_JOB_LEVEL, base); - break; - case Sp::GM_LEVEL: - localPlayer->setGroupId(base); - break; - - default: - UNIMPLEMENTEDPACKETFIELD(type); - break; - } -} - -#undef setStatComplex - -} // namespace TmwAthena diff --git a/src/net/tmwa/playerhandler.h b/src/net/tmwa/playerhandler.h deleted file mode 100644 index 898a03057..000000000 --- a/src/net/tmwa/playerhandler.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_PLAYERHANDLER_H -#define NET_TMWA_PLAYERHANDLER_H - -#include "net/ea/playerhandler.h" - -namespace TmwAthena -{ - -class PlayerHandler final : public Ea::PlayerHandler -{ - public: - PlayerHandler(); - - A_DELETE_COPY(PlayerHandler) - - ~PlayerHandler(); - - void attack(const BeingId id, - const Keep keep) const override final; - void stopAttack() const override final; - void emote(const uint8_t emoteId) const override final; - - void increaseAttribute(const AttributesT attr, - const int amount) const override final; - void increaseSkill(const uint16_t skillId) const override final; - - void pickUp(const FloorItem *const floorItem) const override final; - void setDirection(const unsigned char direction) const override final; - void setDestination(const int x, const int y, - const int direction) const override final; - void changeAction(const BeingActionT &action) - const override final; - void requestOnlineList() const override final A_CONST; - void updateStatus(const uint8_t status) const override final A_CONST; - - void respawn() const override final; - - void setShortcut(const int idx, - const uint8_t type, - const int id, - const int level) const override final A_CONST; - - void shortcutShiftRow(const int row) const override final; - - void removeOption() const override final A_CONST; - - void changeCart(const int type) const override final A_CONST; - - void setMemo() const override final A_CONST; - - void doriDori() const override final A_CONST; - - void explosionSpirits() const override final A_CONST; - - void requestPvpInfo() const override final A_CONST; - - void revive() const override final A_CONST; - - void setViewEquipment(const bool allow) const override final A_CONST; - - void setStat(Net::MessageIn &msg, - const int type, - const int base, - const int mod, - const Notify notify) const override final; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_PLAYERHANDLER_H diff --git a/src/net/tmwa/playerrecv.cpp b/src/net/tmwa/playerrecv.cpp deleted file mode 100644 index b6b23403f..000000000 --- a/src/net/tmwa/playerrecv.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/playerrecv.h" - -#include "being/localplayer.h" -#include "being/playerinfo.h" - -#include "gui/windows/statuswindow.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace TmwAthena -{ - -void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) -{ - BLOCK_START("PlayerRecv::processPlayerStatUpdate5") - PlayerInfo::setAttribute(Attributes::PLAYER_CHAR_POINTS, - msg.readInt16("char points")); - - unsigned int val = msg.readUInt8("str"); - PlayerInfo::setStatBase(Attributes::PLAYER_STR, val); - if (statusWindow != nullptr) - { - statusWindow->setPointsNeeded(Attributes::PLAYER_STR, - msg.readUInt8("str cost")); - } - else - { - msg.readUInt8("str cost"); - } - - val = msg.readUInt8("agi"); - PlayerInfo::setStatBase(Attributes::PLAYER_AGI, val); - if (statusWindow != nullptr) - { - statusWindow->setPointsNeeded(Attributes::PLAYER_AGI, - msg.readUInt8("agi cost")); - } - else - { - msg.readUInt8("agi cost"); - } - - val = msg.readUInt8("vit"); - PlayerInfo::setStatBase(Attributes::PLAYER_VIT, val); - if (statusWindow != nullptr) - { - statusWindow->setPointsNeeded(Attributes::PLAYER_VIT, - msg.readUInt8("vit cost")); - } - else - { - msg.readUInt8("vit cost"); - } - - val = msg.readUInt8("int"); - PlayerInfo::setStatBase(Attributes::PLAYER_INT, val); - if (statusWindow != nullptr) - { - statusWindow->setPointsNeeded(Attributes::PLAYER_INT, - msg.readUInt8("int cost")); - } - else - { - msg.readUInt8("int cost"); - } - - val = msg.readUInt8("dex"); - PlayerInfo::setStatBase(Attributes::PLAYER_DEX, val); - if (statusWindow != nullptr) - { - statusWindow->setPointsNeeded(Attributes::PLAYER_DEX, - msg.readUInt8("dex cost")); - } - else - { - msg.readUInt8("dex cost"); - } - - val = msg.readUInt8("luk"); - PlayerInfo::setStatBase(Attributes::PLAYER_LUK, val); - if (statusWindow != nullptr) - { - statusWindow->setPointsNeeded(Attributes::PLAYER_LUK, - msg.readUInt8("luk cost")); - } - else - { - msg.readUInt8("luk cost"); - } - - PlayerInfo::setStatBase(Attributes::PLAYER_ATK, - msg.readInt16("atk"), Notify_false); - PlayerInfo::setStatMod(Attributes::PLAYER_ATK, msg.readInt16("atk+")); - PlayerInfo::updateAttrs(); - - val = msg.readInt16("matk"); - PlayerInfo::setStatBase(Attributes::PLAYER_MATK, val, Notify_false); - - val = msg.readInt16("matk+"); - PlayerInfo::setStatMod(Attributes::PLAYER_MATK, val); - - PlayerInfo::setStatBase(Attributes::PLAYER_DEF, - msg.readInt16("def"), Notify_false); - PlayerInfo::setStatMod(Attributes::PLAYER_DEF, msg.readInt16("def+")); - - PlayerInfo::setStatBase(Attributes::PLAYER_MDEF, - msg.readInt16("mdef"), Notify_false); - PlayerInfo::setStatMod(Attributes::PLAYER_MDEF, msg.readInt16("mdef+")); - - PlayerInfo::setStatBase(Attributes::PLAYER_HIT, msg.readInt16("hit")); - - PlayerInfo::setStatBase(Attributes::PLAYER_FLEE, - msg.readInt16("flee"), Notify_false); - PlayerInfo::setStatMod(Attributes::PLAYER_FLEE, msg.readInt16("flee+")); - - PlayerInfo::setStatBase(Attributes::PLAYER_CRIT, msg.readInt16("crit")); - - PlayerInfo::setStatBase(Attributes::PLAYER_MANNER, - msg.readInt16("manner")); - msg.readInt16("unused?"); - BLOCK_END("PlayerRecv::processPlayerStatUpdate5") -} - -void PlayerRecv::processWalkResponse(Net::MessageIn &msg) -{ - BLOCK_START("PlayerRecv::processWalkResponse") - /* - * This client assumes that all walk messages succeed, - * and that the server will send a correction notice - * otherwise. - */ - uint16_t srcX, srcY, dstX, dstY; - msg.readInt32("tick"); - msg.readCoordinatePair(srcX, srcY, dstX, dstY, "move path"); - msg.readUInt8("unused"); - if (localPlayer != nullptr) - localPlayer->setRealPos(dstX, dstY); - BLOCK_END("PlayerRecv::processWalkResponse") -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/playerrecv.h b/src/net/tmwa/playerrecv.h deleted file mode 100644 index 626114640..000000000 --- a/src/net/tmwa/playerrecv.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_PLAYERRECV_H -#define NET_TMWA_PLAYERRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace TmwAthena -{ - namespace PlayerRecv - { - void processPlayerStatUpdate5(Net::MessageIn &msg); - void processWalkResponse(Net::MessageIn &msg); - } // namespace PlayerRecv -} // namespace TmwAthena - -#endif // NET_TMWA_PLAYERRECV_H diff --git a/src/net/tmwa/protocolout.cpp b/src/net/tmwa/protocolout.cpp deleted file mode 100644 index 38cee1227..000000000 --- a/src/net/tmwa/protocolout.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -namespace TmwAthena -{ -#include "net/protocoloutdefine.h" -#include "net/tmwa/packetsout.inc" -#undef packet -PROTOCOLOUT_VOID -PACKETSOUT_VOID -} // namespace TmwAthena - -#include "debug.h" diff --git a/src/net/tmwa/protocolout.h b/src/net/tmwa/protocolout.h deleted file mode 100644 index 08ce043fc..000000000 --- a/src/net/tmwa/protocolout.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_PROTOCOLOUT_H -#define NET_TMWA_PROTOCOLOUT_H - -#include "net/protocoloutinclude.h" - -#define PROTOCOLOUT_VOID - -namespace TmwAthena -{ -#include "net/tmwa/packetsout.inc" -PACKETSOUT_VOID -} // namespace TmwAthena - -#undef packet -#undef packet2 -#undef startCondition -#undef endCondition -#undef PACKETSOUT_VOID - -#endif // NET_TMWA_PROTOCOLOUT_H diff --git a/src/net/tmwa/questhandler.cpp b/src/net/tmwa/questhandler.cpp deleted file mode 100644 index 1acc60740..000000000 --- a/src/net/tmwa/questhandler.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/questhandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -QuestHandler::QuestHandler() : - Net::QuestHandler() -{ - questHandler = this; -} - -QuestHandler::~QuestHandler() -{ - questHandler = nullptr; -} - -void QuestHandler::setQeustActiveState(const int questId A_UNUSED, - const bool active A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/questhandler.h b/src/net/tmwa/questhandler.h deleted file mode 100644 index 4c56ef0c9..000000000 --- a/src/net/tmwa/questhandler.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_QUESTHANDLER_H -#define NET_TMWA_QUESTHANDLER_H - -#include "net/questhandler.h" - -namespace TmwAthena -{ - -class QuestHandler final : public Net::QuestHandler -{ - public: - QuestHandler(); - - A_DELETE_COPY(QuestHandler) - - ~QuestHandler(); - - void setQeustActiveState(const int questId, - const bool active) const override final - A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_QUESTHANDLER_H diff --git a/src/net/tmwa/questrecv.cpp b/src/net/tmwa/questrecv.cpp deleted file mode 100644 index d38012a69..000000000 --- a/src/net/tmwa/questrecv.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/questrecv.h" - -#include "gui/windows/skilldialog.h" -#include "gui/windows/questswindow.h" - -#include "net/messagein.h" - -#include "const/resources/skill.h" - -#include "debug.h" - -namespace TmwAthena -{ - -void QuestRecv::processSetQuestVar(Net::MessageIn &msg) -{ - const int var = msg.readInt16("variable"); - const int val = msg.readInt32("value"); - if (questsWindow != nullptr) - { - questsWindow->updateQuest(var, val, 0, 0, 0); - questsWindow->rebuild(true); - } - if (skillDialog != nullptr) - { - skillDialog->updateQuest(var, val, 0, 0, 0); - skillDialog->playUpdateEffect(var + SKILL_VAR_MIN_ID); - } -} - -void QuestRecv::processPlayerQuests(Net::MessageIn &msg) -{ - const int count = (msg.readInt16("len") - 4) / 6; - for (int f = 0; f < count; f ++) - { - const int var = msg.readInt16("variable"); - const int val = msg.readInt32("value"); - if (questsWindow != nullptr) - questsWindow->updateQuest(var, val, 0, 0, 0); - if (skillDialog != nullptr) - skillDialog->updateQuest(var, val, 0, 0, 0); - } - if (questsWindow != nullptr) - questsWindow->rebuild(false); -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/questrecv.h b/src/net/tmwa/questrecv.h deleted file mode 100644 index 3e9d958ea..000000000 --- a/src/net/tmwa/questrecv.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_QUESTRECV_H -#define NET_TMWA_QUESTRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace TmwAthena -{ - namespace QuestRecv - { - void processSetQuestVar(Net::MessageIn &msg); - void processPlayerQuests(Net::MessageIn &msg); - } // namespace QuestRecv -} // namespace TmwAthena - -#endif // NET_TMWA_QUESTRECV_H diff --git a/src/net/tmwa/recvpackets.inc b/src/net/tmwa/recvpackets.inc deleted file mode 100644 index 808019018..000000000 --- a/src/net/tmwa/recvpackets.inc +++ /dev/null @@ -1,32 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_RECVPACKETS_H -#define NET_TMWA_RECVPACKETS_H - -#define RECVPACKETS_VOID - -#include "net/recvpacketdefine.h" - -#include "net/tmwa/packetsin.inc" - -#undef packet - -#endif // NET_TMWA_RECVPACKETS_H diff --git a/src/net/tmwa/roulettehandler.cpp b/src/net/tmwa/roulettehandler.cpp deleted file mode 100644 index 03b1afd8a..000000000 --- a/src/net/tmwa/roulettehandler.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/roulettehandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -RouletteHandler::RouletteHandler() : - Net::RouletteHandler() -{ - rouletteHandler = this; -} - -RouletteHandler::~RouletteHandler() -{ - rouletteHandler = nullptr; -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/roulettehandler.h b/src/net/tmwa/roulettehandler.h deleted file mode 100644 index b575d3ca3..000000000 --- a/src/net/tmwa/roulettehandler.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_ROULETTEHANDLER_H -#define NET_TMWA_ROULETTEHANDLER_H - -#include "net/roulettehandler.h" - -namespace TmwAthena -{ -class RouletteHandler final : public Net::RouletteHandler -{ - public: - RouletteHandler(); - - A_DELETE_COPY(RouletteHandler) - - ~RouletteHandler(); -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_ROULETTEHANDLER_H diff --git a/src/net/tmwa/searchstorehandler.cpp b/src/net/tmwa/searchstorehandler.cpp deleted file mode 100644 index 34f41fb8a..000000000 --- a/src/net/tmwa/searchstorehandler.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/searchstorehandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -SearchStoreHandler::SearchStoreHandler() : - Net::SearchStoreHandler() -{ - searchStoreHandler = this; -} - -SearchStoreHandler::~SearchStoreHandler() -{ - searchStoreHandler = nullptr; -} - -void SearchStoreHandler::search(const StoreSearchTypeT type A_UNUSED, - const int minPrice A_UNUSED, - const int maxPrice A_UNUSED, - const int itemId A_UNUSED) const -{ -} - -void SearchStoreHandler::nextPage() const -{ -} - -void SearchStoreHandler::close() const -{ -} - -void SearchStoreHandler::select(const int accountId A_UNUSED, - const int storeId A_UNUSED, - const int itemId A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/searchstorehandler.h b/src/net/tmwa/searchstorehandler.h deleted file mode 100644 index 20112fcb1..000000000 --- a/src/net/tmwa/searchstorehandler.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_SEARCHSTOREHANDLER_H -#define NET_TMWA_SEARCHSTOREHANDLER_H - -#include "net/searchstorehandler.h" - -namespace TmwAthena -{ -class SearchStoreHandler final : public Net::SearchStoreHandler -{ - public: - SearchStoreHandler(); - - A_DELETE_COPY(SearchStoreHandler) - - ~SearchStoreHandler(); - - void search(const StoreSearchTypeT type, - const int minPrice, - const int maxPrice, - const int itemId) const override final A_CONST; - - void nextPage() const override final A_CONST; - - void close() const override final A_CONST; - - void select(const int accountId, - const int storeId, - const int itemId) const override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_SEARCHSTOREHANDLER_H diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp deleted file mode 100644 index 5af454314..000000000 --- a/src/net/tmwa/serverfeatures.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/serverfeatures.h" - -#include "debug.h" - -extern unsigned int tmwServerVersion; - -namespace TmwAthena -{ - -ServerFeatures::ServerFeatures() : - Net::ServerFeatures() -{ - serverFeatures = this; -} - -bool ServerFeatures::haveServerOnlineList() const -{ - return false; -} - -bool ServerFeatures::haveServerHp() const -{ - return tmwServerVersion > 0x0f0513; -} - -bool ServerFeatures::havePlayerStatusUpdate() const -{ - return false; -} - -bool ServerFeatures::haveIncompleteChatMessages() const -{ - return tmwServerVersion <= 0x100209; -} - -bool ServerFeatures::haveRaceSelection() const -{ - return false; -} - -bool ServerFeatures::haveLookSelection() const -{ - return false; -} - -bool ServerFeatures::haveMove3() const -{ - return tmwServerVersion >= 0x0f0512 && tmwServerVersion <= 0xf0706; -} - -bool ServerFeatures::haveCharOtherGender() const -{ - return tmwServerVersion > 0x0f0b17; -} - -bool ServerFeatures::haveMonsterAttackRange() const -{ - return tmwServerVersion >= 0x0f0513; -} - -bool ServerFeatures::haveEmailOnRegister() const -{ - return false; -} - -bool ServerFeatures::haveEmailOnDelete() const -{ - return false; -} - -bool ServerFeatures::haveServerVersion() const -{ - return true; -} - -bool ServerFeatures::haveMapServerVersion() const -{ - return false; -} - -bool ServerFeatures::haveNpcGender() const -{ - return tmwServerVersion >= 0x0f0513; -} - -bool ServerFeatures::haveJoinChannel() const -{ - return false; -} - -bool ServerFeatures::haveCreateCharGender() const -{ - return tmwServerVersion > 0x0f0b17; -} - -bool ServerFeatures::haveTalkPet() const -{ - return true; -} - -bool ServerFeatures::haveMovePet() const -{ - return true; -} - -bool ServerFeatures::haveServerWarpNames() const -{ - return false; -} - -bool ServerFeatures::haveExtendedRiding() const -{ - return false; -} - -bool ServerFeatures::haveExtendedDropsPosition() const -{ - return false; -} - -bool ServerFeatures::haveMoveWhileSit() const -{ - return true; -} - -bool ServerFeatures::haveKillerId() const -{ - return false; -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h deleted file mode 100644 index 95371c1b3..000000000 --- a/src/net/tmwa/serverfeatures.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_SERVERFEATURES_H -#define NET_TMWA_SERVERFEATURES_H - -#include "net/serverfeatures.h" - -#include "localconsts.h" - -namespace TmwAthena -{ -class ServerFeatures final : public Net::ServerFeatures -{ - public: - ServerFeatures(); - - A_DELETE_COPY(ServerFeatures) - - bool haveServerOnlineList() const override final A_CONST; - - bool haveServerHp() const override final; - - bool havePlayerStatusUpdate() const override final A_CONST; - - bool haveIncompleteChatMessages() const override final; - - bool haveRaceSelection() const override final A_CONST; - - bool haveLookSelection() const override final A_CONST; - - bool haveMove3() const override final; - - bool haveCharOtherGender() const override final; - - bool haveMonsterAttackRange() const override final; - - bool haveEmailOnRegister() const override final A_CONST; - - bool haveEmailOnDelete() const override final A_CONST; - - bool haveServerVersion() const override final A_CONST; - - bool haveMapServerVersion() const override final A_CONST; - - bool haveNpcGender() const override final; - - bool haveJoinChannel() const override final A_CONST; - - bool haveCreateCharGender() const override final; - - bool haveTalkPet() const override final A_CONST; - - bool haveMovePet() const override final A_CONST; - - bool haveServerWarpNames() const override final A_CONST; - - bool haveExtendedRiding() const override final A_CONST; - - bool haveExtendedDropsPosition() const override final A_CONST; - - bool haveMoveWhileSit() const override final A_CONST; - - bool haveKillerId() const override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_SERVERFEATURES_H diff --git a/src/net/tmwa/skillhandler.cpp b/src/net/tmwa/skillhandler.cpp deleted file mode 100644 index 9f8de7b2f..000000000 --- a/src/net/tmwa/skillhandler.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/skillhandler.h" - -#include "net/tmwa/messageout.h" -#include "net/tmwa/protocolout.h" - -#include "debug.h" - -namespace TmwAthena -{ - -SkillHandler::SkillHandler() : - Ea::SkillHandler() -{ - skillHandler = this; -} - -SkillHandler::~SkillHandler() -{ - skillHandler = nullptr; -} - -void SkillHandler::useBeing(const int id, const int level, - const BeingId beingId) const -{ - createOutPacket(CMSG_SKILL_USE_BEING); - outMsg.writeInt16(CAST_S16(id), "skill id"); - outMsg.writeInt16(CAST_S16(level), "level"); - outMsg.writeBeingId(beingId, "target id"); -} - -void SkillHandler::usePos(const int id, const int level, - const int x, const int y) const -{ - createOutPacket(CMSG_SKILL_USE_POSITION); - outMsg.writeInt16(CAST_S16(level), "skill level"); - outMsg.writeInt16(CAST_S16(id), "skill id"); - outMsg.writeInt16(CAST_S16(x), "x"); - outMsg.writeInt16(CAST_S16(y), "y"); -} - -void SkillHandler::usePos(const int id, const int level, - const int x, const int y, - const std::string &text) const -{ - createOutPacket(CMSG_SKILL_USE_POSITION_MORE); - outMsg.writeInt16(CAST_S16(level), "skill level"); - outMsg.writeInt16(CAST_S16(id), "skill id"); - outMsg.writeInt16(CAST_S16(x), "x"); - outMsg.writeInt16(CAST_S16(y), "y"); - outMsg.writeString(text, 80, "text"); -} - -void SkillHandler::useMap(const int id, const std::string &map) const -{ - createOutPacket(CMSG_SKILL_USE_MAP); - outMsg.writeInt16(CAST_S16(id), "skill id"); - outMsg.writeString(map, 16, "map name"); -} - -void SkillHandler::getAlchemistRanks() const -{ -} - -void SkillHandler::getBlacksmithRanks() const -{ -} - -void SkillHandler::getPkRanks() const -{ -} - -void SkillHandler::getTaekwonRanks() const -{ -} - -void SkillHandler::feelSaveOk(const int which A_UNUSED) const -{ -} - -void SkillHandler::lessEffects(const bool isLess A_UNUSED) const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/skillhandler.h b/src/net/tmwa/skillhandler.h deleted file mode 100644 index 324774bea..000000000 --- a/src/net/tmwa/skillhandler.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_SKILLHANDLER_H -#define NET_TMWA_SKILLHANDLER_H - -#include "net/ea/skillhandler.h" - -namespace TmwAthena -{ - -class SkillHandler final : public Ea::SkillHandler -{ - public: - SkillHandler(); - - A_DELETE_COPY(SkillHandler) - - ~SkillHandler(); - - void useBeing(const int id, - const int level, - const BeingId beingId) const override final; - - void usePos(const int id, - const int level, - const int x, const int y) const override final; - - void usePos(const int id, - const int level, - const int x, const int y, - const std::string &text) const override final; - - void useMap(const int id, const std::string &map) const override final; - - void getAlchemistRanks() const override final; - - void getBlacksmithRanks() const override final; - - void getPkRanks() const override final; - - void getTaekwonRanks() const override final; - - void feelSaveOk(const int which) const override final; - - void lessEffects(const bool isLess) const override final; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_SKILLHANDLER_H diff --git a/src/net/tmwa/skillrecv.cpp b/src/net/tmwa/skillrecv.cpp deleted file mode 100644 index faea79059..000000000 --- a/src/net/tmwa/skillrecv.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/skillrecv.h" - -#include "notifymanager.h" - -#include "being/localplayer.h" -#include "being/playerinfo.h" - -#include "const/net/skill.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/skilldialog.h" - -#include "net/messagein.h" - -#include "utils/gettext.h" - -#include "debug.h" - -namespace TmwAthena -{ - -void SkillRecv::processPlayerSkills(Net::MessageIn &msg) -{ - msg.readInt16("len"); - const int skillCount = (msg.getLength() - 4) / 37; - int updateSkill = 0; - - for (int k = 0; k < skillCount; k++) - { - const int skillId = msg.readInt16("skill id"); - const SkillType::SkillType inf = static_cast<SkillType::SkillType>( - msg.readInt16("inf")); - msg.readInt16("skill pool flags"); - const int level = msg.readInt16("skill level"); - const int sp = msg.readInt16("sp"); - const int range = msg.readInt16("range"); - msg.skip(24, "unused"); - const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); - const int oldLevel = PlayerInfo::getSkillLevel(skillId); - if ((oldLevel != 0) && oldLevel != level) - updateSkill = skillId; - PlayerInfo::setSkillLevel(skillId, level); - if (skillDialog != nullptr) - { - if (!skillDialog->updateSkill(skillId, range, up, inf, sp)) - { - skillDialog->addSkill(SkillOwner::Player, - skillId, "", level, range, up, inf, sp); - } - } - } - if (skillDialog != nullptr) - { - skillDialog->update(); - if (updateSkill != 0) - skillDialog->playUpdateEffect(updateSkill); - } -} - -void SkillRecv::processSkillFailed(Net::MessageIn &msg) -{ - // Action failed (ex. sit because you have not reached the - // right level) - const int skillId = msg.readInt16("skill id"); - const int16_t bskill = msg.readInt16("bskill"); - msg.readInt16("btype"); - const signed char success = msg.readUInt8("success"); - const signed char reason = msg.readUInt8("reason"); - if (success != CAST_S32(SKILL_FAILED) - && bskill == CAST_S32(BSKILL_EMOTE)) - { - logger->log("Action: %d/%d", bskill, success); - } - - std::string txt; - if (success == CAST_S32(SKILL_FAILED) - && skillId == CAST_S32(SKILL_BASIC)) - { - if ((localPlayer != nullptr) && - bskill == CAST_S32(BSKILL_EMOTE) && - reason == CAST_S32(RFAIL_SKILLDEP)) - { - localPlayer->stopAdvert(); - } - - switch (bskill) - { - case BSKILL_TRADE: - // TRANSLATORS: error message - txt = _("Trade failed!"); - break; - case BSKILL_EMOTE: - // TRANSLATORS: error message - txt = _("Emote failed!"); - break; - case BSKILL_SIT: - // TRANSLATORS: error message - txt = _("Sit failed!"); - break; - case BSKILL_CREATECHAT: - // TRANSLATORS: error message - txt = _("Chat creating failed!"); - break; - case BSKILL_JOINPARTY: - // TRANSLATORS: error message - txt = _("Could not join party!"); - break; - case BSKILL_SHOUT: - // TRANSLATORS: error message - txt = _("Cannot shout!"); - break; - default: - UNIMPLEMENTEDPACKETFIELD(bskill); - break; - } - - txt.append(" "); - - switch (reason) - { - case RFAIL_SKILLDEP: - // TRANSLATORS: error message - txt.append(_("You have not yet reached a high enough lvl!")); - break; - case RFAIL_INSUFHP: - // TRANSLATORS: error message - txt.append(_("Insufficient HP!")); - break; - case RFAIL_INSUFSP: - // TRANSLATORS: error message - txt.append(_("Insufficient SP!")); - break; - case RFAIL_NOMEMO: - // TRANSLATORS: error message - txt.append(_("You have no memos!")); - break; - case RFAIL_SKILLDELAY: - // TRANSLATORS: error message - txt.append(_("You cannot do that right now!")); - break; - case RFAIL_ZENY: - // TRANSLATORS: error message - txt.append(_("Seems you need more money... ;-)")); - break; - case RFAIL_WEAPON: - // TRANSLATORS: error message - txt.append(_("You cannot use this skill with that " - "kind of weapon!")); - break; - case RFAIL_REDGEM: - // TRANSLATORS: error message - txt.append(_("You need another red gem!")); - break; - case RFAIL_BLUEGEM: - // TRANSLATORS: error message - txt.append(_("You need another blue gem!")); - break; - case RFAIL_OVERWEIGHT: - // TRANSLATORS: error message - txt.append(_("You're carrying to much to do this!")); - break; - default: - // TRANSLATORS: error message - txt.append(_("Huh? What's that?")); - UNIMPLEMENTEDPACKETFIELD(reason); - break; - } - } - else - { - switch (skillId) - { - case SKILL_WARP : - // TRANSLATORS: error message - txt = _("Warp failed..."); - break; - case SKILL_STEAL : - // TRANSLATORS: error message - txt = _("Could not steal anything..."); - break; - case SKILL_ENVENOM : - // TRANSLATORS: error message - txt = _("Poison had no effect..."); - break; - default: - UNIMPLEMENTEDPACKETFIELD(skillId); - break; - } - } - - NotifyManager::notify(NotifyTypes::SKILL_FAIL_MESSAGE, txt); -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/skillrecv.h b/src/net/tmwa/skillrecv.h deleted file mode 100644 index f63d883c2..000000000 --- a/src/net/tmwa/skillrecv.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_SKILLRECV_H -#define NET_TMWA_SKILLRECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace TmwAthena -{ - namespace SkillRecv - { - void processSkillFailed(Net::MessageIn &msg); - void processPlayerSkills(Net::MessageIn &msg); - } // namespace SkillRecv -} // namespace TmwAthena - -#endif // NET_TMWA_SKILLRECV_H diff --git a/src/net/tmwa/sp.h b/src/net/tmwa/sp.h deleted file mode 100644 index 10711bfce..000000000 --- a/src/net/tmwa/sp.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_SP_H -#define NET_TMWA_SP_H - -namespace Sp -{ - enum - { - SPEED = 0, - BASEEXP = 1, - JOBEXP = 2, - KARMA = 3, - MANNER = 4, - HP = 5, - MAXHP = 6, - SP = 7, - MAXSP = 8, - STATUSPOINT = 9, - BASELEVEL = 11, - SKILLPOINT = 12, - STR = 13, - AGI = 14, - VIT = 15, - INT = 16, - DEX = 17, - LUK = 18, - CLASS = 19, - ZENY = 20, - SEX = 21, - NEXTBASEEXP = 22, - JOB_MOD = 23, // SP_NEXTJOBEXP - WEIGHT = 24, - MAXWEIGHT = 25, - USTR = 32, - UAGI = 33, - UVIT = 34, - UINT = 35, - UDEX = 36, - ULUK = 37, - ATK1 = 41, - ATK2 = 42, - MATK1 = 43, - MATK2 = 44, - DEF1 = 45, - DEF2 = 46, - MDEF1 = 47, - MDEF2 = 48, - HIT = 49, - FLEE1 = 50, - FLEE2 = 51, - CRITICAL = 52, - ASPD = 53, - JOBLEVEL = 55, - - GM_LEVEL = 500 - }; -} // namespace Sp - -#endif // NET_TMWA_SP_H diff --git a/src/net/tmwa/sprite.h b/src/net/tmwa/sprite.h deleted file mode 100644 index 97cdada4c..000000000 --- a/src/net/tmwa/sprite.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_SPRITE_H -#define NET_TMWA_SPRITE_H - -enum -{ - SPRITE_BASE = 0, - SPRITE_HAIR, - SPRITE_WEAPON, - SPRITE_HEAD_BOTTOM, - SPRITE_HEAD_TOP, - SPRITE_HEAD_MID, - SPRITE_HAIR_COLOR, - SPRITE_CLOTHES_COLOR, - SPRITE_SHIELD, - SPRITE_SHOES, - SPRITE_BODY, - SPRITE_FLOOR, - SPRITE_ROBE, - SPRITE_EVOL2, - SPRITE_VECTOREND -}; - -#endif // NET_TMWA_SPRITE_H diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp deleted file mode 100644 index f82612bd0..000000000 --- a/src/net/tmwa/tradehandler.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/tradehandler.h" - -#include "being/playerinfo.h" - -#include "const/net/inventory.h" - -#include "net/tmwa/messageout.h" -#include "net/tmwa/protocolout.h" - -#include "resources/item/item.h" - -#include "debug.h" - -extern std::string tradePartnerName; - -namespace TmwAthena -{ - -TradeHandler::TradeHandler() : - Ea::TradeHandler() -{ - tradeHandler = this; -} - -TradeHandler::~TradeHandler() -{ - tradeHandler = nullptr; -} - -void TradeHandler::request(const Being *const being) const -{ - if (being == nullptr) - return; - - createOutPacket(CMSG_TRADE_REQUEST); - outMsg.writeBeingId(being->getId(), "player id"); -} - -void TradeHandler::respond(const bool accept) const -{ - if (!accept) - PlayerInfo::setTrading(Trading_false); - - createOutPacket(CMSG_TRADE_RESPONSE); - outMsg.writeInt8(CAST_S8(accept ? 3 : 4), "accept"); -} - -void TradeHandler::addItem(const Item *const item, const int amount) const -{ - if (item == nullptr) - return; - - createOutPacket(CMSG_TRADE_ITEM_ADD_REQUEST); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); - outMsg.writeInt32(amount, "amount"); -} - -void TradeHandler::setMoney(const int amount) const -{ - createOutPacket(CMSG_TRADE_ITEM_ADD_REQUEST); - outMsg.writeInt16(0, "index"); - outMsg.writeInt32(amount, "amount"); -} - -void TradeHandler::confirm() const -{ - createOutPacket(CMSG_TRADE_ADD_COMPLETE); -} - -void TradeHandler::finish() const -{ - createOutPacket(CMSG_TRADE_OK); -} - -void TradeHandler::cancel() const -{ - createOutPacket(CMSG_TRADE_CANCEL_REQUEST); -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/tradehandler.h b/src/net/tmwa/tradehandler.h deleted file mode 100644 index b8538f1bc..000000000 --- a/src/net/tmwa/tradehandler.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_TRADEHANDLER_H -#define NET_TMWA_TRADEHANDLER_H - -#include "net/ea/tradehandler.h" - -namespace TmwAthena -{ - -class TradeHandler final : public Ea::TradeHandler -{ - public: - TradeHandler(); - - A_DELETE_COPY(TradeHandler) - - ~TradeHandler(); - - void request(const Being *const being) const override final; - - void respond(const bool accept) const override final; - - void addItem(const Item *const item, - const int amount) const override final; - - void setMoney(const int amount) const override final; - - void confirm() const override final; - - void finish() const override final; - - void cancel() const override final; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_TRADEHANDLER_H diff --git a/src/net/tmwa/traderecv.cpp b/src/net/tmwa/traderecv.cpp deleted file mode 100644 index d799d9f91..000000000 --- a/src/net/tmwa/traderecv.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/traderecv.h" - -#include "notifymanager.h" - -#include "being/playerinfo.h" -#include "being/playerrelation.h" -#include "being/playerrelations.h" - -#include "const/net/inventory.h" - -#include "enums/resources/notifytypes.h" - -#include "gui/windows/tradewindow.h" - -#include "net/messagein.h" -#include "net/tradehandler.h" - -#include "net/ea/traderecv.h" - -#include "resources/inventory/inventory.h" - -#include "resources/item/item.h" - -#include "utils/stringutils.h" - -#include "debug.h" - -extern std::string tradePartnerName; - -namespace TmwAthena -{ - -void TradeRecv::processTradeRequest(Net::MessageIn &msg) -{ - Ea::TradeRecv::processTradeRequestContinue(msg.readString(24, "name")); -} - -void TradeRecv::processTradeItemAdd(Net::MessageIn &msg) -{ - const int amount = msg.readInt32("amount"); - const int type = msg.readInt16("type"); - const uint8_t identify = msg.readUInt8("identify"); - msg.readUInt8("attribute"); - const uint8_t refine = msg.readUInt8("refine"); - int cards[maxCards]; - for (int f = 0; f < maxCards; f++) - cards[f] = msg.readUInt16("card"); - - if (tradeWindow != nullptr) - { - if (type == 0) - { - tradeWindow->setMoney(amount); - } - else - { - tradeWindow->addItem2(type, - ItemType::Unknown, - cards, - nullptr, - 4, - false, - amount, - refine, - ItemColor_one, - fromBool(identify, Identified), - Damaged_false, - Favorite_false, - Equipm_false); - } - } -} - -void TradeRecv::processTradeItemAddResponse(Net::MessageIn &msg) -{ - // Trade: New Item add response (was 0x00ea, now 01b1) - const int index = msg.readInt16("index") - INVENTORY_OFFSET; - Item *item = nullptr; - if (PlayerInfo::getInventory() != nullptr) - item = PlayerInfo::getInventory()->getItem(index); - - if (item == nullptr) - { - if (tradeWindow != nullptr) - tradeWindow->receivedOk(true); - return; - } - const int quantity = msg.readInt16("amount"); - - const uint8_t res = msg.readUInt8("status"); - switch (res) - { - case 0: - // Successfully added item - if (tradeWindow != nullptr) - { - tradeWindow->addItem2(item->getId(), - item->getType(), - item->getCards(), - nullptr, - 4, - true, - quantity, - item->getRefine(), - item->getColor(), - item->getIdentified(), - item->getDamaged(), - item->getFavorite(), - item->isEquipment()); - } - item->increaseQuantity(-quantity); - break; - case 1: - // Add item failed - player overweighted - NotifyManager::notify(NotifyTypes:: - TRADE_ADD_PARTNER_OVER_WEIGHT); - break; - case 2: - // Add item failed - player has no free slot - NotifyManager::notify(NotifyTypes::TRADE_ADD_PARTNER_NO_SLOTS); - break; - case 3: - // Add item failed - non tradable item - NotifyManager::notify(NotifyTypes::TRADE_ADD_UNTRADABLE_ITEM); - break; - default: - NotifyManager::notify(NotifyTypes::TRADE_ADD_ERROR); - UNIMPLEMENTEDPACKETFIELD(res); - logger->log("QQQ SMSG_TRADE_ITEM_ADD_RESPONSE: " - + toString(res)); - break; - } -} - -void TradeRecv::processTradeResponse(Net::MessageIn &msg) -{ - if (tradePartnerName.empty() || - !playerRelations.hasPermission(tradePartnerName, - PlayerRelation::TRADE)) - { - tradeHandler->respond(false); - return; - } - const uint8_t type = msg.readUInt8("type"); - Ea::TradeRecv::processTradeResponseContinue(type); -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/traderecv.h b/src/net/tmwa/traderecv.h deleted file mode 100644 index 253348dab..000000000 --- a/src/net/tmwa/traderecv.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_TRADERECV_H -#define NET_TMWA_TRADERECV_H - -namespace Net -{ - class MessageIn; -} // namespace Net - -namespace TmwAthena -{ - namespace TradeRecv - { - void processTradeRequest(Net::MessageIn &msg); - void processTradeItemAdd(Net::MessageIn &msg); - void processTradeItemAddResponse(Net::MessageIn &msg); - void processTradeResponse(Net::MessageIn &msg); - } // namespace TradeRecv -} // namespace TmwAthena - -#endif // NET_TMWA_TRADERECV_H diff --git a/src/net/tmwa/updateprotocol.cpp b/src/net/tmwa/updateprotocol.cpp deleted file mode 100644 index 3928cc101..000000000 --- a/src/net/tmwa/updateprotocol.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/updateprotocol.h" - -#include "net/tmwa/network.h" -#include "net/tmwa/protocolout.h" - -#include "debug.h" - -namespace TmwAthena -{ - -void updateProtocol() -{ -#define PACKETS_UPDATE -#include "net/protocoloutupdate.h" -#include "net/tmwa/packetsout.inc" -#undef packet - Network *const network = Network::mInstance; - if (network != nullptr) - { - network->clearHandlers(); - network->registerHandlers(); - } -} - -PACKETSOUT_VOID -PROTOCOLOUTUPDATE_VOID -PROTOCOLOUT_VOID - -} // namespace TmwAthena diff --git a/src/net/tmwa/updateprotocol.h b/src/net/tmwa/updateprotocol.h deleted file mode 100644 index f460f2c7c..000000000 --- a/src/net/tmwa/updateprotocol.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_UPDATEPROTOCOL_H -#define NET_TMWA_UPDATEPROTOCOL_H - -namespace TmwAthena -{ - void updateProtocol(); -} // namespace TmwAthena - -#endif // NET_TMWA_UPDATEPROTOCOL_H diff --git a/src/net/tmwa/vendinghandler.cpp b/src/net/tmwa/vendinghandler.cpp deleted file mode 100644 index 30237cb0e..000000000 --- a/src/net/tmwa/vendinghandler.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/tmwa/vendinghandler.h" - -#include "debug.h" - -namespace TmwAthena -{ - -VendingHandler::VendingHandler() -{ - vendingHandler = this; -} - -VendingHandler::~VendingHandler() -{ - vendingHandler = nullptr; -} - -void VendingHandler::close() const -{ -} - -void VendingHandler::open(const Being *const being A_UNUSED) const -{ -} - -void VendingHandler::buy(const Being *const being A_UNUSED, - const int index A_UNUSED, - const int amount A_UNUSED) const -{ -} - -void VendingHandler::buyItems(const Being *const being A_UNUSED, - const STD_VECTOR<ShopItem*> &items A_UNUSED) - const -{ -} - -void VendingHandler::buy2(const Being *const being A_UNUSED, - const int vendId A_UNUSED, - const int index A_UNUSED, - const int amount A_UNUSED) const -{ -} - -void VendingHandler::createShop(const std::string &name A_UNUSED, - const bool flag A_UNUSED, - const STD_VECTOR<ShopItem*> &items A_UNUSED) - const -{ -} - -} // namespace TmwAthena diff --git a/src/net/tmwa/vendinghandler.h b/src/net/tmwa/vendinghandler.h deleted file mode 100644 index 3af4a110b..000000000 --- a/src/net/tmwa/vendinghandler.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TMWA_VENDINGHANDLER_H -#define NET_TMWA_VENDINGHANDLER_H - -#include "net/vendinghandler.h" - -namespace TmwAthena -{ - -class VendingHandler final : public Net::VendingHandler -{ - public: - VendingHandler(); - - A_DELETE_COPY(VendingHandler) - - ~VendingHandler(); - - void close() const override final A_CONST; - - void open(const Being *const being) const override final A_CONST; - - void buy(const Being *const being, - const int index, - const int amount) const override final A_CONST; - - void buyItems(const Being *const being, - const STD_VECTOR<ShopItem*> &items) const - override final A_CONST; - - void buy2(const Being *const being, - const int vendId, - const int index, - const int amount) const override final A_CONST; - - void createShop(const std::string &name, - const bool flag, - const STD_VECTOR<ShopItem*> &items) const - override final A_CONST; -}; - -} // namespace TmwAthena - -#endif // NET_TMWA_VENDINGHANDLER_H diff --git a/src/net/tradehandler.h b/src/net/tradehandler.h deleted file mode 100644 index ca125da53..000000000 --- a/src/net/tradehandler.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_TRADEHANDLER_H -#define NET_TRADEHANDLER_H - -#include "being/being.h" - -#include "localconsts.h" - -class Item; - -namespace Net -{ -class TradeHandler notfinal -{ - public: - TradeHandler() - { } - - A_DELETE_COPY(TradeHandler) - - virtual ~TradeHandler() - { } - - virtual void request(const Being *const being A_UNUSED) const - { } - - virtual void respond(const bool accept A_UNUSED) const - { } - - virtual void addItem(const Item *const item A_UNUSED, - const int amount A_UNUSED) const - { } - - virtual void removeItem(const int slotNum A_UNUSED, - const int amount A_UNUSED) const - { } - - virtual void setMoney(const int amount A_UNUSED) const - { } - - virtual void confirm() const - { } - - virtual void finish() const - { } - - virtual void cancel() const - { } -}; - -} // namespace Net - -extern Net::TradeHandler *tradeHandler; - -#endif // NET_TRADEHANDLER_H diff --git a/src/net/updatetypeoperators.cpp b/src/net/updatetypeoperators.cpp deleted file mode 100644 index 1ee52455c..000000000 --- a/src/net/updatetypeoperators.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/updatetypeoperators.h" - -#include "utils/cast.h" - -#include "debug.h" - -int operator&(const UpdateTypeT &a, const UpdateTypeT &b) -{ - return CAST_S32(a) & CAST_S32(b); -} - -int operator|(const UpdateTypeT &a, const UpdateTypeT &b) -{ - return CAST_S32(a) | CAST_S32(b); -} - -int operator|(const int &a, const UpdateTypeT &b) -{ - return a | CAST_S32(b); -} diff --git a/src/net/updatetypeoperators.h b/src/net/updatetypeoperators.h deleted file mode 100644 index 93a062088..000000000 --- a/src/net/updatetypeoperators.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_UPDATETYPEOPERATORS_H -#define NET_UPDATETYPEOPERATORS_H - -#include "enums/net/updatetype.h" - -int operator&(const UpdateTypeT &a, const UpdateTypeT &b); -int operator|(const UpdateTypeT &a, const UpdateTypeT &b); -int operator|(const int &a, const UpdateTypeT &b); - -#endif // NET_UPDATETYPEOPERATORS_H diff --git a/src/net/uploadcharinfo.h b/src/net/uploadcharinfo.h deleted file mode 100644 index 7a11de0a8..000000000 --- a/src/net/uploadcharinfo.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_UPLOADCHARINFO_H -#define NET_UPLOADCHARINFO_H - -#include <string> - -#include "localconsts.h" - -class ChatTab; - -namespace Net -{ - class Download; -} // namespace Net - -struct UploadChatInfo final -{ - UploadChatInfo() : - tab(nullptr), - upload(nullptr), - text(), - addStr() - { } - - A_DELETE_COPY(UploadChatInfo) - - ChatTab *tab; - Net::Download *upload; - std::string text; - std::string addStr; -}; - -#endif // NET_UPLOADCHARINFO_H diff --git a/src/net/useragent.cpp b/src/net/useragent.cpp deleted file mode 100644 index c08c68cda..000000000 --- a/src/net/useragent.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "net/useragent.h" - -#include "configuration.h" -#include "settings.h" -#include "main.h" - -#include "render/graphics.h" - -#include "debug.h" - -void UserAgent::update() -{ - std::string renderName; - if (mainGraphics != nullptr) - renderName = mainGraphics->getName(); - else - renderName = "unknown"; - - settings.userAgent = strprintf(PACKAGE_EXTENDED_VERSION, - branding.getStringValue("appName").c_str(), - renderName.c_str()); -} diff --git a/src/net/useragent.h b/src/net/useragent.h deleted file mode 100644 index f6c5aea32..000000000 --- a/src/net/useragent.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_USERAGENT_H -#define NET_USERAGENT_H - -#include "localconsts.h" - -namespace UserAgent -{ - void update(); -} // namespace UserAgent - -#endif // NET_USERAGENT_H diff --git a/src/net/vendinghandler.h b/src/net/vendinghandler.h deleted file mode 100644 index b5653163b..000000000 --- a/src/net/vendinghandler.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_VENDINGHANDLER_H -#define NET_VENDINGHANDLER_H - -#include "utils/vector.h" - -#include <string> - -#include "localconsts.h" - -class Being; -class ShopItem; - -namespace Net -{ - -class VendingHandler notfinal -{ - public: - VendingHandler() - { } - - A_DELETE_COPY(VendingHandler) - - virtual ~VendingHandler() - { } - - virtual void close() const = 0; - - virtual void open(const Being *const being) const = 0; - - virtual void buy(const Being *const being, - const int index, - const int amount) const = 0; - - virtual void buyItems(const Being *const being, - const STD_VECTOR<ShopItem*> &items) const = 0; - - virtual void buy2(const Being *const being, - const int vendId, - const int index, - const int amount) const = 0; - - virtual void createShop(const std::string &name, - const bool flag, - const STD_VECTOR<ShopItem*> &items) const = 0; -}; - -} // namespace Net - -extern Net::VendingHandler *vendingHandler; - -#endif // NET_VENDINGHANDLER_H diff --git a/src/net/worldinfo.h b/src/net/worldinfo.h deleted file mode 100644 index 8ba2615e7..000000000 --- a/src/net/worldinfo.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef NET_WORLDINFO_H -#define NET_WORLDINFO_H - -#include "utils/vector.h" - -#if defined(__GXX_EXPERIMENTAL_CXX0X__) -#if defined(__APPLE__) -#include <tr1/cstdint> -#endif // defined(__APPLE__) -#endif // defined(__GXX_EXPERIMENTAL_CXX0X__) - -#include <string> - -#include "localconsts.h" - -struct WorldInfo final -{ - WorldInfo() : - address(0), - name(), - port(0), - online_users(0), - updateHost() - { - } - - A_DELETE_COPY(WorldInfo) - - int address; - std::string name; - uint16_t port; - int online_users; - std::string updateHost; -}; - -typedef STD_VECTOR<WorldInfo*> Worlds; - -#endif // NET_WORLDINFO_H |