Skip to content

Commit

Permalink
Close connection after 15 seconds (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMacocian authored Nov 26, 2023
1 parent d75f4bc commit 6600e99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion GuildWarsPartySearch/Config.Release.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ServerOptions": {
"ApiKey": "[APIKEY]",
"Certificate": "[CERTIFICATE_BASE64]",
"InactivityTimeout": "0:0:5",
"InactivityTimeout": "0:0:15",
"HeartbeatFrequency": "0:0:1"
},
"StorageAccountOptions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ void IHandler.Tick(MTSC.ServerSide.Server server)

foreach (ClientData client in server.Clients)
{
if (DateTime.Now - client.LastActivityTime > this.inactivityTimeout &&
!this.IsConnected(client.Socket))
if (DateTime.Now - client.LastActivityTime > this.inactivityTimeout)
{
server.Log("Disconnected: " + client.Socket.RemoteEndPoint?.ToString());
client.ToBeRemoved = true;
Expand Down

0 comments on commit 6600e99

Please sign in to comment.