public static void Serialize(Stream stream, UpdateMemberStateNotification instance) { if (instance.HasAgentId) { stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, instance.AgentId.GetSerializedSize()); EntityId.Serialize(stream, instance.AgentId); } if (instance.StateChange.Count > 0) { foreach (Member member in instance.StateChange) { stream.WriteByte(18); ProtocolParser.WriteUInt32(stream, member.GetSerializedSize()); Member.Serialize(stream, member); } } if (instance.RemovedRole.Count > 0) { stream.WriteByte(26); uint num = 0u; foreach (uint val in instance.RemovedRole) { num += ProtocolParser.SizeOfUInt32(val); } ProtocolParser.WriteUInt32(stream, num); foreach (uint val2 in instance.RemovedRole) { ProtocolParser.WriteUInt32(stream, val2); } } }
public static void Serialize(Stream stream, UpdateMemberStateRequest instance) { if (instance.HasAgentId) { stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, instance.AgentId.GetSerializedSize()); EntityId.Serialize(stream, instance.AgentId); } if (instance.StateChange.Count > 0) { foreach (Member stateChange in instance.StateChange) { stream.WriteByte(18); ProtocolParser.WriteUInt32(stream, stateChange.GetSerializedSize()); Member.Serialize(stream, stateChange); } } if (instance.RemovedRole.Count > 0) { stream.WriteByte(26); uint num = 0; foreach (uint removedRole in instance.RemovedRole) { num += ProtocolParser.SizeOfUInt32(removedRole); } ProtocolParser.WriteUInt32(stream, num); foreach (uint removedRole1 in instance.RemovedRole) { ProtocolParser.WriteUInt32(stream, removedRole1); } } }
public static void Serialize(Stream stream, JoinNotification instance) { if (instance.Member == null) { throw new ArgumentNullException("Member", "Required by proto specification."); } stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, instance.Member.GetSerializedSize()); Member.Serialize(stream, instance.Member); }
public static void Serialize(Stream stream, UpdateMemberStateRequest instance) { if (instance.HasAgentId) { stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, instance.AgentId.GetSerializedSize()); EntityId.Serialize(stream, instance.AgentId); } if (instance.StateChange.get_Count() > 0) { using (List <Member> .Enumerator enumerator = instance.StateChange.GetEnumerator()) { while (enumerator.MoveNext()) { Member current = enumerator.get_Current(); stream.WriteByte(18); ProtocolParser.WriteUInt32(stream, current.GetSerializedSize()); Member.Serialize(stream, current); } } } if (instance.RemovedRole.get_Count() > 0) { stream.WriteByte(26); uint num = 0u; using (List <uint> .Enumerator enumerator2 = instance.RemovedRole.GetEnumerator()) { while (enumerator2.MoveNext()) { uint current2 = enumerator2.get_Current(); num += ProtocolParser.SizeOfUInt32(current2); } } ProtocolParser.WriteUInt32(stream, num); using (List <uint> .Enumerator enumerator3 = instance.RemovedRole.GetEnumerator()) { while (enumerator3.MoveNext()) { uint current3 = enumerator3.get_Current(); ProtocolParser.WriteUInt32(stream, current3); } } } }
public void Serialize(Stream stream) { Member.Serialize(stream, this); }