Sample examples

The examples below are based on the git sample project, see the link below for more information.

📂 Download C++ examplesarrow-up-right

📂 Download C# examplesarrow-up-right

Client

- Proxy & Stub

// Client -> Server RMI Proxy instance
Simple::Proxy g_SimpleProxy;

// Unlike an RMI proxy, it is used after overriding a function.
class SimpleStub : public Simple::Stub
{
public:
	DECRMI_Simple_ShowChat;
	DECRMI_Simple_SystemChat;

	DECRMI_Simple_P2PChat;
};

// RMI stub instance for receiving messages
SimpleStub g_SimpleStub;

- Defining RMI functions

RMI functions use the following conventions for easy naming.

=> DEFRMI_GlobalName_FunctionName

- Create a NetClient object

- Connecting Events

You can design the logic you need in the server connection event and then use it.

- Proxy & Stub Registration

- Connect to a server

Then, in a function that will be called every frame, call netClient -> FrameMove().

circle-exclamation

Server

- Proxy & Stub

- Defining RMI functions

- Create a NetServer object

- Connecting Events

- Proxy & Stub Registration

Start a server

Common

- vars.h

- vars.cpp, vars.cs

Last updated