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/GetServerConfigInstruct.cs

47 lines
1.8 KiB
C#

namespace OMS.NET.Instructs
{
public class GetServerConfigInstruct : Instruct
{
public GetServerConfigInstruct()
{
this.Type = "get_serverConfig";
}
public override Task Handler(string wsid)
{
return Task.Run(() =>
{
this.ResponseOrBroadcastInstructs.Add(new SendServerConfigInstruct
{
IsResponse = true,
Data = new
{
anonymous_login = bool.TryParse(GlobalArea.ServerConfig.AnonymousLogin, out bool booleanValue) && booleanValue,
key = GlobalArea.ServerConfig.Key,
url = GlobalArea.ServerConfig.Url,
name = GlobalArea.ServerConfig.Name,
online_number = GlobalArea.ConnectClientsCount,
max_online = GlobalArea.ServerConfig.MaxUser,
default_x = GlobalArea.ServerConfig.DefaultX,
default_y = GlobalArea.ServerConfig.DefaultY,
//以下在0.7会删除
enable_base_map = GlobalArea.ServerConfig.EnableBase,
//base_map_type= GlobalArea.ServerConfig.ServerConfigEnableBase,
max_zoom = GlobalArea.ServerConfig.MaxZoom,
min_zoom = GlobalArea.ServerConfig.MinZoom,
default_zoom = GlobalArea.ServerConfig.DefaultZoom,
base_map_url = GlobalArea.ServerConfig.BaseMapUrl
}
});
});
}
}
public class SendServerConfigInstruct : Instruct
{
public SendServerConfigInstruct()
{
this.Type = "send_serverConfig";
}
}
}