SocketLibrary.Packets.Packet.AddInt C# (CSharp) Method

AddInt() public method

Adds an int to this packet.
public AddInt ( int value ) : void
value int The int to add
return void
        public void AddInt(int value)
        {
            foreach (Byte b in BitConverter.GetBytes(value))
            {
                this.data.AddLast(b);
            }
        }

Usage Example

示例#1
0
        /// <summary>
        /// This object will request a server id.
        /// </summary>
        /// <param name="type">The unit type as defined in [type]Headers.cs</param>
        public void RequestServerID()
        {
            Packet p = new Packet(Headers.GAME_REQUEST_OBJECT_ID);
            p.AddInt(localID);

            GameServerConnectionManager.GetInstance().SendPacket(p);
        }
All Usage Examples Of SocketLibrary.Packets.Packet::AddInt