mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-04 21:50:35 -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
9
server/FSO.Server.Protocol/CitySelector/AvatarAppearanceType.cs
Executable file
9
server/FSO.Server.Protocol/CitySelector/AvatarAppearanceType.cs
Executable file
|
@ -0,0 +1,9 @@
|
|||
namespace FSO.Server.Protocol.CitySelector
|
||||
{
|
||||
public enum AvatarAppearanceType
|
||||
{
|
||||
Light = 0,
|
||||
Medium = 1,
|
||||
Dark = 2
|
||||
}
|
||||
}
|
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
|
||||
}
|
||||
}
|
8
server/FSO.Server.Protocol/CitySelector/AvatarGender.cs
Executable file
8
server/FSO.Server.Protocol/CitySelector/AvatarGender.cs
Executable file
|
@ -0,0 +1,8 @@
|
|||
namespace FSO.Server.Protocol.CitySelector
|
||||
{
|
||||
public enum AvatarGender
|
||||
{
|
||||
Male = 1,
|
||||
Female = 2
|
||||
}
|
||||
}
|
8
server/FSO.Server.Protocol/CitySelector/InitialConnectServletRequest.cs
Executable file
8
server/FSO.Server.Protocol/CitySelector/InitialConnectServletRequest.cs
Executable file
|
@ -0,0 +1,8 @@
|
|||
namespace FSO.Server.Protocol.CitySelector
|
||||
{
|
||||
public class InitialConnectServletRequest
|
||||
{
|
||||
public string Ticket;
|
||||
public string Version;
|
||||
}
|
||||
}
|
50
server/FSO.Server.Protocol/CitySelector/InitialConnectServletResult.cs
Executable file
50
server/FSO.Server.Protocol/CitySelector/InitialConnectServletResult.cs
Executable file
|
@ -0,0 +1,50 @@
|
|||
using FSO.Common.Utils;
|
||||
using System;
|
||||
|
||||
namespace FSO.Server.Protocol.CitySelector
|
||||
{
|
||||
public class InitialConnectServletResult : IXMLEntity
|
||||
{
|
||||
public InitialConnectServletResultType Status;
|
||||
public XMLErrorMessage Error;
|
||||
public UserAuthorized UserAuthorized;
|
||||
|
||||
|
||||
|
||||
#region IXMLEntity Members
|
||||
|
||||
public System.Xml.XmlElement Serialize(System.Xml.XmlDocument doc)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Parse(System.Xml.XmlElement element)
|
||||
{
|
||||
switch (element.Name)
|
||||
{
|
||||
case "Error-Message":
|
||||
Status = InitialConnectServletResultType.Error;
|
||||
Error = new XMLErrorMessage();
|
||||
Error.Parse(element);
|
||||
break;
|
||||
case "User-Authorized":
|
||||
Status = InitialConnectServletResultType.Authorized;
|
||||
UserAuthorized = new UserAuthorized();
|
||||
UserAuthorized.Parse(element);
|
||||
break;
|
||||
case "Patch-Result":
|
||||
Status = InitialConnectServletResultType.Patch;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public enum InitialConnectServletResultType
|
||||
{
|
||||
Authorized,
|
||||
Patch,
|
||||
Error
|
||||
}
|
||||
}
|
8
server/FSO.Server.Protocol/CitySelector/ShardSelectorServletRequest.cs
Executable file
8
server/FSO.Server.Protocol/CitySelector/ShardSelectorServletRequest.cs
Executable file
|
@ -0,0 +1,8 @@
|
|||
namespace FSO.Server.Protocol.CitySelector
|
||||
{
|
||||
public class ShardSelectorServletRequest
|
||||
{
|
||||
public string ShardName;
|
||||
public string AvatarID;
|
||||
}
|
||||
}
|
45
server/FSO.Server.Protocol/CitySelector/ShardSelectorServletResponse.cs
Executable file
45
server/FSO.Server.Protocol/CitySelector/ShardSelectorServletResponse.cs
Executable file
|
@ -0,0 +1,45 @@
|
|||
using FSO.Common.Utils;
|
||||
|
||||
namespace FSO.Server.Protocol.CitySelector
|
||||
{
|
||||
public class ShardSelectorServletResponse : IXMLEntity
|
||||
{
|
||||
public string Address;
|
||||
public string Ticket;
|
||||
public string ConnectionID;
|
||||
public uint PlayerID;
|
||||
public string AvatarID;
|
||||
|
||||
public bool PreAlpha = false;
|
||||
|
||||
#region IXMLPrinter Members
|
||||
|
||||
public System.Xml.XmlElement Serialize(System.Xml.XmlDocument doc)
|
||||
{
|
||||
var result = doc.CreateElement("Shard-Selection");
|
||||
result.AppendTextNode("Connection-Address", Address);
|
||||
result.AppendTextNode("Authorization-Ticket", Ticket);
|
||||
result.AppendTextNode("PlayerID", PlayerID.ToString());
|
||||
|
||||
if (PreAlpha == false)
|
||||
{
|
||||
result.AppendTextNode("ConnectionID", ConnectionID);
|
||||
result.AppendTextNode("EntitlementLevel", "");
|
||||
}
|
||||
result.AppendTextNode("AvatarID", AvatarID); //freeso now uses this
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Parse(System.Xml.XmlElement element)
|
||||
{
|
||||
this.Address = element.ReadTextNode("Connection-Address");
|
||||
this.Ticket = element.ReadTextNode("Authorization-Ticket");
|
||||
this.PlayerID = uint.Parse(element.ReadTextNode("PlayerID"));
|
||||
|
||||
this.AvatarID = element.ReadTextNode("AvatarID");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
12
server/FSO.Server.Protocol/CitySelector/ShardStatus.cs
Executable file
12
server/FSO.Server.Protocol/CitySelector/ShardStatus.cs
Executable file
|
@ -0,0 +1,12 @@
|
|||
namespace FSO.Server.Protocol.CitySelector
|
||||
{
|
||||
public enum ShardStatus
|
||||
{
|
||||
Up,
|
||||
Down,
|
||||
Busy,
|
||||
Full,
|
||||
Closed,
|
||||
Frontier
|
||||
}
|
||||
}
|
44
server/FSO.Server.Protocol/CitySelector/ShardStatusItem.cs
Executable file
44
server/FSO.Server.Protocol/CitySelector/ShardStatusItem.cs
Executable file
|
@ -0,0 +1,44 @@
|
|||
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"));
|
||||
}
|
||||
}
|
||||
}
|
30
server/FSO.Server.Protocol/CitySelector/UserAuthorized.cs
Executable file
30
server/FSO.Server.Protocol/CitySelector/UserAuthorized.cs
Executable file
|
@ -0,0 +1,30 @@
|
|||
using FSO.Common.Utils;
|
||||
|
||||
namespace FSO.Server.Protocol.CitySelector
|
||||
{
|
||||
public class UserAuthorized : IXMLEntity
|
||||
{
|
||||
public string FSOVersion;
|
||||
public string FSOBranch;
|
||||
public string FSOUpdateUrl;
|
||||
public string FSOCDNUrl;
|
||||
|
||||
public System.Xml.XmlElement Serialize(System.Xml.XmlDocument doc)
|
||||
{
|
||||
var element = doc.CreateElement("User-Authorized");
|
||||
element.AppendTextNode("FSO-Version", FSOVersion);
|
||||
element.AppendTextNode("FSO-Branch", FSOBranch);
|
||||
element.AppendTextNode("FSO-UpdateUrl", FSOUpdateUrl);
|
||||
element.AppendTextNode("FSO-CDNUrl", FSOCDNUrl);
|
||||
return element;
|
||||
}
|
||||
|
||||
public void Parse(System.Xml.XmlElement element)
|
||||
{
|
||||
this.FSOVersion = element.ReadTextNode("FSO-Version");
|
||||
this.FSOBranch = element.ReadTextNode("FSO-Branch");
|
||||
this.FSOUpdateUrl = element.ReadTextNode("FSO-UpdateUrl");
|
||||
this.FSOCDNUrl = element.ReadTextNode("FSO-CDNUrl");
|
||||
}
|
||||
}
|
||||
}
|
38
server/FSO.Server.Protocol/CitySelector/XMLErrorMessage.cs
Executable file
38
server/FSO.Server.Protocol/CitySelector/XMLErrorMessage.cs
Executable file
|
@ -0,0 +1,38 @@
|
|||
using FSO.Common.Utils;
|
||||
using System;
|
||||
|
||||
namespace FSO.Server.Protocol.CitySelector
|
||||
{
|
||||
public class XMLErrorMessage : IXMLEntity
|
||||
{
|
||||
public String Code;
|
||||
public String Message;
|
||||
|
||||
public XMLErrorMessage(){
|
||||
}
|
||||
|
||||
public XMLErrorMessage(String code, String message)
|
||||
{
|
||||
this.Code = code;
|
||||
this.Message = message;
|
||||
}
|
||||
|
||||
#region IXMLPrinter Members
|
||||
|
||||
public System.Xml.XmlElement Serialize(System.Xml.XmlDocument doc)
|
||||
{
|
||||
var element = doc.CreateElement("Error-Message");
|
||||
element.AppendTextNode("Error-Number", Code);
|
||||
element.AppendTextNode("Error", Message);
|
||||
return element;
|
||||
}
|
||||
|
||||
public void Parse(System.Xml.XmlElement element)
|
||||
{
|
||||
this.Code = element.ReadTextNode("Error-Number");
|
||||
this.Message = element.ReadTextNode("Error");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue