Пример #1
0
        private void EnterGameoReturn(Role role)
        {
            RoleOperation_EnterGameReturnProto proto = new RoleOperation_EnterGameReturnProto();

            proto.IsSucess = true;
            role.Client_Socket.SendMsg(proto.ToArray());
        }
    public static RoleOperation_EnterGameReturnProto GetProto(byte[] buffer, bool isChild = false)
    {
        RoleOperation_EnterGameReturnProto proto = new RoleOperation_EnterGameReturnProto();

        MMO_MemoryStream ms = null;

        if (!isChild)
        {
            ms = GameEntry.Socket.SocketSendMS;
        }
        else
        {
            ms = GameEntry.Pool.DequeueClassObject <MMO_MemoryStream>();
        }
        ms.SetLength(0);
        ms.Write(buffer, 0, buffer.Length);
        ms.Position = 0;

        proto.IsSuccess = ms.ReadBool();
        if (!proto.IsSuccess)
        {
            proto.MsgCode = ms.ReadInt();
        }

        if (isChild)
        {
            GameEntry.Pool.EnqueueClassObject(ms);
        }
        return(proto);
    }
Пример #3
0
 public static RoleOperation_EnterGameReturnProto ToProto(byte[] buffer)
 {
     using (MMO_MemoryStream ms = new MMO_MemoryStream(buffer))
     {
         RoleOperation_EnterGameReturnProto proto = new RoleOperation_EnterGameReturnProto();
         proto.IsSucess = ms.ReadBool();
         return(proto);
     }
 }
Пример #4
0
    public static void OnRoleOperation_EnterGameReturn(byte[] buffer)
    {
        RoleOperation_EnterGameReturnProto proto = RoleOperation_EnterGameReturnProto.GetProto(buffer);

#if DEBUG_LOG_PROTO
        Debug.Log("<color=#00eaff>接收消息:</color><color=#00ff9c>" + proto.ProtoEnName + " " + proto.ProtoCode + "</color>");
        Debug.Log("<color=#c5e1dc>==>>" + JsonUtility.ToJson(proto) + "</color>");
#endif
    }
    /// <summary>
    /// 进入游戏协议回调
    /// </summary>
    /// <param name="p"></param>
    private void OnEnterGameReturnProto(byte[] p)
    {
        RoleOperation_EnterGameReturnProto proto = RoleOperation_EnterGameReturnProto.ToProto(p);

        m_EnterGameOK = proto.IsSucess;
        if (proto.IsSucess)
        {
            Debug.Log("进入游戏成功");
        }
    }
    /// <summary>
    /// 已有角色 进入游戏  服务器返回信息
    /// </summary>
    /// <param name="p"></param>
    private void OnEnterGameReturnCallback(byte[] p)
    {
        RoleOperation_EnterGameReturnProto proto = RoleOperation_EnterGameReturnProto.GetProto(p);

        if (proto.IsSuccess)
        {
            //进入游戏成功
            AppDebug.Log("进入游戏");
        }
        else
        {
            UIMessageCtr.Instance.Show("提示", "创建角色失败?");
        }
    }
Пример #7
0
    public static RoleOperation_EnterGameReturnProto GetProto(byte[] buffer)
    {
        RoleOperation_EnterGameReturnProto proto = new RoleOperation_EnterGameReturnProto();

        using (MMO_MemoryStream ms = new MMO_MemoryStream(buffer))
        {
            proto.IsSuccess = ms.ReadBool();
            if (!proto.IsSuccess)
            {
                proto.MsgCode = ms.ReadInt();
            }
        }
        return(proto);
    }
Пример #8
0
    public static RoleOperation_EnterGameReturnProto GetProto(MMO_MemoryStream ms, byte[] buffer)
    {
        RoleOperation_EnterGameReturnProto proto = new RoleOperation_EnterGameReturnProto();

        ms.SetLength(0);
        ms.Write(buffer, 0, buffer.Length);
        ms.Position = 0;

        proto.IsSuccess = ms.ReadBool();
        if (!proto.IsSuccess)
        {
            proto.MsgCode = ms.ReadInt();
        }

        return(proto);
    }