Incorrect master

Posted by PainiteOfficial
Hey Size!

I wanted some advice on a problem I'm currently facing.
Basically, I create a new session and then I check if I'm the master with gms_self_ismaster().
It returns as expected, I am the master of the session.

Now the problem is that sometimes when I add a new player in my session, that player gets to be the master instead of me (the one who created it and also joined first)

Any idea how I can fix that?

Replies (1)

Last message on 24 Apr 2021

Size43 (Administrator) on 24 Apr 2021, 19:24:24
The master player is the player that has been connected to the server the longest -- that might not always be the player that has been int that session for the longest amount of time.

For what purpose are you trying to use the master player? Depending on what you want to achieve, there are multiple other possible approaches. One would be to store the ID of the player that created the session in a global variable, and have clients read that instead of the master player.