/// <summary>
        /// Initialises a new instance with the given App Token. Must be called on the
        /// main thread.
        /// </summary>
        ///
        /// <param name="appToken">The App Token.</param>
        /// <param name="verboseLogging">Whether or not to enable verbose logging. This is typically only
        /// enabled while debugging.</param>
        public ChilliConnectSdk(string appToken, bool verboseLogging)
        {
            var logging = new Logging(verboseLogging);

            m_sdkObject = GameObjectFactory.CreateCoreSdkGameObject();
            var taskScheduler       = m_sdkObject.GetComponent <TaskScheduler>();
            var httpSystem          = new HttpSystem(taskScheduler);
            var serverRequestSystem = new ServerRequestSystem(taskScheduler, httpSystem);
            var dataStore           = new DataStore();

            dataStore.Set("AppToken", appToken);

            PlayerAccounts    = new PlayerAccounts(logging, taskScheduler, serverRequestSystem, dataStore);
            CloudData         = new CloudData(logging, taskScheduler, serverRequestSystem, dataStore);
            Leaderboards      = new Leaderboards(logging, taskScheduler, serverRequestSystem, dataStore);
            CloudCode         = new CloudCode(logging, taskScheduler, serverRequestSystem, dataStore);
            PushNotifications = new PushNotifications(logging, taskScheduler, serverRequestSystem, dataStore);
            InAppPurchase     = new InAppPurchase(logging, taskScheduler, serverRequestSystem, dataStore);
            Metrics           = new Metrics(logging, taskScheduler, serverRequestSystem, dataStore);
            Catalog           = new Catalog(logging, taskScheduler, serverRequestSystem, dataStore);
            Economy           = new Economy(logging, taskScheduler, serverRequestSystem, dataStore);
            Messaging         = new Messaging(logging, taskScheduler, serverRequestSystem, dataStore);
            LiveOps           = new LiveOps(logging, taskScheduler, serverRequestSystem, dataStore);
            Multiplayer       = new Multiplayer(logging, taskScheduler, serverRequestSystem, dataStore);
            AsyncMultiplayer  = new AsyncMultiplayer(logging, taskScheduler, serverRequestSystem, dataStore);
        }
Beispiel #2
0
    void Start()
    {
        m_httpSystem = gameObject.GetComponent <HttpSystem>();

        m_title.text = StageManager.Instance.GetTitleText();
        InitializeSoldierTeam();
        InitializeSoldierList();
    }
Beispiel #3
0
        private static string UserAgent(HttpSystem system, HttpBrowser browser)
        {
            string systemString  = string.Empty;
            string browserString = string.Empty;

            switch (system)
            {
            case HttpSystem.Windows:
                systemString = $"(Windows NT {GenerateVersionOS(system)}; Win64; x64)";
                break;

            case HttpSystem.Linux:
                systemString = $"(X11; Linux {GenerateVersionOS(system)})";
                break;

            case HttpSystem.Mac:
                systemString = $"(Macintosh; Intel Mac OS X {GenerateVersionOS(system)})";
                break;

            case HttpSystem.ChromeOS:
                systemString = $"(X11; CrOS x86_64 {GenerateVersionOS(system)})";
                break;
            }

            switch (browser)
            {
            case HttpBrowser.Chrome:
                browserString = $"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{GenerateBrowserVersion(browser)} Safari/605.1.15";
                break;

            case HttpBrowser.Firefox:
                browserString = $"Gecko/20100101 Firefox/{GenerateBrowserVersion(browser)}";
                break;

            case HttpBrowser.Opera:
                browserString = $"AppleWebKit/537.36 (KHTML, like Gecko) {GenerateBrowserVersion(browser)}";
                break;

            case HttpBrowser.Safari:
                browserString = $"AppleWebKit/533.20.25 (KHTML, like Gecko) Version/{GenerateBrowserVersion(browser)} Safari/605.1.15";
                break;

            case HttpBrowser.Edge:
                browserString = $"AppleWebKit/537.36 (KHTML, like Gecko) {GenerateBrowserVersion(browser)}";
                break;
            }

            return($"Mozilla/5.0 {systemString} {browserString}");
        }
Beispiel #4
0
        private static string GenerateVersionOS(HttpSystem system)
        {
            string[] windows = new[] { "10.0", "6.2", "6.1", "6.3" };
            string[] linux   = new[] { "i686", "x86_64" };

            string[] mac = new[]
            {
                "10_9", "10_9_1", "10_9_2", "10_9_3", "10_9_4", "10_9_5", "10_10", "10_10_1",
                "10_10_2", "10_10_3", "10_10_4", "10_10_5", "10_11", "10_11_1", "10_11_2",
                "10_11_3", "10_11_4", "10_11_5", "10.11.6", "10_12", "10_12_1", "10_12_2",
                "10_12_3", "10_12_4", "10_12_5", "10_12_6", "10_13", "10_13_1", "10_13_2",
                "10_13_3", "10_13_4", "10_13_5", "10_13_6", "10_14_0", "10.15", "11.0"
            };

            string[] chromeOS = new[]
            {
                "10575.58.0", "10718.71.2", "10718.88.2", "10895.78.0", "10895.78.0", "11021.45.0", "11151.4.0",
                "11167.0.0", "10895.56.0", "11021.34.0", "11166.0.0"
            };

            switch (system)
            {
            case HttpSystem.Windows:
                return(windows[new Random().Next(0, windows.Count())]);

            case HttpSystem.Mac:
                return(mac[new Random().Next(0, mac.Count())]);

            case HttpSystem.Linux:
                return(linux[new Random().Next(0, linux.Count())]);

            case HttpSystem.ChromeOS:
                return(chromeOS[new Random().Next(0, chromeOS.Count())]);

            default:
                return(null);
            }
        }
 private void Awake()
 {
     m_httpSystem = gameObject.GetComponent <HttpSystem>();
 }
Beispiel #6
0
        public static string GenerateUserAgent(HttpSystem system)
        {
            HttpBrowser[] browserList = Enum.GetValues(typeof(HttpBrowser)).Cast <HttpBrowser>().ToArray();

            return(UserAgent(system, browserList[new Random().Next(0, browserList.Count())]));
        }
Beispiel #7
0
 public static string GenerateUserAgent(HttpSystem system, HttpBrowser browser)
 {
     return(UserAgent(system, browser));
 }
 private void Start()
 {
     m_httpSystem = GetComponent <HttpSystem>();
     StartCoroutine(m_httpSystem.RequestUserData(SetTroopName));
 }
    private void Start()
    {
        m_httpSystem = GetComponent <HttpSystem>();

        m_id.text = PlayerPrefs.GetInt("UserId").ToString();
    }