示例#1
0
        public static CloudBaseApp Init(string env, int timeout)
        {
            if (Instance == null)
            {
                Instance = new CloudBaseApp(env, timeout);
            }

            return(Instance);
        }
示例#2
0
 public PolicyTaskHandler(
     ILogger logger,
     IPolicyConfig policyConfig
     )
 {
     _logger       = logger;
     _policyConfig = policyConfig;
     _cloudBaseApp = CloudBaseApp.Init(_policyConfig.CloudBaseEnvId, 10000);
     _httpClient   = new HttpClient();
 }
示例#3
0
        async public static void updateUserInfo()
        {
            CloudBaseApp app   = CloudBaseApp.Init("59eb4700a3c34", 3000);
            AuthState    state = await app.Auth.GetAuthStateAsync();

            if (state == null)
            {
                // 匿名登录
                state = await app.Auth.SignInAnonymouslyAsync();
            }

            // 调用云函数
            FunctionResponse res = await app.Function.CallFunctionAsync("updateUserInfo", _userInfo);
        }
示例#4
0
        async public static void UploadMgobeUserInfo(string gameId)
        {
            CloudBaseApp app   = CloudBaseApp.Init("59eb4700a3c34", 3000);
            AuthState    state = await app.Auth.GetAuthStateAsync();

            if (state == null)
            {
                // 匿名登录
                state = await app.Auth.SignInAnonymouslyAsync();
            }
            // 调用云函数
            FunctionResponse res = await app.Function.CallFunctionAsync("uploadServiceUser", new Dictionary <string, dynamic> {
                { "gameId", gameId }, { "serviceType", "mgobe" }
            });
        }