In ProudNet, there is a functionality that allows you to approach the moment of RMI being called. Using this functionality, you can do following things.
Log every RMI being called
Optimize the game server performance by estimating the execution time of each RMI
16.1Approaching Transmission (Proxy) call
A way to approach to the moment when transmission is being called is like below.
First, create a Proxy derived class of compiler result.
Override Proud::IRmiProxy::NotifySendByProxy.
When you do there, the overridden method will be called at each transmission is made.
Fundamentaly Proud::IRmiProxy::NotifySendByProxy is set to call but to increase the performance, there are times that you want to stop the call. At those times, all you need to is to set false for Proud.IRmiProxy.m_enableNotifySendByProxy.
16.2Approaching the moment of reception (Stub) call
Approaching to reception being called can be done as followed.
Set true for Proud.IRmiStub.m_enableStubProfiling, a member variable of Stub instance.
Override Proud.IRmiStub.BeforeRmiInvocation and Proud.IRmiStub.AfterRmiInvocation, the derived classes of Stub compiled result.
When you set as above, the overridden method will be called at every reception. Proud.IRmiStub.BeforeRmiInvocation will be called just before RMI execution and then Proud.IRmiStub.AfterRmiInvocation will be called when the execution is done. Using above would help spotting RMI that causes slowdown of server performance due to long operation time.
Also, you can output all parameters of RMI function being received from Stub by following the below steps.
Set true for Proud.IRmiStub.m_enableNotifyCallFromStub, a member variable of Stub instance.
Override Proud::IRmiStub::NotifyCallFromStub. This method receives parameter converted as string type. So this is a good place to start making a log.
WARNING ** When Proud.IRmiStub.m_enableNotifyCallFromStub is on, it would significantly drop the performance of RMI operation. Please use it when it is absolutely needed.
16.3Concealing the name of RMI
ProudNet is set to store the names of RMI on the executable file to display them on Proud.IRmiStub.BeforeRmiInvocation. But for security reason, you can conceal their name if you want as following the next steps.
Before doing #include for ..._proxy.cpp, one of PIDL compiled results, you can define as below.
#define HIDE_RMI_NAME_STRING
But, when this method is used, no RMI names can be displayed on Proud.IRmiStub.BeforeRmiInvocation thus please think again before you actually use it.