Multiple server instances in one process is now possible

This commit is contained in:
Sardelka
2022-06-23 14:10:16 +08:00
parent 41385abc7d
commit 82e7cdd785
11 changed files with 302 additions and 294 deletions

View File

@ -47,7 +47,7 @@ namespace RageCoop.Server
_ => (0x0, null),
};
}
/*
public static Client GetClientByNetID(long id)
{
Client result = null;
@ -75,17 +75,18 @@ namespace RageCoop.Server
return Server.MainNetServer.Connections.Find(x => x.RemoteUniqueIdentifier == client.NetID);
}
*/
// Return a list of all connections but not the local connection
public static List<NetConnection> Exclude(this IEnumerable<NetConnection> connections,NetConnection toExclude)
{
return new(connections.Where(e => e != toExclude));
}
/*
public static List<NetConnection> FilterAllLocal(long local)
{
return new(Server.MainNetServer.Connections.Where(e => e.RemoteUniqueIdentifier != local));
}
*/
public static T Read<T>(string file) where T : new()
{
XmlSerializer ser = new(typeof(T));