11.PIDL 컴파일 결과물 포함하기

사용예

//PIDL 컴파일 결과물을 포함 하여 생성합니다.

SynchWorldC2C.Proxy c2cProxy = new SynchWorldC2C.Proxy();
SynchWorldC2S.Proxy c2sProxy = new SynchWorldC2S.Proxy();
SynchWorldS2C.Stub s2cStub = new SynchWorldS2C.Stub();
SynchWorldC2C.Stub c2cStub = new SynchWorldC2C.Stub();
...

void Start () //꼭 Start에서 해야 하는 것은 아니지만, 여기서 하는것이 편합니다.
{
    //netclient의 Event delegate들을 세팅합니다.

    netClient.JoinServerCompleteHandler = OnJoinServerComplete;
    ...

    //stub를 처리할 delegate를 세팅합니다.
    s2cStub.NotifyLocalHeroViewersGroupID = NotifyLocalHeroViewersGroupID; //<- 아래의 함수를 세팅합니다.

    //똑같이 아래 함수들을 만들어 세팅합니다.
    s2cStub.RemoteHero_Appear = RemoteHero_Appear;

    s2cStub.RemoteHero_Disappear = RemoteHero_Disappear;

    c2cStub.P2P_LocalHero_Move = P2P_LocalHero_Move;

    //client에 proxy,stub들을 attach합니다.
    //주의!!! attach를 하지 않으면 작동하지 않습니다.
    netClient.AttachProxy(c2cProxy);

    netClient.AttachProxy(c2sProxy);

    netClient.AttachStub(s2cStub);

    netClient.AttachStub(c2cStub);

    ...
}

//delegate에 맞게 함수를 만들어 줍니다.
bool NotifyLocalHeroViewersGroupID(Nettention.Proud.HostID remote,Nettention.Proud.RmiContext rmiContext, Nettention.Proud.HostID localHeroViewersGroupID)
{
    ...
    return true;
}