图层排序
parent
2666922c4e
commit
cb0103b988
@ -0,0 +1,50 @@
|
|||||||
|
using System.Text.Json;
|
||||||
|
using System.Text.Json.Nodes;
|
||||||
|
using OMS.NET.Common;
|
||||||
|
|
||||||
|
namespace OMS.NET.Instructs
|
||||||
|
{
|
||||||
|
public class UpdateLayerOrderInstruct : Instruct
|
||||||
|
{
|
||||||
|
public UpdateLayerOrderInstruct()
|
||||||
|
{
|
||||||
|
Type = "broadcast";
|
||||||
|
Class = "updateLayerOrder";
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Task Handler(string wsid)
|
||||||
|
{
|
||||||
|
return Task.Run(() =>
|
||||||
|
{
|
||||||
|
if (!GlobalArea.LoginCheckByID(wsid)) return;//登录检查不通过则直接退出
|
||||||
|
if (Data?.GetType() != typeof(JsonElement)) return;//Data 非空和JsonElement类型检查
|
||||||
|
string conveyor = GlobalArea.GetLoginEmailByID(wsid);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
long active = Data.GetProperty("active").GetInt64();
|
||||||
|
long passive = Data.GetProperty("passive").GetInt64();
|
||||||
|
string type = Data.GetProperty("type").GetString();
|
||||||
|
LayerData order = GlobalArea.GetOrderLayerData();
|
||||||
|
order.AdjustOrderLayer(active, passive, type);
|
||||||
|
ResponseOrBroadcastInstructs.Add(new Instruct()
|
||||||
|
{
|
||||||
|
IsBroadcast = true,
|
||||||
|
Type = "broadcast",
|
||||||
|
Class = "updateLayerOrder",
|
||||||
|
Conveyor = conveyor,
|
||||||
|
Time = GlobalArea.GetCurrentTime(),
|
||||||
|
Data = new
|
||||||
|
{
|
||||||
|
member = order.Members
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
GlobalArea.Log.Warn($"处理{Class}广播指令出错:" + ex.Message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue