summaryrefslogtreecommitdiff
path: root/src/net/ea/guildhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-07 13:22:17 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-07 13:22:17 +0300
commitffff40ebf2296b68794172c86d0e0115a3c102d8 (patch)
treebc0cb5fd5b7e98e234cb193a57832406b19b3d9b /src/net/ea/guildhandler.cpp
parent561146476411a5df4610427123d3bdbd2c006515 (diff)
downloadplus-ffff40ebf2296b68794172c86d0e0115a3c102d8.tar.gz
plus-ffff40ebf2296b68794172c86d0e0115a3c102d8.tar.bz2
plus-ffff40ebf2296b68794172c86d0e0115a3c102d8.tar.xz
plus-ffff40ebf2296b68794172c86d0e0115a3c102d8.zip
Add reading guild skills in processGuildSkillInfo.
Diffstat (limited to 'src/net/ea/guildhandler.cpp')
-rw-r--r--src/net/ea/guildhandler.cpp39
1 files changed, 25 insertions, 14 deletions
diff --git a/src/net/ea/guildhandler.cpp b/src/net/ea/guildhandler.cpp
index 04b602c63..2364cfa9a 100644
--- a/src/net/ea/guildhandler.cpp
+++ b/src/net/ea/guildhandler.cpp
@@ -26,8 +26,10 @@
#include "notifymanager.h"
#include "being/localplayer.h"
+#include "being/playerinfo.h"
#include "gui/windows/chatwindow.h"
+#include "gui/windows/skilldialog.h"
#include "gui/windows/socialwindow.h"
#include "net/messagein.h"
@@ -325,24 +327,33 @@ void GuildHandler::processGuildEmblem(Net::MessageIn &msg) const
void GuildHandler::processGuildSkillInfo(Net::MessageIn &msg) const
{
- const int length = msg.readInt16();
- const int count = (length - 6) / 37;
-
- msg.readInt16(); // 'Skill point'
+ const int count = (msg.readInt16("len") - 6) / 37;
+ msg.readInt16("skill points");
- if (length < 6)
- return;
+ if (skillDialog)
+ skillDialog->hideSkills(SkillOwner::Guild);
for (int i = 0; i < count; i++)
{
- msg.readInt16(); // ID
- msg.readInt16(); // 'Info' (unknown atm)
- msg.readInt16(); // 0 unused
- msg.readInt16(); // Level
- msg.readInt16(); // SP
- msg.readInt16(); // 'Range'
- msg.skip(24); // 0 unused
- msg.readUInt8(); // Can be increased
+ const int skillId = msg.readInt16("skill id");
+ const SkillType::SkillType inf = static_cast<SkillType::SkillType>(
+ msg.readInt32("inf"));
+ const int level = msg.readInt16("skill level");
+ const int sp = msg.readInt16("sp");
+ const int range = msg.readInt16("range");
+ const std::string name = msg.readString(24, "skill name");
+ const int up = msg.readUInt8("up flag");
+ PlayerInfo::setSkillLevel(skillId, level);
+ if (skillDialog)
+ {
+ if (!skillDialog->updateSkill(skillId, range, up, inf, sp))
+ {
+ skillDialog->addSkill(SkillOwner::Guild,
+ skillId, name, level, range, up, inf, sp);
+ }
+ }
}
+ if (skillDialog)
+ skillDialog->updateModels();
}
void GuildHandler::processGuildNotice(Net::MessageIn &msg) const