From 2cb0ea20f016cfb0da4a72456210dfece9f59b27 Mon Sep 17 00:00:00 2001 From: Koncord Date: Sat, 9 Dec 2017 10:13:14 +0800 Subject: [PATCH] [General] Modernize packets Use explicit for constructors Use override instead virtual for inherited methods Mark final derived classes as "final" --- components/openmw-mp/Base/BasePacketProcessor.hpp | 2 +- .../openmw-mp/Controllers/ActorPacketController.cpp | 2 +- .../openmw-mp/Controllers/PlayerPacketController.cpp | 2 +- .../openmw-mp/Controllers/WorldPacketController.cpp | 2 +- components/openmw-mp/Packets/Actor/ActorPacket.cpp | 5 ----- components/openmw-mp/Packets/Actor/ActorPacket.hpp | 6 +++--- components/openmw-mp/Packets/Actor/PacketActorAI.hpp | 6 +++--- .../openmw-mp/Packets/Actor/PacketActorAnimFlags.hpp | 4 ++-- .../openmw-mp/Packets/Actor/PacketActorAnimPlay.hpp | 6 +++--- .../openmw-mp/Packets/Actor/PacketActorAttack.hpp | 6 +++--- .../openmw-mp/Packets/Actor/PacketActorAuthority.hpp | 6 +++--- .../openmw-mp/Packets/Actor/PacketActorCellChange.hpp | 6 +++--- .../openmw-mp/Packets/Actor/PacketActorDeath.hpp | 6 +++--- .../openmw-mp/Packets/Actor/PacketActorEquipment.hpp | 6 +++--- components/openmw-mp/Packets/Actor/PacketActorList.hpp | 4 ++-- .../openmw-mp/Packets/Actor/PacketActorPosition.hpp | 6 +++--- .../openmw-mp/Packets/Actor/PacketActorSpeech.hpp | 6 +++--- .../Packets/Actor/PacketActorStatsDynamic.hpp | 6 +++--- components/openmw-mp/Packets/Actor/PacketActorTest.hpp | 6 +++--- components/openmw-mp/Packets/BasePacket.cpp | 5 ----- components/openmw-mp/Packets/BasePacket.hpp | 10 +++++----- components/openmw-mp/Packets/PacketPreInit.hpp | 6 +++--- .../openmw-mp/Packets/Player/PacketChatMessage.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketDisconnect.hpp | 2 +- components/openmw-mp/Packets/Player/PacketGUIBoxes.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketGUIWindow.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketGameSettings.hpp | 4 ++-- components/openmw-mp/Packets/Player/PacketGameTime.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketGameWeather.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketHandshake.hpp | 4 ++-- components/openmw-mp/Packets/Player/PacketLoaded.hpp | 2 +- .../Packets/Player/PacketPlayerActiveSkills.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerAnimFlags.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerAnimPlay.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerAttack.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerAttribute.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerBaseInfo.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerBook.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerBounty.hpp | 4 ++-- .../Packets/Player/PacketPlayerCellChange.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerCellState.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerCharGen.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerClass.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerDeath.hpp | 2 +- .../openmw-mp/Packets/Player/PacketPlayerEquipment.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerFaction.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerInventory.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerJail.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerJournal.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerKillCount.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerLevel.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerMap.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerPosition.hpp | 4 ++-- .../Packets/Player/PacketPlayerRegionAuthority.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerRest.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerResurrect.hpp | 4 ++-- .../Packets/Player/PacketPlayerShapeshift.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerSkill.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerSpeech.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerSpellbook.hpp | 4 ++-- .../Packets/Player/PacketPlayerStatsDynamic.hpp | 4 ++-- .../openmw-mp/Packets/Player/PacketPlayerTopic.hpp | 4 ++-- components/openmw-mp/Packets/Player/PlayerPacket.cpp | 5 ----- components/openmw-mp/Packets/Player/PlayerPacket.hpp | 2 +- .../openmw-mp/Packets/World/PacketConsoleCommand.hpp | 6 +++--- components/openmw-mp/Packets/World/PacketContainer.hpp | 6 +++--- components/openmw-mp/Packets/World/PacketDoorState.hpp | 6 +++--- components/openmw-mp/Packets/World/PacketMusicPlay.hpp | 6 +++--- .../openmw-mp/Packets/World/PacketObjectAnimPlay.hpp | 6 +++--- .../openmw-mp/Packets/World/PacketObjectDelete.hpp | 4 ++-- .../openmw-mp/Packets/World/PacketObjectLock.hpp | 6 +++--- .../openmw-mp/Packets/World/PacketObjectMove.hpp | 6 +++--- .../openmw-mp/Packets/World/PacketObjectPlace.hpp | 6 +++--- .../openmw-mp/Packets/World/PacketObjectRotate.hpp | 6 +++--- .../openmw-mp/Packets/World/PacketObjectScale.hpp | 6 +++--- .../openmw-mp/Packets/World/PacketObjectSpawn.hpp | 6 +++--- .../openmw-mp/Packets/World/PacketObjectState.hpp | 6 +++--- .../openmw-mp/Packets/World/PacketObjectTrap.hpp | 6 +++--- .../Packets/World/PacketScriptGlobalShort.hpp | 6 +++--- .../openmw-mp/Packets/World/PacketScriptLocalFloat.hpp | 6 +++--- .../openmw-mp/Packets/World/PacketScriptLocalShort.hpp | 6 +++--- .../Packets/World/PacketScriptMemberShort.hpp | 6 +++--- components/openmw-mp/Packets/World/PacketVideoPlay.hpp | 6 +++--- components/openmw-mp/Packets/World/WorldPacket.cpp | 5 ----- components/openmw-mp/Packets/World/WorldPacket.hpp | 8 ++++---- 85 files changed, 190 insertions(+), 210 deletions(-) diff --git a/components/openmw-mp/Base/BasePacketProcessor.hpp b/components/openmw-mp/Base/BasePacketProcessor.hpp index 6fd23002d..88dd641b2 100644 --- a/components/openmw-mp/Base/BasePacketProcessor.hpp +++ b/components/openmw-mp/Base/BasePacketProcessor.hpp @@ -38,7 +38,7 @@ public: throw std::logic_error("processor " + p.second->strPacketID + " already registered. Check " + 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: unsigned char packetID; diff --git a/components/openmw-mp/Controllers/ActorPacketController.cpp b/components/openmw-mp/Controllers/ActorPacketController.cpp index b585805f9..7cf05e3ca 100644 --- a/components/openmw-mp/Controllers/ActorPacketController.cpp +++ b/components/openmw-mp/Controllers/ActorPacketController.cpp @@ -20,7 +20,7 @@ inline void AddPacket(mwmp::ActorPacketController::packets_t *packets, RakNet::R { T *packet = new T(peer); 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) diff --git a/components/openmw-mp/Controllers/PlayerPacketController.cpp b/components/openmw-mp/Controllers/PlayerPacketController.cpp index ca20ead80..2850702d7 100644 --- a/components/openmw-mp/Controllers/PlayerPacketController.cpp +++ b/components/openmw-mp/Controllers/PlayerPacketController.cpp @@ -46,7 +46,7 @@ inline void AddPacket(mwmp::PlayerPacketController::packets_t *packets, RakNet:: { T *packet = new T(peer); 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) diff --git a/components/openmw-mp/Controllers/WorldPacketController.cpp b/components/openmw-mp/Controllers/WorldPacketController.cpp index bf190b6fe..612da93b0 100644 --- a/components/openmw-mp/Controllers/WorldPacketController.cpp +++ b/components/openmw-mp/Controllers/WorldPacketController.cpp @@ -27,7 +27,7 @@ inline void AddPacket(mwmp::WorldPacketController::packets_t *packets, RakNet::R { T *packet = new T(peer); 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) diff --git a/components/openmw-mp/Packets/Actor/ActorPacket.cpp b/components/openmw-mp/Packets/Actor/ActorPacket.cpp index 37ae661fc..4692769a4 100644 --- a/components/openmw-mp/Packets/Actor/ActorPacket.cpp +++ b/components/openmw-mp/Packets/Actor/ActorPacket.cpp @@ -14,11 +14,6 @@ ActorPacket::ActorPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer) this->peer = peer; } -ActorPacket::~ActorPacket() -{ - -} - void ActorPacket::setActorList(BaseActorList *actorList) { this->actorList = actorList; diff --git a/components/openmw-mp/Packets/Actor/ActorPacket.hpp b/components/openmw-mp/Packets/Actor/ActorPacket.hpp index f137d6931..917c4eeb9 100644 --- a/components/openmw-mp/Packets/Actor/ActorPacket.hpp +++ b/components/openmw-mp/Packets/Actor/ActorPacket.hpp @@ -15,13 +15,13 @@ namespace mwmp class ActorPacket : public BasePacket { public: - ActorPacket(RakNet::RakPeerInterface *peer); + explicit ActorPacket(RakNet::RakPeerInterface *peer); - ~ActorPacket(); + ~ActorPacket() override = default; void setActorList(BaseActorList *actorList); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; protected: bool PacketHeader(RakNet::BitStream *bs, bool send); virtual void Actor(BaseActor &actor, bool send) {}; diff --git a/components/openmw-mp/Packets/Actor/PacketActorAI.hpp b/components/openmw-mp/Packets/Actor/PacketActorAI.hpp index c1c187a9c..ad8be1af1 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorAI.hpp +++ b/components/openmw-mp/Packets/Actor/PacketActorAI.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketActorAI : public ActorPacket + class PacketActorAI final: public ActorPacket { public: - PacketActorAI(RakNet::RakPeerInterface *peer); + explicit PacketActorAI(RakNet::RakPeerInterface *peer); - virtual void Actor(BaseActor &actor, bool send); + void Actor(BaseActor &actor, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Actor/PacketActorAnimFlags.hpp b/components/openmw-mp/Packets/Actor/PacketActorAnimFlags.hpp index 0b52f36ae..e8c8bf8b8 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorAnimFlags.hpp +++ b/components/openmw-mp/Packets/Actor/PacketActorAnimFlags.hpp @@ -5,10 +5,10 @@ namespace mwmp { - class PacketActorAnimFlags : public ActorPacket + class PacketActorAnimFlags final: public ActorPacket { public: - PacketActorAnimFlags(RakNet::RakPeerInterface *peer); + explicit PacketActorAnimFlags(RakNet::RakPeerInterface *peer); void Actor(BaseActor &actor, bool send) final; }; diff --git a/components/openmw-mp/Packets/Actor/PacketActorAnimPlay.hpp b/components/openmw-mp/Packets/Actor/PacketActorAnimPlay.hpp index 0bf818b58..8086db70f 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorAnimPlay.hpp +++ b/components/openmw-mp/Packets/Actor/PacketActorAnimPlay.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketActorAnimPlay : public ActorPacket + class PacketActorAnimPlay final: public ActorPacket { public: - PacketActorAnimPlay(RakNet::RakPeerInterface *peer); + explicit PacketActorAnimPlay(RakNet::RakPeerInterface *peer); - virtual void Actor(BaseActor &actor, bool send); + void Actor(BaseActor &actor, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Actor/PacketActorAttack.hpp b/components/openmw-mp/Packets/Actor/PacketActorAttack.hpp index d924da8df..8dab8fb89 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorAttack.hpp +++ b/components/openmw-mp/Packets/Actor/PacketActorAttack.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketActorAttack : public ActorPacket + class PacketActorAttack final: public ActorPacket { public: - PacketActorAttack(RakNet::RakPeerInterface *peer); + explicit PacketActorAttack(RakNet::RakPeerInterface *peer); - virtual void Actor(BaseActor &actor, bool send); + void Actor(BaseActor &actor, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Actor/PacketActorAuthority.hpp b/components/openmw-mp/Packets/Actor/PacketActorAuthority.hpp index 3ddf52210..568b6ef81 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorAuthority.hpp +++ b/components/openmw-mp/Packets/Actor/PacketActorAuthority.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketActorAuthority : public ActorPacket + class PacketActorAuthority final: public ActorPacket { 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; }; } diff --git a/components/openmw-mp/Packets/Actor/PacketActorCellChange.hpp b/components/openmw-mp/Packets/Actor/PacketActorCellChange.hpp index cee4ecbda..b15a30764 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorCellChange.hpp +++ b/components/openmw-mp/Packets/Actor/PacketActorCellChange.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketActorCellChange : public ActorPacket + class PacketActorCellChange final: public ActorPacket { public: - PacketActorCellChange(RakNet::RakPeerInterface *peer); + explicit PacketActorCellChange(RakNet::RakPeerInterface *peer); - virtual void Actor(BaseActor &actor, bool send); + void Actor(BaseActor &actor, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Actor/PacketActorDeath.hpp b/components/openmw-mp/Packets/Actor/PacketActorDeath.hpp index 13ab4463a..36e414290 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorDeath.hpp +++ b/components/openmw-mp/Packets/Actor/PacketActorDeath.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketActorDeath : public ActorPacket + class PacketActorDeath final: public ActorPacket { public: - PacketActorDeath(RakNet::RakPeerInterface *peer); + explicit PacketActorDeath(RakNet::RakPeerInterface *peer); - virtual void Actor(BaseActor &actor, bool send); + void Actor(BaseActor &actor, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Actor/PacketActorEquipment.hpp b/components/openmw-mp/Packets/Actor/PacketActorEquipment.hpp index 8d8ed3946..e950fced5 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorEquipment.hpp +++ b/components/openmw-mp/Packets/Actor/PacketActorEquipment.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketActorEquipment : public ActorPacket + class PacketActorEquipment final: public ActorPacket { public: - PacketActorEquipment(RakNet::RakPeerInterface *peer); + explicit PacketActorEquipment(RakNet::RakPeerInterface *peer); - virtual void Actor(BaseActor &actor, bool send); + void Actor(BaseActor &actor, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Actor/PacketActorList.hpp b/components/openmw-mp/Packets/Actor/PacketActorList.hpp index 6ee48cdcc..757340ea5 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorList.hpp +++ b/components/openmw-mp/Packets/Actor/PacketActorList.hpp @@ -5,10 +5,10 @@ namespace mwmp { - class PacketActorList : public ActorPacket + class PacketActorList final: public ActorPacket { public: - PacketActorList(RakNet::RakPeerInterface *peer); + explicit PacketActorList(RakNet::RakPeerInterface *peer); void Packet(RakNet::BitStream *bs, bool send) final; }; diff --git a/components/openmw-mp/Packets/Actor/PacketActorPosition.hpp b/components/openmw-mp/Packets/Actor/PacketActorPosition.hpp index a0cee62f6..db65c442a 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorPosition.hpp +++ b/components/openmw-mp/Packets/Actor/PacketActorPosition.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketActorPosition : public ActorPacket + class PacketActorPosition final: public ActorPacket { public: - PacketActorPosition(RakNet::RakPeerInterface *peer); + explicit PacketActorPosition(RakNet::RakPeerInterface *peer); - virtual void Actor(BaseActor &actor, bool send); + void Actor(BaseActor &actor, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Actor/PacketActorSpeech.hpp b/components/openmw-mp/Packets/Actor/PacketActorSpeech.hpp index 0c0b4f7f9..4dd169f55 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorSpeech.hpp +++ b/components/openmw-mp/Packets/Actor/PacketActorSpeech.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketActorSpeech : public ActorPacket + class PacketActorSpeech final: public ActorPacket { public: - PacketActorSpeech(RakNet::RakPeerInterface *peer); + explicit PacketActorSpeech(RakNet::RakPeerInterface *peer); - virtual void Actor(BaseActor &actor, bool send); + void Actor(BaseActor &actor, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Actor/PacketActorStatsDynamic.hpp b/components/openmw-mp/Packets/Actor/PacketActorStatsDynamic.hpp index c5c26599a..d0c38ff9a 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorStatsDynamic.hpp +++ b/components/openmw-mp/Packets/Actor/PacketActorStatsDynamic.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketActorStatsDynamic : public ActorPacket + class PacketActorStatsDynamic final: public ActorPacket { public: - PacketActorStatsDynamic(RakNet::RakPeerInterface *peer); + explicit PacketActorStatsDynamic(RakNet::RakPeerInterface *peer); - virtual void Actor(BaseActor &actor, bool send); + void Actor(BaseActor &actor, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Actor/PacketActorTest.hpp b/components/openmw-mp/Packets/Actor/PacketActorTest.hpp index d53e2fecd..6f6ed8d9a 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorTest.hpp +++ b/components/openmw-mp/Packets/Actor/PacketActorTest.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketActorTest : public ActorPacket + class PacketActorTest final: public ActorPacket { public: - PacketActorTest(RakNet::RakPeerInterface *peer); + explicit PacketActorTest(RakNet::RakPeerInterface *peer); - virtual void Actor(BaseActor &actor, bool send); + void Actor(BaseActor &actor, bool send) override; }; } diff --git a/components/openmw-mp/Packets/BasePacket.cpp b/components/openmw-mp/Packets/BasePacket.cpp index 483e783cf..93de1762c 100644 --- a/components/openmw-mp/Packets/BasePacket.cpp +++ b/components/openmw-mp/Packets/BasePacket.cpp @@ -14,11 +14,6 @@ BasePacket::BasePacket(RakNet::RakPeerInterface *peer) this->peer = peer; } -BasePacket::~BasePacket() -{ - -} - void BasePacket::Packet(RakNet::BitStream *bs, bool send) { this->bs = bs; diff --git a/components/openmw-mp/Packets/BasePacket.hpp b/components/openmw-mp/Packets/BasePacket.hpp index 26b48e2d7..1c7bb19b2 100644 --- a/components/openmw-mp/Packets/BasePacket.hpp +++ b/components/openmw-mp/Packets/BasePacket.hpp @@ -12,9 +12,9 @@ namespace mwmp class BasePacket { public: - BasePacket(RakNet::RakPeerInterface *peer); + explicit BasePacket(RakNet::RakPeerInterface *peer); - virtual ~BasePacket(); + virtual ~BasePacket() = default; virtual void Packet(RakNet::BitStream *bs, bool send); virtual uint32_t Send(bool toOtherPlayers = true); @@ -29,12 +29,12 @@ namespace mwmp void SetStreams(RakNet::BitStream *inStream, RakNet::BitStream *outStream); 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(1 + RakNet::RakNetGUID::size()); // packetID + RakNetGUID (uint64_t) } - unsigned char GetPacketID() + unsigned char GetPacketID() const { return packetID; } diff --git a/components/openmw-mp/Packets/PacketPreInit.hpp b/components/openmw-mp/Packets/PacketPreInit.hpp index ff1281752..a973f0603 100644 --- a/components/openmw-mp/Packets/PacketPreInit.hpp +++ b/components/openmw-mp/Packets/PacketPreInit.hpp @@ -11,16 +11,16 @@ namespace mwmp { - class PacketPreInit : public BasePacket + class PacketPreInit final: public BasePacket { public: typedef std::vector HashList; typedef std::pair PluginPair; typedef std::vector 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); private: PluginContainer *checksums; diff --git a/components/openmw-mp/Packets/Player/PacketChatMessage.hpp b/components/openmw-mp/Packets/Player/PacketChatMessage.hpp index 937e59f03..fa1020a4e 100644 --- a/components/openmw-mp/Packets/Player/PacketChatMessage.hpp +++ b/components/openmw-mp/Packets/Player/PacketChatMessage.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketChatMessage : public PlayerPacket + class PacketChatMessage final: public PlayerPacket { public: PacketChatMessage(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketDisconnect.hpp b/components/openmw-mp/Packets/Player/PacketDisconnect.hpp index df3eff5a6..5dcc0f0f4 100644 --- a/components/openmw-mp/Packets/Player/PacketDisconnect.hpp +++ b/components/openmw-mp/Packets/Player/PacketDisconnect.hpp @@ -10,7 +10,7 @@ namespace mwmp { - class PacketDisconnect : public PlayerPacket + class PacketDisconnect final: public PlayerPacket { public: PacketDisconnect(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) diff --git a/components/openmw-mp/Packets/Player/PacketGUIBoxes.hpp b/components/openmw-mp/Packets/Player/PacketGUIBoxes.hpp index 6a5a5c870..058c2b821 100644 --- a/components/openmw-mp/Packets/Player/PacketGUIBoxes.hpp +++ b/components/openmw-mp/Packets/Player/PacketGUIBoxes.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketGUIBoxes : public PlayerPacket + class PacketGUIBoxes final: public PlayerPacket { public: PacketGUIBoxes(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketGUIWindow.hpp b/components/openmw-mp/Packets/Player/PacketGUIWindow.hpp index 9bd6a340f..e8e098a32 100644 --- a/components/openmw-mp/Packets/Player/PacketGUIWindow.hpp +++ b/components/openmw-mp/Packets/Player/PacketGUIWindow.hpp @@ -9,11 +9,11 @@ namespace mwmp { - class PacketGUIWindow : public PlayerPacket + class PacketGUIWindow final: public PlayerPacket { public: PacketGUIWindow(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketGameSettings.hpp b/components/openmw-mp/Packets/Player/PacketGameSettings.hpp index 1ee0db4be..328562700 100644 --- a/components/openmw-mp/Packets/Player/PacketGameSettings.hpp +++ b/components/openmw-mp/Packets/Player/PacketGameSettings.hpp @@ -6,12 +6,12 @@ namespace mwmp { - class PacketGameSettings: public PlayerPacket + class PacketGameSettings final: public PlayerPacket { public: PacketGameSettings(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketGameTime.hpp b/components/openmw-mp/Packets/Player/PacketGameTime.hpp index 9f48f8674..2bafaab82 100644 --- a/components/openmw-mp/Packets/Player/PacketGameTime.hpp +++ b/components/openmw-mp/Packets/Player/PacketGameTime.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketGameTime : public PlayerPacket + class PacketGameTime final: public PlayerPacket { public: PacketGameTime(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketGameWeather.hpp b/components/openmw-mp/Packets/Player/PacketGameWeather.hpp index 3d6806953..50d1a42ed 100644 --- a/components/openmw-mp/Packets/Player/PacketGameWeather.hpp +++ b/components/openmw-mp/Packets/Player/PacketGameWeather.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketGameWeather : public PlayerPacket + class PacketGameWeather final: public PlayerPacket { public: PacketGameWeather(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketHandshake.hpp b/components/openmw-mp/Packets/Player/PacketHandshake.hpp index e6494c04f..f141574f2 100644 --- a/components/openmw-mp/Packets/Player/PacketHandshake.hpp +++ b/components/openmw-mp/Packets/Player/PacketHandshake.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketHandshake : public PlayerPacket + class PacketHandshake final: public PlayerPacket { public: PacketHandshake(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketLoaded.hpp b/components/openmw-mp/Packets/Player/PacketLoaded.hpp index f26dc5353..f5806cb05 100644 --- a/components/openmw-mp/Packets/Player/PacketLoaded.hpp +++ b/components/openmw-mp/Packets/Player/PacketLoaded.hpp @@ -9,7 +9,7 @@ namespace mwmp { - class PacketLoaded : public PlayerPacket + class PacketLoaded final: public PlayerPacket { public: PacketLoaded(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) diff --git a/components/openmw-mp/Packets/Player/PacketPlayerActiveSkills.hpp b/components/openmw-mp/Packets/Player/PacketPlayerActiveSkills.hpp index bc33bbe74..d1c627124 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerActiveSkills.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerActiveSkills.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketPlayerActiveSkills : public PlayerPacket + class PacketPlayerActiveSkills final: public PlayerPacket { public: PacketPlayerActiveSkills(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerAnimFlags.hpp b/components/openmw-mp/Packets/Player/PacketPlayerAnimFlags.hpp index 7cae56aec..fe7e493ca 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerAnimFlags.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerAnimFlags.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketPlayerAnimFlags : public PlayerPacket + class PacketPlayerAnimFlags final: public PlayerPacket { public: PacketPlayerAnimFlags(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerAnimPlay.hpp b/components/openmw-mp/Packets/Player/PacketPlayerAnimPlay.hpp index 112a81d02..150dcbee8 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerAnimPlay.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerAnimPlay.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerAnimPlay : public PlayerPacket + class PacketPlayerAnimPlay final: public PlayerPacket { public: PacketPlayerAnimPlay(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerAttack.hpp b/components/openmw-mp/Packets/Player/PacketPlayerAttack.hpp index 65a08e8b5..4b2273f23 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerAttack.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerAttack.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketPlayerAttack : public PlayerPacket + class PacketPlayerAttack final: public PlayerPacket { public: PacketPlayerAttack(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerAttribute.hpp b/components/openmw-mp/Packets/Player/PacketPlayerAttribute.hpp index 5945a278b..20644cd09 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerAttribute.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerAttribute.hpp @@ -9,13 +9,13 @@ namespace mwmp { - class PacketPlayerAttribute : public PlayerPacket + class PacketPlayerAttribute final: public PlayerPacket { public: const static int AttributeCount = 8; PacketPlayerAttribute(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerBaseInfo.hpp b/components/openmw-mp/Packets/Player/PacketPlayerBaseInfo.hpp index c4f26829e..2ae47c177 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerBaseInfo.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerBaseInfo.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketPlayerBaseInfo : public PlayerPacket + class PacketPlayerBaseInfo final: public PlayerPacket { public: PacketPlayerBaseInfo(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerBook.hpp b/components/openmw-mp/Packets/Player/PacketPlayerBook.hpp index b25d45d36..e3824f54e 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerBook.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerBook.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerBook : public PlayerPacket + class PacketPlayerBook final: public PlayerPacket { public: PacketPlayerBook(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerBounty.hpp b/components/openmw-mp/Packets/Player/PacketPlayerBounty.hpp index 5dd7b1a77..82259e20b 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerBounty.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerBounty.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerBounty : public PlayerPacket + class PacketPlayerBounty final: public PlayerPacket { public: PacketPlayerBounty(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerCellChange.hpp b/components/openmw-mp/Packets/Player/PacketPlayerCellChange.hpp index 409b2eede..052d4b99f 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerCellChange.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerCellChange.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketPlayerCellChange : public PlayerPacket + class PacketPlayerCellChange final: public PlayerPacket { public: PacketPlayerCellChange(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerCellState.hpp b/components/openmw-mp/Packets/Player/PacketPlayerCellState.hpp index bfad68ed0..83345d2ac 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerCellState.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerCellState.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerCellState : public PlayerPacket + class PacketPlayerCellState final: public PlayerPacket { public: PacketPlayerCellState(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerCharGen.hpp b/components/openmw-mp/Packets/Player/PacketPlayerCharGen.hpp index fa3e778c7..a036a8c2b 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerCharGen.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerCharGen.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketPlayerCharGen : public PlayerPacket + class PacketPlayerCharGen final: public PlayerPacket { public: PacketPlayerCharGen(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerClass.hpp b/components/openmw-mp/Packets/Player/PacketPlayerClass.hpp index 33c685f65..bff3eeb14 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerClass.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerClass.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketPlayerClass : public PlayerPacket + class PacketPlayerClass final: public PlayerPacket { public: PacketPlayerClass(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerDeath.hpp b/components/openmw-mp/Packets/Player/PacketPlayerDeath.hpp index ba48a56ee..12c34366a 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerDeath.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerDeath.hpp @@ -11,7 +11,7 @@ namespace mwmp { - class PacketPlayerDeath: public PlayerPacket + class PacketPlayerDeath final: public PlayerPacket { public: PacketPlayerDeath(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) diff --git a/components/openmw-mp/Packets/Player/PacketPlayerEquipment.hpp b/components/openmw-mp/Packets/Player/PacketPlayerEquipment.hpp index c204f8579..2d110e09d 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerEquipment.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerEquipment.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketPlayerEquipment : public PlayerPacket + class PacketPlayerEquipment final: public PlayerPacket { public: PacketPlayerEquipment(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerFaction.hpp b/components/openmw-mp/Packets/Player/PacketPlayerFaction.hpp index 73efd2c6b..f30652f29 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerFaction.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerFaction.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerFaction : public PlayerPacket + class PacketPlayerFaction final: public PlayerPacket { public: PacketPlayerFaction(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerInventory.hpp b/components/openmw-mp/Packets/Player/PacketPlayerInventory.hpp index 1bc97fbb2..cb8f3709b 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerInventory.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerInventory.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketPlayerInventory : public PlayerPacket + class PacketPlayerInventory final: public PlayerPacket { public: PacketPlayerInventory(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerJail.hpp b/components/openmw-mp/Packets/Player/PacketPlayerJail.hpp index 836bd1100..eebce4172 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerJail.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerJail.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerJail : public PlayerPacket + class PacketPlayerJail final: public PlayerPacket { public: PacketPlayerJail(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerJournal.hpp b/components/openmw-mp/Packets/Player/PacketPlayerJournal.hpp index 189af506f..8f75edaba 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerJournal.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerJournal.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerJournal : public PlayerPacket + class PacketPlayerJournal final: public PlayerPacket { public: PacketPlayerJournal(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerKillCount.hpp b/components/openmw-mp/Packets/Player/PacketPlayerKillCount.hpp index 6883d3507..1894037b6 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerKillCount.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerKillCount.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerKillCount : public PlayerPacket + class PacketPlayerKillCount final: public PlayerPacket { public: PacketPlayerKillCount(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerLevel.hpp b/components/openmw-mp/Packets/Player/PacketPlayerLevel.hpp index dac2aebec..f478d5f71 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerLevel.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerLevel.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerLevel : public PlayerPacket + class PacketPlayerLevel final: public PlayerPacket { public: PacketPlayerLevel(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerMap.hpp b/components/openmw-mp/Packets/Player/PacketPlayerMap.hpp index bc351989a..5c63eb9b4 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerMap.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerMap.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerMap : public PlayerPacket + class PacketPlayerMap final: public PlayerPacket { public: PacketPlayerMap(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerPosition.hpp b/components/openmw-mp/Packets/Player/PacketPlayerPosition.hpp index dcbc56213..5e8a1920a 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerPosition.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerPosition.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketPlayerPosition : public PlayerPacket + class PacketPlayerPosition final: public PlayerPacket { public: PacketPlayerPosition(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerRegionAuthority.hpp b/components/openmw-mp/Packets/Player/PacketPlayerRegionAuthority.hpp index 8180b79f7..88844c0a4 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerRegionAuthority.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerRegionAuthority.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerRegionAuthority : public PlayerPacket + class PacketPlayerRegionAuthority final: public PlayerPacket { public: PacketPlayerRegionAuthority(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerRest.hpp b/components/openmw-mp/Packets/Player/PacketPlayerRest.hpp index a7637f678..c3666afd1 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerRest.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerRest.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerRest : public PlayerPacket + class PacketPlayerRest final: public PlayerPacket { public: PacketPlayerRest(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerResurrect.hpp b/components/openmw-mp/Packets/Player/PacketPlayerResurrect.hpp index 3eda3b0e6..6a37e3ee7 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerResurrect.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerResurrect.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerResurrect : public PlayerPacket + class PacketPlayerResurrect final: public PlayerPacket { public: PacketPlayerResurrect(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerShapeshift.hpp b/components/openmw-mp/Packets/Player/PacketPlayerShapeshift.hpp index fb6c41045..78313c4de 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerShapeshift.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerShapeshift.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerShapeshift : public PlayerPacket + class PacketPlayerShapeshift final: public PlayerPacket { public: PacketPlayerShapeshift(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerSkill.hpp b/components/openmw-mp/Packets/Player/PacketPlayerSkill.hpp index fc71c720c..7922dd9b5 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerSkill.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerSkill.hpp @@ -9,14 +9,14 @@ namespace mwmp { - class PacketPlayerSkill : public PlayerPacket + class PacketPlayerSkill final: public PlayerPacket { public: const static int SkillCount = 27; const static int AttributeCount = 8; PacketPlayerSkill(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerSpeech.hpp b/components/openmw-mp/Packets/Player/PacketPlayerSpeech.hpp index 98f38319c..271ad667e 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerSpeech.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerSpeech.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerSpeech : public PlayerPacket + class PacketPlayerSpeech final: public PlayerPacket { public: PacketPlayerSpeech(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerSpellbook.hpp b/components/openmw-mp/Packets/Player/PacketPlayerSpellbook.hpp index eeaa4c13c..94517be02 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerSpellbook.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerSpellbook.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerSpellbook : public PlayerPacket + class PacketPlayerSpellbook final: public PlayerPacket { public: PacketPlayerSpellbook(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerStatsDynamic.hpp b/components/openmw-mp/Packets/Player/PacketPlayerStatsDynamic.hpp index 799f901a4..ede751d91 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerStatsDynamic.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerStatsDynamic.hpp @@ -9,12 +9,12 @@ namespace mwmp { - class PacketPlayerStatsDynamic : public PlayerPacket + class PacketPlayerStatsDynamic final: public PlayerPacket { public: PacketPlayerStatsDynamic(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerTopic.hpp b/components/openmw-mp/Packets/Player/PacketPlayerTopic.hpp index d111b1e74..9e0788980 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerTopic.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerTopic.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketPlayerTopic : public PlayerPacket + class PacketPlayerTopic final: public PlayerPacket { public: PacketPlayerTopic(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Player/PlayerPacket.cpp b/components/openmw-mp/Packets/Player/PlayerPacket.cpp index a0544809d..d01634ea5 100644 --- a/components/openmw-mp/Packets/Player/PlayerPacket.cpp +++ b/components/openmw-mp/Packets/Player/PlayerPacket.cpp @@ -14,11 +14,6 @@ PlayerPacket::PlayerPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer) this->peer = peer; } -PlayerPacket::~PlayerPacket() -{ - -} - void PlayerPacket::setPlayer(BasePlayer *player) { this->player = player; diff --git a/components/openmw-mp/Packets/Player/PlayerPacket.hpp b/components/openmw-mp/Packets/Player/PlayerPacket.hpp index 1f6e0fa05..babe1d028 100644 --- a/components/openmw-mp/Packets/Player/PlayerPacket.hpp +++ b/components/openmw-mp/Packets/Player/PlayerPacket.hpp @@ -16,7 +16,7 @@ namespace mwmp public: PlayerPacket(RakNet::RakPeerInterface *peer); - ~PlayerPacket(); + ~PlayerPacket() override = default; void setPlayer(BasePlayer *player); BasePlayer *getPlayer(); diff --git a/components/openmw-mp/Packets/World/PacketConsoleCommand.hpp b/components/openmw-mp/Packets/World/PacketConsoleCommand.hpp index f04d2c247..6ce630ea1 100644 --- a/components/openmw-mp/Packets/World/PacketConsoleCommand.hpp +++ b/components/openmw-mp/Packets/World/PacketConsoleCommand.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketConsoleCommand : public WorldPacket + class PacketConsoleCommand final: public WorldPacket { public: - PacketConsoleCommand(RakNet::RakPeerInterface *peer); + explicit PacketConsoleCommand(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &obj, bool send); + void Object(WorldObject &obj, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketContainer.hpp b/components/openmw-mp/Packets/World/PacketContainer.hpp index 28a885283..0b42cb3f4 100644 --- a/components/openmw-mp/Packets/World/PacketContainer.hpp +++ b/components/openmw-mp/Packets/World/PacketContainer.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketContainer : public WorldPacket + class PacketContainer final: public WorldPacket { 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; }; } diff --git a/components/openmw-mp/Packets/World/PacketDoorState.hpp b/components/openmw-mp/Packets/World/PacketDoorState.hpp index 91f38f033..a156182da 100644 --- a/components/openmw-mp/Packets/World/PacketDoorState.hpp +++ b/components/openmw-mp/Packets/World/PacketDoorState.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketDoorState : public WorldPacket + class PacketDoorState final: public WorldPacket { public: - PacketDoorState(RakNet::RakPeerInterface *peer); + explicit PacketDoorState(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + void Object(WorldObject &worldObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketMusicPlay.hpp b/components/openmw-mp/Packets/World/PacketMusicPlay.hpp index 748b0d1d2..aa98f3bb9 100644 --- a/components/openmw-mp/Packets/World/PacketMusicPlay.hpp +++ b/components/openmw-mp/Packets/World/PacketMusicPlay.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketMusicPlay : public WorldPacket + class PacketMusicPlay final: public WorldPacket { public: - PacketMusicPlay(RakNet::RakPeerInterface *peer); + explicit PacketMusicPlay(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + void Object(WorldObject &worldObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectAnimPlay.hpp b/components/openmw-mp/Packets/World/PacketObjectAnimPlay.hpp index c6443bad4..4cbe94200 100644 --- a/components/openmw-mp/Packets/World/PacketObjectAnimPlay.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectAnimPlay.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketObjectAnimPlay : public WorldPacket + class PacketObjectAnimPlay final: public WorldPacket { public: - PacketObjectAnimPlay(RakNet::RakPeerInterface *peer); + explicit PacketObjectAnimPlay(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + void Object(WorldObject &worldObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectDelete.hpp b/components/openmw-mp/Packets/World/PacketObjectDelete.hpp index 4b91d348e..ba33b6b9e 100644 --- a/components/openmw-mp/Packets/World/PacketObjectDelete.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectDelete.hpp @@ -5,10 +5,10 @@ namespace mwmp { - class PacketObjectDelete : public WorldPacket + class PacketObjectDelete final: public WorldPacket { public: - PacketObjectDelete(RakNet::RakPeerInterface *peer); + explicit PacketObjectDelete(RakNet::RakPeerInterface *peer); }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectLock.hpp b/components/openmw-mp/Packets/World/PacketObjectLock.hpp index 691b3bf84..536ce45b6 100644 --- a/components/openmw-mp/Packets/World/PacketObjectLock.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectLock.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketObjectLock : public WorldPacket + class PacketObjectLock final: public WorldPacket { public: - PacketObjectLock(RakNet::RakPeerInterface *peer); + explicit PacketObjectLock(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + void Object(WorldObject &worldObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectMove.hpp b/components/openmw-mp/Packets/World/PacketObjectMove.hpp index f92487212..66de4bb5b 100644 --- a/components/openmw-mp/Packets/World/PacketObjectMove.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectMove.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketObjectMove : public WorldPacket + class PacketObjectMove final: public WorldPacket { public: - PacketObjectMove(RakNet::RakPeerInterface *peer); + explicit PacketObjectMove(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + void Object(WorldObject &worldObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectPlace.hpp b/components/openmw-mp/Packets/World/PacketObjectPlace.hpp index d50c881df..3ee3e4be0 100644 --- a/components/openmw-mp/Packets/World/PacketObjectPlace.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectPlace.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketObjectPlace : public WorldPacket + class PacketObjectPlace final: public WorldPacket { public: - PacketObjectPlace(RakNet::RakPeerInterface *peer); + explicit PacketObjectPlace(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + void Object(WorldObject &worldObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectRotate.hpp b/components/openmw-mp/Packets/World/PacketObjectRotate.hpp index b438a8372..6720b847e 100644 --- a/components/openmw-mp/Packets/World/PacketObjectRotate.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectRotate.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketObjectRotate : public WorldPacket + class PacketObjectRotate final: public WorldPacket { public: - PacketObjectRotate(RakNet::RakPeerInterface *peer); + explicit PacketObjectRotate(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + void Object(WorldObject &worldObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectScale.hpp b/components/openmw-mp/Packets/World/PacketObjectScale.hpp index 8e5d2b431..97a16c516 100644 --- a/components/openmw-mp/Packets/World/PacketObjectScale.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectScale.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketObjectScale : public WorldPacket + class PacketObjectScale final: public WorldPacket { public: - PacketObjectScale(RakNet::RakPeerInterface *peer); + explicit PacketObjectScale(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + void Object(WorldObject &worldObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectSpawn.hpp b/components/openmw-mp/Packets/World/PacketObjectSpawn.hpp index 1f6973268..2c9040049 100644 --- a/components/openmw-mp/Packets/World/PacketObjectSpawn.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectSpawn.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketObjectSpawn : public WorldPacket + class PacketObjectSpawn final: public WorldPacket { public: - PacketObjectSpawn(RakNet::RakPeerInterface *peer); + explicit PacketObjectSpawn(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + void Object(WorldObject &worldObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectState.hpp b/components/openmw-mp/Packets/World/PacketObjectState.hpp index 1fb2f2c90..90c83316c 100644 --- a/components/openmw-mp/Packets/World/PacketObjectState.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectState.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketObjectState : public WorldPacket + class PacketObjectState final: public WorldPacket { public: - PacketObjectState(RakNet::RakPeerInterface *peer); + explicit PacketObjectState(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + void Object(WorldObject &worldObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectTrap.hpp b/components/openmw-mp/Packets/World/PacketObjectTrap.hpp index aadbd037d..ab5dac8ea 100644 --- a/components/openmw-mp/Packets/World/PacketObjectTrap.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectTrap.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketObjectTrap : public WorldPacket + class PacketObjectTrap final: public WorldPacket { public: - PacketObjectTrap(RakNet::RakPeerInterface *peer); + explicit PacketObjectTrap(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + void Object(WorldObject &worldObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketScriptGlobalShort.hpp b/components/openmw-mp/Packets/World/PacketScriptGlobalShort.hpp index ea2a3034f..f1bfa2861 100644 --- a/components/openmw-mp/Packets/World/PacketScriptGlobalShort.hpp +++ b/components/openmw-mp/Packets/World/PacketScriptGlobalShort.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketScriptGlobalShort : public WorldPacket + class PacketScriptGlobalShort final: public WorldPacket { public: - PacketScriptGlobalShort(RakNet::RakPeerInterface *peer); + explicit PacketScriptGlobalShort(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + void Object(WorldObject &worldObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketScriptLocalFloat.hpp b/components/openmw-mp/Packets/World/PacketScriptLocalFloat.hpp index adf57eda3..83791c251 100644 --- a/components/openmw-mp/Packets/World/PacketScriptLocalFloat.hpp +++ b/components/openmw-mp/Packets/World/PacketScriptLocalFloat.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketScriptLocalFloat : public WorldPacket + class PacketScriptLocalFloat final: public WorldPacket { public: - PacketScriptLocalFloat(RakNet::RakPeerInterface *peer); + explicit PacketScriptLocalFloat(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + void Object(WorldObject &worldObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketScriptLocalShort.hpp b/components/openmw-mp/Packets/World/PacketScriptLocalShort.hpp index 3c767b850..9f857b1b4 100644 --- a/components/openmw-mp/Packets/World/PacketScriptLocalShort.hpp +++ b/components/openmw-mp/Packets/World/PacketScriptLocalShort.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketScriptLocalShort : public WorldPacket + class PacketScriptLocalShort final: public WorldPacket { public: - PacketScriptLocalShort(RakNet::RakPeerInterface *peer); + explicit PacketScriptLocalShort(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &obj, bool send); + void Object(WorldObject &obj, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketScriptMemberShort.hpp b/components/openmw-mp/Packets/World/PacketScriptMemberShort.hpp index 61e99b9c0..e55d97bf3 100644 --- a/components/openmw-mp/Packets/World/PacketScriptMemberShort.hpp +++ b/components/openmw-mp/Packets/World/PacketScriptMemberShort.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketScriptMemberShort : public WorldPacket + class PacketScriptMemberShort final: public WorldPacket { public: - PacketScriptMemberShort(RakNet::RakPeerInterface *peer); + explicit PacketScriptMemberShort(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &obj, bool send); + void Object(WorldObject &obj, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/PacketVideoPlay.hpp b/components/openmw-mp/Packets/World/PacketVideoPlay.hpp index 9af2def65..14de3ca3f 100644 --- a/components/openmw-mp/Packets/World/PacketVideoPlay.hpp +++ b/components/openmw-mp/Packets/World/PacketVideoPlay.hpp @@ -5,12 +5,12 @@ namespace mwmp { - class PacketVideoPlay : public WorldPacket + class PacketVideoPlay final: public WorldPacket { public: - PacketVideoPlay(RakNet::RakPeerInterface *peer); + explicit PacketVideoPlay(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &obj, bool send); + void Object(WorldObject &obj, bool send) override; }; } diff --git a/components/openmw-mp/Packets/World/WorldPacket.cpp b/components/openmw-mp/Packets/World/WorldPacket.cpp index b85ffdf1c..da37dcd58 100644 --- a/components/openmw-mp/Packets/World/WorldPacket.cpp +++ b/components/openmw-mp/Packets/World/WorldPacket.cpp @@ -15,11 +15,6 @@ WorldPacket::WorldPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer) this->peer = peer; } -WorldPacket::~WorldPacket() -{ - -} - void WorldPacket::setEvent(BaseEvent *event) { this->event = event; diff --git a/components/openmw-mp/Packets/World/WorldPacket.hpp b/components/openmw-mp/Packets/World/WorldPacket.hpp index 4f67b9631..d788008a7 100644 --- a/components/openmw-mp/Packets/World/WorldPacket.hpp +++ b/components/openmw-mp/Packets/World/WorldPacket.hpp @@ -12,16 +12,16 @@ namespace mwmp { - class WorldPacket : public BasePacket + class WorldPacket: public BasePacket { public: - WorldPacket(RakNet::RakPeerInterface *peer); + explicit WorldPacket(RakNet::RakPeerInterface *peer); - ~WorldPacket(); + ~WorldPacket() override = default; void setEvent(BaseEvent *event); - virtual void Packet(RakNet::BitStream *bs, bool send); + void Packet(RakNet::BitStream *bs, bool send) override; protected: virtual void Object(WorldObject &worldObject, bool send);