Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
omard2000

Photon Server Browser

Question

Hi guys, I'm trying to make a server browser for my FPS game. How would I make it so that all the servers can appear in the availabelRoomsText variable. Also, how would I go about joining the servers that are received from the room list?

 

if (PhotonNetwork.insideLobby) {
            var rooms = PhotonNetwork.GetRoomList ();
            foreach (var room in rooms) {
                availableRoomsText.text = "Room: " + room.name.ToString();
            }

        }

Edited by omard2000

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 2

If you using a new GUI you need to use Layouts.

1)Make a Server info panel instance Like this:

Please login or register to see this spoiler.
  • Like 2

Share this post


Link to post
Share on other sites

  • 0

1. If i understand you

   

Please login or register to see this code.

2. Use PhotonNetwork.JoinRoom("there needs to be your room name")

Share this post


Link to post
Share on other sites
  • 0

Thanks for your reply. Right now I only get the server names all in one line. I am using Unity's UI system. How would I go about separating the server names into separate lines with a button next to them which gives the option to join the game?

Share this post


Link to post
Share on other sites
  • 0

here's a legacy GUI example of a server browser, shouldn't be too hard to pick apart and implement into your game :)

 

EDIT: Code formatting seems to be broken here atm, here's a pastebin link instead: Please login or register to see this link.

 

Please login or register to see this spoiler. Edited by Connor Gibson
Code format error
  • Like 1

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

 

Thanks! I'm actually gonna give this a try first :). I'll let you know how it goes! :). Thanks for the great reply

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

 

Please login or register to see this spoiler.

Share this post


Link to post
Share on other sites
  • 0

@chapaeff - I got stuck again, sorry :(. Please login or register to see this link.  Any idea why it is looking like this?

Share this post


Link to post
Share on other sites
  • 0

@chapaeff - it's still acting a bit weird. I think it's just too much for my little UI skills. I'm going to try editing it a bit and see if it works :). I'll share my results at the end :). Thanks again!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...