新建分组图层
parent
cb0103b988
commit
829bf729e5
@ -0,0 +1,56 @@
|
||||
using System.Text.Json;
|
||||
using OMS.NET.Common;
|
||||
using OMS.NET.DbClass;
|
||||
|
||||
namespace OMS.NET.Instructs
|
||||
{
|
||||
public class CreateGroupLayerInstruct : Instruct
|
||||
{
|
||||
public CreateGroupLayerInstruct()
|
||||
{
|
||||
Type = "broadcast";
|
||||
Class = "createGroupLayer";
|
||||
}
|
||||
|
||||
public override Task Handler(string wsid)
|
||||
{
|
||||
return Task.Run(() =>
|
||||
{
|
||||
if (!GlobalArea.LoginCheckByID(wsid)) return;//登录检查不通过则直接退出
|
||||
if (Data?.GetType() != typeof(JsonElement)) return;//Data 非空和JsonElement类型检查
|
||||
try
|
||||
{
|
||||
string conveyor = GlobalArea.GetLoginEmailByID(wsid);
|
||||
AccountData accountData = GlobalArea.GetLoginAccountData(conveyor)!;
|
||||
string creator = $"{accountData.UserName}({conveyor})";
|
||||
LayerData newGroupLayer = GlobalArea.CreateGroupLayer(creator);
|
||||
string time = GlobalArea.GetCurrentTime();
|
||||
ResponseOrBroadcastInstructs.Add(new Instruct()
|
||||
{
|
||||
IsBroadcast = true,
|
||||
Type = "broadcast",
|
||||
Class = "createGroupLayer",
|
||||
Conveyor = conveyor,
|
||||
Time = time,
|
||||
Data = newGroupLayer
|
||||
});
|
||||
ResponseOrBroadcastInstructs.Add(new Instruct()
|
||||
{
|
||||
IsBroadcast = true,
|
||||
Type = "broadcast",
|
||||
Class = "updateLayerOrder",
|
||||
Conveyor = conveyor,
|
||||
Time = time,
|
||||
Data = new{
|
||||
member = GlobalArea.GetOrderLayerData().Members
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
GlobalArea.Log.Warn($"处理{Class}广播指令出错:" + ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue