Connected no longer depends on socket
This commit is contained in:
parent
94a29aca12
commit
6759f80bc5
|
@ -6,7 +6,7 @@ namespace Server;
|
||||||
|
|
||||||
public class Client : IDisposable {
|
public class Client : IDisposable {
|
||||||
public Socket? Socket;
|
public Socket? Socket;
|
||||||
public bool Connected => Socket?.Connected ?? false;
|
public bool Connected = false;
|
||||||
public Guid Id;
|
public Guid Id;
|
||||||
public CostumePacket CurrentCostume = new CostumePacket {
|
public CostumePacket CurrentCostume = new CostumePacket {
|
||||||
BodyName = "",
|
BodyName = "",
|
||||||
|
|
|
@ -121,6 +121,8 @@ public class Server {
|
||||||
default:
|
default:
|
||||||
throw new Exception($"Invalid connection type {connect.ConnectionType}");
|
throw new Exception($"Invalid connection type {connect.ConnectionType}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
client.Connected = true;
|
||||||
if (firstConn) {
|
if (firstConn) {
|
||||||
// do any cleanup required when it comes to new clients
|
// do any cleanup required when it comes to new clients
|
||||||
List<Client> toDisconnect = Clients.FindAll(c => c.Id == header.Id && c.Connected && c.Socket != null);
|
List<Client> toDisconnect = Clients.FindAll(c => c.Id == header.Id && c.Connected && c.Socket != null);
|
||||||
|
|
Loading…
Reference in New Issue