Unexpected return code -2 of operation Join

Options
shiba_nivengo
edited October 2011 in DotNet
Hi!
I'm trying Photon server to know if it fits our requirements, but I'm having some problems with the .Net client SDK. I cannot even run the demos included in the SDK, and I'm having the following error:
OnOperationReturn: unexpected return code -2 of operation Join.

It's weird because I've been testing the angry bots demo for Unity and everything works well.
Any help will be appreciated. Thanks

Comments

  • Boris
    Options
    What's the content of the returned debug message?
  • This is the complete debug output since the moment the connection is established in demo-lobby.
    Connect()
    new NConnect UDP.
    Remote IP: localhost:5055
    thread start: netSim9952723
    queueIncomingCommand( NC(0|6 r/u: 1/0 st/r#/rt:0/0/0) )  -  incomingReliableSequenceNumber: 0
    nPeerReturn():Connect
    Connect(ed)
    'demo-lobby.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'demo-lobby.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.resources\2.0.0.0_es_b77a5c561934e089\System.resources.dll'
    A first chance exception of type 'System.FormatException' occurred in System.dll
    A first chance exception of type 'System.FormatException' occurred in System.dll
    queueIncomingCommand( NC(0|6 r/u: 2/0 st/r#/rt:0/0/0) )  -  incomingReliableSequenceNumber: 1
    nPeerReturn() 90/-2
    A first chance exception of type 'System.NullReferenceException' occurred in demo-lobby.exe
    

    The null exception is thrown at Game.cs line 167.

    Thanks for your help.
  • Boris
    Options
    i don't see the "unexpected return code -2 of operation Join" message there?
    what version of photon are you using?
    The parameter keys of lite v3 are different to the ones used by v2, maybe you run a v2 client against a v3 server, or the other way around?
  • Sorry, I mixed things. Let me explain myself.
    First I tried to run demo-lobby but I got the error shown in the previous post. After trying sometimes, I couldn't find out a solution and I thought that maybe the problem was in the server and not on the client side. I decided to download the server from your webpage and don't use the server I downloaded together with the Unity Angry Bots Demo.
    With the new server I got the same error when executing the demo-lobby.
    While testing, I noticed that the new server had a functionality, called Run Test Client, that the other server did not have. It is when I run that Test Client when I'm getting the error "Unexpected return code -2 of operation Join" written in the output console.
    I hope this clarifies everything. Thanks and sorry about the little mess.
  • Kaiserludi
    Options
    Boris wrote:
    i don't see the "unexpected return code -2 of operation Join" message there?
    Second line from bottom, his client app prints out "nPeerReturn() 90/-2", 90 is the opCode for opJoin in Photon 2 and -2 is the value, which he has mentioned, so I guess, it is printing out the returnCode for opJoin there.
  • Boris
    Options
    The test client requires Lite, so it doesn't work with Loadbalancing.
    I have to download Angry Bots to see what's going on, I haven't heard of any issues so far though.
    The loadbalancing server returns code -2 for "OperationInvalid". If you go into the method that dispatches the operation response you can add more logging and print the debug message to find out what exactly the server doesn't like, most likely it doesn't know the code 90.
    Having said that, code 90 is the operation code for join that Lite on Photon 2 used, the latest Photon 3 RC uses code 255 instead. So it's clear now that you have a v2 or early v3 client here that tries to use a v3 server.

    This happens just with the server that you downloaded from our home page, or with the server that's included with the demo?
  • Kaiserludi
    Options
    Boris wrote:
    The test client requires Lite, so it doesn't work with Loadbalancing.
    Having said that, code 90 is the operation code for join that Lite on Photon 2 used, the latest Photon 3 RC uses code 255 instead. So it's clear now that you have a v2 or early v3 client here that tries to use a v3 server.
    Well, the Loadbalancing server (assuming, he is not bypassing the master and directly connecting to a gameserver) will always respond with "unknown operation", if you request an operation with a code, existing in Lite, but not in LoadBalancing, so this would even fail, if client and server version would be compatible.
    Nevertheless I also think, that he is using a Photon 2 client (because of the operation code) and a Photon 3 server (as there was neither LoadBalancing nor AngyBots for Photon 2).
    Afaik there is no combination of a Photon 3 server and a Photon 2 client, which has ever been released, in which client and server are fully compatible to each other, as long as Lite comes into play and is not manually adjusted.
  • Fixed!
    I downloaded Photon Server v3 and everything worked. I don't understand why Photon v2 examples didn't work with Photon server v2, but it dosen't matter.
    Anyway, I would suggest to change the order in which the different versions of Photon appear in the download page. I didn't know that there were another version of Photon 3 until Boris said it. It may seem naive, but usually people (like me) tend to download the first items that appear in a webpage, and don't scrool down to look for other stuff.
    Bye!
  • Not Fixed.
    Demo-lobby is finally working well, but now the Angry Bots Demo doesn't work with Photon-Server-SDK_v3-0-6-2188-RC3.
    I'm getting this error:
    Authentication failed: OperationResponse 1: ReturnCode: -1 (Unknown operation code 1). Parameters: {}.
    UnityEngine.Debug:LogError(Object)
    PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Plugins/PhotonNetwork/PhotonHandler.cs:82)
    NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Plugins/PhotonNetwork/NetworkingPeer.cs:686)
    NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Plugins/PhotonNetwork/NetworkingPeer.cs:708)
    ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
    ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
    ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
    
  • Finally, both Angry Bots Demo and demo-lobby work at the same time and with the same photon version 2 server.
    Does Unity plugin work with photon v3?
  • Kaiserludi
    Options
    Finally, both Angry Bots Demo and demo-lobby work at the same time and with the same photon version 2 server.
    Does Unity plugin work with photon v3?
    Yes, it does, but afaik there is a Photon 3 version shipped with it. not sure, if it also works with the standard one. It did not with the first RCs.
  • Tobias
    Options
    The Chat Demo and the Angry Bots Demo use different server applications.
    The workflow is a bit different between them: Chat is simple and uses a simple "single" Lite Lobby app while the Angry Bots uses the "loadbalaning" application. This would allow you to run multiple game servers and forward players to each, depending on their workload.

    We could make them use the same server logic but then we couldn't show each approaches pro's and con's.
    Sorry for the inconvenience.