#Unity Session : cannot repeatedly join the same room

1 messages · Page 1 of 1 (latest)

desert tinsel
#

i followed the workflow below and discovered a "index out of range error"

As a host for roomA -> join room B + leave roomA -> return to own session by CreateSession -> become host again for newly created room -> join room B + leave roomA again

to be simple, joining on the same room for second time will throw this error

#

i already ensured the session ID of room B is always the same

#

the error is from

await MultiplayerService.Instance.JoinSessionByIdAsync(sessionID);```
#

this is first time

#

this is second time

#

the weird thing is

player actually joined into the session, because if u attempt to join the session again it will say

"player is already a member of the lobby"

uncut viper
#

If the last user leaves a session it will get deleted. Is the host still in that session?

desert tinsel
#

yes

#

room B host didnt do anything , it exists all the time, its just player A exit and rejoin room B

#

i think i will take a short video to show the error tmr👍

uncut viper
desert tinsel
#

all of the leaving and rejoining feels fine until the error pops out

#

and i dont think reconnectasync works for me in this case, because if i need player to reconnect, i need to know player had joined the room right?

which means player cannot leave session so that cs getjoinedRoomByIDworks , and then i can use the ID to reconnect back

but if i do that the player will need to stay in the room until he went offline, that might be like 4 hrs+ , and it will keep occupy room slot , lets say a room of 4, 2 of the player joined and left, but then the room is still in 3/4 right?

uncut viper
#

If the player leaves the session, they should be showing in the lobby anymore. If the player isn't leaving properly, it might be waiting for the player to timeout
But to use reconnectasync, you would need to keep a list of sessions the player had previously joined, yea

desert tinsel
uncut viper
desert tinsel
#

i gonna check if network manager is the problem

#

no its not the problem

#

now it pops out this one

uncut viper
# desert tinsel

huh, if you are leaving the session with the relay connection, then you'll need to wait for the 10 second soft shutdown to complete before trying to start it back up

desert tinsel
#

i dont think it relate to the index error

#

ohhhhhhh

#

i gonna test with 30 seconds span then

uncut viper
#

I believe there is an OnServerStopped event you can listen for

desert tinsel
#

sry i just forgot that, the index error still there....

#

ignore the relay error