/// <summary> /// Recycles the packet object. /// </summary> public override void Recycle() { base.Recycle(); this.Type = MeshEventType.GossipDigest; this.State = null; this.Since = null; }
/// <summary> /// Acquires a <see cref="MeshGossip"/> instance. /// </summary> /// <param name="since">The version to request from the neigbour.</param> public static MeshGossip Acquire(ReplicatedVersion since) { // Acquires a new gossip packet var packet = Pool.Acquire(); packet.Type = MeshEventType.GossipSince; packet.State = since; return(packet); }
/// <summary> /// Acquires a <see cref="MeshGossip"/> instance. /// </summary> /// <param name="update">The update to send to the neigbour.</param> /// <param name="since">The version for the update to write.</param> public static MeshGossip Acquire(ReplicatedHybridDictionary update, ReplicatedVersion since) { // Acquires a new gossip packet var packet = Pool.Acquire(); packet.Since = since; packet.Type = MeshEventType.GossipUpdate; packet.State = update; return(packet); }
public void Write(IReplicated item, ReplicatedVersion since) { item.Write(this, since); }
/// <summary> /// Deserializes this packet from a binary stream. /// </summary> /// <param name="writer">PacketWriter used to deserialize the packet.</param> public override void Write(PacketWriter writer, ReplicatedVersion since) { writer.Write(this.Data); }
/// <summary> /// Deserializes this packet from a binary stream. /// </summary> /// <param name="writer">PacketWriter used to deserialize the packet.</param> public override void Write(PacketWriter writer, ReplicatedVersion since) { writer.Write(this.EndPoint.ToString()); }
/// <summary> /// Deserializes this packet from a binary stream. /// </summary> /// <param name="writer">PacketWriter used to deserialize the packet.</param> /// <param name="since">The minimum version of updates to pack.</param> public override void Write(PacketWriter writer, ReplicatedVersion since) { writer.Write((ushort)1); writer.Write(this.ClientId); writer.Write(this.Username); }