Ejemplo n.º 1
0
    public void InitNetwork(UserRole userRole, GameData gameData, string uiServerIP, PlaybackMode pbmode)
    {
        serverEndpoint.ip         = gameData.OSC_ServerIP;
        serverEndpoint.remotePort = gameData.OSC_ClientPort;

        int inPort;
        int outPort;

        if (userRole == UserRole.Server || (userRole == UserRole.Playback && pbmode == PlaybackMode.Offline))
        {
            inPort  = gameData.OSC_ServerPort;
            outPort = gameData.OSC_ClientPort;
        }
        else
        {
            inPort  = gameData.OSC_ClientPort;
            outPort = gameData.OSC_ServerPort;
        }

        osc.inPort  = inPort;
        osc.outPort = outPort;
        osc.outIP   = uiServerIP;
        osc.Init();

        print("OSC Connexion initiation to " + osc.outIP + " : " + osc.outPort + "/" + osc.inPort);
    }