mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-29 06:33:06 +00:00
Add client id logs
This commit is contained in:
parent
b660fcfd53
commit
94a29aca12
1 changed files with 3 additions and 3 deletions
|
@ -134,7 +134,7 @@ public class Server {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.Info($"Client {socket.RemoteEndPoint} connected.");
|
Logger.Info($"Client {socket.RemoteEndPoint} ({client.Id}) connected.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -145,9 +145,9 @@ public class Server {
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
if (e is SocketException {SocketErrorCode: SocketError.ConnectionReset}) {
|
if (e is SocketException {SocketErrorCode: SocketError.ConnectionReset}) {
|
||||||
Logger.Info($"Client {socket.RemoteEndPoint} disconnected from the server");
|
Logger.Info($"Client {socket.RemoteEndPoint} ({client.Id}) disconnected from the server");
|
||||||
} else {
|
} else {
|
||||||
Logger.Error($"Exception on socket {socket.RemoteEndPoint}, disconnecting for: {e}");
|
Logger.Error($"Exception on socket {socket.RemoteEndPoint} ({client.Id}) and disconnecting for: {e}");
|
||||||
Task.Run(() => socket.DisconnectAsync(false));
|
Task.Run(() => socket.DisconnectAsync(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue