Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RakNet InternalPacketPool & RakPeer::Send improvements and fixes #923

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Server/Components/LegacyNetwork/legacy_network_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ class RakNetLegacyNetwork final : public Network, public CoreEventHandler, publi
const PeerNetworkData::NetworkID& nid = netData.networkID;
const RakNet::PlayerID rid { unsigned(nid.address.v4), nid.port };

return rakNetServer.Send((const char*)bs.GetData(), bs.GetNumberOfUnreadBits(), RakNet::HIGH_PRIORITY, reliability, channel, rid, true);
return rakNetServer.Send(&bs, RakNet::HIGH_PRIORITY, reliability, channel, rid, true);
}
}

return rakNetServer.Send((const char*)bs.GetData(), bs.GetNumberOfUnreadBits(), RakNet::HIGH_PRIORITY, reliability, channel, RakNet::UNASSIGNED_PLAYER_ID, true);
return rakNetServer.Send(&bs, RakNet::HIGH_PRIORITY, reliability, channel, RakNet::UNASSIGNED_PLAYER_ID, true);
}

bool sendPacket(IPlayer& peer, Span<uint8_t> data, int channel, bool dispatchEvents) override
Expand Down Expand Up @@ -180,7 +180,7 @@ class RakNetLegacyNetwork final : public Network, public CoreEventHandler, publi
const PeerNetworkData::NetworkID& nid = netData.networkID;
const RakNet::PlayerID rid { unsigned(nid.address.v4), nid.port };
const RakNet::PacketReliability reliability = (channel == OrderingChannel_Reliable) ? RakNet::RELIABLE : ((channel == OrderingChannel_Unordered) ? RakNet::UNRELIABLE : RakNet::UNRELIABLE_SEQUENCED);
return rakNetServer.Send((const char*)bs.GetData(), bs.GetNumberOfBytesUsed(), RakNet::HIGH_PRIORITY, reliability, channel, rid, false);
return rakNetServer.Send(&bs, RakNet::HIGH_PRIORITY, reliability, channel, rid, false);
}

bool broadcastRPC(int id, Span<uint8_t> data, int channel, const IPlayer* exceptPeer, bool dispatchEvents) override
Expand Down
Loading