Remove outdated ID_GAME_UPDATE_SKILLS packet

pull/58/head
David Cernat 8 years ago
parent e36321f448
commit 8abef0bebe

@ -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);
}

@ -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)

@ -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,

@ -1,25 +0,0 @@
//
// Created by koncord on 11.01.16.
//
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/esm/creaturestats.hpp>
#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);
}

@ -1,23 +0,0 @@
//
// Created by koncord on 11.01.16.
//
#ifndef OPENMW_PacketAttributesAndStats_HPP
#define OPENMW_PacketAttributesAndStats_HPP
#include <components/openmw-mp/Packets/BasePacket.hpp>
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
Loading…
Cancel
Save