Skip to content

Commit

Permalink
fix: prevent sending disconnect event if server is the same - fix #86 (
Browse files Browse the repository at this point in the history
  • Loading branch information
pagoru authored Sep 30, 2024
1 parent 4b82d4f commit 275e54f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions app/server/src/system/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,25 @@ export const sessions = () => {
]);
const session = sessionMap[accountId];

console.warn(
accountId,
"->",
session?.server,
"->",
foundSession?.value?.server,
"<<<<",
);

const currentSession = foundSession.value;

//check if session server exists and changed if so disconnect from last server
//only if last server is different from current one
if (
session &&
session.server !== currentSession.server &&
(session.sessionId !== currentSession.sessionId ||
session.ticketId !== currentSession.ticketId ||
session.server !== currentSession.server)
session.ticketId !== currentSession.ticketId)
) {
$disconnectFromLastServer(accountId, session.server);
console.warn(
accountId,
"->",
session?.server,
"->",
foundSession?.value?.server,
"<<<<",
);
}
//reassign server session
sessionMap[accountId] = currentSession;
Expand Down

0 comments on commit 275e54f

Please sign in to comment.