Proud::RmiContext Class Reference

Public Member Functions

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

Public Attributes

bool m_relayed
 
HostID m_sentFrom
 
int m_unreliableS2CRoutedMulticastMaxCount
 
int m_unreliableS2CRoutedMulticastMaxPingMs
 
int m_maxDirectP2PMulticastCount
 
int64_t m_uniqueID
 
bool m_fillSendFailedRemotes
 
CFastArray< SendFailedRemotem_sendFailedRemotes
 
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
 
RmiID m_rmiID
 

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. This is the message compression feature. When things other than CM_None is selected for this value, you can compress to send the message.

  • The default value is CM_None
  • If the message to be sent is too small (approx. 50 bytes) or does not get smaller even if it’s compressed, then send it uncompressed.
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 .
bool Proud::RmiContext::m_fillSendFailedRemotes
송신이 실패할 경우 송신 실패 대상에 대한 정보를 채울 것인지를 나타냅니다.

m_sendFailedRemotes를 위해 사용됩니다. 기본값은 false입니다.

주의: 이 변수를 켜면, 송신함수가 m_sendFailedRemotes를 변경합니다. 서로 다른 스레드가 같은 RmiContext 객체를 다루지 않도록 주의하십시오.

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. If true, the message used in unreliable transmission is divided and sent into MTU size. Turn this off if the server has high CPU use due to UDP processing. The default value is true.

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.
RmiID Proud::RmiContext::m_rmiID

m_rmiID is used to identify which RMI packets are being processed within ProudNet. RmiID

CFastArray<SendFailedRemote> Proud::RmiContext::m_sendFailedRemotes
송신이 실패할 경우 여기에 송신 실패 대상이 채워집니다. 

m_fillSendFailedRemotes=true일때만 채워집니다.

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.