mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-06 14:40:28 -04:00
Removed NioTSO client and server
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
This commit is contained in:
parent
f12ba1502b
commit
22191ce648
591 changed files with 53264 additions and 3362 deletions
96
server/FSO.Server.Protocol/CitySelector/AvatarData.cs
Executable file
96
server/FSO.Server.Protocol/CitySelector/AvatarData.cs
Executable file
|
@ -0,0 +1,96 @@
|
|||
using FSO.Common.Utils;
|
||||
using System;
|
||||
|
||||
namespace FSO.Server.Protocol.CitySelector
|
||||
{
|
||||
public class AvatarData : IXMLEntity
|
||||
{
|
||||
public uint ID;
|
||||
public string Name;
|
||||
public string ShardName;
|
||||
|
||||
|
||||
|
||||
/** Non standard **/
|
||||
|
||||
/** Appearance **/
|
||||
public AvatarAppearanceType AppearanceType { get; set; }
|
||||
public ulong HeadOutfitID { get; set; }
|
||||
public ulong BodyOutfitID { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
/** Lot **/
|
||||
public uint? LotId { get; set; }
|
||||
public uint? LotLocation { get; set; }
|
||||
public string LotName { get; set; }
|
||||
|
||||
#region IXMLPrinter Members
|
||||
|
||||
public System.Xml.XmlElement Serialize(System.Xml.XmlDocument doc)
|
||||
{
|
||||
var result = doc.CreateElement("Avatar-Data");
|
||||
result.AppendTextNode("AvatarID", ID.ToString());
|
||||
result.AppendTextNode("Name", Name);
|
||||
result.AppendTextNode("Shard-Name", ShardName);
|
||||
|
||||
//NEW: Appearance info
|
||||
result.AppendTextNode("Head", HeadOutfitID.ToString());
|
||||
result.AppendTextNode("Body", BodyOutfitID.ToString());
|
||||
result.AppendTextNode("Appearance", AppearanceType.ToString());
|
||||
|
||||
if (LotId.HasValue && LotLocation.HasValue && LotName != null){
|
||||
result.AppendTextNode("LotId", LotId.Value.ToString());
|
||||
result.AppendTextNode("LotName", LotName);
|
||||
result.AppendTextNode("LotLocation", LotLocation.Value.ToString());
|
||||
}
|
||||
|
||||
result.AppendTextNode("Description", Description);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Parse(System.Xml.XmlElement element)
|
||||
{
|
||||
this.ID = uint.Parse(element.ReadTextNode("AvatarID"));
|
||||
this.Name = element.ReadTextNode("Name");
|
||||
this.ShardName = element.ReadTextNode("Shard-Name");
|
||||
|
||||
var headString = element.ReadTextNode("Head");
|
||||
if (headString != null)
|
||||
{
|
||||
this.HeadOutfitID = ulong.Parse(headString);
|
||||
}
|
||||
|
||||
var bodyString = element.ReadTextNode("Body");
|
||||
if (bodyString != null)
|
||||
{
|
||||
this.BodyOutfitID = ulong.Parse(bodyString);
|
||||
}
|
||||
|
||||
var apprString = element.ReadTextNode("Appearance");
|
||||
if (apprString != null)
|
||||
{
|
||||
this.AppearanceType = (AvatarAppearanceType)Enum.Parse(typeof(AvatarAppearanceType), apprString);
|
||||
}
|
||||
|
||||
var lotId = element.ReadTextNode("LotId");
|
||||
if(lotId != null)
|
||||
{
|
||||
this.LotId = uint.Parse(lotId);
|
||||
}
|
||||
|
||||
var lotLocation = element.ReadTextNode("LotLocation");
|
||||
if (lotLocation != null)
|
||||
{
|
||||
this.LotLocation = uint.Parse(lotLocation);
|
||||
}
|
||||
|
||||
LotName = element.ReadTextNode("LotName");
|
||||
|
||||
var descString = element.ReadTextNode("Description");
|
||||
this.Description = descString ?? "";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue