Esempio n. 1
0
        void Initialize(Config config)
        {
            Config    = config;
            DataStore = new DataStore();

            BugReport.Init(config.ApiEndpoint + "/bugs");

            Assets.LoadAsync("profanity", typeof(TextAsset), o =>
            {
                TextAsset profanity = o as TextAsset;
                if (profanity != null)
                {
                    ProfanityFilter.Init(profanity.text);
                    Assets.Unload("profanity");
                }
            });

            var options = new EndPointOptions {
                Key = config.ApiKey.Value
            };

            if (config.ApiKeepAlive > 0)
            {
                options.KeepAlive         = true;
                options.KeepAliveUrl      = "/util/ping";
                options.KeepAliveInterval = config.ApiKeepAlive;
            }
            ApiEndPoint = EndPointFactory.Create(config.ApiEndpoint, options);

            EB.Memory.OnBreach += delegate()
            {
                FatalError("ID_SPARX_ERROR_UNKNOWN");
            };

            InitializeComponents();
        }