Ejemplo n.º 1
0
        protected override void Load()
        {
            this.information = new WebstoreInfo();
            Instance         = this;


            logWarning("Tebex Loaded");
            if (Instance.Configuration.Instance.secret == "")
            {
                logError("You have not yet defined your secret key. Use /tebex:secret <secret> to define your key");
            }
            else
            {
                CommandTebexInfo infoCommand = new CommandTebexInfo();
                String[]         command     = new[] { "tebex:info" };
                infoCommand.Execute(new ConsolePlayer(), command);
            }

            System.Net.ServicePointManager.ServerCertificateValidationCallback +=
                (sender, certificate, chain, errors) => { return(true); };

            ChatListener chatListener = new ChatListener();

            chatListener.Register(this);
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public override void Init(ITorchBase torch)
        {
            base.Init(torch);
            string path = Path.Combine(StoragePath, "TebexTorchAPI.cfg");

            Tebex.logInfo($"Attempting to load config from {path}");
            _config = Persistent <TebexConfig> .Load(path);

            _sessionManager = Torch.Managers.GetManager <TorchSessionManager>();
            if (_sessionManager != null)
            {
                _sessionManager.SessionStateChanged += SessionChanged;
            }

            System.Net.ServicePointManager.ServerCertificateValidationCallback +=
                (sender, certificate, chain, errors) => { return(true); };

            Torch.GameStateChanged += GameStateChanged;

            this.information = new WebstoreInfo();
            Instance         = this;
        }