초기커밋
This commit is contained in:
48
GameServer/Contents/GameZone/GameZoneCheat.cs
Normal file
48
GameServer/Contents/GameZone/GameZoneCheat.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using ServerCommon;
|
||||
using ServerCore; using ServerBase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer;
|
||||
|
||||
[ChatCommandAttribute("teleport", typeof(ChatCommandTeleport), AuthAdminLevelType.Developer, AuthAdminLevelType.GmNormal, AuthAdminLevelType.GmSuper)]
|
||||
internal class ChatCommandTeleport : ChatCommandBase
|
||||
{
|
||||
public override async Task invoke(Player player, string token, string[] args)
|
||||
{
|
||||
Log.getLogger().info($"HandleTeleport");
|
||||
|
||||
var result = new Result();
|
||||
var err_msg = string.Empty;
|
||||
|
||||
if (args.Length < 3)
|
||||
return;
|
||||
if (float.TryParse(args[0], out float x) == false || float.TryParse(args[1], out float y) == false || float.TryParse(args[2], out float z) == false)
|
||||
return;
|
||||
|
||||
Pos pos = new Pos();
|
||||
pos.X = x;
|
||||
pos.Y = y;
|
||||
pos.Z = z;
|
||||
pos.Angle = 0;
|
||||
|
||||
var game_zone_action = player.getEntityAction<GameZoneAction>();
|
||||
NullReferenceCheckHelper.throwIfNull(game_zone_action, () => $"game zone action is null !!! - {player.toBasicString()}");
|
||||
|
||||
result = game_zone_action.tryMove(pos);
|
||||
if(result.isFail())
|
||||
{
|
||||
err_msg = $"Failed to tryMove at {this.getTypeName()} !!! : {result.toBasicString()} - {player.toBasicString()}";
|
||||
Log.getLogger().error(err_msg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
LocationNotifyHelper.send_S2C_NTF_SET_LOCATION(player);
|
||||
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user