Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Michealunity · Mar 28, 2016 at 02:54 PM · listphotonissueroomjoin

Photon room name issue

Hi guys i have a little problem with this code, i can create a room but when i try to catch the name of the room in the function Crea_o_Entra_in_partita looks like there is no room open even if a room exist, Any idea where the problem is? Here is the code: `

< using UnityEngine; using System.Collections; using System.Collections.Generic;

     public class Play_manager : MonoBehaviour
     {
     
         public bool solo;
         public bool group;
     
         public string Room_Name = "";
     
         public bool five_vs_five;
         public bool three_vs_three_vs_three;
         public bool four_vs_four;
         public bool five_vs_five_d;
         public bool three_vs_three;
     
         public string five = "5vs5";
         public string three = "3vs3vs3";
         public string four = "4vs4";
         public string fived = "5vs5d";
         public string six = "3vs3";
     
     
         public GameObject invite5vs5;
         public GameObject invite3vs3vs3;
         public GameObject invite4vs4;
         public GameObject invite5vs5d;
         public GameObject invite3vs3;
     
         public string roomNameprov;
     
         // Use this for initialization
         void Start()
         {
     
     
         }
     
         // Update is called once per frame
         void Update()
         {
             if(!PhotonNetwork.connected)
             {
                 PhotonNetwork.ConnectUsingSettings("1");
                 PhotonNetwork.playerName = Random.Range(0, 100).ToString();
             }
     
         }
     
     
         public void Crea_o_Entra_in_PArtita()
         {
             
     
             //////////SE IN SOLO//////////////
             if (solo && five_vs_five)
             {
                
                 foreach(RoomInfo room in PhotonNetwork.GetRoomList())
                 {
                     if (room.name.Contains(five) && PhotonNetwork.room.playerCount < PhotonNetwork.room.maxPlayers)
                     {
                         roomNameprov = room.name;
                         if (roomNameprov != "")
                         {
                             PhotonNetwork.JoinRoom(roomNameprov);
                             return;
                         }
                     }
                 }
     
             }
     
             if (solo && three_vs_three_vs_three)
             {
                 foreach (RoomInfo room in PhotonNetwork.GetRoomList())
                 {
                     if (room.name.Contains(three) && PhotonNetwork.room.playerCount < PhotonNetwork.room.maxPlayers)
                     {
                         if (roomNameprov != "")
                         {
                             PhotonNetwork.JoinRoom(roomNameprov);
                             return;
                         }
                     }
                 }
             }
     
             if (solo && four_vs_four)
             {
                 foreach (RoomInfo room in PhotonNetwork.GetRoomList())
                 {
                     if (room.name.Contains(four) && PhotonNetwork.room.playerCount < PhotonNetwork.room.maxPlayers)
                     {
                         if (roomNameprov != "")
                         {
                             PhotonNetwork.JoinRoom(roomNameprov);
                             return;
                         }
                     }
                 }
             }
     
             if (solo && five_vs_five_d)
             {
                 foreach (RoomInfo room in PhotonNetwork.GetRoomList())
                 {
                     if (room.name.Contains(fived) && PhotonNetwork.room.playerCount < PhotonNetwork.room.maxPlayers)
                     {
                         if (roomNameprov != "")
                         {
                             PhotonNetwork.JoinRoom(roomNameprov);
                             return;
                         }
                     }
                 }
             }
     
             if (solo && three_vs_three)
             {
                 foreach (RoomInfo room in PhotonNetwork.GetRoomList())
                 {
                     if (room.name.Contains(six) && PhotonNetwork.room.playerCount < PhotonNetwork.room.maxPlayers)
                     {
                         if (roomNameprov != "")
                         {
                             PhotonNetwork.JoinRoom(roomNameprov);
                             return;
                         }
                     }
                 }
             }
     
     
             ////////////SE IN GRUPPO////////////
     
     
     
             if (group && five_vs_five)
             {
                 string room_name1 = five + PhotonNetwork.playerName + Random.Range(0, 10000);
                 RoomOptions roomOptions1 = new RoomOptions() { isOpen = true, maxPlayers = 2 }; ////////
                 PhotonNetwork.CreateRoom(room_name1, roomOptions1, TypedLobby.Default);
     
     
                 Debug.Log("ho creato e sono dentro una stanza");
     
                 invite5vs5.SetActive(true);
     
             }
     
             if (group && three_vs_three_vs_three)
             {
                 string room_name2 = three + PhotonNetwork.playerName + Random.Range(0, 10000);
                 RoomOptions roomOptions2 = new RoomOptions() { isOpen = true, maxPlayers = 2 };
                 PhotonNetwork.CreateRoom(room_name2, roomOptions2, TypedLobby.Default);
                 Debug.Log("ho creato e sono dentro una stanza");
     
                 invite3vs3vs3.SetActive(true);
     
     
             }
     
             if (group && four_vs_four)
             {
                 string room_name3 = four + PhotonNetwork.playerName + Random.Range(0, 10000);
                 RoomOptions roomOptions3 = new RoomOptions() { isOpen = true, maxPlayers = 2 };
                 PhotonNetwork.CreateRoom(room_name3, roomOptions3, TypedLobby.Default);
                 Debug.Log("ho creato e sono dentro una stanza");
     
                 invite4vs4.SetActive(true);
     
             }
     
             if (group && five_vs_five_d)
             {
                 string room_name4 = fived + PhotonNetwork.playerName + Random.Range(0, 10000);
                 RoomOptions roomOptions4 = new RoomOptions() { isOpen = true, maxPlayers = 2 };
                 PhotonNetwork.CreateRoom(room_name4, roomOptions4, TypedLobby.Default);
                 Debug.Log("ho creato e sono dentro una stanza");
     
                 invite5vs5d.SetActive(true);
     
             }
     
             if (group && three_vs_three)
             {
                 string room_name5 = six + PhotonNetwork.playerName + Random.Range(0, 10000);
                 RoomOptions roomOptions5 = new RoomOptions() { isOpen = true, maxPlayers = 2 };
                 PhotonNetwork.CreateRoom(room_name5, roomOptions5, TypedLobby.Default);
                 Debug.Log("ho creato e sono dentro una stanza");
     
                 invite3vs3.SetActive(true);
     
             }
         }
     
     }

Any idea where is the problem? Thanks to all

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

PhotonNetwork.GetRoomList() output = 0 1 Answer

Unity Photon Create a Passworded Room and join? 0 Answers

Photon Join room (Not Random Room) 1 Answer

Photon Networking create room issue 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges