Ejemplo n.º 1
0
 public RaqnApiSession() : base()
 {
     id      = "L$" + System.Guid.NewGuid();
     started = RaqnTime.LocalNow();
     expires = RaqnTime.FOREVER;
     logins  = new List <RaqnLogin>();
 }
Ejemplo n.º 2
0
        public Coroutine SyncPlaySession(RaqnPlaySession _ps, Action <RaqnPlaySession> OnReady = null, Action <string> OnError = null)
        {
            RaqnRequest _req = new RaqnRequest("/play/sync");

            _req.SetField <RaqnPlaySession>("playsession", _ps);
            _req.SetField <string>("time", RaqnTime.LocalNow());
            if (OnReady != null)
            {
                _req.OnSuccess += RaqnUtils.ComposeAction <RaqnResponse, RaqnPlaySession>(OnReady, _ResponseParser <RaqnPlaySession>("_playsession"));
            }
            if (OnError != null)
            {
                _req.OnError += OnError;
            }
            return(Raqn.Instance.StartCoroutine(SendRequest(_req)));
        }
Ejemplo n.º 3
0
 public void End(Action OnReady = null, Action <string> OnError = null)
 {
     if (IsOffline())
     {
         end = RaqnTime.LocalNow();
         Sync(OnReady, OnError);
     }
     else
     {
         Raqn.Api.OnPlayEndSuccess += () =>
         {
             Sync(OnReady, OnError);
         };
         Raqn.Api.OnPlayEndError += (_err) =>
         {
             Sync(OnReady, OnError);
         };
         Raqn.Api.EndPlay();
     }
 }
Ejemplo n.º 4
0
 public RaqnPlaySession() : base()
 {
     id    = "L$" + System.Guid.NewGuid();
     start = RaqnTime.LocalNow();
     local_engine_start = RaqnTime.LocalEngineNow();
 }