summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-01 23:12:05 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-06 01:18:55 +0300
commita65ebfceea7e708adef3dd62a01c25b52800e572 (patch)
tree1e4f84c9b71710493b1269dcc74cdae443413bee /src/net
parent34f1d92ebe54d22a3bee4308eae3fc9620c27b67 (diff)
downloadmv-a65ebfceea7e708adef3dd62a01c25b52800e572.tar.gz
mv-a65ebfceea7e708adef3dd62a01c25b52800e572.tar.bz2
mv-a65ebfceea7e708adef3dd62a01c25b52800e572.tar.xz
mv-a65ebfceea7e708adef3dd62a01c25b52800e572.zip
Move processPlayerSkills from ea namespace into tmwa and eathena.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/skillhandler.cpp30
-rw-r--r--src/net/ea/skillhandler.h2
-rw-r--r--src/net/eathena/skillhandler.cpp34
-rw-r--r--src/net/eathena/skillhandler.h3
-rw-r--r--src/net/tmwa/skillhandler.cpp34
-rw-r--r--src/net/tmwa/skillhandler.h3
6 files changed, 74 insertions, 32 deletions
diff --git a/src/net/ea/skillhandler.cpp b/src/net/ea/skillhandler.cpp
index 59e8f75e8..ecf98952a 100644
--- a/src/net/ea/skillhandler.cpp
+++ b/src/net/ea/skillhandler.cpp
@@ -75,36 +75,6 @@ SkillHandler::SkillHandler()
{
}
-void SkillHandler::processPlayerSkills(Net::MessageIn &msg)
-{
- msg.readInt16(); // length
- const int skillCount = (msg.getLength() - 4) / 37;
- int updateSkill = 0;
-
- for (int k = 0; k < skillCount; k++)
- {
- const int skillId = msg.readInt16();
- msg.readInt16(); // target type
- msg.skip(2); // skill pool flags
- const int level = msg.readInt16();
- msg.readInt16(); // sp
- const int range = msg.readInt16();
- msg.skip(24); // 0 unused
- const int up = msg.readUInt8();
- const int oldLevel = PlayerInfo::getSkillLevel(skillId);
- if (oldLevel && oldLevel != level)
- updateSkill = skillId;
- PlayerInfo::setSkillLevel(skillId, level);
- if (skillDialog)
- {
- if (!skillDialog->updateSkill(skillId, range, up))
- skillDialog->addSkill(skillId, level, range, up);
- }
- }
- if (updateSkill && skillDialog)
- skillDialog->playUpdateEffect(updateSkill);
-}
-
void SkillHandler::processPlayerSkillUp(Net::MessageIn &msg)
{
const int skillId = msg.readInt16();
diff --git a/src/net/ea/skillhandler.h b/src/net/ea/skillhandler.h
index 37ce90cbb..2ee2a11fc 100644
--- a/src/net/ea/skillhandler.h
+++ b/src/net/ea/skillhandler.h
@@ -42,8 +42,6 @@ class SkillHandler notfinal : public Net::SkillHandler
A_DELETE_COPY(SkillHandler)
- static void processPlayerSkills(Net::MessageIn &msg);
-
static void processPlayerSkillUp(Net::MessageIn &msg);
static void processSkillFailed(Net::MessageIn &msg);
diff --git a/src/net/eathena/skillhandler.cpp b/src/net/eathena/skillhandler.cpp
index 34b44e9f1..673bcd136 100644
--- a/src/net/eathena/skillhandler.cpp
+++ b/src/net/eathena/skillhandler.cpp
@@ -22,6 +22,10 @@
#include "net/eathena/skillhandler.h"
+#include "being/playerinfo.h"
+
+#include "gui/windows/skilldialog.h"
+
#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
@@ -94,4 +98,34 @@ void SkillHandler::useMap(const int id, const std::string &map) const
outMsg.writeString(map, 16);
}
+void SkillHandler::processPlayerSkills(Net::MessageIn &msg)
+{
+ msg.readInt16(); // length
+ const int skillCount = (msg.getLength() - 4) / 37;
+ int updateSkill = 0;
+
+ for (int k = 0; k < skillCount; k++)
+ {
+ const int skillId = msg.readInt16();
+ msg.readInt16(); // target type
+ msg.skip(2); // skill pool flags
+ const int level = msg.readInt16();
+ msg.readInt16(); // sp
+ const int range = msg.readInt16();
+ msg.skip(24); // 0 unused
+ const int up = msg.readUInt8();
+ const int oldLevel = PlayerInfo::getSkillLevel(skillId);
+ if (oldLevel && oldLevel != level)
+ updateSkill = skillId;
+ PlayerInfo::setSkillLevel(skillId, level);
+ if (skillDialog)
+ {
+ if (!skillDialog->updateSkill(skillId, range, up))
+ skillDialog->addSkill(skillId, level, range, up);
+ }
+ }
+ if (updateSkill && skillDialog)
+ skillDialog->playUpdateEffect(updateSkill);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/skillhandler.h b/src/net/eathena/skillhandler.h
index 3b63bcfc5..c33971245 100644
--- a/src/net/eathena/skillhandler.h
+++ b/src/net/eathena/skillhandler.h
@@ -46,6 +46,9 @@ class SkillHandler final : public MessageHandler, public Ea::SkillHandler
const int x, const int y) const override final;
void useMap(const int id, const std::string &map) const override final;
+
+ protected:
+ void processPlayerSkills(Net::MessageIn &msg);
};
} // namespace EAthena
diff --git a/src/net/tmwa/skillhandler.cpp b/src/net/tmwa/skillhandler.cpp
index 19953e051..33e06cd3c 100644
--- a/src/net/tmwa/skillhandler.cpp
+++ b/src/net/tmwa/skillhandler.cpp
@@ -22,6 +22,10 @@
#include "net/tmwa/skillhandler.h"
+#include "being/playerinfo.h"
+
+#include "gui/windows/skilldialog.h"
+
#include "net/tmwa/messageout.h"
#include "net/tmwa/protocol.h"
@@ -96,4 +100,34 @@ void SkillHandler::useMap(const int id, const std::string &map) const
outMsg.writeString(map, 16);
}
+void SkillHandler::processPlayerSkills(Net::MessageIn &msg)
+{
+ msg.readInt16(); // length
+ const int skillCount = (msg.getLength() - 4) / 37;
+ int updateSkill = 0;
+
+ for (int k = 0; k < skillCount; k++)
+ {
+ const int skillId = msg.readInt16();
+ msg.readInt16(); // target type
+ msg.skip(2); // skill pool flags
+ const int level = msg.readInt16();
+ msg.readInt16(); // sp
+ const int range = msg.readInt16();
+ msg.skip(24); // 0 unused
+ const int up = msg.readUInt8();
+ const int oldLevel = PlayerInfo::getSkillLevel(skillId);
+ if (oldLevel && oldLevel != level)
+ updateSkill = skillId;
+ PlayerInfo::setSkillLevel(skillId, level);
+ if (skillDialog)
+ {
+ if (!skillDialog->updateSkill(skillId, range, up))
+ skillDialog->addSkill(skillId, level, range, up);
+ }
+ }
+ if (updateSkill && skillDialog)
+ skillDialog->playUpdateEffect(updateSkill);
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/skillhandler.h b/src/net/tmwa/skillhandler.h
index d1c813f5e..a0be82c63 100644
--- a/src/net/tmwa/skillhandler.h
+++ b/src/net/tmwa/skillhandler.h
@@ -46,6 +46,9 @@ class SkillHandler final : public MessageHandler, public Ea::SkillHandler
const int x, const int y) const override final;
void useMap(const int id, const std::string &map) const override final;
+
+ protected:
+ void processPlayerSkills(Net::MessageIn &msg);
};
} // namespace TmwAthena