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

Classes

struct  RPCMessage
 

Public Types

enum class  Directionality { OnlyOwnerInvokes , Bidirectional }
 
- Public Types inherited from RavEngine::Queryable< RPCComponent >
typedef std::array< ctti_t, ntypes > arraytype
 

Public Member Functions

 RPCComponent (Entity owner)
 
 MOVE_NO_COPY (RPCComponent)
 
template<typename Fn >
void RegisterServerRPC (uint16_t name, const Fn &func, Directionality type=Directionality::OnlyOwnerInvokes)
 
template<typename Fn >
void RegisterClientRPC (uint16_t name, const Fn &func, Directionality type=Directionality::OnlyOwnerInvokes)
 
template<typename ... A>
constexpr void InvokeServerRPC (uint16_t id, NetworkBase::Reliability mode, A &&... args) const
 
template<typename ... A>
constexpr void InvokeClientRPCDirected (uint16_t id, HSteamNetConnection target, NetworkBase::Reliability mode, A &&... args) const
 
template<typename ... A>
constexpr void InvokeClientRPCToAllExcept (uint16_t id, HSteamNetConnection doNotSend, NetworkBase::Reliability mode, A &&... args) const
 
template<typename ... A>
constexpr void InvokeClientRPC (uint16_t id, NetworkBase::Reliability mode, A &&... args) const
 
void CacheClientRPC (const std::string_view &cmd, bool isOwner, HSteamNetConnection origin)
 
void CacheServerRPC (const std::string_view &cmd, bool isOwner, HSteamNetConnection origin)
 
void ProcessClientRPCs ()
 
void ProcessServerRPCs ()
 
void Swap ()
 
- Public Member Functions inherited from RavEngine::ComponentWithOwner
 ComponentWithOwner (const decltype(owner) o)
 
Entity GetOwner () const
 

Additional Inherited Members

- Static Public Member Functions inherited from RavEngine::Queryable< RPCComponent >
static constexpr const arraytype & GetQueryTypes ()
 
- Public Attributes inherited from RavEngine::Queryable< RPCComponent >
constexpr q_qt_def
 
- Static Public Attributes inherited from RavEngine::Queryable< RPCComponent >
static constexpr std::size_t ntypes
 
- Protected Attributes inherited from RavEngine::ComponentWithOwner
Entity owner
 

Member Function Documentation

◆ CacheClientRPC()

void RavEngine::RPCComponent::CacheClientRPC ( const std::string_view &  cmd,
bool  isOwner,
HSteamNetConnection  origin 
)
inline

Invoked automatically. For internal use only.

◆ CacheServerRPC()

void RavEngine::RPCComponent::CacheServerRPC ( const std::string_view &  cmd,
bool  isOwner,
HSteamNetConnection  origin 
)
inline

Invoked automatically. For internal use only.

◆ InvokeClientRPC()

template<typename ... A>
constexpr void RavEngine::RPCComponent::InvokeClientRPC ( uint16_t  id,
NetworkBase::Reliability  mode,
A &&...  args 
) const
inlineconstexpr

Invoke an RPC on the client

Parameters
idthe name of the RPC
modeimportance that the message arrive at the destination
argstemplated parameter list

◆ InvokeServerRPC()

template<typename ... A>
constexpr void RavEngine::RPCComponent::InvokeServerRPC ( uint16_t  id,
NetworkBase::Reliability  mode,
A &&...  args 
) const
inlineconstexpr

Invoke an RPC on the server

Parameters
idthe name of the RPC
modeimportance that the message arrive at the destination
argstemplated parameter list

◆ ProcessClientRPCs()

void RavEngine::RPCComponent::ProcessClientRPCs ( )
inline

Invoked automatically. For internal use only.

◆ ProcessServerRPCs()

void RavEngine::RPCComponent::ProcessServerRPCs ( )
inline

Invoked automatically. For internal use only.

◆ RegisterClientRPC()

template<typename Fn >
void RavEngine::RPCComponent::RegisterClientRPC ( uint16_t  name,
const Fn &  func,
Directionality  type = Directionality::OnlyOwnerInvokes 
)
inline

Register a Client RPC - this is run on a client when invoked from the server

Parameters
namethe name for the RPC (must be unique)
functhe function to call

◆ RegisterServerRPC()

template<typename Fn >
void RavEngine::RPCComponent::RegisterServerRPC ( uint16_t  name,
const Fn &  func,
Directionality  type = Directionality::OnlyOwnerInvokes 
)
inline

Register a server RPC - this is run on the server when invoked from a client

Parameters
namethe name for the RPC (must be unique)
functhe function to call

◆ Swap()

void RavEngine::RPCComponent::Swap ( )
inline

For internal use only. Switches which queue is being filled and which is being emptied


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