Skip to content

Commit 876f2be

Browse files
authored
Merge pull request #1215 from OpenSamp/master
Fix RPC call to use correct bit count for data transmission
2 parents 2e74b36 + 2e0a9c8 commit 876f2be

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Server/Components/LegacyNetwork/legacy_network_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,11 @@ class RakNetLegacyNetwork final : public Network, public CoreEventHandler, publi
241241
const PeerNetworkData::NetworkID& nid = netData.networkID;
242242
const RakNet::PlayerID rid { unsigned(nid.address.v4), nid.port };
243243

244-
return rakNetServer.RPC(id, (const char*)bs.GetData(), bs.GetNumberOfUnreadBits(), RakNet::HIGH_PRIORITY, reliability, channel, rid, true, false, RakNet::UNASSIGNED_NETWORK_ID, nullptr);
244+
return rakNetServer.RPC(id, (const char*)bs.GetData(), bs.GetNumberOfBitsUsed(), RakNet::HIGH_PRIORITY, reliability, channel, rid, true, false, RakNet::UNASSIGNED_NETWORK_ID, nullptr);
245245
}
246246
}
247247

248-
return rakNetServer.RPC(id, (const char*)bs.GetData(), bs.GetNumberOfUnreadBits(), RakNet::HIGH_PRIORITY, reliability, channel, RakNet::UNASSIGNED_PLAYER_ID, true, false, RakNet::UNASSIGNED_NETWORK_ID, nullptr);
248+
return rakNetServer.RPC(id, (const char*)bs.GetData(), bs.GetNumberOfBitsUsed(), RakNet::HIGH_PRIORITY, reliability, channel, RakNet::UNASSIGNED_PLAYER_ID, true, false, RakNet::UNASSIGNED_NETWORK_ID, nullptr);
249249
}
250250

251251
bool sendRPC(IPlayer& peer, int id, Span<uint8_t> data, int channel, bool dispatchEvents) override

0 commit comments

Comments
 (0)