mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-03-22 09:22:24 +00:00
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
44 lines
1.4 KiB
C#
Executable file
44 lines
1.4 KiB
C#
Executable file
using System;
|
|
using FSO.Common.Utils;
|
|
|
|
namespace FSO.Server.Protocol.CitySelector
|
|
{
|
|
public class ShardStatusItem : IXMLEntity
|
|
{
|
|
public string Name;
|
|
public int Rank;
|
|
public string Map;
|
|
public ShardStatus Status;
|
|
public int Id;
|
|
public string PublicHost;
|
|
public string InternalHost;
|
|
public string VersionName;
|
|
public string VersionNumber;
|
|
public int? UpdateID;
|
|
|
|
public ShardStatusItem()
|
|
{
|
|
}
|
|
|
|
public System.Xml.XmlElement Serialize(System.Xml.XmlDocument doc)
|
|
{
|
|
var result = doc.CreateElement("Shard-Status");
|
|
result.AppendTextNode("Location", "public");
|
|
result.AppendTextNode("Name", Name);
|
|
result.AppendTextNode("Rank", Rank.ToString());
|
|
result.AppendTextNode("Map", Map);
|
|
result.AppendTextNode("Status", Status.ToString());
|
|
result.AppendTextNode("Id", Id.ToString());
|
|
return result;
|
|
}
|
|
|
|
public void Parse(System.Xml.XmlElement element)
|
|
{
|
|
this.Name = element.ReadTextNode("Name");
|
|
this.Rank = int.Parse(element.ReadTextNode("Rank"));
|
|
this.Map = element.ReadTextNode("Map");
|
|
this.Status = (ShardStatus)Enum.Parse(typeof(ShardStatus), element.ReadTextNode("Status"));
|
|
this.Id = int.Parse(element.ReadTextNode("Id"));
|
|
}
|
|
}
|
|
}
|