Questions on how I could prevent peers in chatroom to join as host

0 favourites
  • 3 posts
  • First let me explain what I'm trying to achieve:

    Hi everyone, so the multiplayer chat is great. But because of the importance of being able to moderate a room, I would like it where only I can join as the host when I'm online. If i'm not joining as host (using some secret button / key combo) I would like others to be know the chatroom is offline..

    This is important as if someone outside joins as host who's not someone I know, they could effectively hijack the room and just be a real pain to deal with..

    My plan is to have a "SysOp" account always connected so this normally would fix that, but if for any reason my Sysop gets knocked out of the chat, someone else could take over.

    So the question:

    is there a way before the player attempts to enter the room to prevent them from being able to join. I could imagine a menu screen where this menu screen shows "Chat Room (offline)" when they go there and the chat room is hostless.. but when the host is in the room, remove the offline notification and allow them to proceed.

    I went through all the options in multiplayer and didn't see anything that seemed like it would do the trick. It seems like if the host is in the room, there might be some way another user via construct could detect if "host is in the room".. or somehow that the room is instantiated.. if it is. then proceed, but if not, then the chatroom is offline.

    Thanks in advance for any tips / advise anyone has.

    Sincerely,

    Caleb

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • After connecting to the signalling server, you can use the request room list action.

    Subsequently, you'll be able to use the on room list trigger condition. In that event, the various listroom expressions can get you information like if a room exists or already has one connected user (host) or not. Use that as a condition before allowing a user to join a room.

  • ah i see.. i wasn't sure about those. so i need to check for the specific room name i'm currently using and if it doesn't exist.. update the ability to go further. Ah that's awesome. I'll see how far I get with that!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)