mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-22 03:05:16 +00:00
Connected no longer depends on socket
This commit is contained in:
parent
94a29aca12
commit
6759f80bc5
2 changed files with 3 additions and 1 deletions
|
@ -6,7 +6,7 @@ namespace Server;
|
|||
|
||||
public class Client : IDisposable {
|
||||
public Socket? Socket;
|
||||
public bool Connected => Socket?.Connected ?? false;
|
||||
public bool Connected = false;
|
||||
public Guid Id;
|
||||
public CostumePacket CurrentCostume = new CostumePacket {
|
||||
BodyName = "",
|
||||
|
|
|
@ -121,6 +121,8 @@ public class Server {
|
|||
default:
|
||||
throw new Exception($"Invalid connection type {connect.ConnectionType}");
|
||||
}
|
||||
|
||||
client.Connected = true;
|
||||
if (firstConn) {
|
||||
// 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);
|
||||
|
|
Loading…
Reference in a new issue