Drawing Sessions

Posted by Chibi
So I Wanted To Implement A System That Shows Up The Existing Rooms To The Players, But Still My Question is How Can I Draw Sessions Like This ?http://prntscr.com/h9focs

Replies (4)

Last message on 30 Apr 2019

Aouab on 30 Apr 2019, 03:17:15
ShadowNYA , is that you?
Size43 (Administrator) on 18 Nov 2017, 15:02:56

There's a small explanation of sessions here:https://gamemakerserver.com/en/docs/article/sessions/
There are also multiple posts about sessions in this forum:https://gamemakerserver.com/en/forum/board/1/
If you need any additional information, please let me know.
Chibi (Topicstarter) on 14 Apr 2019, 20:15:49
I've been trying to remake this system but there is a problem, so basically even though no one created any session at all there is always these 2 sessionshttp://prntscr.com/nbux7i and they also say that there is 1 player on them while there's no one in there.
This is what I've got so far :
var i;
for(i = 0; i < 25; i += 1;){
    if (gms_session_exists(i)){
        draw_text(x+55,y+(20*i),"Room : "+string(i)+" Players : "+string(gms_session_count())+"/4");

that code is inside of the LobbyController object and inside of a draw event.
Size43 (Administrator) on 24 Apr 2019, 11:57:30
gms_session_count returns the number of sessions, not the number of players in that session. There's gms_session_player_count(...) for getting the number of players in the session.

Also, you should only use session IDs (except for gms_session_find(i)) as arguments to any gms_session_* functions. Using an index directly has been deprecated.