User kicked out of desired room

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

FireballFred
Posts: 4
Joined: 30 Jan 2017, 23:03

User kicked out of desired room

Postby FireballFred » 14 Feb 2018, 00:57

Here is the problematic sequence of events for me:
    User U1 creates and enters room R1
    User U2 enters R1
    User U1 exits the game
    User U2 enters room R2 (which already exists)

Expected behavior:
    User U2 leaves R1
    User U2 enters R2
    Room R1 gets destroyed (owner and all occupants have left)
    User U2 stays in R2 until he/she decides to leave

Actual behavior:
    User U2 leaves R1
    User U2 enters R2
    Room R1 gets destroyed
    User U2 gets booted from R2

This seems like a bug that sees R1 got destroyed so decides to kick the last user out of his/her last joined room, but the last joined room is R2 (not R1), so the user gets kicked from R2. U2 does get a USER_EXIT_ROOM event, with a room variable of R2.

Server Version 2.13.0
Unity Client v1.7.5
Happens locally and in production, every time I perform these steps.
User avatar
Lapo
Site Admin
Posts: 19988
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: User kicked out of desired room

Postby Lapo » 14 Feb 2018, 09:53

Hello,
Actual behavior:
User U2 leaves R1
User U2 enters R2
Room R1 gets destroyed
User U2 gets booted from R2

Are there any client or server errors?

Is U2 actually booted from the Room or is there a join error?
Also, what type of Room is R2?
Are the join requests sent from client or server side?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
FireballFred
Posts: 4
Joined: 30 Jan 2017, 23:03

Re: User kicked out of desired room

Postby FireballFred » 14 Feb 2018, 19:22

I removed our server side extension while verifying this, so requests are all client side.
I'm not seeing errors on the server or client side. All rooms are not game rooms.

I managed to track down the issue.
We had a code path that had a reference to R1 and was calling LeaveRoomRequest(R1) after R1 was destroyed. The server was removing U2 from R2 after receiving the request to remove U2 from the non-existent R1.

We have fixed the issue by adding a check that JoinedRooms.Contains(R1) before that LeaveRoomRequest is made.

Thank you for your time.
User avatar
Lapo
Site Admin
Posts: 19988
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: User kicked out of desired room

Postby Lapo » 15 Feb 2018, 08:57

Great! :)

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 6 guests