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

Bug: Games with unauthenticated players can't be rejoined #438

Open
lijim opened this issue Apr 2, 2023 · 0 comments
Open

Bug: Games with unauthenticated players can't be rejoined #438

lijim opened this issue Apr 2, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@lijim
Copy link
Owner

lijim commented Apr 2, 2023

Right now rejoin works fine if there are two or more players that are logged in, but if one or more players don't have logins, the game doesn't handle rejoin functionality as expected, instead booting both players out.

The suspected code is the code for calculating if a whole room is abandoned:

const isEntireRoomDisconnected = (room: DetailedRoomWithBoard): boolean => {
        if (!room) {
            return false;
        }
        const allSessions = findAllSessions();
        const { players } = room;
        return players.every(
            (player) =>
                !allSessions.find((session) => session.username === player)
                    ?.connected
        );
    };
@lijim lijim added the bug Something isn't working label Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant