1.7 버전에서의 PIDL 컴파일러는 CSharp으로 제작되었습니다.
PIDL 컴파일러를 실행하기 위해서는 dot net framework 4.5 설치되어 있어야 합니다.
(https://www.microsoft.com/en-us/download/details.aspx?id=42642)
1.PIDL 파일 생성, 문법에 따라서 작성합니다.
ex)
[marshaler(cs) = SimpleCSharp.CMyMarshaler, access=public] global C2C 2000 // client-to-client RMI, First message ID = 2000 { P2PChat([in] System.String a,[in] int b, [in] float c); P2PChat2([in] SimpleCSharp.MyClass a); }
[marshaler(cs) = SimpleCSharp.CMyMarshaler, access=public] global C2S 3000 // client-to-server RMI, First message ID = 3000 { // Sample of sending chatting massge to server // 서버로 채팅 메시지를 보내는 예제 // [encrypted] Chat([in] System.String a,[in] int b,[in] float c, [in] SimpleCSharp.MyClass d, [in] System.Collections.Generic.List<int> f, [in] System.Collections.Generic.Dictionary<int,float> g, [in] Nettention.Proud.ByteArray block); }
[marshaler(cs) = SimpleCSharp.CMyMarshaler, access=public] global S2C 4000 // server-to-client RMI, 최초 메시지 ID = 4000 { ShowChat([in] System.String a,[in]int b,[in]float c); SystemChat([in] System.String txt); }
2.*.PIDL 파일을 프로젝트에 포함시킵니다.
3.프로젝트에 포함된 PIDL 파일들에 대해서 Project-Propertys-Build Events-Pre-build event command line에 build event를 추가/작성합니다.
"$(ProjectDir)......\util\PIDL.exe -cs $(ProjectDir)\C2C.PIDL -outdir $(ProjectDir)"
"$(ProjectDir)......\util\PIDL.exe -cs $(ProjectDir)\C2S.PIDL -outdir $(ProjectDir)"
"$(ProjectDir)......\util\PIDL.exe -cs $(ProjectDir)\S2C.PIDL -outdir $(ProjectDir)"
4.프로젝트를 빌드하면 아래와 같이 PIDL 파일 *_Common.cs, *_proxy.cs, *_stub.cs 파일을 확인할 수 있습니다.