public static IEnumerator Processor(string _url, string _method, Dictionary <string, Any> _params, Service.OnReplyCallback _onReply, Service.OnErrorCallback _onError, Service.Options _options)
    {
        yield return(new WaitForEndOfFrame());

        if (_url.EndsWith("/login"))
        {
            if (_params["username"].AsString.Equals("guest") && _params["password"].AsString.Equals("guest"))
            {
                _onReply("ok");
            }
            else
            {
                _onError("errcode:1");
            }
            yield break;
        }

        _onError("");
    }
Exemple #2
0
    IEnumerator asyncMockProcessor(string _url, string _method, Dictionary <string, Any> _params, Service.OnReplyCallback _onReply, Service.OnErrorCallback _onError, Service.Options _options)
    {
        yield return(new WaitForEndOfFrame());

        if (_url.EndsWith("/login"))
        {
            if (_params["username"].AsString().Equals("admin") && _params["password"].AsString().Equals("admin"))
            {
                _onReply("ok");
            }
            else
            {
                _onError(Error.NewAccessErr(""));
            }
            yield break;
        }

        _onError(Error.NewAccessErr(""));
    }
Exemple #3
0
 void mockProcessor(string _url, string _method, Dictionary <string, Any> _params, Service.OnReplyCallback _onReply, Service.OnErrorCallback _onError, Service.Options _options)
 {
     this.StartCoroutine(asyncMockProcessor(_url, _method, _params, _onReply, _onError, _options));
 }
Exemple #4
0
 public static void MockProcessor(string _url, string _method, Dictionary <string, Any> _params, Service.OnReplyCallback _onReply, Service.OnErrorCallback _onError, Service.Options _options)
 {
     if (!_url.Equals("http://localhost/signin"))
     {
         _onError(Error.NewAccessErr("404 not found"));
         return;
     }
     if (_params["username"].AsString().Equals("admin") && _params["password"].AsString().Equals("11223344"))
     {
         _onReply("00000000001");
     }
     else
     {
         _onError(Error.NewAccessErr("password is not matched"));
     }
 }
    public static IEnumerator Processor(string _url, string _method, Dictionary <string, Any> _params, Service.OnReplyCallback _onReply, Service.OnErrorCallback _onError, Service.Options _options)
    {
        yield return(new WaitForEndOfFrame());

        if (_url.EndsWith("/account/profile/fetch"))
        {
            fetchProfile(_params, _onReply, _onError);
        }
        else
        {
            _onError("404");
        }
    }
Exemple #6
0
 public void mockProcessor(string _url, string _method, Dictionary <string, Any> _params, Service.OnReplyCallback _onReply, Service.OnErrorCallback _onError, Service.Options _options)
 {
     Debug.Log("use mock processor");
     mono.StartCoroutine(asyncMockProcessor(_url, _method, _params, _onReply, _onError, _options));
 }