From 8abef0bebe6a5e9a7c968acd78ac4a216b2ccce1 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Fri, 2 Sep 2016 07:36:39 +0300 Subject: [PATCH] Remove outdated ID_GAME_UPDATE_SKILLS packet --- apps/openmw/mwmp/LocalPlayer.cpp | 1 - apps/openmw/mwmp/Networking.cpp | 28 ------------------- components/openmw-mp/NetworkMessages.hpp | 1 - .../Packets/PacketAttributesAndStats.cpp | 25 ----------------- .../Packets/PacketAttributesAndStats.hpp | 23 --------------- 5 files changed, 78 deletions(-) delete mode 100644 components/openmw-mp/Packets/PacketAttributesAndStats.cpp delete mode 100644 components/openmw-mp/Packets/PacketAttributesAndStats.hpp diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 058ac30e4..44ba11c0d 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -537,7 +537,6 @@ bool LocalPlayer::CharGenThread() // ToDo: need fix { updateBaseStats(true); updateAttributesAndSkills(true); - //GetNetworking()->GetPacket(ID_GAME_UPDATE_SKILLS)->Send(this); SendClass(); GetNetworking()->GetPacket(ID_GAME_CHARGEN)->Send(this); } diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 24b056a68..9c5266d79 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -271,34 +271,6 @@ void Networking::ReceiveMessage(RakNet::Packet *packet) } break; } - case ID_GAME_UPDATE_SKILLS: - { - if (id == myid) - { - getLocalPlayer()->updateAttributesAndSkills(true); - myPacket->Send(getLocalPlayer(), serverAddr); - } - else if (pl != 0) - { - myPacket->Packet(&bsIn, pl, false); - - MWMechanics::SkillValue skillValue; - MWMechanics::AttributeValue attributeValue; - - for (int i = 0; i < PacketAttributesAndStats::StatsCount; ++i) - { - skillValue.readState(pl->NpcStats()->mSkills[i]); - pl->getPtr().getClass().getNpcStats(pl->getPtr()).setSkill(i, skillValue); - } - - for (int i = 0; i < PacketAttributesAndStats::AttributesCount; ++i) - { - attributeValue.readState(pl->CreatureStats()->mAttributes[i]); - pl->getPtr().getClass().getCreatureStats(pl->getPtr()).setAttribute(i, attributeValue); - } - } - break; - } case ID_GAME_ATTACK: { if (pl != 0) diff --git a/components/openmw-mp/NetworkMessages.hpp b/components/openmw-mp/NetworkMessages.hpp index d5b8da06c..60f993b35 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -13,7 +13,6 @@ enum GameMessages ID_GAME_CHARGEN, ID_GAME_UPDATE_POS, ID_GAME_UPDATE_BASESTATS, - ID_GAME_UPDATE_SKILLS, ID_GAME_ATTACK, ID_USER_MYID, ID_GAME_UPDATE_EQUIPED, diff --git a/components/openmw-mp/Packets/PacketAttributesAndStats.cpp b/components/openmw-mp/Packets/PacketAttributesAndStats.cpp deleted file mode 100644 index f6ba73b17..000000000 --- a/components/openmw-mp/Packets/PacketAttributesAndStats.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Created by koncord on 11.01.16. -// - -#include -#include -#include "PacketAttributesAndStats.hpp" - -using namespace mwmp; - -PacketAttributesAndStats::PacketAttributesAndStats(RakNet::RakPeerInterface *peer) : BasePacket(peer) -{ - packetID = ID_GAME_UPDATE_SKILLS; -} - -void PacketAttributesAndStats::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send) -{ - BasePacket::Packet(bs, player, send); - - for (int i = 0; i < AttributesCount; ++i) - RW(player->CreatureStats()->mAttributes[i], send); - - for (int i = 0; i < StatsCount; ++i) - RW(player->NpcStats()->mSkills[i], send); -} diff --git a/components/openmw-mp/Packets/PacketAttributesAndStats.hpp b/components/openmw-mp/Packets/PacketAttributesAndStats.hpp deleted file mode 100644 index 2392b1ba8..000000000 --- a/components/openmw-mp/Packets/PacketAttributesAndStats.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Created by koncord on 11.01.16. -// - -#ifndef OPENMW_PacketAttributesAndStats_HPP -#define OPENMW_PacketAttributesAndStats_HPP - -#include - -namespace mwmp -{ - class PacketAttributesAndStats : public BasePacket - { - public: - const static int AttributesCount = 8; - const static int StatsCount = 27; - PacketAttributesAndStats(RakNet::RakPeerInterface *peer); - - virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send); - }; -} - -#endif //OPENMW_PacketAttributesAndStats_HPP