C# Class Lidgren.Network.NetBuffer

Afficher le fichier Open project: Fr0sZ/Skylines-Multiplayer Class Usage Examples

Méthodes publiques

Méthode Description
EnsureBufferSize ( int numberOfBits ) : void

Ensures the buffer can hold this number of bits

ReadAllFields ( object target ) : void

Reads all public and private declared instance fields of the object in alphabetical order using reflection

ReadAllFields ( object target, BindingFlags flags ) : void

Reads all fields with the specified binding of the object in alphabetical order using reflection

ReadAllProperties ( object target ) : void

Reads all public and private declared instance fields of the object in alphabetical order using reflection

ReadAllProperties ( object target, BindingFlags flags ) : void

Reads all fields with the specified binding of the object in alphabetical order using reflection

ReadBits ( byte into, int offset, int numberOfBits ) : void

Reads the specified number of bits into a preallocated array

ReadBoolean ( ) : bool

Reads a boolean value (stored as a single bit) written using Write(bool)

ReadByte ( byte &result ) : bool

Reads a byte and returns true or false for success

ReadByte ( ) : byte

Reads a byte

ReadByte ( int numberOfBits ) : byte

Reads 1 to 8 bits into a byte

ReadBytes ( int numberOfBytes, byte &result ) : bool

Reads the specified number of bytes and returns true for success

ReadBytes ( int numberOfBytes ) : byte[]

Reads the specified number of bytes

ReadBytes ( byte into, int offset, int numberOfBytes ) : void

Reads the specified number of bytes into a preallocated array

ReadDouble ( ) : double

Reads a 64 bit floating point value written using Write(Double)

ReadFloat ( ) : float

Reads a 32 bit floating point value written using Write(Single)

ReadIPEndPoint ( ) : IPEndPoint

Reads a stored IPv4 endpoint description

ReadInt16 ( ) : Int16

Reads a 16 bit signed integer written using Write(Int16)

ReadInt32 ( ) : Int32

Reads a 32 bit signed integer written using Write(Int32)

ReadInt32 ( int numberOfBits ) : Int32

Reads a signed integer stored in 1 to 32 bits, written using Write(Int32, Int32)

ReadInt64 ( ) : System.Int64

Reads a 64 bit signed integer written using Write(Int64)

ReadInt64 ( int numberOfBits ) : System.Int64

Reads a signed integer stored in 1 to 64 bits, written using Write(Int64, Int32)

ReadPadBits ( ) : void

Pads data with enough bits to reach a full byte. Decreases cpu usage for subsequent byte writes.

ReadRangedInteger ( int min, int max ) : int

Reads a 32 bit integer value written using WriteRangedInteger()

ReadRangedSingle ( float min, float max, int numberOfBits ) : float

Reads a 32 bit floating point value written using WriteRangedSingle()

ReadSignedSingle ( int numberOfBits ) : float

Reads a 32 bit floating point value written using WriteSignedSingle()

ReadSingle ( float &result ) : bool

Reads a 32 bit floating point value written using Write(Single)

ReadSingle ( ) : float

Reads a 32 bit floating point value written using Write(Single)

ReadString ( string &result ) : bool

Reads a string written using Write(string) and returns true for success

ReadString ( ) : string

Reads a string written using Write(string)

ReadTime ( NetConnection connection, bool highPrecision ) : double

Reads a value, in local time comparable to NetTime.Now, written using WriteTime() for the connection supplied

ReadUnitSingle ( int numberOfBits ) : float

Reads a 32 bit floating point value written using WriteUnitSingle()

ReadVariableInt32 ( ) : int

Reads a variable sized Int32 written using WriteVariableInt32()

ReadVariableInt64 ( ) : System.Int64

Reads a variable sized Int64 written using WriteVariableInt64()

ReadVector3 ( ) : System.Vector3

SkipPadBits ( ) : void

Pads data with enough bits to reach a full byte. Decreases cpu usage for subsequent byte writes.

SkipPadBits ( int numberOfBits ) : void

Pads data with the specified number of bits.

Write ( IPEndPoint endPoint ) : void

Writes an endpoint description

Write ( Int16 source ) : void

Writes a signed 16 bit integer

Write ( Int32 source ) : void

Writes a 32 bit signed integer

Write ( Int32 source, int numberOfBits ) : void

Writes a signed integer using 1 to 32 bits

Write ( System.Int64 source ) : void

Writes a 64 bit signed integer

Write ( System.Int64 source, int numberOfBits ) : void

Writes a signed integer using 1 to 64 bits

Write ( NetBuffer buffer ) : void

Append all the bits of message to this message

Write ( UInt32 source ) : void

Writes a 32 bit unsigned integer

Write ( System.Vector3 source ) : void

Writes a 32 bit floating point value

Write ( bool value ) : void

Writes a boolean value using 1 bit

Write ( byte source ) : void

Write a byte

Write ( byte source, int numberOfBits ) : void

Writes 1 to 8 bits of a byte

Write ( byte source, int offsetInBytes, int numberOfBytes ) : void

Writes the specified number of bytes from an array

Write ( double source ) : void

Writes a 64 bit floating point value

Write ( float source ) : void

Writes a 32 bit floating point value

Write ( string source ) : void

Write a string

WriteAllFields ( object ob ) : void

Writes all public and private declared instance fields of the object in alphabetical order using reflection

WriteAllFields ( object ob, BindingFlags flags ) : void

Writes all fields with specified binding in alphabetical order using reflection

WriteAllProperties ( object ob ) : void

Writes all public and private declared instance properties of the object in alphabetical order using reflection

WriteAllProperties ( object ob, BindingFlags flags ) : void

Writes all properties with specified binding in alphabetical order using reflection

WriteAt ( Int32 offset, Int16 source ) : void

Writes a 16 bit signed integer at a given offset in the buffer

WriteAt ( Int32 offset, Int32 source ) : void

Writes a 32 bit signed integer at a given offset in the buffer

WritePadBits ( ) : void

Pads data with enough bits to reach a full byte. Decreases cpu usage for subsequent byte writes.

WritePadBits ( int numberOfBits ) : void

Pads data with the specified number of bits.

WriteRangedInteger ( int min, int max, int value ) : int

Writes an integer with the least amount of bits need for the specified range Returns number of bits written

WriteRangedSingle ( float value, float min, float max, int numberOfBits ) : void

Compress a float within a specified range using a certain number of bits

WriteSignedSingle ( float value, int numberOfBits ) : void

Compress (lossy) a float in the range -1..1 using numberOfBits bits

WriteTime ( bool highPrecision ) : void

Writes the current local time to a message; readable (and convertable to local time) by the remote host using ReadTime()

WriteTime ( double localTime, bool highPrecision ) : void

Writes a local timestamp to a message; readable (and convertable to local time) by the remote host using ReadTime()

WriteUnitSingle ( float value, int numberOfBits ) : void

Compress (lossy) a float in the range 0..1 using numberOfBits bits

WriteVariableInt32 ( int value ) : int

Write Base128 encoded variable sized signed integer of up to 32 bits

WriteVariableInt64 ( System.Int64 value ) : int

Write Base128 encoded variable sized signed integer of up to 64 bits

Private Methods

Méthode Description
InternalEnsureBufferSize ( int numberOfBits ) : void

Ensures the buffer can hold this number of bits

ReadInt32 ( Int32 &result ) : bool
ReadSByte ( ) : sbyte
ReadUInt16 ( ) : UInt16
ReadUInt32 ( ) : UInt32
ReadUInt32 ( int numberOfBits ) : UInt32
ReadUInt32 ( UInt32 &result ) : bool
ReadUInt64 ( ) : System.UInt64
ReadUInt64 ( int numberOfBits ) : System.UInt64
ReadVariableUInt32 ( uint &result ) : bool
ReadVariableUInt32 ( ) : uint
ReadVariableUInt64 ( ) : System.UInt64
Write ( UInt16 source ) : void
Write ( UInt16 source, int numberOfBits ) : void
Write ( UInt32 source, int numberOfBits ) : void
Write ( System.UInt64 source ) : void
Write ( System.UInt64 source, int numberOfBits ) : void
Write ( sbyte source ) : void
WriteAt ( Int32 offset, UInt16 source ) : void
WriteAt ( Int32 offset, UInt32 source ) : void
WriteAt ( Int32 offset, System.UInt64 source ) : void
WriteVariableUInt32 ( uint value ) : int
WriteVariableUInt64 ( System.UInt64 value ) : int

Method Details

EnsureBufferSize() public méthode

Ensures the buffer can hold this number of bits
public EnsureBufferSize ( int numberOfBits ) : void
numberOfBits int
Résultat void

ReadAllFields() public méthode

Reads all public and private declared instance fields of the object in alphabetical order using reflection
public ReadAllFields ( object target ) : void
target object
Résultat void

ReadAllFields() public méthode

Reads all fields with the specified binding of the object in alphabetical order using reflection
public ReadAllFields ( object target, BindingFlags flags ) : void
target object
flags BindingFlags
Résultat void

ReadAllProperties() public méthode

Reads all public and private declared instance fields of the object in alphabetical order using reflection
public ReadAllProperties ( object target ) : void
target object
Résultat void

ReadAllProperties() public méthode

Reads all fields with the specified binding of the object in alphabetical order using reflection
public ReadAllProperties ( object target, BindingFlags flags ) : void
target object
flags BindingFlags
Résultat void

ReadBits() public méthode

Reads the specified number of bits into a preallocated array
public ReadBits ( byte into, int offset, int numberOfBits ) : void
into byte The destination array
offset int The offset where to start writing in the destination array
numberOfBits int The number of bits to read
Résultat void

ReadBoolean() public méthode

Reads a boolean value (stored as a single bit) written using Write(bool)
public ReadBoolean ( ) : bool
Résultat bool

ReadByte() public méthode

Reads a byte and returns true or false for success
public ReadByte ( byte &result ) : bool
result byte
Résultat bool

ReadByte() public méthode

Reads a byte
public ReadByte ( ) : byte
Résultat byte

ReadByte() public méthode

Reads 1 to 8 bits into a byte
public ReadByte ( int numberOfBits ) : byte
numberOfBits int
Résultat byte

ReadBytes() public méthode

Reads the specified number of bytes and returns true for success
public ReadBytes ( int numberOfBytes, byte &result ) : bool
numberOfBytes int
result byte
Résultat bool

ReadBytes() public méthode

Reads the specified number of bytes
public ReadBytes ( int numberOfBytes ) : byte[]
numberOfBytes int
Résultat byte[]

ReadBytes() public méthode

Reads the specified number of bytes into a preallocated array
public ReadBytes ( byte into, int offset, int numberOfBytes ) : void
into byte The destination array
offset int The offset where to start writing in the destination array
numberOfBytes int The number of bytes to read
Résultat void

ReadDouble() public méthode

Reads a 64 bit floating point value written using Write(Double)
public ReadDouble ( ) : double
Résultat double

ReadFloat() public méthode

Reads a 32 bit floating point value written using Write(Single)
public ReadFloat ( ) : float
Résultat float

ReadIPEndPoint() public méthode

Reads a stored IPv4 endpoint description
public ReadIPEndPoint ( ) : IPEndPoint
Résultat System.Net.IPEndPoint

ReadInt16() public méthode

Reads a 16 bit signed integer written using Write(Int16)
public ReadInt16 ( ) : Int16
Résultat System.Int16

ReadInt32() public méthode

Reads a 32 bit signed integer written using Write(Int32)
public ReadInt32 ( ) : Int32
Résultat System.Int32

ReadInt32() public méthode

Reads a signed integer stored in 1 to 32 bits, written using Write(Int32, Int32)
public ReadInt32 ( int numberOfBits ) : Int32
numberOfBits int
Résultat System.Int32

ReadInt64() public méthode

Reads a 64 bit signed integer written using Write(Int64)
public ReadInt64 ( ) : System.Int64
Résultat System.Int64

ReadInt64() public méthode

Reads a signed integer stored in 1 to 64 bits, written using Write(Int64, Int32)
public ReadInt64 ( int numberOfBits ) : System.Int64
numberOfBits int
Résultat System.Int64

ReadPadBits() public méthode

Pads data with enough bits to reach a full byte. Decreases cpu usage for subsequent byte writes.
public ReadPadBits ( ) : void
Résultat void

ReadRangedInteger() public méthode

Reads a 32 bit integer value written using WriteRangedInteger()
public ReadRangedInteger ( int min, int max ) : int
min int The minimum value used when writing the value
max int The maximum value used when writing the value
Résultat int

ReadRangedSingle() public méthode

Reads a 32 bit floating point value written using WriteRangedSingle()
public ReadRangedSingle ( float min, float max, int numberOfBits ) : float
min float The minimum value used when writing the value
max float The maximum value used when writing the value
numberOfBits int The number of bits used when writing the value
Résultat float

ReadSignedSingle() public méthode

Reads a 32 bit floating point value written using WriteSignedSingle()
public ReadSignedSingle ( int numberOfBits ) : float
numberOfBits int The number of bits used when writing the value
Résultat float

ReadSingle() public méthode

Reads a 32 bit floating point value written using Write(Single)
public ReadSingle ( float &result ) : bool
result float
Résultat bool

ReadSingle() public méthode

Reads a 32 bit floating point value written using Write(Single)
public ReadSingle ( ) : float
Résultat float

ReadString() public méthode

Reads a string written using Write(string) and returns true for success
public ReadString ( string &result ) : bool
result string
Résultat bool

ReadString() public méthode

Reads a string written using Write(string)
public ReadString ( ) : string
Résultat string

ReadTime() public méthode

Reads a value, in local time comparable to NetTime.Now, written using WriteTime() for the connection supplied
public ReadTime ( NetConnection connection, bool highPrecision ) : double
connection NetConnection
highPrecision bool
Résultat double

ReadUnitSingle() public méthode

Reads a 32 bit floating point value written using WriteUnitSingle()
public ReadUnitSingle ( int numberOfBits ) : float
numberOfBits int The number of bits used when writing the value
Résultat float

ReadVariableInt32() public méthode

Reads a variable sized Int32 written using WriteVariableInt32()
public ReadVariableInt32 ( ) : int
Résultat int

ReadVariableInt64() public méthode

Reads a variable sized Int64 written using WriteVariableInt64()
public ReadVariableInt64 ( ) : System.Int64
Résultat System.Int64

ReadVector3() public méthode

public ReadVector3 ( ) : System.Vector3
Résultat System.Vector3

SkipPadBits() public méthode

Pads data with enough bits to reach a full byte. Decreases cpu usage for subsequent byte writes.
public SkipPadBits ( ) : void
Résultat void

SkipPadBits() public méthode

Pads data with the specified number of bits.
public SkipPadBits ( int numberOfBits ) : void
numberOfBits int
Résultat void

Write() public méthode

Writes an endpoint description
public Write ( IPEndPoint endPoint ) : void
endPoint System.Net.IPEndPoint
Résultat void

Write() public méthode

Writes a signed 16 bit integer
public Write ( Int16 source ) : void
source System.Int16
Résultat void

Write() public méthode

Writes a 32 bit signed integer
public Write ( Int32 source ) : void
source System.Int32
Résultat void

Write() public méthode

Writes a signed integer using 1 to 32 bits
public Write ( Int32 source, int numberOfBits ) : void
source System.Int32
numberOfBits int
Résultat void

Write() public méthode

Writes a 64 bit signed integer
public Write ( System.Int64 source ) : void
source System.Int64
Résultat void

Write() public méthode

Writes a signed integer using 1 to 64 bits
public Write ( System.Int64 source, int numberOfBits ) : void
source System.Int64
numberOfBits int
Résultat void

Write() public méthode

Append all the bits of message to this message
public Write ( NetBuffer buffer ) : void
buffer NetBuffer
Résultat void

Write() public méthode

Writes a 32 bit unsigned integer
public Write ( UInt32 source ) : void
source System.UInt32
Résultat void

Write() public méthode

Writes a 32 bit floating point value
public Write ( System.Vector3 source ) : void
source System.Vector3
Résultat void

Write() public méthode

Writes a boolean value using 1 bit
public Write ( bool value ) : void
value bool
Résultat void

Write() public méthode

Write a byte
public Write ( byte source ) : void
source byte
Résultat void

Write() public méthode

Writes 1 to 8 bits of a byte
public Write ( byte source, int numberOfBits ) : void
source byte
numberOfBits int
Résultat void

Write() public méthode

Writes the specified number of bytes from an array
public Write ( byte source, int offsetInBytes, int numberOfBytes ) : void
source byte
offsetInBytes int
numberOfBytes int
Résultat void

Write() public méthode

Writes a 64 bit floating point value
public Write ( double source ) : void
source double
Résultat void

Write() public méthode

Writes a 32 bit floating point value
public Write ( float source ) : void
source float
Résultat void

Write() public méthode

Write a string
public Write ( string source ) : void
source string
Résultat void

WriteAllFields() public méthode

Writes all public and private declared instance fields of the object in alphabetical order using reflection
public WriteAllFields ( object ob ) : void
ob object
Résultat void

WriteAllFields() public méthode

Writes all fields with specified binding in alphabetical order using reflection
public WriteAllFields ( object ob, BindingFlags flags ) : void
ob object
flags BindingFlags
Résultat void

WriteAllProperties() public méthode

Writes all public and private declared instance properties of the object in alphabetical order using reflection
public WriteAllProperties ( object ob ) : void
ob object
Résultat void

WriteAllProperties() public méthode

Writes all properties with specified binding in alphabetical order using reflection
public WriteAllProperties ( object ob, BindingFlags flags ) : void
ob object
flags BindingFlags
Résultat void

WriteAt() public méthode

Writes a 16 bit signed integer at a given offset in the buffer
public WriteAt ( Int32 offset, Int16 source ) : void
offset System.Int32
source System.Int16
Résultat void

WriteAt() public méthode

Writes a 32 bit signed integer at a given offset in the buffer
public WriteAt ( Int32 offset, Int32 source ) : void
offset System.Int32
source System.Int32
Résultat void

WritePadBits() public méthode

Pads data with enough bits to reach a full byte. Decreases cpu usage for subsequent byte writes.
public WritePadBits ( ) : void
Résultat void

WritePadBits() public méthode

Pads data with the specified number of bits.
public WritePadBits ( int numberOfBits ) : void
numberOfBits int
Résultat void

WriteRangedInteger() public méthode

Writes an integer with the least amount of bits need for the specified range Returns number of bits written
public WriteRangedInteger ( int min, int max, int value ) : int
min int
max int
value int
Résultat int

WriteRangedSingle() public méthode

Compress a float within a specified range using a certain number of bits
public WriteRangedSingle ( float value, float min, float max, int numberOfBits ) : void
value float
min float
max float
numberOfBits int
Résultat void

WriteSignedSingle() public méthode

Compress (lossy) a float in the range -1..1 using numberOfBits bits
public WriteSignedSingle ( float value, int numberOfBits ) : void
value float
numberOfBits int
Résultat void

WriteTime() public méthode

Writes the current local time to a message; readable (and convertable to local time) by the remote host using ReadTime()
public WriteTime ( bool highPrecision ) : void
highPrecision bool
Résultat void

WriteTime() public méthode

Writes a local timestamp to a message; readable (and convertable to local time) by the remote host using ReadTime()
public WriteTime ( double localTime, bool highPrecision ) : void
localTime double
highPrecision bool
Résultat void

WriteUnitSingle() public méthode

Compress (lossy) a float in the range 0..1 using numberOfBits bits
public WriteUnitSingle ( float value, int numberOfBits ) : void
value float
numberOfBits int
Résultat void

WriteVariableInt32() public méthode

Write Base128 encoded variable sized signed integer of up to 32 bits
public WriteVariableInt32 ( int value ) : int
value int
Résultat int

WriteVariableInt64() public méthode

Write Base128 encoded variable sized signed integer of up to 64 bits
public WriteVariableInt64 ( System.Int64 value ) : int
value System.Int64
Résultat int