Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Third Party Photon OperationResponse 254: ReturnCode: -2

Discussion in 'Multiplayer' started by wulveagfin, Jul 17, 2018.

  1. wulveagfin

    wulveagfin

    Joined:
    Oct 3, 2014
    Posts:
    27
    Unity 2018.2.0f2
    Photon 1.91

    Code that worked until I upgraded from 2018.1 to 2018.2:

    Code (CSharp):
    1.  
    2. Operation failed: OperationResponse 254: ReturnCode: -2 (Unknown operation code). Parameters: {} Server: MasterServer
    3. UnityEngine.Debug:LogError(Object)
    4. NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1623)
    5. ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
    6. ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
    7. ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
    8. PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:158)
    9.  
    Code (CSharp):
    1. Failed parsing address:
    2. UnityEngine.Debug:LogError(Object)
    3. NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1574)
    4. ExitGames.Client.Photon.IPhotonSocket:Connect()
    5. ExitGames.Client.Photon.SocketUdp:Connect()
    6. ExitGames.Client.Photon.EnetPeer:Connect(String, String, Object)
    7. ExitGames.Client.Photon.PhotonPeer:Connect(String, String, Object)
    8. NetworkingPeer:Connect(String, ServerConnection) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:590)
    9. NetworkingPeer:OnStatusChanged(StatusCode) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2175)
    10. ExitGames.Client.Photon.<>c__DisplayClass146_0:<EnqueueStatusCallback>b__0()
    11. ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
    12. ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
    13. PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:158)
    14.  
    The code is:


    if(!PhotonNetwork.insideLobby)
    {
    this.JoinRandomRoomAfterOnLobby = true;
    PhotonNetwork.LeaveRoom();
    PhotonNetwork.JoinLobby();
    return;
    }


    The Update Loop ends, and the Photon code takes over. It produces that error. I can't find this error on the internet anywhere. "OperationResponse 254: ReturnCode: -2"
     
  2. wulveagfin

    wulveagfin

    Joined:
    Oct 3, 2014
    Posts:
    27
    This is no longer an issue. Photon must have fixed something on their server code.
     
  3. Xander511

    Xander511

    Joined:
    May 30, 2014
    Posts:
    3
    I have the same problem, did you make anything else to make it work? I have the same Photon and Unity version as you.
     
  4. wulveagfin

    wulveagfin

    Joined:
    Oct 3, 2014
    Posts:
    27
    It just kinda fixed itself one day.

    I didn't do anything on my side.
     
  5. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,021
    This is more likely a timing-dependent issue. You should make sure the logic waits for specific callbacks, before your client calls JoinLobby or such.
    In your case, 254 is a OperationCode. The class lists this as Leave. Maybe you tried to Leave, while not in a room.
     
  6. Xander511

    Xander511

    Joined:
    May 30, 2014
    Posts:
    3
    You were right, the logic was the problem, thank you for the help.
     
    tobiass likes this.