Example #1
0
    /// <summary>
    /// 接受服务器的响应
    /// </summary>
    /// <param name="operationResponse"></param>
    public void OnOperationResponse(OperationResponse operationResponse)
    {
        LogManager.Log(operationResponse.ToStringFull());
        byte opCode  = operationResponse.OperationCode;
        byte subCode = (byte)operationResponse[80];

        //转接
        switch (opCode)
        {
        case OperationCode.AccountCode:
            AccountReceiver.OnReceive(subCode, operationResponse);
            break;

        case OperationCode.PlayerCode:
            PlayerReceiver.OnReceive(subCode, operationResponse);
            break;

        case OperationCode.SelectCode:
            SelectReceiver.OnReceive(subCode, operationResponse);
            break;

        case OperationCode.BattleCode:
            BattleReceiver.OnReceive(subCode, operationResponse);
            break;
        }
    }
Example #2
0
    //服务端发送过来的响应
    public void OnOperationResponse(OperationResponse response)
    {
        Debug.Log(response.ToStringFull());
        tipText.text = response.DebugMessage;
        byte subCode = (byte)response.Parameters[80];

        switch ((OpCode)response.OperationCode)         //判断发过来操作码
        {
        case OpCode.Account:
            accountReceiver.OnReceive(subCode, response);
            break;

        case OpCode.Room:
            chatRceiver.OnReceive(subCode, response);
            break;

        case OpCode.Battle:
            battleReceiver.OnReceive(subCode, response);
            break;

        case OpCode.Draw:
            drawReceiver.OnReceive(subCode, response);
            break;

        default:
            break;
        }
    }