예제 #1
0
        public Coroutine LicenseRequest(string _dix_id, string _lic_id, Action OnReady = null, Action <string> OnError = null)
        {
            RaqnRequest _req = new RaqnRequest("/dix/" + _dix_id + "/license/request/" + _lic_id);

            _req.OnSuccess += RaqnUtils.ActionWrapper <RaqnResponse>(OnReady);
            _req.OnError   += OnError;
            return(Raqn.Instance.StartCoroutine(SendRequest(_req)));
        }
예제 #2
0
        public Coroutine EndPlay()
        {
            RaqnRequest _req = new RaqnRequest("/play/end");

            _req.OnSuccess += RaqnUtils.ActionWrapper <RaqnResponse>(OnPlayEndSuccess);
            _req.OnError   += OnPlayEndError;
            return(Raqn.Instance.StartCoroutine(SendRequest(_req)));
        }
예제 #3
0
        public Coroutine Start(string _username = "", string _password = "")
        {
            RaqnRequest _req = new RaqnRequest("/start");

            _req.SetAuth(MakeAuthString(_username, _password));
            _req.OnSuccess += RaqnUtils.ActionWrapper <RaqnResponse>(OnStartSuccess);
            _req.OnError   += OnStartError;
            return(Raqn.Instance.StartCoroutine(SendRequest(_req)));
        }
예제 #4
0
        public Coroutine StartPlay(string _dix_id, string _pkg_id)
        {
            RaqnRequest _req = new RaqnRequest("/play/start");

            _req.SetField("dix", _dix_id);
            _req.SetField("package", _pkg_id);
            _req.OnSuccess += RaqnUtils.ActionWrapper <RaqnResponse>(OnPlaySuccess);
            _req.OnError   += OnPlayError;
            return(Raqn.Instance.StartCoroutine(SendRequest(_req)));
        }
예제 #5
0
        public Coroutine LoginUser(string _username, string _password)
        {
            RaqnRequest _req = new RaqnRequest("/user/login");

            if (session == null)
            {
                _req.SetAuth(MakeAuthString(_username, _password));
            }
            _req.SetField("user", MakeAuthString(_username, _password));
            _req.OnSuccess += RaqnUtils.ActionWrapper <RaqnResponse>(OnLoginSuccess);
            _req.OnError   += OnLoginError;
            return(Raqn.Instance.StartCoroutine(SendRequest(_req)));
        }
예제 #6
0
        public Coroutine SendPlayEvents(List <RaqnPlayEvent> _el, string _user, Action OnReady = null, Action <string> OnError = null)
        {
            RaqnRequest _req = new RaqnRequest("/play/events/update");

            _req.SetField <string>("user", _user);
            _req.SetField <string>("format", "RAW");
            _req.SetField <List <RaqnPlayEvent> >("events", _el);
            if (OnReady != null)
            {
                _req.OnSuccess += RaqnUtils.ActionWrapper <RaqnResponse>(OnReady);
            }
            if (OnError != null)
            {
                _req.OnError += OnError;
            }
            return(Raqn.Instance.StartCoroutine(SendRequest(_req)));
        }
예제 #7
0
        public Coroutine SendPlayData(RaqnData _pd, string _user, Action OnReady = null, Action <string> OnError = null)
        {
            RaqnRequest _req = new RaqnRequest("/play/data/update");

            _req.SetField <string>("user", _user);
            _req.SetField <string>("format", "RAW");
            _req.SetField <RaqnData>("data", _pd);
            if (OnReady != null)
            {
                _req.OnSuccess += RaqnUtils.ActionWrapper <RaqnResponse>(OnReady);
            }
            if (OnError != null)
            {
                _req.OnError += OnError;
            }
            return(Raqn.Instance.StartCoroutine(SendRequest(_req)));
        }