Write() 공개 메소드

public Write ( bool data ) : void
data bool
리턴 void
예제 #1
0
 /// <summary>
 ///   Sends the specified writer.
 /// </summary>
 /// <param name="writer"> The writer. </param>
 /// <param name="version"> The version. </param>
 /// <remarks>
 /// </remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     if (version >= 38)
     {
         writer.Write(Code);
         writer.Write((byte) EntityIds.Count ());
         foreach (int item in EntityIds)
         {
             writer.Write(item);
         }
     }
     else
     {
         if (EntityIds == null || EntityIds.Count () == 0)
         {
             writer.Write(Code);
             writer.Write(0);
         }
         else
             foreach (int item in EntityIds)
             {
                 writer.Write(Code);
                 writer.Write(item);
             }
     }
 }
예제 #2
0
        /// <summary>
        ///   Sends the specified writer.
        /// </summary>
        /// <param name="writer"> The writer. </param>
        /// <param name="version"> The version. </param>
        /// <remarks>
        /// </remarks>
        protected override void OnSend(BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            writer.Write(TeamName);
            writer.Write(Mode);
            if (Mode == 2 || Mode == 0)
            {
                writer.Write(TeamDisplayName);
                writer.Write(TeamPrefix);
                writer.Write(TeamSufix);
                if (version >= 60)
                    writer.Write(FriendlyFire);
                else
                    writer.Write(FriendlyFire != 0);
            }

            Players = Players ?? new string[0];
            writer.Write(PlayerCount);
            if (Mode == 0 || Mode == 3 || Mode == 4)
            {
                foreach (var player in Players)
                {
                    writer.Write(player);
                }
            }
        }
 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new System.ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(ResponseType);
 }
예제 #4
0
 /// <summary>
 ///   Sends the specified writer.
 /// </summary>
 /// <param name="writer"> The writer. </param>
 /// <param name="version"> The version. </param>
 /// <remarks>
 /// </remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(Number);
 }
예제 #5
0
        /// <summary>
        /// Sends the specified writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="version">The version.</param>
        /// <remarks></remarks>
        protected override void OnSend(BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            if (version >= 32)
            {
                byte d = 0;

                d |= (byte)((Flying ? 1 : 0) << 0);
                d |= (byte)((InstantBuild ? 1 : 0) << 1);
                d |= (byte)((MayFly ? 1 : 0) << 2);
                d |= (byte)((Invulnerable ? 1 : 0) << 3);
                writer.Write(d);
                writer.Write(FlyingSpeed);
                writer.Write(WalkSpeed);
            }
            else
            {
                writer.Write(Flying);
                writer.Write(InstantBuild);
                writer.Write(MayFly);
                writer.Write(Invulnerable);
            }
        }
 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new System.ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(StatisticId);
     writer.Write(Amount);
 }
예제 #7
0
 /// <summary>
 ///   Sends the specified writer.
 /// </summary>
 /// <param name="writer"> The writer. </param>
 /// <param name="version"> The version. </param>
 /// <remarks>
 /// </remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(EntityId);
     MetadataInfo.WriteMetadata(InnerData, writer);
 }
예제 #8
0
 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new System.ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(Health);
     writer.Write(Food);
     writer.Write(FoodSaturation);
 }
예제 #9
0
 /// <summary>
 ///   Sends the specified writer.
 /// </summary>
 /// <param name="writer"> The writer. </param>
 /// <param name="version"> The version. </param>
 /// <remarks>
 /// </remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(WindowId);
     writer.Write(Count);
     InventoryPacket.WritePayload(writer, Items);
 }
예제 #10
0
 /// <summary>
 ///   Sends the specified writer.
 /// </summary>
 /// <param name="writer"> The writer. </param>
 /// <param name="version"> The version. </param>
 /// <remarks>
 /// </remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(UserEntity);
     writer.Write(TargetEntity);
     writer.Write(LeftClick);
 }
예제 #11
0
 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new System.ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(WindowId);
     writer.Write(ProgressBarType);
     writer.Write(Value);
 }
예제 #12
0
        /// <summary>
        ///   Sends the specified writer.
        /// </summary>
        /// <param name="writer"> The writer. </param>
        /// <param name="version"> The version. </param>
        /// <remarks>
        /// </remarks>
        protected override void OnSend(BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            writer.Write(MessageColor);
            writer.WriteClassicString(TextMessage);
        }
예제 #13
0
 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(EntityId);
     writer.Write(Yaw);
     writer.Write(Pitch);
 }
예제 #14
0
 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new System.ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(WindowId);
     writer.Write(ActionNumber);
     writer.Write(Accepted);
 }
예제 #15
0
 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new System.ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(PlayerName);
     writer.Write(Online);
     writer.Write(Ping);
 }
예제 #16
0
 /// <summary>
 ///   Sends the specified writer.
 /// </summary>
 /// <param name="writer"> The writer. </param>
 /// <param name="version"> The version. </param>
 /// <remarks>
 /// </remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(WindowId);
     writer.Write(Slot);
     writer.Write(Item);
 }
예제 #17
0
 /// <summary>
 ///   Sends the specified writer.
 /// </summary>
 /// <param name="writer"> The writer. </param>
 /// <param name="version"> The version. </param>
 /// <remarks>
 /// </remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(CurrentExperience);
     writer.Write(Level);
     writer.Write(TotalExperience);
 }
예제 #18
0
 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(EntityId);
     writer.Write(EffectId);
     writer.Write(Amplifier);
     writer.Write(Duration);
 }
예제 #19
0
        /// <summary>
        ///   Sends the specified writer.
        /// </summary>
        /// <param name="writer"> The writer. </param>
        /// <param name="version"> The version. </param>
        /// <remarks>
        /// </remarks>
        protected override void OnSend(BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            writer.Write(ScoreboardName);
            writer.Write(ScoreboardDispayText);
            writer.Write(CreateRemove);
        }
예제 #20
0
 /// <summary>
 ///   Sends the specified writer.
 /// </summary>
 /// <param name="writer"> The writer. </param>
 /// <param name="version"> The version. </param>
 /// <remarks>
 /// </remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(EntityId);
     writer.Write(ActionId);
     if (version >= 72)
         writer.Write(Unknown);
 }
예제 #21
0
 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new System.ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(WindowId);
     writer.Write(InventoryType);
     writer.Write(WindowTitle);
     writer.Write(Slots);
 }
 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(ProtocolVersion);
     writer.WriteClassicString(Username);
     writer.WriteClassicString(VerificationKey);
     writer.Write(Unused);
 }
예제 #23
0
        /// <summary>
        ///   Sends the specified writer.
        /// </summary>
        /// <param name="writer"> The writer. </param>
        /// <param name="version"> The version. </param>
        /// <remarks>
        /// </remarks>
        protected override void OnSend(BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            writer.Write(Sideways);
            writer.Write(Forward);
            writer.Write(Jump);
            writer.Write(Unmount);
        }
예제 #24
0
        /// <summary>
        ///   Sends the specified writer.
        /// </summary>
        /// <param name="writer"> The writer. </param>
        /// <param name="version"> The version. </param>
        /// <remarks>
        /// </remarks>
        protected override void OnSend(BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            writer.Write(ItemName);
            writer.Write(UpdateRemove);
            writer.Write(ScoreName);
            writer.Write(Value);
        }
예제 #25
0
 /// <summary>
 ///   Sends the specified writer.
 /// </summary>
 /// <param name="writer"> The writer. </param>
 /// <param name="version"> The version. </param>
 /// <remarks>
 /// </remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(StatisticId);
     if (version >= 72)
         writer.Write(Amount);
     else
         writer.Write((byte) Amount);
 }
예제 #26
0
        /// <summary>
        ///   Sends the specified writer.
        /// </summary>
        /// <param name="writer"> The writer. </param>
        /// <param name="version"> The version. </param>
        /// <remarks>
        /// </remarks>
        protected override void OnSend(BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            writer.Write(PlayerID);
            writer.Write(ChangeX);
            writer.Write(ChangeY);
            writer.Write(ChangeZ);
        }
예제 #27
0
 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new System.ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(Unknown1);
     writer.Write(Unknown2);
     writer.Write(Unknown3);
     writer.Write(Unknown4);
     writer.Write(Unknown5);
     writer.Write(Unknown6);
 }
예제 #28
0
        /// <summary>
        ///   Sends the specified writer.
        /// </summary>
        /// <param name="writer"> The writer. </param>
        /// <param name="version"> The version. </param>
        /// <remarks>
        /// </remarks>
        protected override void OnSend(BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            byte[] data = ChunkData.ToArray ();

            writer.Write((short) data.Length);
            writer.Write(data);
            writer.Write(PercentComplete);
        }
예제 #29
0
 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(PositionX);
     writer.Write(PositionY);
     writer.Write(PositionZ);
     writer.Write(Byte1);
     writer.Write(Byte2);
     if (version >= 38)
         writer.Write(UnknownInt16);
 }
예제 #30
0
 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(PositionX);
     writer.Write(PositionY);
     writer.Write(PositionZ);
     if (version >= 38)
         writer.Write(BlockType);
     else
         writer.Write((byte)BlockType);
     writer.Write(BlockMetadata);
 }