//Protobuffer从MemoryStream进行反序列化 public bool FromMemoryStream(MemoryStream protoMS) { OneVSOneRpcActMessageNotify pb = ProtoBuf.Serializer.Deserialize <OneVSOneRpcActMessageNotify>(protoMS); FromPB(pb); return(true); }
//从Protobuffer类型初始化 public void FromPB(OneVSOneRpcActMessageNotify v) { if (v == null) { return; } m_UserId = v.UserId; m_PlanName = v.PlanName; }
//转化成Protobuffer类型函数 public OneVSOneRpcActMessageNotify ToPB() { OneVSOneRpcActMessageNotify v = new OneVSOneRpcActMessageNotify(); v.UserId = m_UserId; v.PlanName = m_PlanName; return(v); }