//Protobuffer从MemoryStream进行反序列化 public bool FromMemoryStream(MemoryStream protoMS) { DungeonRpcEnterAsk pb = ProtoBuf.Serializer.Deserialize <DungeonRpcEnterAsk>(protoMS); FromPB(pb); return(true); }
//从Protobuffer类型初始化 public void FromPB(DungeonRpcEnterAsk v) { if (v == null) { return; } m_DungeonId = v.DungeonId; m_DungeonType = v.DungeonType; m_BirthPoint = v.BirthPoint; m_FaceDir = v.FaceDir; m_GuildId = v.GuildId; }
//转化成Protobuffer类型函数 public DungeonRpcEnterAsk ToPB() { DungeonRpcEnterAsk v = new DungeonRpcEnterAsk(); v.DungeonId = m_DungeonId; v.DungeonType = m_DungeonType; v.BirthPoint = m_BirthPoint; v.FaceDir = m_FaceDir; v.GuildId = m_GuildId; return(v); }