mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-05 22:20:27 -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
48
server/FSO.Server.Common/ServerVersion.cs
Executable file
48
server/FSO.Server.Common/ServerVersion.cs
Executable file
|
@ -0,0 +1,48 @@
|
|||
using System.IO;
|
||||
|
||||
namespace FSO.Server.Common
|
||||
{
|
||||
public class ServerVersion
|
||||
{
|
||||
public string Name;
|
||||
public string Number;
|
||||
public int? UpdateID;
|
||||
|
||||
public static ServerVersion Get()
|
||||
{
|
||||
var result = new ServerVersion()
|
||||
{
|
||||
Name = "unknown",
|
||||
Number = "0"
|
||||
};
|
||||
|
||||
if (File.Exists("version.txt"))
|
||||
{
|
||||
using (StreamReader Reader = new StreamReader(File.Open("version.txt", FileMode.Open, FileAccess.Read, FileShare.Read)))
|
||||
{
|
||||
var str = Reader.ReadLine();
|
||||
var split = str.LastIndexOf('-');
|
||||
|
||||
result.Name = str;
|
||||
if (split != -1)
|
||||
{
|
||||
result.Name = str.Substring(0, split);
|
||||
result.Number = str.Substring(split + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (File.Exists("updateID.txt"))
|
||||
{
|
||||
var stringID = File.ReadAllText("updateID.txt");
|
||||
int id;
|
||||
if (int.TryParse(stringID, out id))
|
||||
{
|
||||
result.UpdateID = id;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue