PhotonNetwork.Connect and LiteLobbyPeer.Connect

Hello everybody.

could someone link me an example or give me an idea in how to implement a lobby chat inside a game? (using unity)

I'm currently testing the LiteLobby demo to implement a kind of lobby chat where players will connect before join the game.
So my idea is to load a scene where the players will connect to the lobby chat and when the room get the maximum players they will be send to a second scene (where is the map, enemies etc..).
Now the issue is that the demo uses Lite peer connection custom events and stuffs, and my game was using the PhotonNetwork class to make the connection create the object instances and more stuff, im not sure if its possible to make the lobby with one kind of connection and when the players are sent to the game use the PhotonNetwork Class to handle the connection.

Also, i was noticing that the Photon network connection only works when using the Photon InstanceLoadBalance in the local server, and the LiteLobby use the Photon Instance1 , so i don't have any clue in how to implement and test the demo chat in my game :/

Thanks in advance for any clue and regards.

Comments

  • It seems you got the impression that chat and waiting for more players is something that can only be done in a lobby. This is not the case.
    I'm writing this out of my head, so please look around, if either of the method names is misspelled (or named similarly in PUN).

    You only need to get X players into a room. There they could chat and wait until all places are taken. Then, they could load a scene and play.

    PhotonNetwork JoinRandomRoom() will join a room if possible. If not, there is a error callback. There create a room (as you can't find any) with maxplayers set to your favourite number of players.
    This gets you a max of X players per room and very simple joining. No need for a lobby or anything. Just send chat RPCs like the Demo Worker does.

    If needed, you can close a room. This makes sure no new players get into it, even if someone drops out. Do this, before you switch from "chatting and waiting" to "playing a game".
  • Tobias wrote:
    It seems you got the impression that chat and waiting for more players is something that can only be done in a lobby. This is not the case.
    I'm writing this out of my head, so please look around, if either of the method names is misspelled (or named similarly in PUN).

    You only need to get X players into a room. There they could chat and wait until all places are taken. Then, they could load a scene and play.

    PhotonNetwork JoinRandomRoom() will join a room if possible. If not, there is a error callback. There create a room (as you can't find any) with maxplayers set to your favourite number of players.
    This gets you a max of X players per room and very simple joining. No need for a lobby or anything. Just send chat RPCs like the Demo Worker does.

    If needed, you can close a room. This makes sure no new players get into it, even if someone drops out. Do this, before you switch from "chatting and waiting" to "playing a game".

    Thanks for the quick reply.
    I was very focused on integrate the lite lobby demo in our game that i didn't consider in using the photonnetwork methods to make the chat rooms.
    Now I got an idea on how to make the rooms, using the events OnJoinedRoom, OnCreatedRoom etc.. and some GUI code.

    thanks for the advice :D