[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 " +
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;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -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<size_t>(1 + RakNet::RakNetGUID::size()); // packetID + RakNetGUID (uint64_t)
}
unsigned char GetPacketID()
unsigned char GetPacketID() const
{
return packetID;
}

@ -11,16 +11,16 @@
namespace mwmp
{
class PacketPreInit : public BasePacket
class PacketPreInit final: public BasePacket
{
public:
typedef std::vector<unsigned> HashList;
typedef std::pair<std::string, HashList> PluginPair;
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);
private:
PluginContainer *checksums;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save