mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 21:45:32 +00:00
Move RequestData() method to BasePacket
This commit is contained in:
parent
fd6dd5daa8
commit
6c8c0827ea
6 changed files with 10 additions and 22 deletions
|
@ -34,4 +34,12 @@ void BasePacket::SetStreams(RakNet::BitStream *inStream, RakNet::BitStream *outS
|
|||
bsRead = inStream;
|
||||
if (outStream != 0)
|
||||
bsSend = outStream;
|
||||
}
|
||||
}
|
||||
|
||||
void BasePacket::RequestData(RakNet::RakNetGUID guid)
|
||||
{
|
||||
bsSend->ResetWritePointer();
|
||||
bsSend->Write(packetID);
|
||||
bsSend->Write(guid);
|
||||
peer->Send(bsSend, HIGH_PRIORITY, RELIABLE_ORDERED, 0, guid, false);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ namespace mwmp
|
|||
void SetReadStream(RakNet::BitStream *bitStream);
|
||||
void SetSendStream(RakNet::BitStream *bitStream);
|
||||
void SetStreams(RakNet::BitStream *inStream, RakNet::BitStream *outStream);
|
||||
virtual void RequestData(RakNet::RakNetGUID guid);
|
||||
|
||||
static size_t headerSize()
|
||||
{
|
||||
|
@ -65,7 +66,6 @@ namespace mwmp
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void RW(std::string &str, bool write)
|
||||
{
|
||||
if (write)
|
||||
|
|
|
@ -48,11 +48,3 @@ void PlayerPacket::Read(BasePlayer *player)
|
|||
{
|
||||
Packet(bsRead, player, false);
|
||||
}
|
||||
|
||||
void PlayerPacket::RequestData(RakNet::RakNetGUID guid)
|
||||
{
|
||||
bsSend->ResetWritePointer();
|
||||
bsSend->Write(packetID);
|
||||
bsSend->Write(guid);
|
||||
peer->Send(bsSend, HIGH_PRIORITY, RELIABLE_ORDERED, 0, guid, false);
|
||||
}
|
||||
|
|
|
@ -25,8 +25,6 @@ namespace mwmp
|
|||
virtual void Send(BasePlayer *player, RakNet::AddressOrGUID destination);
|
||||
virtual void Read(BasePlayer *player);
|
||||
|
||||
virtual void RequestData(RakNet::RakNetGUID guid);
|
||||
|
||||
static size_t headerSize()
|
||||
{
|
||||
return (size_t)(1 + RakNet::RakNetGUID::size()); // packetID + RakNetGUID (uint64_t)
|
||||
|
|
|
@ -48,11 +48,3 @@ void WorldPacket::Read(WorldEvent *event)
|
|||
{
|
||||
Packet(bsRead, event, false);
|
||||
}
|
||||
|
||||
void WorldPacket::RequestData(RakNet::RakNetGUID guid)
|
||||
{
|
||||
bsSend->ResetWritePointer();
|
||||
bsSend->Write(packetID);
|
||||
bsSend->Write(guid);
|
||||
peer->Send(bsSend, HIGH_PRIORITY, RELIABLE_ORDERED, 0, guid, false);
|
||||
}
|
||||
|
|
|
@ -25,8 +25,6 @@ namespace mwmp
|
|||
virtual void Send(WorldEvent *event, RakNet::AddressOrGUID destination);
|
||||
virtual void Read(WorldEvent *event);
|
||||
|
||||
virtual void RequestData(RakNet::RakNetGUID guid);
|
||||
|
||||
static size_t headerSize()
|
||||
{
|
||||
return (size_t)(1 + RakNet::RakNetGUID::size()); // packetID + RakNetGUID (uint64_t)
|
||||
|
|
Loading…
Reference in a new issue