Add a new cmd

This commit is contained in:
Somebody
2024-07-11 19:01:12 +08:00
parent 3993435070
commit 52bac58c2b
2 changed files with 38 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
using EggLink.DanhengServer.Internationalization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EggLink.DanhengServer.Command.Command.Cmd
{
[CommandInfo("raid", "Game.Command.Raid.Desc", "Game.Command.Raid.Usage", permission: "")]
public class CommandRaid : ICommand
{
[CommandMethod("0 leave")]
public void Leave(CommandArg arg)
{
if (arg.Target == null)
{
arg.SendMsg(I18nManager.Translate("Game.Command.Notice.PlayerNotFound"));
return;
}
arg.Target.Player!.RaidManager!.LeaveRaid(false);
arg.SendMsg(I18nManager.Translate("Game.Command.Raid.Leaved"));
}
}
}

View File

@@ -113,6 +113,7 @@ namespace EggLink.DanhengServer.Internationalization.Message
public SceneTextCHS Scene { get; } = new();
public UnlockAllTextCHS UnlockAll { get; } = new();
public MailTextCHS Mail { get; } = new();
public RaidTextCHS Raid { get; } = new();
}
#endregion
@@ -352,6 +353,16 @@ namespace EggLink.DanhengServer.Internationalization.Message
public string MailSentWithAttachment { get; } = "带附件的邮件已发送!";
}
/// <summary>
/// path: Game.Command.Raid
/// </summary>
public class RaidTextCHS
{
public string Desc { get; } = "管理玩家的任务临时场景";
public string Usage { get; } = "/raid <leave - 离开临时场景>";
public string Leaved { get; } = "已离开临时场景!";
}
#endregion
#endregion