public void SelectNCMB(NCMBObject selectObj)
    {
        _signalingNCMB = new NCMB_RTC();
        var json = JsonConverter.ToJson(new NCMBStateData(NCMBStateData.MyNCMBstate.SELECTEDROOM));

        selectObj = NCMB_RTC.SetJson_connectState(selectObj, json);
        _SignalingNCMB.SaveObject(selectObj);
    }
Exemplo n.º 2
0
 //接続が成立したことを知らせる
 void InformConnect()
 {
     _signalingNCMB.FetchObject((obj) =>
     {
         var json_state = JsonConverter.ToJson(new NCMBStateData(NCMBStateData.MyNCMBstate.CONNECTED));
         var savedObj   = NCMB_RTC.SetJson_connectState(obj, json_state);
         _signalingNCMB.UpdateObject(savedObj);
     });
 }
    public void CreateNCMB(string roomName, string hostName)
    {
        _signalingNCMB = new NCMB_RTC();
        var obj  = _SignalingNCMB.CreateObject(roomName, hostName);
        var json = JsonConverter.ToJson(new NCMBStateData(NCMBStateData.MyNCMBstate.CREATEDROOM));

        obj = NCMB_RTC.SetJson_connectState(obj, json);
        _SignalingNCMB.SaveObject(obj);
    }
Exemplo n.º 4
0
    void SendSDP(RTCSessionDescription session, NCMBStateData.MyNCMBstate state)
    {
        bool isoffer    = (session.type == RTCSdpType.Offer);
        var  type       = (isoffer) ? RTCSendData.DATATYPE.OFFERE : RTCSendData.DATATYPE.ANSWER;
        var  data       = new RTCSendData(type, session.sdp);
        var  json       = JsonConverter.ToJson(data);
        var  json_state = JsonConverter.ToJson(new NCMBStateData(state));

        _signalingNCMB.FetchObject((NCMBObject obj) => {
            var saveobj = NCMB_RTC.SetJson_SDPData(obj, isoffer, json);
            saveobj     = NCMB_RTC.SetJson_connectState(saveobj, json_state);
            _signalingNCMB.UpdateObject(saveobj);
        });
    }
Exemplo n.º 5
0
    void SendIceCandidata(List <string> jsonlist)
    {
        _signalingNCMB.FetchObject((obj) =>
        {
            var json           = NCMB_RTC.GetJson_SDPData(obj, _IsOffer);
            var data           = JsonConverter.FromJson <RTCSendData>(json);
            data.candidateJson = jsonlist;
            json           = JsonConverter.ToJson(data);
            var json_state = (_IsOffer) ? JsonConverter.ToJson(new NCMBStateData(NCMBStateData.MyNCMBstate.CONNECTED_sdp))
                                        : JsonConverter.ToJson(new NCMBStateData(NCMBStateData.MyNCMBstate.SENDED_ice));
            var saveobj = NCMB_RTC.SetJson_SDPData(obj, _IsOffer, json);
            saveobj     = NCMB_RTC.SetJson_connectState(saveobj, json_state);

            _signalingNCMB.UpdateObject(saveobj);
            Debug.Log($"sendJson");
        });
    }