Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent sending disconnect event if server is the same - fix #86 #87

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading