[raknet] Implement/match RakPeer::GetAnyPlayerIDFromIndex(...)

This commit is contained in:
RD42 2024-08-17 21:29:07 +08:00
parent dcfcaab9b0
commit 46575af1e9
2 changed files with 14 additions and 0 deletions

View File

@ -1466,6 +1466,18 @@ PlayerID RakPeer::GetPlayerIDFromIndex( int index )
return UNASSIGNED_PLAYER_ID;
}
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PlayerID RakPeer::GetAnyPlayerIDFromIndex( int index )
{
// remoteSystemList in user thread
if ( index >= 0 && index < maximumNumberOfPeers )
return remoteSystemList[ index ].playerId;
return UNASSIGNED_PLAYER_ID;
}
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Description:
// Bans an IP from connecting. Banned IPs persist between connections.

View File

@ -232,6 +232,8 @@ public:
/// \return The PlayerID
PlayerID GetPlayerIDFromIndex( int index );
PlayerID GetAnyPlayerIDFromIndex( int index );
/// Bans an IP from connecting. Banned IPs persist between connections but are not saved on shutdown nor loaded on startup.
/// param[in] IP Dotted IP address. Can use * as a wildcard, such as 128.0.0.* will ban all IP addresses starting with 128.0.0
/// \param[in] milliseconds how many ms for a temporary ban. Use 0 for a permanent ban