Skip to content

Commit

Permalink
Merge pull request #24 from stayintarkov/Remove-WS-Timeout
Browse files Browse the repository at this point in the history
Remove WS Timeout. It affects Udp sessions.
  • Loading branch information
paulov-t authored Feb 1, 2024
2 parents 517143f + 3c7ec20 commit b928f87
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/CoopMatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ export class CoopMatch {

friendlyAI: friendlyAI;

private CheckStartTimeout : NodeJS.Timeout;
private CheckStillRunningInterval: NodeJS.Timeout;
// private CheckStartTimeout : NodeJS.Timeout;
// private CheckStillRunningInterval: NodeJS.Timeout;

/** A STATIC Dictonary of Coop Matches. The Key is the Account Id of the Player that created it */
public static CoopMatches: Record<string, CoopMatch> = {};
Expand Down Expand Up @@ -128,15 +128,15 @@ export class CoopMatch {
});

// This checks to see if the WebSockets can still be communicated with. If it cannot for any reason. The match/raid/session will close down.
this.CheckStartTimeout = setTimeout(() => {
this.CheckStillRunningInterval = setInterval(() => {
// this.CheckStartTimeout = setTimeout(() => {
// this.CheckStillRunningInterval = setInterval(() => {

if(!WebSocketHandler.Instance.areThereAnyWebSocketsOpen(this.ConnectedPlayers)) {
this.endSession(CoopMatchEndSessionMessages.WEBSOCKET_TIMEOUT_MESSAGE);
}
// if(!WebSocketHandler.Instance.areThereAnyWebSocketsOpen(this.ConnectedPlayers)) {
// this.endSession(CoopMatchEndSessionMessages.WEBSOCKET_TIMEOUT_MESSAGE);
// }

}, CoopConfig.Instance.webSocketTimeoutSeconds * 1000);
}, CoopConfig.Instance.webSocketTimeoutCheckStartSeconds * 1000);
// }, CoopConfig.Instance.webSocketTimeoutSeconds * 1000);
// }, CoopConfig.Instance.webSocketTimeoutCheckStartSeconds * 1000);
}

public ProcessData(info: any, logger: ILogger) {
Expand Down Expand Up @@ -310,8 +310,8 @@ export class CoopMatch {
this.Status = CoopMatchStatus.Complete;

//clearTimeout(this.SendLastDataInterval);
clearTimeout(this.CheckStartTimeout);
clearInterval(this.CheckStillRunningInterval);
// clearTimeout(this.CheckStartTimeout);
// clearInterval(this.CheckStillRunningInterval);

this.LocationData = null;

Expand Down

0 comments on commit b928f87

Please sign in to comment.