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

        FromPB(pb);
        return(true);
    }
示例#2
0
    //转化成Protobuffer类型函数
    public FriendRpcDelFriendAsk ToPB()
    {
        FriendRpcDelFriendAsk v = new FriendRpcDelFriendAsk();

        for (int i = 0; i < (int)m_UserId.Count; i++)
        {
            v.UserId.Add(m_UserId[i]);
        }

        return(v);
    }
示例#3
0
 //从Protobuffer类型初始化
 public void FromPB(FriendRpcDelFriendAsk v)
 {
     if (v == null)
     {
         return;
     }
     m_UserId.Clear();
     for (int i = 0; i < v.UserId.Count; i++)
     {
         m_UserId.Add(v.UserId[i]);
     }
 }