summaryrefslogtreecommitdiff
path: root/src/net/manaserv
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-07-08 20:42:40 +0300
committerAndrei Karas <akaras@inbox.ru>2011-07-08 20:42:40 +0300
commit1fcd75140b847a0e50584fc07fc47d90c9dd9fa8 (patch)
tree5c1b23c7eabc7d421f46d40ab0bf787ef7dac49b /src/net/manaserv
parent53bc0b25c23f8f24d4119ae6fb5ba6ca0a91be19 (diff)
downloadplus-1fcd75140b847a0e50584fc07fc47d90c9dd9fa8.tar.gz
plus-1fcd75140b847a0e50584fc07fc47d90c9dd9fa8.tar.bz2
plus-1fcd75140b847a0e50584fc07fc47d90c9dd9fa8.tar.xz
plus-1fcd75140b847a0e50584fc07fc47d90c9dd9fa8.zip
Add small optimisations and fixes.
Diffstat (limited to 'src/net/manaserv')
-rw-r--r--src/net/manaserv/inventoryhandler.cpp4
-rw-r--r--src/net/manaserv/inventoryhandler.h4
-rw-r--r--src/net/manaserv/partyhandler.cpp2
-rw-r--r--src/net/manaserv/partyhandler.h11
-rw-r--r--src/net/manaserv/playerhandler.cpp8
-rw-r--r--src/net/manaserv/playerhandler.h8
6 files changed, 20 insertions, 17 deletions
diff --git a/src/net/manaserv/inventoryhandler.cpp b/src/net/manaserv/inventoryhandler.cpp
index 75823be51..5e38354fb 100644
--- a/src/net/manaserv/inventoryhandler.cpp
+++ b/src/net/manaserv/inventoryhandler.cpp
@@ -151,7 +151,7 @@ void InventoryHandler::dropItem(const Item *item, int amount)
gameServerConnection->send(msg);
}
-bool InventoryHandler::canSplit(const Item *item)
+bool InventoryHandler::canSplit(const Item *item) const
{
return item && !item->isEquipment() && item->getQuantity() > 1;
}
@@ -212,7 +212,7 @@ size_t InventoryHandler::getSize(int type) const
}
}
-int InventoryHandler::convertFromServerSlot(int eAthenaSlot)
+int InventoryHandler::convertFromServerSlot(int eAthenaSlot) const
{
return eAthenaSlot;
}
diff --git a/src/net/manaserv/inventoryhandler.h b/src/net/manaserv/inventoryhandler.h
index 6b24699b0..fbe53d735 100644
--- a/src/net/manaserv/inventoryhandler.h
+++ b/src/net/manaserv/inventoryhandler.h
@@ -84,7 +84,7 @@ class InventoryHandler : public MessageHandler, Net::InventoryHandler
void dropItem(const Item *item, int amount);
- bool canSplit(const Item *item);
+ bool canSplit(const Item *item) const;
void splitItem(const Item *item, int amount);
@@ -99,7 +99,7 @@ class InventoryHandler : public MessageHandler, Net::InventoryHandler
size_t getSize(int type) const;
- int convertFromServerSlot(int eAthenaSlot);
+ int convertFromServerSlot(int eAthenaSlot) const;
private:
EquipBackend mEquips;
diff --git a/src/net/manaserv/partyhandler.cpp b/src/net/manaserv/partyhandler.cpp
index b3d69e826..9a5f19678 100644
--- a/src/net/manaserv/partyhandler.cpp
+++ b/src/net/manaserv/partyhandler.cpp
@@ -186,7 +186,7 @@ void PartyHandler::chat(const std::string &text A_UNUSED)
// TODO
}
-void PartyHandler::requestPartyMembers()
+void PartyHandler::requestPartyMembers() const
{
//MessageOut msg(PCMSG_GUILD_GET_MEMBERS);
diff --git a/src/net/manaserv/partyhandler.h b/src/net/manaserv/partyhandler.h
index 45cc39e05..7403d0e36 100644
--- a/src/net/manaserv/partyhandler.h
+++ b/src/net/manaserv/partyhandler.h
@@ -65,13 +65,16 @@ public:
void chat(const std::string &text);
- void requestPartyMembers();
+ void requestPartyMembers() const;
- PartyShare getShareExperience() { return PARTY_SHARE_NO; }
+ PartyShare getShareExperience() const
+ { return PARTY_SHARE_NO; }
- void setShareExperience(PartyShare share A_UNUSED) {}
+ void setShareExperience(PartyShare share A_UNUSED)
+ { }
- PartyShare getShareItems() { return PARTY_SHARE_NO; }
+ PartyShare getShareItems() const
+ { return PARTY_SHARE_NO; }
void setShareItems(PartyShare share A_UNUSED) {}
private:
diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp
index 5ac058b7e..1194cb9f2 100644
--- a/src/net/manaserv/playerhandler.cpp
+++ b/src/net/manaserv/playerhandler.cpp
@@ -417,22 +417,22 @@ void PlayerHandler::ignoreAll(bool ignore A_UNUSED)
// TODO
}
-bool PlayerHandler::canUseMagic()
+bool PlayerHandler::canUseMagic() const
{
return true;
}
-bool PlayerHandler::canCorrectAttributes()
+bool PlayerHandler::canCorrectAttributes() const
{
return true;
}
-int PlayerHandler::getJobLocation()
+int PlayerHandler::getJobLocation() const
{
return -1;
}
-Vector PlayerHandler::getDefaultWalkSpeed()
+Vector PlayerHandler::getDefaultWalkSpeed() const
{
// Return translation in pixels per ticks.
return ManaServ::BeingHandler::giveSpeedInPixelsPerTicks(6.0f);
diff --git a/src/net/manaserv/playerhandler.h b/src/net/manaserv/playerhandler.h
index 2460877ec..dcd05d5fc 100644
--- a/src/net/manaserv/playerhandler.h
+++ b/src/net/manaserv/playerhandler.h
@@ -70,12 +70,12 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler
void ignorePlayer(const std::string &player, bool ignore);
void ignoreAll(bool ignore);
- bool canUseMagic();
- bool canCorrectAttributes();
+ bool canUseMagic() const;
+ bool canCorrectAttributes() const;
- int getJobLocation();
+ int getJobLocation() const;
- Vector getDefaultWalkSpeed();
+ Vector getDefaultWalkSpeed() const;
private:
void handleMapChangeMessage(Net::MessageIn &msg);