From df44755b11b98f313e79c79fb04a5726fa990ff8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 24 Aug 2015 15:01:08 +0300 Subject: Rename admin receive handler into adminrecv. --- src/CMakeLists.txt | 8 ++-- src/Makefile.am | 8 ++-- src/net/ea/admin.cpp | 44 --------------------- src/net/ea/admin.h | 41 -------------------- src/net/ea/adminrecv.cpp | 44 +++++++++++++++++++++ src/net/ea/adminrecv.h | 41 ++++++++++++++++++++ src/net/eathena/admin.cpp | 84 ---------------------------------------- src/net/eathena/admin.h | 36 ----------------- src/net/eathena/adminhandler.cpp | 12 +++--- src/net/eathena/adminrecv.cpp | 84 ++++++++++++++++++++++++++++++++++++++++ src/net/eathena/adminrecv.h | 36 +++++++++++++++++ src/net/tmwa/adminhandler.cpp | 4 +- 12 files changed, 221 insertions(+), 221 deletions(-) delete mode 100644 src/net/ea/admin.cpp delete mode 100644 src/net/ea/admin.h create mode 100644 src/net/ea/adminrecv.cpp create mode 100644 src/net/ea/adminrecv.h delete mode 100644 src/net/eathena/admin.cpp delete mode 100644 src/net/eathena/admin.h create mode 100644 src/net/eathena/adminrecv.cpp create mode 100644 src/net/eathena/adminrecv.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8a2e4879c..f4d3a0eaa 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1339,8 +1339,8 @@ SET(DYE_CMD_SRCS ) SET(SRCS_EVOL - net/ea/admin.cpp - net/ea/admin.h + net/ea/adminrecv.cpp + net/ea/adminrecv.h net/ea/adminhandler.cpp net/ea/adminhandler.h net/ea/beingnet.cpp @@ -1518,8 +1518,8 @@ SET(SRCS_EATHENA net/roulettehandler.h net/searchstorehandler.h net/vendinghandler.h - net/eathena/admin.cpp - net/eathena/admin.h + net/eathena/adminrecv.cpp + net/eathena/adminrecv.h net/eathena/adminhandler.cpp net/eathena/adminhandler.h net/eathena/auction.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 2ce4d5b80..1a55783ed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1181,8 +1181,8 @@ manaplus_SOURCES += main.cpp \ net/packetdefine.h \ net/packetlimiter.cpp \ net/packetlimiter.h \ - net/ea/admin.cpp \ - net/ea/admin.h \ + net/ea/adminrecv.cpp \ + net/ea/adminrecv.h \ net/ea/adminhandler.cpp \ net/ea/adminhandler.h \ net/ea/beingnet.cpp \ @@ -1364,8 +1364,8 @@ manaplus_SOURCES += gui/windows/bankwindow.cpp \ net/roulettehandler.h \ net/searchstorehandler.h \ net/vendinghandler.h \ - net/eathena/admin.cpp \ - net/eathena/admin.h \ + net/eathena/adminrecv.cpp \ + net/eathena/adminrecv.h \ net/eathena/adminhandler.cpp \ net/eathena/adminhandler.h \ net/eathena/auction.cpp \ diff --git a/src/net/ea/admin.cpp b/src/net/ea/admin.cpp deleted file mode 100644 index fb6973c6e..000000000 --- a/src/net/ea/admin.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-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "net/ea/admin.h" - -#include "notifymanager.h" - -#include "enums/resources/notifytypes.h" - -#include "net/messagein.h" - -#include "debug.h" - -namespace Ea -{ - -void Admin::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/admin.h b/src/net/ea/admin.h deleted file mode 100644 index c9beea3cb..000000000 --- a/src/net/ea/admin.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-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef NET_EA_ADMIN_H -#define NET_EA_ADMIN_H - -#include "localconsts.h" - -namespace Net -{ - class MessageIn; -} - -namespace Ea -{ - namespace Admin - { - void processKickAck(Net::MessageIn &msg); - } // namespace Admin -} // namespace Ea - -#endif // NET_EA_ADMIN_H diff --git a/src/net/ea/adminrecv.cpp b/src/net/ea/adminrecv.cpp new file mode 100644 index 000000000..be9345b68 --- /dev/null +++ b/src/net/ea/adminrecv.cpp @@ -0,0 +1,44 @@ +/* + * The ManaPlus Client + * Copyright (C) 2004-2009 The Mana World Development Team + * Copyright (C) 2009-2010 The Mana Developers + * Copyright (C) 2011-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#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 new file mode 100644 index 000000000..47da05c59 --- /dev/null +++ b/src/net/ea/adminrecv.h @@ -0,0 +1,41 @@ +/* + * The ManaPlus Client + * Copyright (C) 2004-2009 The Mana World Development Team + * Copyright (C) 2009-2010 The Mana Developers + * Copyright (C) 2011-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef NET_EA_ADMIN_H +#define NET_EA_ADMIN_H + +#include "localconsts.h" + +namespace Net +{ + class MessageIn; +} + +namespace Ea +{ + namespace AdminRecv + { + void processKickAck(Net::MessageIn &msg); + } // namespace Admin +} // namespace Ea + +#endif // NET_EA_ADMIN_H diff --git a/src/net/eathena/admin.cpp b/src/net/eathena/admin.cpp deleted file mode 100644 index 1a8fdd7c3..000000000 --- a/src/net/eathena/admin.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "net/eathena/admin.h" - -#include "logger.h" - -#include "being/being.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocol.h" - -#include "debug.h" - -namespace EAthena -{ - -void Admin::processAdminGetLoginAck(Net::MessageIn &msg) -{ - UNIMPLIMENTEDPACKET; - msg.readBeingId("account id"); - msg.readString(24, "login"); -} - -void Admin::processSetTileType(Net::MessageIn &msg) -{ - UNIMPLIMENTEDPACKET; - // +++ here need set collision tile for map - msg.readInt16("x"); - msg.readInt16("y"); - msg.readInt16("type"); - msg.readString(16, "map name"); -} - -void Admin::processAccountStats(Net::MessageIn &msg) -{ - UNIMPLIMENTEDPACKET; - // +++ 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/admin.h b/src/net/eathena/admin.h deleted file mode 100644 index 85fc8e546..000000000 --- a/src/net/eathena/admin.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef NET_EATHENA_ADMIN_H -#define NET_EATHENA_ADMIN_H - -#include "net/eathena/messagehandler.h" - -namespace EAthena -{ - namespace Admin - { - void processAdminGetLoginAck(Net::MessageIn &msg); - void processSetTileType(Net::MessageIn &msg); - void processAccountStats(Net::MessageIn &msg); - } // namespace Admin -} // namespace EAthena - -#endif // NET_EATHENA_ADMIN_H diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp index e44d66c60..6a938a478 100644 --- a/src/net/eathena/adminhandler.cpp +++ b/src/net/eathena/adminhandler.cpp @@ -26,9 +26,9 @@ #include "being/being.h" -#include "net/ea/admin.h" +#include "net/ea/adminrecv.h" -#include "net/eathena/admin.h" +#include "net/eathena/adminrecv.h" #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" @@ -62,16 +62,16 @@ void AdminHandler::handleMessage(Net::MessageIn &msg) switch (msg.getId()) { case SMSG_ADMIN_KICK_ACK: - Ea::Admin::processKickAck(msg); + Ea::AdminRecv::processKickAck(msg); break; case SMSG_ADMIN_GET_LOGIN_ACK: - Admin::processAdminGetLoginAck(msg); + AdminRecv::processAdminGetLoginAck(msg); break; case SMSG_ADMIN_SET_TILE_TYPE: - Admin::processSetTileType(msg); + AdminRecv::processSetTileType(msg); break; case SMSG_ADMIN_ACCOUNT_STATS: - Admin::processAccountStats(msg); + AdminRecv::processAccountStats(msg); break; default: break; diff --git a/src/net/eathena/adminrecv.cpp b/src/net/eathena/adminrecv.cpp new file mode 100644 index 000000000..e88843c79 --- /dev/null +++ b/src/net/eathena/adminrecv.cpp @@ -0,0 +1,84 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "net/eathena/adminrecv.h" + +#include "logger.h" + +#include "being/being.h" + +#include "net/eathena/messageout.h" +#include "net/eathena/protocol.h" + +#include "debug.h" + +namespace EAthena +{ + +void AdminRecv::processAdminGetLoginAck(Net::MessageIn &msg) +{ + UNIMPLIMENTEDPACKET; + msg.readBeingId("account id"); + msg.readString(24, "login"); +} + +void AdminRecv::processSetTileType(Net::MessageIn &msg) +{ + UNIMPLIMENTEDPACKET; + // +++ 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) +{ + UNIMPLIMENTEDPACKET; + // +++ 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 new file mode 100644 index 000000000..5be80e996 --- /dev/null +++ b/src/net/eathena/adminrecv.h @@ -0,0 +1,36 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef NET_EATHENA_ADMIN_H +#define NET_EATHENA_ADMIN_H + +#include "net/eathena/messagehandler.h" + +namespace EAthena +{ + namespace AdminRecv + { + void processAdminGetLoginAck(Net::MessageIn &msg); + void processSetTileType(Net::MessageIn &msg); + void processAccountStats(Net::MessageIn &msg); + } // namespace Admin +} // namespace EAthena + +#endif // NET_EATHENA_ADMIN_H diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp index 1d378a77b..834a29c43 100644 --- a/src/net/tmwa/adminhandler.cpp +++ b/src/net/tmwa/adminhandler.cpp @@ -26,7 +26,7 @@ #include "net/chathandler.h" -#include "net/ea/admin.h" +#include "net/ea/adminrecv.h" #include "net/tmwa/messageout.h" #include "net/tmwa/protocol.h" @@ -59,7 +59,7 @@ void AdminHandler::handleMessage(Net::MessageIn &msg) switch (msg.getId()) { case SMSG_ADMIN_KICK_ACK: - Ea::Admin::processKickAck(msg); + Ea::AdminRecv::processKickAck(msg); break; default: -- cgit v1.2.3-70-g09d2