Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 /
  • Help Room /
avatar image
0
Question by NovaWake · Jan 07, 2016 at 11:03 PM · networkingobjectphoton

How do I resolve this Photon Error: Operation failed: OperationResponse 226: ReturnCode: 32758 (Game does not exists).

I'm trying to: If all rooms are full or there are no rooms: Create a room with a 2 player max and join it. Else randomly join room.

Here is my code:

 using UnityEngine;
 using Photon;
 
 public class MyMatchMaker : Photon.PunBehaviour
 {
     private PhotonView myPhotonView;
 
     public void Start()
     {
         PhotonNetwork.autoJoinLobby = true;
 
         Debug.Log("Connecting to photon server...");
         PhotonNetwork.ConnectUsingSettings("0.1");
     }
 
     public override void OnConnectedToPhoton()
     {
         Debug.Log("Connected to Photon.");
     }
 
     public override void OnJoinedLobby()
     {
         Debug.Log("Connected to Lobby.");
 
         //Pre-setup options for the room you are about to create.
         RoomOptions options = new RoomOptions();
         options.maxPlayers = 2;
 
         //create the room w those options
         if (PhotonNetwork.CreateRoom("0", options, TypedLobby.Default))
         {
             Debug.Log("Created new Room.");
         }
 
         //this should join room 0 as there should not be any other rooms available.
         PhotonNetwork.JoinRandomRoom(); 
 
     }
 
     public void OnPhotonRandomJoinFailed()
     {
         Debug.Log("Join Random Room Failed.");
 
         //Pre-setup options for the room you are about to create.
         RoomOptions options = new RoomOptions();
         options.maxPlayers = 2; // 2 player limit.
 
         //create the room w those options
         PhotonNetwork.CreateRoom("1", options, TypedLobby.Default);
 
         PhotonNetwork.JoinRandomRoom();
     }
 
     public override void OnJoinedRoom()
     {
         if (PhotonNetwork.room != null)
             Debug.Log("Connected to room: " + PhotonNetwork.room);
         else
             Debug.Log("Not in a room.");
 
         GameObject player = PhotonNetwork.Instantiate("Character", Vector3.zero, Quaternion.identity, 0);
     }
 }
 

When I run it, Photon gives me this error:

Operation failed: OperationResponse 226: ReturnCode: 32758 (Game does not exists). Parameters: {} Server: GameServer UnityEngine.Debug:LogError(Object) NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1157) ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[]) ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:125)

Comment
Add comment · Show 3
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
avatar image NovaWake · Jan 07, 2016 at 11:06 PM 0
Share

Interestingly enough, if I remove the two lines that say: PhotonNetwork.JoinRandomRoom(); It runs, but if there are more than two players I get another error:

Operation failed: OperationResponse 227: ReturnCode: 32766 (A game with the specified id already exist.). Parameters: {} Server: $$anonymous$$asterServer UnityEngine.Debug:LogError(Object) NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1157) ExitGames.Client.Photon.PeerBase:Deserialize$$anonymous$$essageAndCallback(Byte[]) ExitGames.Client.Photon.EnetPeer:DispatchInco$$anonymous$$gCommands() ExitGames.Client.Photon.PhotonPeer:DispatchInco$$anonymous$$gCommands() PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:125)

avatar image tobiass · Jan 08, 2016 at 10:13 AM 0
Share

Please check out the demos and this page: https://doc.photonengine.com/en/pun/current/tutorials/matchmaking-and-lobby

You should avoid using rooms with hard-coded names. While they are full, you're out of luck joining them. If you create a room, the creating client will automatically enter (join) the room, too. So you never need to have CreateRoom() and JoinRandom() right after another.

I write this as comment, because I'm not actively fixing anything you posted but you should now be able to fix things.

avatar image amanpu tobiass · May 02, 2016 at 05:10 AM 0
Share

@tobiass I fixed the issue by setting hosting region to 'asia' ins$$anonymous$$d of 'best'. Is it right solution?

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Unity_scat · Oct 26, 2016 at 04:30 AM

If you replace Join or JoinRoom with JoinOrCreateRoom, you should just avoid the problem and the need for OnPhotonJoinFailed or OnPhotonRandomJoinFailed.

Comment
Add comment · Show 1 · Share
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
avatar image younessben2021 · Dec 14, 2021 at 08:21 PM 0
Share

That's not the point we need to join a specific room actually ,I have the same issue I even I've done all the possible ways to solve but still dont know the real reason behind

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

57 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

[Photon Networking] Passing My Player scripts 'Target' object to the Uncontrolled version of My Player 1 Answer

Unity crash on creating Build using Realistic car controller and photon 1 Answer

Unity Photon Player Instantiation 1 Answer

Photon RPC Parameter NullReferenceException 1 Answer

How to add realtime game events without updating build? 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