Skip to content
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
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
option(RAKNET_BUILD_FOR_CLIENT "Build RakNet without server-side functionality" NO)

if(WIN32)
add_definitions(
-D_CRT_SECURE_NO_WARNINGS
Expand Down Expand Up @@ -50,7 +52,11 @@ target_include_directories(raknet
)

if (WIN32)
target_link_libraries(raknet Ws2_32 OMP-SDK)
target_link_libraries(raknet Ws2_32)
endif()

if (RAKNET_BUILD_FOR_CLIENT)
target_compile_definitions(raknet PUBLIC -DRAKNET_BUILD_FOR_CLIENT)
else()
target_link_libraries(raknet OMP-SDK)
endif()
6 changes: 6 additions & 0 deletions Include/raknet/RakPeer.h
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,9 @@ namespace RakNet
bool setAESKey; /// true if security is enabled.
RPCMap rpcMap; /// Mapping of RPC calls to single byte integers to save transmission bandwidth.
enum ConnectMode {NO_ACTION, DISCONNECT_ASAP, DISCONNECT_ASAP_SILENTLY, DISCONNECT_ON_NO_ACK, REQUESTED_CONNECTION, HANDLING_CONNECTION_REQUEST, UNVERIFIED_SENDER, SET_ENCRYPTION_ON_MULTIPLE_16_BYTE_PACKET, CONNECTED} connectMode;
#ifndef RAKNET_BUILD_FOR_CLIENT
SAMPRakNet::RemoteSystemData sampData;
#endif
bool isLogon;
};

Expand All @@ -529,7 +531,9 @@ namespace RakNet
friend void* UpdateNetworkLoop( void* arguments );
#endif

#ifndef RAKNET_BUILD_FOR_CLIENT
friend bool __stdcall ProcessBan(RakPeer* rakPeer, PlayerID playerId, const char* data, const int length);
#endif

// This is done to provide custom RPC handling when in a blocking RPC
Packet* ReceiveIgnoreRPC( void );
Expand All @@ -543,11 +547,13 @@ namespace RakNet
/// \return 0 if none
RemoteSystemStruct *GetRemoteSystemFromPlayerID( const PlayerID playerID, bool calledFromNetworkThread, bool onlyActive) const;
///Parse out a connection request packet
#ifndef RAKNET_BUILD_FOR_CLIENT
void ParseConnectionRequestPacket( RakPeer::RemoteSystemStruct *remoteSystem, PlayerID playerId, const char *data, int byteSize);
bool ParseConnectionAuthPacket(RakPeer::RemoteSystemStruct* remoteSystem, PlayerID playerId, unsigned char* data, int byteSize);
///When we get a connection request from an ip / port, accept it unless full
void OnConnectionRequest( RakPeer::RemoteSystemStruct *remoteSystem, unsigned char *AESKey, bool setAESKey );
void AcceptConnectionRequest(RakPeer::RemoteSystemStruct* remoteSystem);
#endif
///Send a reliable disconnect packet to this player and disconnect them when it is delivered
void NotifyAndFlagForDisconnect( const PlayerID playerId, bool performImmediate, unsigned char orderingChannel );
///Returns how many remote systems initiated a connection to us
Expand Down
2 changes: 2 additions & 0 deletions Include/raknet/RakServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,10 @@ namespace RakNet
/// \sa RakNetStatistics.h
RakNetStatisticsStruct * GetStatistics( const PlayerID playerId ) override;

#ifndef RAKNET_BUILD_FOR_CLIENT
/// Return the SAMPRakNet RemoteSystemData for a player ID
virtual SAMPRakNet::RemoteSystemData GetSAMPDataFromPlayerID(const PlayerID playerId) override;
#endif

/// Get Remote System data for a player from their ID
virtual RakPeer::RemoteSystemStruct* GetRemoteSystemFromPlayerID(const PlayerID playerId) override;
Expand Down
2 changes: 2 additions & 0 deletions Include/raknet/RakServerInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,10 @@ namespace RakNet
/// \sa RakNetStatistics.h
virtual RakNetStatisticsStruct * GetStatistics( const PlayerID playerId )=0;

#ifndef RAKNET_BUILD_FOR_CLIENT
/// Get SAMP data for a player from their ID
virtual SAMPRakNet::RemoteSystemData GetSAMPDataFromPlayerID(const PlayerID playerId) = 0;
#endif

/// Get Remote System data for a player from their ID
virtual RakPeer::RemoteSystemStruct* GetRemoteSystemFromPlayerID(const PlayerID playerId) = 0;
Expand Down
Loading