You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OMS.NET/Instructs/GetUserDataInstruct.cs

48 lines
1.6 KiB
C#

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";
}
}
}