Esempio n. 1
0
        static AccelBytePlugin()
        {
            var configFile = Resources.Load("AccelByteSDKConfig");

            if (configFile == null)
            {
                throw new Exception("'AccelByteSDKConfig.json' isn't found in the Project/Assets/Resources directory");
            }

            string wholeJsonText = ((TextAsset)configFile).text;

            AccelBytePlugin.config = SimpleJson.SimpleJson.DeserializeObject <Config>(wholeJsonText);
            AccelBytePlugin.config.Expand();
            AccelBytePlugin.taskDispatcher  = new AsyncTaskDispatcher();
            AccelBytePlugin.coroutineRunner = new CoroutineRunner();
            var authApi = new AuthenticationApi(AccelBytePlugin.config.IamServerUrl);

            AccelBytePlugin.user = new User(
                authApi,
                new UserApi(AccelBytePlugin.config.IamServerUrl),
                AccelBytePlugin.config.Namespace,
                AccelBytePlugin.config.ClientId,
                AccelBytePlugin.config.ClientSecret,
                AccelBytePlugin.config.RedirectUri,
                AccelBytePlugin.taskDispatcher,
                AccelBytePlugin.coroutineRunner);

            ServicePointManager.ServerCertificateValidationCallback = AccelBytePlugin.OnCertificateValidated;
        }
 internal UserProfiles(string @namespace, UserProfilesApi api, User user,
                       AsyncTaskDispatcher taskDispatcher, CoroutineRunner coroutineRunner)
 {
     this.api             = api;
     this.@namespace      = @namespace;
     this.user            = user;
     this.taskDispatcher  = taskDispatcher;
     this.coroutineRunner = coroutineRunner;
 }
Esempio n. 3
0
 internal Lobby(string url, User account, AsyncTaskDispatcher taskDispatcher,
                CoroutineRunner coroutineRunner)
 {
     this.account              = account;
     this.taskDispatcher       = taskDispatcher;
     this.coroutineRunner      = coroutineRunner;
     this.responseCallbacks    = new Dictionary <long, Action <ErrorCode, string> >();
     this.webSocket            = new WebSocket(url + "/lobby/");
     this.webSocket.OnMessage += this.HandleMessages;
     this.webSocket.SslConfiguration.ServerCertificateValidationCallback =
         (sender, certificate, chain, sslPolicyErrors) => true;
 }
Esempio n. 4
0
        internal CloudStorage(CloudStorageApi api, User user, AsyncTaskDispatcher taskDispatcher,
                              CoroutineRunner coroutineRunner)
        {
            Assert.IsNotNull(api, "Can not construct CloudStorage manager; api is null!");
            Assert.IsNotNull(user, "Can not construct CloudStorage manager; userAccount is null!");
            Assert.IsNotNull(taskDispatcher, "Can not construct CloudStorage manager; taskDispatcher is null!");
            Assert.IsNotNull(coroutineRunner, "Can not construct CloudStorage manager; coroutineRunner is null!");

            this.api             = api;
            this.user            = user;
            this.taskDispatcher  = taskDispatcher;
            this.coroutineRunner = coroutineRunner;
        }
Esempio n. 5
0
        internal Orders(OrdersApi api, User user, AsyncTaskDispatcher taskDispatcher,
                        CoroutineRunner coroutineRunner)
        {
            Assert.IsNotNull(api, "Can't construct purchase manager! PurchaseService parameter is null!");
            Assert.IsNotNull(user, "Can't construct purchase manager! UserAccount parameter is null!");
            Assert.IsNotNull(taskDispatcher, "taskReactor must not be null");
            Assert.IsNotNull(coroutineRunner, "coroutineRunner must not be null");

            this.api             = api;
            this.user            = user;
            this.taskDispatcher  = taskDispatcher;
            this.coroutineRunner = coroutineRunner;
        }
Esempio n. 6
0
        internal Items(ItemsApi api, User user, AsyncTaskDispatcher taskDispatcher,
                       CoroutineRunner coroutineRunner)
        {
            Assert.IsNotNull(api, "Can't construct Catalog manager; CatalogService parameter is null!");
            Assert.IsNotNull(user, "Can't construct Catalog manager; UserAccount parameter isnull!");
            Assert.IsNotNull(taskDispatcher, "taskReactor must not be null");
            Assert.IsNotNull(coroutineRunner, "coroutineRunner must not be null");

            this.api             = api;
            this.user            = user;
            this.taskDispatcher  = taskDispatcher;
            this.coroutineRunner = coroutineRunner;
        }
 internal User(AuthenticationApi authApi, UserApi userApi, string @namespace,
               string clientId, string clientSecret, string redirectUri, AsyncTaskDispatcher taskDispatcher,
               CoroutineRunner coroutineRunner)
 {
     this.authApi         = authApi;
     this.userApi         = userApi;
     this.@namespace      = @namespace;
     this.clientId        = clientId;
     this.clientSecret    = clientSecret;
     this.redirectUri     = redirectUri;
     this.taskDispatcher  = taskDispatcher;
     this.coroutineRunner = coroutineRunner;
     this.taskDispatcher.Start(this.Refresh());
 }
Esempio n. 8
0
        internal Wallet(string @namespace, WalletApi api, User user, AsyncTaskDispatcher taskDispatcher,
                        CoroutineRunner coroutineRunner)
        {
            Assert.IsNotNull(api, "Can't construct Wallet! api is null!");
            Assert.IsNotNull(@namespace, "Can't construct Wallet! namespace parameter is null!");
            Assert.IsNotNull(user, "Can't construct Wallet! user parameter is null!");
            Assert.IsNotNull(taskDispatcher, "taskDispatcher must not be null");
            Assert.IsNotNull(coroutineRunner, "coroutineRunner must not be null");

            this.api             = api;
            this.@namespace      = @namespace;
            this.user            = user;
            this.taskDispatcher  = taskDispatcher;
            this.coroutineRunner = coroutineRunner;
        }