From 29181589eb79d3afdf337e2517b4fa43d8bbdd59 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 10 Feb 2018 02:22:04 +0300 Subject: Rename clanInfo into localClan. --- src/CMakeLists.txt | 4 +-- src/Makefile.am | 4 +-- src/being/claninfo.cpp | 25 --------------- src/being/claninfo.h | 72 ------------------------------------------- src/being/localclan.cpp | 25 +++++++++++++++ src/being/localclan.h | 72 +++++++++++++++++++++++++++++++++++++++++++ src/net/eathena/clanrecv.cpp | 18 +++++------ src/progs/manaplus/client.cpp | 4 +-- 8 files changed, 112 insertions(+), 112 deletions(-) delete mode 100644 src/being/claninfo.cpp delete mode 100644 src/being/claninfo.h create mode 100644 src/being/localclan.cpp create mode 100644 src/being/localclan.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2cc8313d8..84f22491b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1053,8 +1053,8 @@ SET(SRCS being/beingspeech.h being/castingeffect.cpp being/castingeffect.h - being/claninfo.cpp - being/claninfo.h + being/localclan.cpp + being/localclan.h beingequipbackend.cpp beingequipbackend.h spellmanager.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 972892ceb..95168fdb1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1022,8 +1022,8 @@ SRC = ${BASE_SRC} \ being/beingspeech.h \ being/castingeffect.cpp \ being/castingeffect.h \ - being/claninfo.cpp \ - being/claninfo.h \ + being/localclan.cpp \ + being/localclan.h \ being/localplayer.cpp \ being/localplayer.h \ being/mercenaryinfo.h \ diff --git a/src/being/claninfo.cpp b/src/being/claninfo.cpp deleted file mode 100644 index bba4fcd5e..000000000 --- a/src/being/claninfo.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2018 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General 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 "being/claninfo.h" - -#include "debug.h" - -ClanInfo clanInfo; diff --git a/src/being/claninfo.h b/src/being/claninfo.h deleted file mode 100644 index 307044cb3..000000000 --- a/src/being/claninfo.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2018 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General 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 BEING_CLANINFO_H -#define BEING_CLANINFO_H - -#include "enums/simpletypes/beingid.h" - -#include "utils/vector.h" - -#include - -#include "localconsts.h" - -struct ClanInfo final -{ - ClanInfo() : - allyClans(), - antagonistClans(), - name(), - masterName(), - mapName(), - id(0), - onlineMembers(0), - totalMembers(0) - { - } - - A_DELETE_COPY(ClanInfo) - - void clear() - { - allyClans.clear(); - antagonistClans.clear(); - name.clear(); - masterName.clear(); - mapName.clear(); - id = 0; - onlineMembers = 0; - totalMembers = 0; - } - - STD_VECTOR allyClans; - STD_VECTOR antagonistClans; - std::string name; - std::string masterName; - std::string mapName; - int id; - int onlineMembers; - int totalMembers; -}; - -extern ClanInfo clanInfo; - -#endif // BEING_CLANINFO_H diff --git a/src/being/localclan.cpp b/src/being/localclan.cpp new file mode 100644 index 000000000..b01c2e85e --- /dev/null +++ b/src/being/localclan.cpp @@ -0,0 +1,25 @@ +/* + * The ManaPlus Client + * Copyright (C) 2018 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 "being/localclan.h" + +#include "debug.h" + +LocalClan localClan; diff --git a/src/being/localclan.h b/src/being/localclan.h new file mode 100644 index 000000000..e8292136f --- /dev/null +++ b/src/being/localclan.h @@ -0,0 +1,72 @@ +/* + * The ManaPlus Client + * Copyright (C) 2018 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 BEING_LOCALCLAN_H +#define BEING_LOCALCLAN_H + +#include "enums/simpletypes/beingid.h" + +#include "utils/vector.h" + +#include + +#include "localconsts.h" + +struct LocalClan final +{ + LocalClan() : + allyClans(), + antagonistClans(), + name(), + masterName(), + mapName(), + id(0), + onlineMembers(0), + totalMembers(0) + { + } + + A_DELETE_COPY(LocalClan) + + void clear() + { + allyClans.clear(); + antagonistClans.clear(); + name.clear(); + masterName.clear(); + mapName.clear(); + id = 0; + onlineMembers = 0; + totalMembers = 0; + } + + STD_VECTOR allyClans; + STD_VECTOR antagonistClans; + std::string name; + std::string masterName; + std::string mapName; + int id; + int onlineMembers; + int totalMembers; +}; + +extern LocalClan localClan; + +#endif // BEING_LOCALCLAN_H diff --git a/src/net/eathena/clanrecv.cpp b/src/net/eathena/clanrecv.cpp index d70d7d876..1eebb1581 100644 --- a/src/net/eathena/clanrecv.cpp +++ b/src/net/eathena/clanrecv.cpp @@ -23,7 +23,7 @@ #include "configuration.h" #include "logger.h" -#include "being/claninfo.h" +#include "being/localclan.h" #include "gui/widgets/tabs/chat/clantab.h" @@ -42,20 +42,20 @@ namespace EAthena void ClanRecv::processClanInfo(Net::MessageIn &msg) { msg.readInt16("len"); - clanInfo.id = msg.readInt32("clan id"); - clanInfo.name = msg.readString(24, "clan name"); - clanInfo.masterName = msg.readString(24, "master name"); - clanInfo.mapName = msg.readString(16, "map name"); + localClan.id = msg.readInt32("clan id"); + localClan.name = msg.readString(24, "clan name"); + localClan.masterName = msg.readString(24, "master name"); + localClan.mapName = msg.readString(16, "map name"); const int allyCount = msg.readUInt8("ally clans count"); const int antagonistCount = msg.readUInt8("antagonist clans count"); for (int f = 0; f < allyCount; f ++) { - clanInfo.allyClans.push_back( + localClan.allyClans.push_back( msg.readString(24, "ally clan name")); } for (int f = 0; f < antagonistCount; f ++) { - clanInfo.antagonistClans.push_back( + localClan.antagonistClans.push_back( msg.readString(24, "antagonist clan name")); } createTab(); @@ -63,8 +63,8 @@ void ClanRecv::processClanInfo(Net::MessageIn &msg) void ClanRecv::processClanOnlineCount(Net::MessageIn &msg) { - clanInfo.onlineMembers = msg.readInt16("online members count"); - clanInfo.totalMembers = msg.readInt16("total members count"); + localClan.onlineMembers = msg.readInt16("online members count"); + localClan.totalMembers = msg.readInt16("total members count"); } void ClanRecv::processClanLeave(Net::MessageIn &msg A_UNUSED) diff --git a/src/progs/manaplus/client.cpp b/src/progs/manaplus/client.cpp index f1273c7a1..04956381f 100644 --- a/src/progs/manaplus/client.cpp +++ b/src/progs/manaplus/client.cpp @@ -34,7 +34,7 @@ #include "soundmanager.h" #include "spellmanager.h" -#include "being/claninfo.h" +#include "being/localclan.h" #include "being/localplayer.h" #include "being/playerinfo.h" #include "being/playerrelations.h" @@ -1986,7 +1986,7 @@ void Client::unloadData() ResourceManager::clearCache(); loginData.clearUpdateHost(); - clanInfo.clear(); + localClan.clear(); serverVersion = 0; packetVersion = 0; tmwServerVersion = 0; -- cgit v1.2.3-70-g09d2