コード例 #1
0
ファイル: MeshGossip.cs プロジェクト: toomasz/emitter
 /// <summary>
 /// Recycles the packet object.
 /// </summary>
 public override void Recycle()
 {
     base.Recycle();
     this.Type  = MeshEventType.GossipDigest;
     this.State = null;
     this.Since = null;
 }
コード例 #2
0
ファイル: MeshGossip.cs プロジェクト: toomasz/emitter
        /// <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);
        }
コード例 #3
0
ファイル: MeshGossip.cs プロジェクト: toomasz/emitter
        /// <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);
        }
コード例 #4
0
ファイル: PacketWriter.cs プロジェクト: toomasz/emitter
 public void Write(IReplicated item, ReplicatedVersion since)
 {
     item.Write(this, since);
 }
コード例 #5
0
ファイル: ReplicatedState.cs プロジェクト: toomasz/emitter
 /// <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);
 }
コード例 #6
0
ファイル: GossipMember.cs プロジェクト: toomasz/emitter
 /// <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());
 }
コード例 #7
0
 /// <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);
 }