[General] Modernize packets

Use explicit for constructors
Use override instead virtual for inherited methods
Mark final derived classes as "final"
sol2-server-rewrite
Koncord 7 years ago
parent de77ee3126
commit 2cb0ea20f0

@ -38,7 +38,7 @@ public:
throw std::logic_error("processor " + p.second->strPacketID + " already registered. Check " + throw std::logic_error("processor " + p.second->strPacketID + " already registered. Check " +
processor->className + " and " + p.second->className); processor->className + " and " + p.second->className);
} }
processors.insert(typename processors_t::value_type(processor->GetPacketID(), processor)); processors.insert(typename processors_t::value_type(processor->GetPacketID(), std::move(processor)));
} }
protected: protected:
unsigned char packetID; unsigned char packetID;

@ -20,7 +20,7 @@ inline void AddPacket(mwmp::ActorPacketController::packets_t *packets, RakNet::R
{ {
T *packet = new T(peer); T *packet = new T(peer);
typedef mwmp::ActorPacketController::packets_t::value_type value_t; typedef mwmp::ActorPacketController::packets_t::value_type value_t;
packets->insert(value_t(packet->GetPacketID(), value_t::second_type(packet))); packets->insert(value_t(packet->GetPacketID(), value_t::second_type(std::move(packet))));
} }
mwmp::ActorPacketController::ActorPacketController(RakNet::RakPeerInterface *peer) mwmp::ActorPacketController::ActorPacketController(RakNet::RakPeerInterface *peer)

@ -46,7 +46,7 @@ inline void AddPacket(mwmp::PlayerPacketController::packets_t *packets, RakNet::
{ {
T *packet = new T(peer); T *packet = new T(peer);
typedef mwmp::PlayerPacketController::packets_t::value_type value_t; typedef mwmp::PlayerPacketController::packets_t::value_type value_t;
packets->insert(value_t(packet->GetPacketID(), value_t::second_type(packet))); packets->insert(value_t(packet->GetPacketID(), value_t::second_type(std::move(packet))));
} }
mwmp::PlayerPacketController::PlayerPacketController(RakNet::RakPeerInterface *peer) mwmp::PlayerPacketController::PlayerPacketController(RakNet::RakPeerInterface *peer)

@ -27,7 +27,7 @@ inline void AddPacket(mwmp::WorldPacketController::packets_t *packets, RakNet::R
{ {
T *packet = new T(peer); T *packet = new T(peer);
typedef mwmp::WorldPacketController::packets_t::value_type value_t; typedef mwmp::WorldPacketController::packets_t::value_type value_t;
packets->insert(value_t(packet->GetPacketID(), value_t::second_type(packet))); packets->insert(value_t(packet->GetPacketID(), value_t::second_type(std::move(packet))));
} }
mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *peer) mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *peer)

@ -14,11 +14,6 @@ ActorPacket::ActorPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer)
this->peer = peer; this->peer = peer;
} }
ActorPacket::~ActorPacket()
{
}
void ActorPacket::setActorList(BaseActorList *actorList) void ActorPacket::setActorList(BaseActorList *actorList)
{ {
this->actorList = actorList; this->actorList = actorList;

@ -15,13 +15,13 @@ namespace mwmp
class ActorPacket : public BasePacket class ActorPacket : public BasePacket
{ {
public: public:
ActorPacket(RakNet::RakPeerInterface *peer); explicit ActorPacket(RakNet::RakPeerInterface *peer);
~ActorPacket(); ~ActorPacket() override = default;
void setActorList(BaseActorList *actorList); void setActorList(BaseActorList *actorList);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
protected: protected:
bool PacketHeader(RakNet::BitStream *bs, bool send); bool PacketHeader(RakNet::BitStream *bs, bool send);
virtual void Actor(BaseActor &actor, bool send) {}; virtual void Actor(BaseActor &actor, bool send) {};

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketActorAI : public ActorPacket class PacketActorAI final: public ActorPacket
{ {
public: public:
PacketActorAI(RakNet::RakPeerInterface *peer); explicit PacketActorAI(RakNet::RakPeerInterface *peer);
virtual void Actor(BaseActor &actor, bool send); void Actor(BaseActor &actor, bool send) override;
}; };
} }

@ -5,10 +5,10 @@
namespace mwmp namespace mwmp
{ {
class PacketActorAnimFlags : public ActorPacket class PacketActorAnimFlags final: public ActorPacket
{ {
public: public:
PacketActorAnimFlags(RakNet::RakPeerInterface *peer); explicit PacketActorAnimFlags(RakNet::RakPeerInterface *peer);
void Actor(BaseActor &actor, bool send) final; void Actor(BaseActor &actor, bool send) final;
}; };

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketActorAnimPlay : public ActorPacket class PacketActorAnimPlay final: public ActorPacket
{ {
public: public:
PacketActorAnimPlay(RakNet::RakPeerInterface *peer); explicit PacketActorAnimPlay(RakNet::RakPeerInterface *peer);
virtual void Actor(BaseActor &actor, bool send); void Actor(BaseActor &actor, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketActorAttack : public ActorPacket class PacketActorAttack final: public ActorPacket
{ {
public: public:
PacketActorAttack(RakNet::RakPeerInterface *peer); explicit PacketActorAttack(RakNet::RakPeerInterface *peer);
virtual void Actor(BaseActor &actor, bool send); void Actor(BaseActor &actor, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketActorAuthority : public ActorPacket class PacketActorAuthority final: public ActorPacket
{ {
public: public:
PacketActorAuthority(RakNet::RakPeerInterface *peer); explicit PacketActorAuthority(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketActorCellChange : public ActorPacket class PacketActorCellChange final: public ActorPacket
{ {
public: public:
PacketActorCellChange(RakNet::RakPeerInterface *peer); explicit PacketActorCellChange(RakNet::RakPeerInterface *peer);
virtual void Actor(BaseActor &actor, bool send); void Actor(BaseActor &actor, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketActorDeath : public ActorPacket class PacketActorDeath final: public ActorPacket
{ {
public: public:
PacketActorDeath(RakNet::RakPeerInterface *peer); explicit PacketActorDeath(RakNet::RakPeerInterface *peer);
virtual void Actor(BaseActor &actor, bool send); void Actor(BaseActor &actor, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketActorEquipment : public ActorPacket class PacketActorEquipment final: public ActorPacket
{ {
public: public:
PacketActorEquipment(RakNet::RakPeerInterface *peer); explicit PacketActorEquipment(RakNet::RakPeerInterface *peer);
virtual void Actor(BaseActor &actor, bool send); void Actor(BaseActor &actor, bool send) override;
}; };
} }

@ -5,10 +5,10 @@
namespace mwmp namespace mwmp
{ {
class PacketActorList : public ActorPacket class PacketActorList final: public ActorPacket
{ {
public: public:
PacketActorList(RakNet::RakPeerInterface *peer); explicit PacketActorList(RakNet::RakPeerInterface *peer);
void Packet(RakNet::BitStream *bs, bool send) final; void Packet(RakNet::BitStream *bs, bool send) final;
}; };

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketActorPosition : public ActorPacket class PacketActorPosition final: public ActorPacket
{ {
public: public:
PacketActorPosition(RakNet::RakPeerInterface *peer); explicit PacketActorPosition(RakNet::RakPeerInterface *peer);
virtual void Actor(BaseActor &actor, bool send); void Actor(BaseActor &actor, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketActorSpeech : public ActorPacket class PacketActorSpeech final: public ActorPacket
{ {
public: public:
PacketActorSpeech(RakNet::RakPeerInterface *peer); explicit PacketActorSpeech(RakNet::RakPeerInterface *peer);
virtual void Actor(BaseActor &actor, bool send); void Actor(BaseActor &actor, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketActorStatsDynamic : public ActorPacket class PacketActorStatsDynamic final: public ActorPacket
{ {
public: public:
PacketActorStatsDynamic(RakNet::RakPeerInterface *peer); explicit PacketActorStatsDynamic(RakNet::RakPeerInterface *peer);
virtual void Actor(BaseActor &actor, bool send); void Actor(BaseActor &actor, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketActorTest : public ActorPacket class PacketActorTest final: public ActorPacket
{ {
public: public:
PacketActorTest(RakNet::RakPeerInterface *peer); explicit PacketActorTest(RakNet::RakPeerInterface *peer);
virtual void Actor(BaseActor &actor, bool send); void Actor(BaseActor &actor, bool send) override;
}; };
} }

@ -14,11 +14,6 @@ BasePacket::BasePacket(RakNet::RakPeerInterface *peer)
this->peer = peer; this->peer = peer;
} }
BasePacket::~BasePacket()
{
}
void BasePacket::Packet(RakNet::BitStream *bs, bool send) void BasePacket::Packet(RakNet::BitStream *bs, bool send)
{ {
this->bs = bs; this->bs = bs;

@ -12,9 +12,9 @@ namespace mwmp
class BasePacket class BasePacket
{ {
public: public:
BasePacket(RakNet::RakPeerInterface *peer); explicit BasePacket(RakNet::RakPeerInterface *peer);
virtual ~BasePacket(); virtual ~BasePacket() = default;
virtual void Packet(RakNet::BitStream *bs, bool send); virtual void Packet(RakNet::BitStream *bs, bool send);
virtual uint32_t Send(bool toOtherPlayers = true); virtual uint32_t Send(bool toOtherPlayers = true);
@ -29,12 +29,12 @@ namespace mwmp
void SetStreams(RakNet::BitStream *inStream, RakNet::BitStream *outStream); void SetStreams(RakNet::BitStream *inStream, RakNet::BitStream *outStream);
virtual uint32_t RequestData(RakNet::RakNetGUID guid); virtual uint32_t RequestData(RakNet::RakNetGUID guid);
static size_t headerSize() static inline size_t headerSize()
{ {
return (size_t)(1 + RakNet::RakNetGUID::size()); // packetID + RakNetGUID (uint64_t) return static_cast<size_t>(1 + RakNet::RakNetGUID::size()); // packetID + RakNetGUID (uint64_t)
} }
unsigned char GetPacketID() unsigned char GetPacketID() const
{ {
return packetID; return packetID;
} }

@ -11,16 +11,16 @@
namespace mwmp namespace mwmp
{ {
class PacketPreInit : public BasePacket class PacketPreInit final: public BasePacket
{ {
public: public:
typedef std::vector<unsigned> HashList; typedef std::vector<unsigned> HashList;
typedef std::pair<std::string, HashList> PluginPair; typedef std::pair<std::string, HashList> PluginPair;
typedef std::vector<PluginPair> PluginContainer; typedef std::vector<PluginPair> PluginContainer;
PacketPreInit(RakNet::RakPeerInterface *peer); explicit PacketPreInit(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
void setChecksums(PluginContainer *checksums); void setChecksums(PluginContainer *checksums);
private: private:
PluginContainer *checksums; PluginContainer *checksums;

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketChatMessage : public PlayerPacket class PacketChatMessage final: public PlayerPacket
{ {
public: public:
PacketChatMessage(RakNet::RakPeerInterface *peer); PacketChatMessage(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -10,7 +10,7 @@
namespace mwmp namespace mwmp
{ {
class PacketDisconnect : public PlayerPacket class PacketDisconnect final: public PlayerPacket
{ {
public: public:
PacketDisconnect(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) PacketDisconnect(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketGUIBoxes : public PlayerPacket class PacketGUIBoxes final: public PlayerPacket
{ {
public: public:
PacketGUIBoxes(RakNet::RakPeerInterface *peer); PacketGUIBoxes(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,11 +9,11 @@
namespace mwmp namespace mwmp
{ {
class PacketGUIWindow : public PlayerPacket class PacketGUIWindow final: public PlayerPacket
{ {
public: public:
PacketGUIWindow(RakNet::RakPeerInterface *peer); PacketGUIWindow(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -6,12 +6,12 @@
namespace mwmp namespace mwmp
{ {
class PacketGameSettings: public PlayerPacket class PacketGameSettings final: public PlayerPacket
{ {
public: public:
PacketGameSettings(RakNet::RakPeerInterface *peer); PacketGameSettings(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketGameTime : public PlayerPacket class PacketGameTime final: public PlayerPacket
{ {
public: public:
PacketGameTime(RakNet::RakPeerInterface *peer); PacketGameTime(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketGameWeather : public PlayerPacket class PacketGameWeather final: public PlayerPacket
{ {
public: public:
PacketGameWeather(RakNet::RakPeerInterface *peer); PacketGameWeather(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketHandshake : public PlayerPacket class PacketHandshake final: public PlayerPacket
{ {
public: public:
PacketHandshake(RakNet::RakPeerInterface *peer); PacketHandshake(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,7 +9,7 @@
namespace mwmp namespace mwmp
{ {
class PacketLoaded : public PlayerPacket class PacketLoaded final: public PlayerPacket
{ {
public: public:
PacketLoaded(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) PacketLoaded(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerActiveSkills : public PlayerPacket class PacketPlayerActiveSkills final: public PlayerPacket
{ {
public: public:
PacketPlayerActiveSkills(RakNet::RakPeerInterface *peer); PacketPlayerActiveSkills(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerAnimFlags : public PlayerPacket class PacketPlayerAnimFlags final: public PlayerPacket
{ {
public: public:
PacketPlayerAnimFlags(RakNet::RakPeerInterface *peer); PacketPlayerAnimFlags(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerAnimPlay : public PlayerPacket class PacketPlayerAnimPlay final: public PlayerPacket
{ {
public: public:
PacketPlayerAnimPlay(RakNet::RakPeerInterface *peer); PacketPlayerAnimPlay(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerAttack : public PlayerPacket class PacketPlayerAttack final: public PlayerPacket
{ {
public: public:
PacketPlayerAttack(RakNet::RakPeerInterface *peer); PacketPlayerAttack(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,13 +9,13 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerAttribute : public PlayerPacket class PacketPlayerAttribute final: public PlayerPacket
{ {
public: public:
const static int AttributeCount = 8; const static int AttributeCount = 8;
PacketPlayerAttribute(RakNet::RakPeerInterface *peer); PacketPlayerAttribute(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerBaseInfo : public PlayerPacket class PacketPlayerBaseInfo final: public PlayerPacket
{ {
public: public:
PacketPlayerBaseInfo(RakNet::RakPeerInterface *peer); PacketPlayerBaseInfo(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerBook : public PlayerPacket class PacketPlayerBook final: public PlayerPacket
{ {
public: public:
PacketPlayerBook(RakNet::RakPeerInterface *peer); PacketPlayerBook(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerBounty : public PlayerPacket class PacketPlayerBounty final: public PlayerPacket
{ {
public: public:
PacketPlayerBounty(RakNet::RakPeerInterface *peer); PacketPlayerBounty(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerCellChange : public PlayerPacket class PacketPlayerCellChange final: public PlayerPacket
{ {
public: public:
PacketPlayerCellChange(RakNet::RakPeerInterface *peer); PacketPlayerCellChange(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerCellState : public PlayerPacket class PacketPlayerCellState final: public PlayerPacket
{ {
public: public:
PacketPlayerCellState(RakNet::RakPeerInterface *peer); PacketPlayerCellState(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerCharGen : public PlayerPacket class PacketPlayerCharGen final: public PlayerPacket
{ {
public: public:
PacketPlayerCharGen(RakNet::RakPeerInterface *peer); PacketPlayerCharGen(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerClass : public PlayerPacket class PacketPlayerClass final: public PlayerPacket
{ {
public: public:
PacketPlayerClass(RakNet::RakPeerInterface *peer); PacketPlayerClass(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -11,7 +11,7 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerDeath: public PlayerPacket class PacketPlayerDeath final: public PlayerPacket
{ {
public: public:
PacketPlayerDeath(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) PacketPlayerDeath(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerEquipment : public PlayerPacket class PacketPlayerEquipment final: public PlayerPacket
{ {
public: public:
PacketPlayerEquipment(RakNet::RakPeerInterface *peer); PacketPlayerEquipment(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerFaction : public PlayerPacket class PacketPlayerFaction final: public PlayerPacket
{ {
public: public:
PacketPlayerFaction(RakNet::RakPeerInterface *peer); PacketPlayerFaction(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerInventory : public PlayerPacket class PacketPlayerInventory final: public PlayerPacket
{ {
public: public:
PacketPlayerInventory(RakNet::RakPeerInterface *peer); PacketPlayerInventory(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerJail : public PlayerPacket class PacketPlayerJail final: public PlayerPacket
{ {
public: public:
PacketPlayerJail(RakNet::RakPeerInterface *peer); PacketPlayerJail(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerJournal : public PlayerPacket class PacketPlayerJournal final: public PlayerPacket
{ {
public: public:
PacketPlayerJournal(RakNet::RakPeerInterface *peer); PacketPlayerJournal(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerKillCount : public PlayerPacket class PacketPlayerKillCount final: public PlayerPacket
{ {
public: public:
PacketPlayerKillCount(RakNet::RakPeerInterface *peer); PacketPlayerKillCount(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerLevel : public PlayerPacket class PacketPlayerLevel final: public PlayerPacket
{ {
public: public:
PacketPlayerLevel(RakNet::RakPeerInterface *peer); PacketPlayerLevel(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerMap : public PlayerPacket class PacketPlayerMap final: public PlayerPacket
{ {
public: public:
PacketPlayerMap(RakNet::RakPeerInterface *peer); PacketPlayerMap(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerPosition : public PlayerPacket class PacketPlayerPosition final: public PlayerPacket
{ {
public: public:
PacketPlayerPosition(RakNet::RakPeerInterface *peer); PacketPlayerPosition(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerRegionAuthority : public PlayerPacket class PacketPlayerRegionAuthority final: public PlayerPacket
{ {
public: public:
PacketPlayerRegionAuthority(RakNet::RakPeerInterface *peer); PacketPlayerRegionAuthority(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerRest : public PlayerPacket class PacketPlayerRest final: public PlayerPacket
{ {
public: public:
PacketPlayerRest(RakNet::RakPeerInterface *peer); PacketPlayerRest(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerResurrect : public PlayerPacket class PacketPlayerResurrect final: public PlayerPacket
{ {
public: public:
PacketPlayerResurrect(RakNet::RakPeerInterface *peer); PacketPlayerResurrect(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerShapeshift : public PlayerPacket class PacketPlayerShapeshift final: public PlayerPacket
{ {
public: public:
PacketPlayerShapeshift(RakNet::RakPeerInterface *peer); PacketPlayerShapeshift(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,14 +9,14 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerSkill : public PlayerPacket class PacketPlayerSkill final: public PlayerPacket
{ {
public: public:
const static int SkillCount = 27; const static int SkillCount = 27;
const static int AttributeCount = 8; const static int AttributeCount = 8;
PacketPlayerSkill(RakNet::RakPeerInterface *peer); PacketPlayerSkill(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerSpeech : public PlayerPacket class PacketPlayerSpeech final: public PlayerPacket
{ {
public: public:
PacketPlayerSpeech(RakNet::RakPeerInterface *peer); PacketPlayerSpeech(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerSpellbook : public PlayerPacket class PacketPlayerSpellbook final: public PlayerPacket
{ {
public: public:
PacketPlayerSpellbook(RakNet::RakPeerInterface *peer); PacketPlayerSpellbook(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -9,12 +9,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerStatsDynamic : public PlayerPacket class PacketPlayerStatsDynamic final: public PlayerPacket
{ {
public: public:
PacketPlayerStatsDynamic(RakNet::RakPeerInterface *peer); PacketPlayerStatsDynamic(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketPlayerTopic : public PlayerPacket class PacketPlayerTopic final: public PlayerPacket
{ {
public: public:
PacketPlayerTopic(RakNet::RakPeerInterface *peer); PacketPlayerTopic(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -14,11 +14,6 @@ PlayerPacket::PlayerPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer)
this->peer = peer; this->peer = peer;
} }
PlayerPacket::~PlayerPacket()
{
}
void PlayerPacket::setPlayer(BasePlayer *player) void PlayerPacket::setPlayer(BasePlayer *player)
{ {
this->player = player; this->player = player;

@ -16,7 +16,7 @@ namespace mwmp
public: public:
PlayerPacket(RakNet::RakPeerInterface *peer); PlayerPacket(RakNet::RakPeerInterface *peer);
~PlayerPacket(); ~PlayerPacket() override = default;
void setPlayer(BasePlayer *player); void setPlayer(BasePlayer *player);
BasePlayer *getPlayer(); BasePlayer *getPlayer();

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketConsoleCommand : public WorldPacket class PacketConsoleCommand final: public WorldPacket
{ {
public: public:
PacketConsoleCommand(RakNet::RakPeerInterface *peer); explicit PacketConsoleCommand(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &obj, bool send); void Object(WorldObject &obj, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketContainer : public WorldPacket class PacketContainer final: public WorldPacket
{ {
public: public:
PacketContainer(RakNet::RakPeerInterface *peer); explicit PacketContainer(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketDoorState : public WorldPacket class PacketDoorState final: public WorldPacket
{ {
public: public:
PacketDoorState(RakNet::RakPeerInterface *peer); explicit PacketDoorState(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send); void Object(WorldObject &worldObject, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketMusicPlay : public WorldPacket class PacketMusicPlay final: public WorldPacket
{ {
public: public:
PacketMusicPlay(RakNet::RakPeerInterface *peer); explicit PacketMusicPlay(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send); void Object(WorldObject &worldObject, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketObjectAnimPlay : public WorldPacket class PacketObjectAnimPlay final: public WorldPacket
{ {
public: public:
PacketObjectAnimPlay(RakNet::RakPeerInterface *peer); explicit PacketObjectAnimPlay(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send); void Object(WorldObject &worldObject, bool send) override;
}; };
} }

@ -5,10 +5,10 @@
namespace mwmp namespace mwmp
{ {
class PacketObjectDelete : public WorldPacket class PacketObjectDelete final: public WorldPacket
{ {
public: public:
PacketObjectDelete(RakNet::RakPeerInterface *peer); explicit PacketObjectDelete(RakNet::RakPeerInterface *peer);
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketObjectLock : public WorldPacket class PacketObjectLock final: public WorldPacket
{ {
public: public:
PacketObjectLock(RakNet::RakPeerInterface *peer); explicit PacketObjectLock(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send); void Object(WorldObject &worldObject, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketObjectMove : public WorldPacket class PacketObjectMove final: public WorldPacket
{ {
public: public:
PacketObjectMove(RakNet::RakPeerInterface *peer); explicit PacketObjectMove(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send); void Object(WorldObject &worldObject, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketObjectPlace : public WorldPacket class PacketObjectPlace final: public WorldPacket
{ {
public: public:
PacketObjectPlace(RakNet::RakPeerInterface *peer); explicit PacketObjectPlace(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send); void Object(WorldObject &worldObject, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketObjectRotate : public WorldPacket class PacketObjectRotate final: public WorldPacket
{ {
public: public:
PacketObjectRotate(RakNet::RakPeerInterface *peer); explicit PacketObjectRotate(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send); void Object(WorldObject &worldObject, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketObjectScale : public WorldPacket class PacketObjectScale final: public WorldPacket
{ {
public: public:
PacketObjectScale(RakNet::RakPeerInterface *peer); explicit PacketObjectScale(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send); void Object(WorldObject &worldObject, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketObjectSpawn : public WorldPacket class PacketObjectSpawn final: public WorldPacket
{ {
public: public:
PacketObjectSpawn(RakNet::RakPeerInterface *peer); explicit PacketObjectSpawn(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send); void Object(WorldObject &worldObject, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketObjectState : public WorldPacket class PacketObjectState final: public WorldPacket
{ {
public: public:
PacketObjectState(RakNet::RakPeerInterface *peer); explicit PacketObjectState(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send); void Object(WorldObject &worldObject, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketObjectTrap : public WorldPacket class PacketObjectTrap final: public WorldPacket
{ {
public: public:
PacketObjectTrap(RakNet::RakPeerInterface *peer); explicit PacketObjectTrap(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send); void Object(WorldObject &worldObject, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketScriptGlobalShort : public WorldPacket class PacketScriptGlobalShort final: public WorldPacket
{ {
public: public:
PacketScriptGlobalShort(RakNet::RakPeerInterface *peer); explicit PacketScriptGlobalShort(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send); void Object(WorldObject &worldObject, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketScriptLocalFloat : public WorldPacket class PacketScriptLocalFloat final: public WorldPacket
{ {
public: public:
PacketScriptLocalFloat(RakNet::RakPeerInterface *peer); explicit PacketScriptLocalFloat(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send); void Object(WorldObject &worldObject, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketScriptLocalShort : public WorldPacket class PacketScriptLocalShort final: public WorldPacket
{ {
public: public:
PacketScriptLocalShort(RakNet::RakPeerInterface *peer); explicit PacketScriptLocalShort(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &obj, bool send); void Object(WorldObject &obj, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketScriptMemberShort : public WorldPacket class PacketScriptMemberShort final: public WorldPacket
{ {
public: public:
PacketScriptMemberShort(RakNet::RakPeerInterface *peer); explicit PacketScriptMemberShort(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &obj, bool send); void Object(WorldObject &obj, bool send) override;
}; };
} }

@ -5,12 +5,12 @@
namespace mwmp namespace mwmp
{ {
class PacketVideoPlay : public WorldPacket class PacketVideoPlay final: public WorldPacket
{ {
public: public:
PacketVideoPlay(RakNet::RakPeerInterface *peer); explicit PacketVideoPlay(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &obj, bool send); void Object(WorldObject &obj, bool send) override;
}; };
} }

@ -15,11 +15,6 @@ WorldPacket::WorldPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer)
this->peer = peer; this->peer = peer;
} }
WorldPacket::~WorldPacket()
{
}
void WorldPacket::setEvent(BaseEvent *event) void WorldPacket::setEvent(BaseEvent *event)
{ {
this->event = event; this->event = event;

@ -15,13 +15,13 @@ namespace mwmp
class WorldPacket: public BasePacket class WorldPacket: public BasePacket
{ {
public: public:
WorldPacket(RakNet::RakPeerInterface *peer); explicit WorldPacket(RakNet::RakPeerInterface *peer);
~WorldPacket(); ~WorldPacket() override = default;
void setEvent(BaseEvent *event); void setEvent(BaseEvent *event);
virtual void Packet(RakNet::BitStream *bs, bool send); void Packet(RakNet::BitStream *bs, bool send) override;
protected: protected:
virtual void Object(WorldObject &worldObject, bool send); virtual void Object(WorldObject &worldObject, bool send);

Loading…
Cancel
Save