초기커밋
This commit is contained in:
31
GameServer/Entity/Ranking/Helper/UgcNpcRankCheat.cs
Normal file
31
GameServer/Entity/Ranking/Helper/UgcNpcRankCheat.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
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()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user