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)) { string userEmail = GlobalArea.UserConnects.First(u => u.ID == wsid).UserEmail!; AccountData accountData = GlobalArea.GetLoginAccountData(userEmail)!; this.ResponseOrBroadcastInstructs.Add(new SendUserDataInstruct() { IsResponse = true, 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, } }); } }); } } public class SendUserDataInstruct : Instruct { public SendUserDataInstruct() { this.Type = "send_userData"; } } }