Project Settings

1. Set up your project

Set up projects for each environment.

▪️ C++

▪️ C#

▪️ Mac Xcode

▪️ Linux

▪️ Unity3D

2. Creating a PIDL file

To use Remote Method Invocation(RMI) in ProudNet, you must first create a file with the PIDL extension.

The PIDL file is the source file that defines the messages that will be sent and received between the hosts. Compiling the PIDL file will create a proxy and a stub, which will be included in the host program.

Do not specify a message first ID value of 60,000 or higher. Values above 60,000 are already specified as message ID values in ProudNet's internal PIDL. Overlapping message IDs will cause an exception in the AttachProxy and AttachStub functions.

The following are the basic usage formats for PIDL files.

global <Namespace> <The first ID value in the message>
{
    ([Declaring attributes]) <Declaring functions> ( [in] Function parameters, ... );
}

Namespace The C++ namespace name of the proxy, stub module that is generated when the PIDL file is compiled. A namespace is essential because ProudNet can use more than one proxy, stub, or stubs at once, but the ambiguity must be resolved with a namespace. For example, if you declare "LobbyC2S", it means "Declare a client -> server call RMI in the game lobby". The first ID value in the message When invoked, each RMI is converted to a network message, which will have an ID value in the message header. It is important to note that it is common to have multiple proxies and stubs for inter-process communication, and they should not have overlapping message ID ranges. Declaring attributes [in] declaration is required. Declaring functions The name of the RMI function. Function parameters It is similar to a C++ function declaration. Parameters are allowed to be declared as follows, but pointer types are not.

int a 
std::vector<int> b
CString c

An example PIDL file is shown below.

rename cs(Proud::String, System.String);

global LobbyC2S 5000  // Message ID starts at 5000
{
    // ID=5001
    Logon([in] Proud::String name,[in] Proud::String password);
    RequestRoomList([in] int pageNumber); // ID=5002
    Chat([in] Proud::String name); // ID=5003
}

Run the PIDL compiler

Start a server and client to prepare of using ProudNet.

Last updated