MikuSB.Loader

This commit is contained in:
Kei-Luna
2026-05-13 07:19:45 +09:00
parent e92b214161
commit d9b16fb55d
13 changed files with 466 additions and 275 deletions

View File

@@ -0,0 +1,29 @@
using MikuSB.Enums.Player;
using MikuSB.Internationalization;
using MikuSB.Loader;
using MikuSB.Util;
namespace MikuSB.GameServer.Command.Commands;
[CommandInfo("game", "Game.Command.Game.Desc", "Game.Command.Game.Usage", [], [PermEnum.Admin, PermEnum.Support])]
public class CommandGame : ICommands
{
private static readonly Logger Logger = new("CommandManager");
[CommandDefault]
public async ValueTask Launch(CommandArg arg)
{
try
{
var pid = GameLaunchService.Launch(arg.Args.ToArray());
var message = I18NManager.Translate("Game.Command.Game.Started", pid.ToString());
Logger.Info(message);
await arg.SendMsg(message);
}
catch (Exception ex)
{
Logger.Error("Failed to launch game.", ex);
await arg.SendMsg(I18NManager.Translate("Game.Command.Game.Failed", ex.Message));
}
}
}