Proud::RmiContext Class Reference

Public Member Functions

PROUD_API RmiContext (MessagePriority priority, MessageReliability reliability, int unreliableS2CRoutedMulticastMaxCount, EncryptMode encryptMode=EM_None)
 
PROUD_API void AssureValidation () const
 

Public Attributes

bool m_relayed
 
HostID m_sentFrom
 
int m_unreliableS2CRoutedMulticastMaxCount
 
int m_unreliableS2CRoutedMulticastMaxPingMs
 
int m_maxDirectP2PMulticastCount
 
int64_t m_uniqueID
 
MessagePriority m_priority
 
MessageReliability m_reliability
 
bool m_enableLoopback
 
void * m_hostTag
 
bool m_enableP2PJitTrigger
 
bool m_allowRelaySend
 
double m_forceRelayThresholdRatio
 
bool m_INTERNAL_USE_isProudNetSpecificRmi
 
bool m_fragmentOnNeed
 
EncryptMode m_encryptMode
 
CompressMode m_compressMode
 

Static Public Attributes

static PROUD_API RmiContext ReliableSend
 
static PROUD_API RmiContext FastEncryptedReliableSend
 
static PROUD_API RmiContext SecureReliableSend
 
static PROUD_API RmiContext UnreliableSend
 
static PROUD_API RmiContext FastEncryptedUnreliableSend
 
static PROUD_API RmiContext SecureUnreliableSend
 
static PROUD_API RmiContext UnreliableS2CRoutedMulticast
 

Detailed Description

Networkign nature related to RMI calling and others

Member Data Documentation

PROUD_API RmiContext Proud::RmiContext::FastEncryptedReliableSend
static

Encrypt with EM_Fast mode then put this as parameter when you call RMI with Reliable message.

  • All other details are same as ReliableSend.
PROUD_API RmiContext Proud::RmiContext::FastEncryptedUnreliableSend
static

Encrypt with EM_Fast mode then put this as parameter when you call RMI with Reliable message.

  • All other details are same as ReliableSend.
bool Proud::RmiContext::m_allowRelaySend

While this value is false if opponent is relay mode then do not send it.

  • Default is true.
CompressMode Proud::RmiContext::m_compressMode

TODO:translate needed.

bool Proud::RmiContext::m_enableLoopback

While this value is false if there are 2 or more RMI receivers then excludes the messaging to itself(loopback). Default is true.

EncryptMode Proud::RmiContext::m_encryptMode

통신 메시지 암호화하기 에서 사용되는 암호화 알고리즘 선택입니다.

  • Default EM_None .
double Proud::RmiContext::m_forceRelayThresholdRatio

Forced relay critical rate value. If you change this value, it can select relay instead of P2P communication when relay is faster than P2p communication.

-For example, If packet sending time is 3 times slower than relay through a server, you may relay it through server even it can send to peer directly. This case set this value to 1/3. Also if it is 5 times slower then set 1/5. If you set 0, it does not do forced relay. Therefore it does forced relay when "Relay p2p ping / Direct p2p ping" is smaller than this value.

  • In China, server-client is faster than P2P.
  • Default is 0
bool Proud::RmiContext::m_fragmentOnNeed

Sends messages after fragmentation. Turn off this if you get higher CPU usage at server. Turned on by default.

void* Proud::RmiContext::m_hostTag

User defined tag value. A User-defined data(Tag) for each host function.

  • Caution!: tag is a value that cannot be network synchronized.
bool Proud::RmiContext::m_INTERNAL_USE_isProudNetSpecificRmi

Identifying value that message for only ProudNet or not

  • Default is false. If it is false then check number of udp messages.
  • Do not change it to true except special case.
int Proud::RmiContext::m_maxDirectP2PMulticastCount

The maximum number of direct multicast can be performed

  • One of Traffic auto-control function (Throttling)
  • When RMI transmitting to P2P group and the value is set as N, for N many of other peers of P2P group members, it will be trasmitted as direct P2P. (Of course when other peers communicate with direct P2P) However, it will be transmitted to the other peers as relayed P2P even if they are performing direct P2P communications. If 0 is set then it means there is no P2P transmission at all.
  • This function is useful when client performs a large amount of multicasts and the speed limit of client upload (e.g. ADSL line with slower upload speed). During broadcasting relayed P2P in Proudnet, client sends only 1 of message to be relayed then server performs the role that sends it to many other clients.
  • Default: infinite
  • User can designate this value to RMI parameter before it is called by client. At server, this value is not used.
MessagePriority Proud::RmiContext::m_priority
mutable

Message trnasmission priority

bool Proud::RmiContext::m_relayed

Is this a relaysed message?

MessageReliability Proud::RmiContext::m_reliability

Message trnasmission method

  • User must define.
HostID Proud::RmiContext::m_sentFrom

HostID of peer that transmitted RMI

  • The value filled at RMI stub
int64_t Proud::RmiContext::m_uniqueID

Unique ID for Transmitting the latest message only.

  • Default is 0 and does not unify if 0.
  • If the mesage to be sent is to be unified at transmission queue then this value must not designate 0 but other value.
int Proud::RmiContext::m_unreliableS2CRoutedMulticastMaxCount

If unreliable send, can perform routed multicast. This is where to decide how many of them are allowed.

  • User must define.
int Proud::RmiContext::m_unreliableS2CRoutedMulticastMaxPingMs

If unreliable messaging, can perform routed multicast. This is where to decide which rate of laggy P2P communications are allowed.

  • User must define.
PROUD_API RmiContext Proud::RmiContext::ReliableSend
static

This is to be entered as parameter when calling RMI as reliable message.

  • It is ok to use separate RmiContext object if needed but usually if the case is usual then it is ok to use this calling RMI.
PROUD_API RmiContext Proud::RmiContext::SecureReliableSend
static

Encrypt with EM_Secure mode then put this as parameter when you call RMI with Reliable message.

  • All other details are same as ReliableSend.
PROUD_API RmiContext Proud::RmiContext::SecureUnreliableSend
static

Encrypt with EM_Secure mode then put this as parameter when you call RMI with Reliable message.

  • All other details are same as ReliableSend.
PROUD_API RmiContext Proud::RmiContext::UnreliableS2CRoutedMulticast
static

This is unreliable server to client multicast message and this is to be entered as parameter when calling RMI.

  • It is ok to use separate RmiContext object if needed but usually if the case is usual then it is ok to use this calling RMI.
  • Set as HIGH priority.
  • This function performs routed send via P2P for those direct P2P connected among receivers when server calls unreliable RMI broadcast to multiple clients. This function saves the amount of transmission from server to client in exchange of increase of CPU use in server. (Can be very useful in most of games.)
PROUD_API RmiContext Proud::RmiContext::UnreliableSend
static

This is to be entered as parameter when calling RMI as reliable message.

  • It is ok to use separate RmiContext object if needed but usually if the case is usual then it is ok to use this calling RMI.
  • Set as HIGH priority.

Reference

  • Generally in most of online games, most of overall communications consist of a few different types of mesages such as character movement, attacking actions and so on while others have significantly low proportion. And there have been many cases where unreliable send was used without enough considerations then caused to spend hours of debugging time. Considering those experiences, it is believed to say that making everything use reliable send at the beginning then replace only those that can handle losses to unreliable can be a good way to develop an online game.