Ejemplo n.º 1
0
    public void Connect(string sessionId, string userId)
    {
        InitializeParsec();

        Parsec.ParsecClientConfig defaultConfig = new Parsec.ParsecClientConfig()
        {
            mediaContainer = 0,
            protocol       = 1,
            secret         = "",
            pngCursor      = false
        };

        var status = Parsec.ClientConnect(defaultConfig, sessionId, userId);

        Log($"Connecting client: {status}");

        gameObject.AddComponent <ParsecGuestInput>().Initialize(Parsec);
    }
    public void Connect(string sessionId, string userId)
    {
        InitializeParsec();

        Parsec.ParsecClientConfig defaultConfig = new Parsec.ParsecClientConfig()
        {
            mediaContainer = 0,
            protocol       = 1,
            secret         = "",
            pngCursor      = false
        };

        var status = Parsec.ClientConnect(defaultConfig, sessionId, userId);

        Log($"Connecting client: {status}");

        gameObject.AddComponent <ParsecGuestInput>().Initialize(Parsec);

        // TODO: This should probably start a coroutine to monitor the connection attempt,
        // firing appropriate events on status change/success/failure.
    }
Ejemplo n.º 3
0
    private void Connect()
    {
        InitParsec();

        role = Role.Guest;

        Parsec.ParsecClientConfig defaultConfig = new Parsec.ParsecClientConfig()
        {
            mediaContainer = 0,
            protocol       = 1,
            secret         = "",
            pngCursor      = false
        };

        var status = parsec.ClientConnect(defaultConfig, sessionId.text, peerId.text);

        Debug.Log($"Parsec client: {status}");

        parsecGuestView.gameObject.SetActive(true);
        menu.SetActive(false);
        tryCreateTextureToggle.gameObject.SetActive(true);

        gameObject.AddComponent <ParsecGuestInput>().Initialize(parsec);

        #region Audio
        pcmData = new Queue <short[]>();

        AudioClip   clip   = AudioClip.Create("ParsecInput", 960, 2, 48000, true, OnAudioRead, OnAudioSetPosition);
        AudioSource source = GetComponent <AudioSource>();
        source.clip = clip;
        source.loop = true;
        source.Play();

        Thread pollThread = new Thread(() => PollAudio());
        pollThread.Start();
        #endregion
    }
Ejemplo n.º 4
0
    private void Connect()
    {
        InitParsec();

        role = Role.Guest;

        Parsec.ParsecClientConfig defaultConfig = new Parsec.ParsecClientConfig()
        {
            mediaContainer = 0,
            protocol       = 1,
            secret         = "",
            pngCursor      = false
        };

        var status = parsec.ClientConnect(defaultConfig, sessionId.text, peerId.text);

        Debug.Log($"Parsec client: {status}");

        parsecGuestView.gameObject.SetActive(true);
        menu.SetActive(false);
        tryCreateTextureToggle.gameObject.SetActive(true);

        gameObject.AddComponent <ParsecGuestInput>().Initialize(parsec);
    }