(Multiplayer) Identify the host of the room.

2

Stats

469 visits, 598 views

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 8 Nov, 2022. Last updated 17 Nov, 2022

Who is the host?

In this tutorial I show how peers can identify who is the host of the room, it is simple and very cool to be able to distinguish the "adm" of the room, as shown in the image...

In the image above we see that "DRI" is the person who created the room the "Host", his name is accompanied by a chess king as an icon which is a special character.

Let's go to work...

Using multiplayer chat as an example to implement the idea...

So let's go to the line where we log in to the room so for the host (yourself) the system adds the special character. and for the peer nothing unusual happens. The only change is to change the selected line.

After that go down to the condition if a peer connects...

Here we will add 2 conditions taking advantage of the previous one as in the image.

So we have the following... Repeating as many times as there are items in the list, give me what is written in each item... If any item is the same as the host's nickname then do an action...

Action: Add a special character to this nickname...

And that's it...

  • 0 Comments

Want to leave a comment? Login or Register an account!