RavEngine
Loading...
Searching...
No Matches
RavEngine::NetworkClient Class Reference
Inheritance diagram for RavEngine::NetworkClient:
[legend]
Collaboration diagram for RavEngine::NetworkClient:
[legend]

Public Member Functions

void Connect (const std::string &addr, uint16_t port)
 
void Disconnect ()
 
void SendMessageToServer (const std::string_view &msg, Reliability mode) const
 
void OnRPC (const std::string_view &cmd)
 
void SendSyncWorldRequest (Ref< World > world)
 
template<typename T >
constexpr void SetNetSpawnHook (const decltype(OnNetSpawnHooks)::value_type::second_type &func)
 

Static Public Member Functions

static void SteamNetConnectionStatusChanged (SteamNetConnectionStatusChangedCallback_t *)
 

Public Attributes

Function< void(HSteamNetConnection)> OnConnecting
 
Function< void(HSteamNetConnection)> OnConnected
 
Function< void(HSteamNetConnection)> OnLostConnection
 

Protected Member Functions

void OnSteamNetConnectionStatusChanged (SteamNetConnectionStatusChangedCallback_t *)
 
void ClientTick ()
 
void NetSpawn (const std::string_view &cmd)
 
void NetDestroy (const std::string_view &cmd)
 
void OwnershipRevoked (const std::string_view &cmd)
 
void OwnershipToThis (const std::string_view &cmd)
 

Protected Attributes

ISteamNetworkingSockets * net_interface = nullptr
 
HSteamNetConnection connection = k_HSteamNetConnection_Invalid
 
- Protected Attributes inherited from RavEngine::NetworkBase
std::thread worker
 
std::atomic< bool > workerIsRunning = false
 
std::atomic< bool > workerHasStopped = true
 
locked_node_hashmap< uuids::uuid, Entity, SpinLock > NetworkIdentities
 

Static Protected Attributes

static NetworkClient * currentClient = nullptr
 

Additional Inherited Members

- Public Types inherited from RavEngine::NetworkBase
enum  Reliability { Unreliable = k_nSteamNetworkingSend_Unreliable , Reliable = k_nSteamNetworkingSend_Reliable }
 

Member Function Documentation

◆ NetDestroy()

void NetworkClient::NetDestroy ( const std::string_view &  cmd)
protected

Invoked when destroy command is received

Parameters
cmdthe raw command from server

◆ NetSpawn()

void NetworkClient::NetSpawn ( const std::string_view &  cmd)
protected

Invoked when spawn command is received

Parameters
cmdthe raw command from server

The documentation for this class was generated from the following files: