summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-19 17:28:57 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-19 17:28:57 +0300
commit34e9ca0dbab79dea6819b153ee136ae8f4caaa3d (patch)
tree7e6d8b928c2a9f50ee144143eee61313ddd54cf2
parent628219ea2bfd48ad236f9c253dc412edcc8e3004 (diff)
downloadplus-34e9ca0dbab79dea6819b153ee136ae8f4caaa3d.tar.gz
plus-34e9ca0dbab79dea6819b153ee136ae8f4caaa3d.tar.bz2
plus-34e9ca0dbab79dea6819b153ee136ae8f4caaa3d.tar.xz
plus-34e9ca0dbab79dea6819b153ee136ae8f4caaa3d.zip
add static in partyhandler.
-rw-r--r--src/net/ea/partyhandler.cpp21
-rw-r--r--src/net/ea/partyhandler.h24
-rw-r--r--src/net/eathena/partyhandler.cpp10
-rw-r--r--src/net/eathena/partyhandler.h18
-rw-r--r--src/net/tmwa/partyhandler.cpp6
-rw-r--r--src/net/tmwa/partyhandler.h8
6 files changed, 45 insertions, 42 deletions
diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp
index 425ba7793..a04e4861c 100644
--- a/src/net/ea/partyhandler.cpp
+++ b/src/net/ea/partyhandler.cpp
@@ -45,11 +45,14 @@ namespace Ea
{
Party *taParty = nullptr;
+Net::PartyShare::Type PartyHandler::mShareExp = Net::PartyShare::UNKNOWN;
+Net::PartyShare::Type PartyHandler::mShareItems = Net::PartyShare::UNKNOWN;
PartyHandler::PartyHandler() :
- mShareExp(Net::PartyShare::UNKNOWN),
- mShareItems(Net::PartyShare::UNKNOWN)
+ Net::PartyHandler()
{
+ mShareExp = Net::PartyShare::UNKNOWN;
+ mShareItems = Net::PartyShare::UNKNOWN;
taParty = Party::getParty(1);
}
@@ -72,7 +75,7 @@ void PartyHandler::clear() const
taParty = nullptr;
}
-void PartyHandler::processPartyCreate(Net::MessageIn &msg) const
+void PartyHandler::processPartyCreate(Net::MessageIn &msg)
{
if (msg.readUInt8())
NotifyManager::notify(NotifyTypes::PARTY_CREATE_FAILED);
@@ -80,7 +83,7 @@ void PartyHandler::processPartyCreate(Net::MessageIn &msg) const
NotifyManager::notify(NotifyTypes::PARTY_CREATED);
}
-void PartyHandler::processPartyInvited(Net::MessageIn &msg) const
+void PartyHandler::processPartyInvited(Net::MessageIn &msg)
{
const int id = msg.readInt32();
const std::string partyName = msg.readString(24);
@@ -154,7 +157,7 @@ void PartyHandler::processPartySettingsContinue(const int16_t exp,
}
}
-void PartyHandler::processPartyMove(Net::MessageIn &msg) const
+void PartyHandler::processPartyMove(Net::MessageIn &msg)
{
const int id = msg.readInt32(); // id
PartyMember *m = nullptr;
@@ -185,7 +188,7 @@ void PartyHandler::processPartyMove(Net::MessageIn &msg) const
}
}
-void PartyHandler::processPartyLeave(Net::MessageIn &msg) const
+void PartyHandler::processPartyLeave(Net::MessageIn &msg)
{
const int id = msg.readInt32("account id");
const std::string nick = msg.readString(24, "nick");
@@ -269,7 +272,7 @@ void PartyHandler::processPartyLeave(Net::MessageIn &msg) const
}
}
-void PartyHandler::processPartyUpdateHp(Net::MessageIn &msg) const
+void PartyHandler::processPartyUpdateHp(Net::MessageIn &msg)
{
const int id = msg.readInt32();
const int hp = msg.readInt16();
@@ -292,7 +295,7 @@ void PartyHandler::processPartyUpdateHp(Net::MessageIn &msg) const
}
}
-void PartyHandler::processPartyUpdateCoords(Net::MessageIn &msg) const
+void PartyHandler::processPartyUpdateCoords(Net::MessageIn &msg)
{
const int id = msg.readInt32(); // id
PartyMember *m = nullptr;
@@ -315,7 +318,7 @@ ChatTab *PartyHandler::getTab() const
return partyTab;
}
-void PartyHandler::createTab() const
+void PartyHandler::createTab()
{
partyTab = new PartyTab(chatWindow);
if (config.getBoolValue("showChatHistory"))
diff --git a/src/net/ea/partyhandler.h b/src/net/ea/partyhandler.h
index e18e8551a..d2c82cc95 100644
--- a/src/net/ea/partyhandler.h
+++ b/src/net/ea/partyhandler.h
@@ -59,26 +59,26 @@ class PartyHandler notfinal : public Net::PartyHandler
ChatTab *getTab() const override final;
- virtual void processPartyCreate(Net::MessageIn &msg) const;
+ protected:
+ static void createTab();
- virtual void processPartyInvited(Net::MessageIn &msg) const;
+ static void processPartyCreate(Net::MessageIn &msg);
- virtual void processPartyMove(Net::MessageIn &msg) const;
+ static void processPartyInvited(Net::MessageIn &msg);
- virtual void processPartyLeave(Net::MessageIn &msg) const;
+ static void processPartyMove(Net::MessageIn &msg);
- virtual void processPartyUpdateHp(Net::MessageIn &msg) const;
+ static void processPartyLeave(Net::MessageIn &msg);
- virtual void processPartyUpdateCoords(Net::MessageIn &msg) const;
+ static void processPartyUpdateHp(Net::MessageIn &msg);
- void processPartySettingsContinue(const int16_t exp,
- const int16_t item);
+ static void processPartyUpdateCoords(Net::MessageIn &msg);
- void createTab() const;
+ static void processPartySettingsContinue(const int16_t exp,
+ const int16_t item);
- protected:
- Net::PartyShare::Type mShareExp;
- Net::PartyShare::Type mShareItems;
+ static Net::PartyShare::Type mShareExp;
+ static Net::PartyShare::Type mShareItems;
};
extern Party *taParty;
diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp
index 6b132646c..a3ccb6776 100644
--- a/src/net/eathena/partyhandler.cpp
+++ b/src/net/eathena/partyhandler.cpp
@@ -277,7 +277,7 @@ void PartyHandler::processPartySettings(Net::MessageIn &msg)
processPartySettingsContinue(exp, item);
}
-void PartyHandler::processPartyInfo(Net::MessageIn &msg) const
+void PartyHandler::processPartyInfo(Net::MessageIn &msg)
{
bool isOldParty = false;
std::set<std::string> names;
@@ -384,7 +384,7 @@ void PartyHandler::processPartyInfo(Net::MessageIn &msg) const
}
}
-void PartyHandler::processPartyMessage(Net::MessageIn &msg) const
+void PartyHandler::processPartyMessage(Net::MessageIn &msg)
{
const int msgLength = msg.readInt16() - 8;
if (msgLength <= 0)
@@ -412,7 +412,7 @@ void PartyHandler::processPartyMessage(Net::MessageIn &msg) const
}
}
-void PartyHandler::processPartyInviteResponse(Net::MessageIn &msg) const
+void PartyHandler::processPartyInviteResponse(Net::MessageIn &msg)
{
if (!partyTab)
return;
@@ -470,7 +470,7 @@ void PartyHandler::allowInvite(const bool allow) const
outMsg.writeInt8(static_cast<int8_t>(allow ? 1 : 0));
}
-void PartyHandler::processPartyItemPickup(Net::MessageIn &msg) const
+void PartyHandler::processPartyItemPickup(Net::MessageIn &msg)
{
// +++ probably need add option to show pickup notifications
// in party tab
@@ -487,7 +487,7 @@ void PartyHandler::processPartyItemPickup(Net::MessageIn &msg) const
msg.readUInt8("item type");
}
-void PartyHandler::processPartyLeader(Net::MessageIn &msg) const
+void PartyHandler::processPartyLeader(Net::MessageIn &msg)
{
PartyMember *const oldMember = Ea::taParty->getMember(
msg.readInt32("old leder id"));
diff --git a/src/net/eathena/partyhandler.h b/src/net/eathena/partyhandler.h
index bc8c550a8..c4bab0f47 100644
--- a/src/net/eathena/partyhandler.h
+++ b/src/net/eathena/partyhandler.h
@@ -63,24 +63,24 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler
void changeLeader(const std::string &name) const override final;
- void processPartySettings(Net::MessageIn &msg);
-
void allowInvite(const bool allow) const override final;
protected:
- void processPartyInvitationStats(Net::MessageIn &msg);
+ static void processPartySettings(Net::MessageIn &msg);
+
+ static void processPartyInvitationStats(Net::MessageIn &msg);
- void processPartyMemberInfo(Net::MessageIn &msg);
+ static void processPartyMemberInfo(Net::MessageIn &msg);
- void processPartyInfo(Net::MessageIn &msg) const;
+ static void processPartyInfo(Net::MessageIn &msg);
- void processPartyMessage(Net::MessageIn &msg) const;
+ static void processPartyMessage(Net::MessageIn &msg);
- void processPartyInviteResponse(Net::MessageIn &msg) const;
+ static void processPartyInviteResponse(Net::MessageIn &msg);
- void processPartyItemPickup(Net::MessageIn &msg) const;
+ static void processPartyItemPickup(Net::MessageIn &msg);
- void processPartyLeader(Net::MessageIn &msg) const;
+ static void processPartyLeader(Net::MessageIn &msg);
};
} // namespace EAthena
diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp
index e2b0c1893..72e3fcbce 100644
--- a/src/net/tmwa/partyhandler.cpp
+++ b/src/net/tmwa/partyhandler.cpp
@@ -218,7 +218,7 @@ void PartyHandler::processPartySettings(Net::MessageIn &msg)
processPartySettingsContinue(exp, item);
}
-void PartyHandler::processPartyInfo(Net::MessageIn &msg) const
+void PartyHandler::processPartyInfo(Net::MessageIn &msg)
{
bool isOldParty = false;
std::set<std::string> names;
@@ -322,7 +322,7 @@ void PartyHandler::processPartyInfo(Net::MessageIn &msg) const
}
}
-void PartyHandler::processPartyMessage(Net::MessageIn &msg) const
+void PartyHandler::processPartyMessage(Net::MessageIn &msg)
{
const int msgLength = msg.readInt16() - 8;
if (msgLength <= 0)
@@ -346,7 +346,7 @@ void PartyHandler::processPartyMessage(Net::MessageIn &msg) const
}
}
-void PartyHandler::processPartyInviteResponse(Net::MessageIn &msg) const
+void PartyHandler::processPartyInviteResponse(Net::MessageIn &msg)
{
if (!partyTab)
return;
diff --git a/src/net/tmwa/partyhandler.h b/src/net/tmwa/partyhandler.h
index 112a36d54..a6fdfdddf 100644
--- a/src/net/tmwa/partyhandler.h
+++ b/src/net/tmwa/partyhandler.h
@@ -66,13 +66,13 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler
void allowInvite(const bool allow) const override final;
protected:
- void processPartySettings(Net::MessageIn &msg);
+ static void processPartySettings(Net::MessageIn &msg);
- void processPartyInfo(Net::MessageIn &msg) const;
+ static void processPartyInfo(Net::MessageIn &msg);
- void processPartyMessage(Net::MessageIn &msg) const;
+ static void processPartyMessage(Net::MessageIn &msg);
- void processPartyInviteResponse(Net::MessageIn &msg) const;
+ static void processPartyInviteResponse(Net::MessageIn &msg);
};
} // namespace TmwAthena