Files
TEngine/Assets/GameScripts/DotNet/Hotfix/Server/Demo/Robot/Console/CreateRobotConsoleHandler.cs
ALEXTANG 336d4b2eb9 [+] 接入ET8服务端
[+] 接入ET8服务端
2023-07-13 12:23:48 +08:00

29 lines
952 B
C#

using System;
using System.Collections.Generic;
using CommandLine;
namespace ET.Server
{
[ConsoleHandler(ConsoleMode.CreateRobot)]
public class CreateRobotConsoleHandler: IConsoleHandler
{
public async ETTask Run(Fiber fiber, ModeContex contex, string content)
{
switch (content)
{
case ConsoleMode.CreateRobot:
Log.Console("CreateRobot args error!");
break;
default:
CreateRobotArgs options = null;
Parser.Default.ParseArguments<CreateRobotArgs>(content.Split(' '))
.WithNotParsed(error => throw new Exception($"CreateRobotArgs error!"))
.WithParsed(o => { options = o; });
break;
}
contex.Parent.RemoveComponent<ModeContex>();
await ETTask.CompletedTask;
}
}
}