Example #1
0
 public static void SetRpcUser(RpcUser rpcUser)
 {
     if (RpcUser != null)
     {
         RpcUser.Logout();
     }
     RpcUser = rpcUser;
 }
Example #2
0
 public static void SetRpcUser(RpcUser rpcUser, bool isOuterNet)
 {
     if (RpcUser != null)
     {
         RpcUser.Logout();
     }
     RpcUser    = rpcUser;
     IsOuterNet = isOuterNet;
 }
Example #3
0
 public static void Login(RpcUser rpcUser)
 {
     if (RpcUser != null)
     {
         RpcUser.Logout();
     }
     RpcUser   = rpcUser;
     LoginedOn = DateTime.Now;
 }
Example #4
0
 public static TResponse SignPost <TResponse>(
     string host,
     int port,
     string controller,
     string action,
     ISignableData data,
     int?timeountMilliseconds = null)
 {
     return(Post <TResponse>(host, port, controller, action, query: RpcUser.GetSignData(data), data, timeountMilliseconds));
 }
Example #5
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TResponse"></typeparam>
 /// <param name="host">用于组装Url</param>
 /// <param name="port">用于组装Url</param>
 /// <param name="controller">用于组装Url</param>
 /// <param name="action">用于组装Url</param>
 /// <param name="signData">用于组装url查询字符串</param>
 /// <param name="data">post的数据</param>
 /// <param name="callback"></param>
 /// <param name="timeountMilliseconds"></param>
 public static void SignPostAsync <TResponse>(
     string host,
     int port,
     string controller,
     string action,
     ISignableData data,
     Action <TResponse, Exception> callback,
     int timeountMilliseconds = 0)
 {
     PostAsync(host, port, controller, action, query: RpcUser.GetSignData(data), data, callback, timeountMilliseconds);
 }
Example #6
0
        public void Test()
        {
            string  password = Guid.NewGuid().ToString();
            RpcUser rpcUser  = new RpcUser("test", password);

            Assert.AreEqual(password, rpcUser.Password);
            for (int i = 0; i < 10000; i++)
            {
                _ = rpcUser.Password;
            }
            rpcUser.Logout();
        }
Example #7
0
 public static void SetRpcUser(RpcUser rpcUser)
 {
     RpcUser = rpcUser;
 }