using OMS.NET.DbClass; namespace OMS.NET.Instructs { public class GetUserDataInstruct : Instruct { public GetUserDataInstruct() { this.Type = "get_userData"; } public override Task Handler(string wsid) { return Task.Run(() => { if (!GlobalArea.LoginCheckByID(wsid)) return;//登录检查,不通过则直接退出 string userEmail = GlobalArea.UserConnects.First(u => u.ID == wsid).UserEmail!; AccountData accountData = GlobalArea.GetLoginAccountData(userEmail)!; this.ResponseOrBroadcastInstructs.Add(new Instruct() { IsResponse = true, Type = "send_userData", Data = new { user_email = accountData.UserEmail, user_name = accountData.UserName, map_layer = accountData.MapLayer, default_a1 = accountData.DefaultA1, save_point = accountData.SavePoint, head_color = accountData.HeadColor, mode = accountData.Mode, phase = accountData.Phase, custom = accountData.Custom, } }); }); } } }