コード例 #1
0
    //Protobuffer从MemoryStream进行反序列化
    public bool FromMemoryStream(MemoryStream protoMS)
    {
        FriendRpcRecommendObj pb = ProtoBuf.Serializer.Deserialize <FriendRpcRecommendObj>(protoMS);

        FromPB(pb);
        return(true);
    }
コード例 #2
0
 //从Protobuffer类型初始化
 public void FromPB(FriendRpcRecommendObj v)
 {
     if (v == null)
     {
         return;
     }
     m_UserId   = v.UserId;
     m_UserName = v.UserName;
     m_Level    = v.Level;
     m_Prof     = v.Prof;
 }
コード例 #3
0
    //转化成Protobuffer类型函数
    public FriendRpcRecommendObj ToPB()
    {
        FriendRpcRecommendObj v = new FriendRpcRecommendObj();

        v.UserId   = m_UserId;
        v.UserName = m_UserName;
        v.Level    = m_Level;
        v.Prof     = m_Prof;

        return(v);
    }