public override void OnEnable() { plugin = this; serverStartTime.Start(); this.AddCommand("scpd_rc", new ReconnectCommand(this)); this.AddCommand("scpd_reconnect", new ReconnectCommand(this)); this.AddCommand("scpd_reload", new ReloadCommand(this)); this.AddCommand("scpd_unsync", new UnsyncCommand(this)); this.AddCommand("scpd_verbose", new VerboseCommand(this)); this.AddCommand("scpd_debug", new DebugCommand(this)); Task.Run(async() => { await Task.Delay(4000); SetUpFileSystem(); LoadConfig(); roleSync = new RoleSync(this); Language.Reload(); Thread connectionThread = new Thread(new ThreadStart(() => new StartNetworkSystem(plugin))); connectionThread.Start(); this.Info("SCPDiscord " + this.Details.version + " enabled."); }); }
public override void OnEnable() { plugin = this; serverStartTime.Start(); AddCommand("scpd_rc", new ReconnectCommand()); AddCommand("scpd_reconnect", new ReconnectCommand()); AddCommand("scpd_reload", new ReloadCommand()); AddCommand("scpd_unsync", new UnsyncCommand()); AddCommand("scpd_verbose", new VerboseCommand()); AddCommand("scpd_debug", new DebugCommand()); AddCommand("scpd_validate", new ValidateCommand()); AddCommand("scpd_grs", new GrantReservedSlotCommand()); AddCommand("scpd_rrs", new RemoveReservedSlotCommand()); AddCommand("scpd_grantreservedslot", new ValidateCommand()); AddCommand("scpd_removereservedslot", new RemoveReservedSlotCommand()); AddCommand("scpd_gvr", new GrantVanillaRankCommand()); AddCommand("scpd_grantvanillarank", new GrantVanillaRankCommand()); SetUpFileSystem(); this.roleSync = new RoleSync(this); LoadConfig(); Language.Reload(); // ReSharper disable once ObjectCreationAsStatement new Thread(() => new StartNetworkSystem(plugin)).Start(); this.maxPlayers = GetConfigInt("max_players"); Info("SCPDiscord " + this.Details.version + " enabled."); }
public override void OnEnable() { plugin = this; serverStartTime.Start(); AddCommand("scpd_rc", new ReconnectCommand()); AddCommand("scpd_reconnect", new ReconnectCommand()); AddCommand("scpd_reload", new ReloadCommand()); AddCommand("scpd_unsync", new UnsyncCommand()); AddCommand("scpd_verbose", new VerboseCommand()); AddCommand("scpd_debug", new DebugCommand()); AddCommand("scpd_validate", new ValidateCommand()); AddCommand("scpd_grs", new GrantReservedSlotCommand()); AddCommand("scpd_rrs", new RemoveReservedSlotCommand()); AddCommand("scpd_grantreservedslot", new GrantReservedSlotCommand()); AddCommand("scpd_removereservedslot", new RemoveReservedSlotCommand()); AddCommand("scpd_gvr", new GrantVanillaRankCommand()); AddCommand("scpd_grantvanillarank", new GrantVanillaRankCommand()); SetUpFileSystem(); this.roleSync = new RoleSync(this); LoadConfig(); if (this.Server.Port == Config.GetInt("bot.port")) { this.Error("ERROR: Server is running on the same port as the plugin, aborting..."); this.Disable(); } Language.Reload(); new Thread(() => new StartNetworkSystem(plugin)).Start(); GetMaxPlayers(); Info("SCPDiscord " + this.Details.version + " enabled."); }