Files
2025-05-01 07:20:41 +09:00

31 lines
1.1 KiB
C#

using ServerCommon;
using ServerCore; using ServerBase;
namespace GameServer;
[ChatCommandAttribute("ugcnpcrank", typeof(ChatCommandGetUgcNpcRank), AuthAdminLevelType.Developer, AuthAdminLevelType.GmNormal, AuthAdminLevelType.GmSuper)]
public class ChatCommandGetUgcNpcRank : ChatCommandBase
{
public override async Task invoke(Player player, string token, string[] args)
{
Log.getLogger().info($"ChatCommandGetUgcNpcRank");
if (args.Length < 2) return;
var message = new ClientToGame();
message.Request = new ClientToGameReq();
message.Request.ReqUgcNpcRank = new();
if(! EnumHelper.tryParse<UgcNpcRankType>(args[0], out var type)) return;
if (!EnumHelper.tryParse<UgcNpcRankState>(args[1], out var state)) return;
message.Request.ReqUgcNpcRank.Type = type;
message.Request.ReqUgcNpcRank.State = state;
var result = await GameServerApp.getServerLogic().onCallProtocolHandler(player, message);
if (result.isFail())
{
Log.getLogger().error($"fail to run ChatCommandGetUgcNpcRank!! : {result.toBasicString()}");
}
}
}