> For the complete documentation index, see [llms.txt](https://docs.proudnet.com/proudnet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.proudnet.com/proudnet/proudnet/2.setting.md).

# 프로젝트 설정

### 1. 프로젝트 설정하기

각 환경에 따라 프로젝트를 설정합니다.

#### :black\_small\_square: [C++](/proudnet/proudnet/2.setting/c++.md)&#x20;

#### :black\_small\_square: [C#](/proudnet/proudnet/2.setting/c.md)

#### :black\_small\_square: [Mac Xcode](/proudnet/proudnet/2.setting/mac-xcode.md)

#### :black\_small\_square: [Linux](/proudnet/proudnet/2.setting/linux.md)

#### :black\_small\_square: [Unity3D](/proudnet/proudnet/2.setting/unity3d.md)

#### :black\_small\_square: [Unreal Engine 4](/proudnet/proudnet/2.setting/unreal-engine-4.md)

### 2. PIDL 파일 작성하기

ProudNet에서 <mark style="color:orange;">Remote Method Invocation(RMI)</mark>를 사용하려면 먼저 확장자가 PIDL인 파일을 만들어야 합니다.&#x20;

PIDL 파일은 호스트 간 주고받을 메시지를 정의하는 소스 파일로, PIDL 파일을 컴파일을 하면 proxy와 stub이 만들어지게 되는데 이들을 호스트 프로그램에 포함시킬 것입니다.

{% hint style="danger" %}
메시지 첫 ID 값을 60,000 이상으로 지정하지 마세요.\
60,000 이상의 값은 ProudNet 내부 PIDL의 메시지 ID값으로 이미 지정되어 있습니다. 메시지 ID가 겹칠 경우 <mark style="color:orange;">AttachProxy</mark> 및 <mark style="color:orange;">AttachStub</mark> 함수에서 exeption이 발생합니다.
{% endhint %}

PIDL 파일의 기본적인 사용 형식은 다음과 같습니다.

{% tabs %}
{% tab title="PIDL" %}

```cpp
global <네임스페이스> <메시지의 첫 ID 값>
{
    ([특성 선언]) <함수 선언> ( [in] 함수 파라메터, ... );
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %} <mark style="color:orange;">**네임스페이스**</mark>\
PIDL 파일을 컴파일했을 때 생성되는 proxy, stub 모듈이 갖는 C++ namespace 이름입니다.\
ProudNet은 2개 이상의 proxy, stub 을 한꺼번에 사용할 수 있는데, 그 대신 namespace로 모호성을 해결해야 하기 때문에 namespace 가 반드시 필요합니다. \
예를 들어 'LobbyC2S' 라고 선언하면, '게임 로비에서 클라이언트-> 서버 호출 RMI를 선언함'을 의미합니다.\
\ <mark style="color:orange;">**메시지의 첫 ID 값**</mark>\
RMI가 호출되면 각각의 RMI는 네트워크 메시지로 변환되는데, 이 메시지는 ID 값을 메시지 헤더에 갖게 됩니다.\
주의할 점은, 프로세스 간 통신을 위해 가지고 있는 여러 개의 proxy, stub끼리 메시지 ID의 범위가 서로 겹치면 안됩니다.\
\ <mark style="color:orange;">**특성 선언**</mark>\
\[in] 선언을 반드시 해야 합니다.\
\ <mark style="color:orange;">**함수 선언**</mark>

RMI 함수 이름입니다.\
\ <mark style="color:orange;">**함수 파라미터**</mark>\
C++ 함수 선언과 비슷합니다. 파라미터는 아래와 같은 선언이 허용되지만 포인터 타입은 허용되지 않습니다.

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

{% endhint %}

PIDL 파일 예시는 다음과 같습니다.

{% tabs %}
{% tab title="PIDL" %}

<pre class="language-cpp"><code class="lang-cpp"><strong>rename cs(Proud::String, System.String);
</strong><strong>
</strong><strong>global LobbyC2S 5000  // 메시지 ID가 5000부터 시작
</strong>{
    // ID=5001이 됩니다
    Logon([in] Proud::String name,[in] Proud::String password);
    RequestRoomList([in] int pageNumber); // ID=5002가 됩니다
    Chat([in] Proud::String name); // ID=5003이 됩니다.
}
</code></pre>

{% endtab %}
{% endtabs %}

{% hint style="success" %}
**참고**

[**RMI**](/proudnet/pn_reference_ko/dictionary.md#rmi)

[**RMI 메시지 범위**](/proudnet/proudnet/using_pn/rmi.md#rmi-2)
{% endhint %}

### 3. [PIDL 컴파일러 실행하기](/proudnet/proudnet/2.setting/pidl.md)

PIDL 컴파일러를 실행합니다.&#x20;

### 4. [서버와 클라이언트 시작하기](/proudnet/proudnet/using_pn/server_client.md#undefined)

서버와 클라이언트를 시작해 ProudNet 사용 준비를 마칩니다.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.proudnet.com/proudnet/proudnet/2.setting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
