diff --git a/Command/Command/Cmd/CommandReload.cs b/Command/Command/Cmd/CommandReload.cs index b04ce4ad..bf568b79 100644 --- a/Command/Command/Cmd/CommandReload.cs +++ b/Command/Command/Cmd/CommandReload.cs @@ -1,5 +1,6 @@ using EggLink.DanhengServer.Data; using EggLink.DanhengServer.Data.Custom; +using EggLink.DanhengServer.GameServer.Plugin; using EggLink.DanhengServer.Internationalization; namespace EggLink.DanhengServer.Command.Command.Cmd; @@ -36,4 +37,14 @@ public class CommandReload : ICommand await arg.SendMsg(I18NManager.Translate("Game.Command.Reload.ConfigReloaded", I18NManager.Translate("Word.VideoKeys"))); } + + [CommandMethod("0 plugin")] + public async ValueTask ReloadPlugin(CommandArg arg) + { + // Reload the plugin + PluginManager.UnloadPlugins(); + PluginManager.LoadPlugins(); + await arg.SendMsg(I18NManager.Translate("Game.Command.Reload.ConfigReloaded", + I18NManager.Translate("Word.Plugin"))); + } } \ No newline at end of file diff --git a/GameServer/Plugin/PluginManager.cs b/GameServer/Plugin/PluginManager.cs index c4e3f7b5..47ffe867 100644 --- a/GameServer/Plugin/PluginManager.cs +++ b/GameServer/Plugin/PluginManager.cs @@ -130,6 +130,7 @@ public class PluginManager plugin.OnUnload(); Plugins.Remove(plugin); PluginAssemblies.Remove(plugin); + I18NManager.PluginLanguages.Remove(value.Name); Logger.Info($"Unloaded plugin {value.Name}"); }