Session change script keeps being executed randomly.

Posted by Aouab
Hellow kingdom of developers ^ - ^

I've recently had a problem with my game , which causes some bugs.

I've done some debug , and I've come to the conclusion that the GMS objects keeps executing the session change script randomly every (let's say) 1 minute , and it causes some bugs such as :
- When the player is connected but still not in a session , it shows some error about variables not being defined (variables that should be defined when the player enters a session).
- Causes the room to restart because the player rejoins the session

Anyone knows why? ^^
Any further information I should give ? ^-^

Thanks.

Replies (3)

Last message on 21 May 2019

Size43 (Administrator) on 5 May 2019, 12:35:09
You'll always enter a session right after logging in, which is just whatever session with type 0 is available.

Does the session ID change whenever the session change script is executed?
Aouab (Topicstarter) on 5 May 2019, 14:38:55
No,

Basically when a client clicks on the play button for example , it goes to the game room session as expected.

But the problem is while the client is in the game room (or any other session) , without doing anything , it keeps rejoining and rejoining the same session he is in , which causes the room to restart everytime.

I don't know the cause of that.
Size43 (Administrator) on 21 May 2019, 16:06:33
Then an easy fix would be to check the old and new session ID in the session change script, and only execute it if they are different.

I'll also add this to my todo list to do a proper fix, but that might take a while because I'm currently very busy.