public static GameLevel_EnterProto ToProto(byte[] buffer)
 {
     using (MMO_MemoryStream ms = new MMO_MemoryStream(buffer))
     {
         GameLevel_EnterProto proto = new GameLevel_EnterProto();
         proto.GameLevelId = ms.ReadInt();
         proto.Grade       = (byte)ms.ReadByte();
         return(proto);
     }
 }
Пример #2
0
    /// <summary>
    /// 点击关卡详情页面进入关卡按钮
    /// </summary>
    /// <param name="p"></param>
    private void OnClickGameLevelDetailsViewEnterLevelButton(object[] p)
    {
        m_GameLevelSceneId = (int)p[0];
        m_Garade           = (GameLevelGrade)p[1];
        GameLevel_EnterProto proto = new GameLevel_EnterProto();

        proto.GameLevelId = m_GameLevelSceneId;
        proto.Grade       = (byte)m_Garade;
        NetWorkSocket.Instance.SendMsg(proto.ToArray());
    }
Пример #3
0
    public static GameLevel_EnterProto GetProto(byte[] buffer)
    {
        GameLevel_EnterProto proto = new GameLevel_EnterProto();

        using (MMoMemorySteam ms = new MMoMemorySteam(buffer))
        {
            ms.ReadUShort();
            proto.GameLevelId = ms.ReadInt();
            proto.Grade       = (byte)ms.ReadByte();
        }
        return(proto);
    }
Пример #4
0
    public static GameLevel_EnterProto GetProto(MMO_MemoryStream ms, byte[] buffer)
    {
        GameLevel_EnterProto proto = new GameLevel_EnterProto();

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

        proto.GameLevelId = ms.ReadInt();
        proto.Grade       = (byte)ms.ReadByte();

        return(proto);
    }