/// <inheritdoc/> public void InitMod() { ModEvents.ChatMessage.RegisterHandler((ClientInfo cInfo, EChatType chatType, int senderEntityId, string msg, string mainName, bool localizeMain, List <int> recipientEntityIds) => this.OnChatMessage(cInfo, chatType, msg, recipientEntityIds)); ModEvents.GameAwake.RegisterHandler(this.OnGameAwake); ModEvents.GameShutdown.RegisterHandler(this.OnGameShutdown); ModEvents.GameStartDone.RegisterHandler(this.OnGameStartDone); ModEvents.PlayerDisconnected.RegisterHandler(this.OnPlayerDisconnected); ModEvents.PlayerLogin.RegisterHandler((ClientInfo cInfo, string compatibilityVersion, StringBuilder rejectReason) => this.OnPlayerLogin(cInfo, rejectReason)); ModEvents.PlayerSpawnedInWorld.RegisterHandler(this.OnPlayerSpawnedInWorld); ModEvents.PlayerSpawning.RegisterHandler((ClientInfo cInfo, int chunkViewDim, PlayerProfile playerProfile) => this.OnPlayerSpawning(cInfo)); ModEvents.SavePlayerData.RegisterHandler((ClientInfo cInfo, PlayerDataFile playerDataFile) => this.OnSavePlayerData(cInfo)); Language.Init(); ChatHelper.Init(); ChatHook.Init(); VoteManager.Init(); ConVarManager.AutoExecConfig(null, true, "Core"); PluginManager.Refresh(); }
/// <summary> /// Adds a configuration file to be automatically loaded. /// </summary> /// <param name="autoCreate">A value indicating whether the file should be automatically created if it does not exist.</param> /// <param name="name">The name of the configuration file without extension.</param> protected void AutoExecConfig(bool autoCreate, string name) { ConVarManager.AutoExecConfig(this, autoCreate, name); }