OpCode 230 - Authentication Failed

tstpierre
edited December 2011 in DotNet
I cannot find any documentation or reference on operation code 230.

I am starting extremely simple by just inheriting LiteApplication and creating my own room cache and peer based on LitePeer and self hosting. The photon unity package simply connects (proper server config) and immediately disconnects.

Here is the server side log:

2011-12-08 10:52:57,696 [6] DEBUG Marksmanship.Server.UnityClient [(null)] - Connection received from: 127.0.0.1
2011-12-08 10:52:57,696 [6] DEBUG Photon.SocketServer.ApplicationBase [(null)] - OnInit - response sent to ConnId 4 with SendResult Ok
2011-12-08 10:52:57,771 [11] DEBUG Lite.LitePeer [(null)] - OnOperationRequest. Code=230
2011-12-08 10:52:57,771 [11] DEBUG Photon.SocketServer.PeerBase [(null)] - SentOpResponse: ConnID=4, opCode=230, return=-1(Unknown operation code 230), ChannelId=0 result=Ok size=36 bytes
2011-12-08 10:52:58,803 [6] DEBUG Photon.SocketServer.ApplicationBase [(null)] - OnDisconnect - ConnID=4
2011-12-08 10:52:58,803 [20] DEBUG Photon.SocketServer.PeerBase [(null)] - Peer 4 changed state from Connected to Disconnected
2011-12-08 10:52:58,803 [20] DEBUG Marksmanship.Server.UnityClient [(null)] - Client disconnected
2011-12-08 10:52:58,803 [20] DEBUG Photon.SocketServer.PeerBase [(null)] - Peer 4 changed state from Disconnected to Disposed

Has anyone ran into this error? Or even found complete listing of baked in op codes?

Thanks.

Comments

  • Here is the stack trace in Unity3d as well:

    Authentication failed. Check AppId.
    OperationResponse 230: ReturnCode: -1 (Unknown operation code 230). Parameters: {}
    UnityEngine.Debug:LogError(Object)
    PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:115)
    NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:634)
    NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:674)
    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:75)


    The AppId is configured and its running according to the socket server logs.
  • Apparently the op code is defined in the unity package's LoadbalancingPeer.cs (yay for embedded classes nested in other files).

    In NetworkingPeer.cs's OnOperationResponse its checking for return code != 0. That is failing. No idea "why". I dont have any authentication I am enforcing, and the configs are set properly.
  • Lastly, using the cloud host it works fine.

    The only difference between my installed win64 host's version and the most current download is a build time of 3 minutes. Same SVN revisions however.
  • Looks like in the LitePeer.cs implementation in the SDK, that op code is never handled and it falls through to an unknown op code:

    protected override void OnOperationRequest(OperationRequest operationRequest, SendParameters sendParameters)
            {
                if (log.IsDebugEnabled)
                {
                    log.DebugFormat("OnOperationRequest. Code={0}", operationRequest.OperationCode);
                }
    
                switch ((OperationCode)operationRequest.OperationCode)
                {
                    case OperationCode.Ping:
                        this.HandlePingOperation(operationRequest, sendParameters);
                        return;
    
                    case OperationCode.Join:
                        this.HandleJoinOperation(operationRequest, sendParameters);
                        return;
    
                    case OperationCode.Leave:
                        this.HandleLeaveOperation(operationRequest, sendParameters);
                        return;
    
                    case OperationCode.RaiseEvent:
                    case OperationCode.GetProperties:
                    case OperationCode.SetProperties:
                        this.HandleGameOperation(operationRequest, sendParameters);
                        return;
                }
    
                string message = string.Format("Unknown operation code {0}", operationRequest.OperationCode);
                this.SendOperationResponse(new OperationResponse { OperationCode = operationRequest.OperationCode, ReturnCode = -1, DebugMessage = message }, sendParameters);
            }
    
  • Well it appears the unity package is only coded to work with Loadbalance based applications...
  • tstpierre wrote:
    Well it appears the unity package is only coded to work with Loadbalance based applications...
    Correct.
    1. Lite doesn't support authentication, thats a feature, which is only build in into LoadBalancing.
    2. Loadbalancing doesn't allow the client to do any highLevel ogic except authentication, until you have successfully authenticated.
    3. Photon Unity Networking (PUN) will automatically authenticate after a succesful connect, so that you do not have to do it yourself. In fact PUn handles authentication as part of the highlevel connect-procedure and will only report a succesfuly connection after having successfully authenticated.
    4. PUN is not compatible to Lite, but only to LoadBalancing.
    5. Loadbalancing consists of a MasterServer and at least 1 GameServer. GameServers are pretty similar to Lite, as they also implement roomLogic, properties and raising events, but additionally implemet authentication and handle joining rooms a bit different from join (in Lite you automatically create a room, when trying to join it, while it isn't exisiting yet, in LoadBalancing joining a not exisiting room will give you an error and you create a room with a seperate create operation).
    6. For PUN we have a seperate subforum: viewforum.php?f=17