Show / Hide Table of Contents

    Interface INetworkMessage

    Interface that represents a network message.

    Namespace: Fibula.Communications.Contracts.Abstractions
    Assembly: Fibula.Communications.Contracts.dll
    Syntax
    public interface INetworkMessage

    Properties

    | Improve this Doc View Source

    Buffer

    Gets the byte buffer for this message.

    Declaration
    Span<byte> Buffer { get; }
    Property Value
    Type Description
    System.Span<System.Byte>
    | Improve this Doc View Source

    Cursor

    Gets the message position.

    Declaration
    int Cursor { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Length

    Gets the message length.

    Declaration
    int Length { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    AddByte(Byte)

    Adds a byte to the message.

    Declaration
    void AddByte(byte value)
    Parameters
    Type Name Description
    System.Byte value

    The byte value to add.

    | Improve this Doc View Source

    AddBytes(ReadOnlySequence<Byte>)

    Adds a byte sequence to the message.

    Declaration
    void AddBytes(ReadOnlySequence<byte> value)
    Parameters
    Type Name Description
    System.Buffers.ReadOnlySequence<System.Byte> value

    The bytes span to add.

    | Improve this Doc View Source

    AddBytes(ReadOnlySpan<Byte>)

    Adds a byte range to the message.

    Declaration
    void AddBytes(ReadOnlySpan<byte> value)
    Parameters
    Type Name Description
    System.ReadOnlySpan<System.Byte> value

    The bytes to add.

    | Improve this Doc View Source

    AddString(String)

    Add a string to the message.

    Declaration
    void AddString(string value)
    Parameters
    Type Name Description
    System.String value

    The string value to add.

    | Improve this Doc View Source

    AddUInt16(UInt16)

    Add an unsigned short integer to the message.

    Declaration
    void AddUInt16(ushort value)
    Parameters
    Type Name Description
    System.UInt16 value

    The value to add.

    | Improve this Doc View Source

    AddUInt32(UInt32)

    Add an unsigned integer to the message.

    Declaration
    void AddUInt32(uint value)
    Parameters
    Type Name Description
    System.UInt32 value

    The value to add.

    | Improve this Doc View Source

    Copy(Nullable<Int32>)

    Creates a copy of this message.

    Declaration
    INetworkMessage Copy(int? overrideCursor = default(int? ))
    Parameters
    Type Name Description
    System.Nullable<System.Int32> overrideCursor

    Optional. A value to override the cursor with.

    Returns
    Type Description
    INetworkMessage

    The copy of the message.

    | Improve this Doc View Source

    GetByte()

    Reads a byte value from the message.

    Declaration
    byte GetByte()
    Returns
    Type Description
    System.Byte

    The value read.

    | Improve this Doc View Source

    GetBytes(Int32)

    Reads some bytes from the message.

    Declaration
    ReadOnlySpan<byte> GetBytes(int count)
    Parameters
    Type Name Description
    System.Int32 count

    The number of bytes to read.

    Returns
    Type Description
    System.ReadOnlySpan<System.Byte>

    The bytes read.

    | Improve this Doc View Source

    GetString()

    Reads a string value from the message.

    Declaration
    string GetString()
    Returns
    Type Description
    System.String

    The value read.

    | Improve this Doc View Source

    GetUInt16()

    Reads an unsigned short value from the message.

    Declaration
    ushort GetUInt16()
    Returns
    Type Description
    System.UInt16

    The value read.

    | Improve this Doc View Source

    GetUInt32()

    Reads an unsigned integer value from the message.

    Declaration
    uint GetUInt32()
    Returns
    Type Description
    System.UInt32

    The value read.

    | Improve this Doc View Source

    PeekByte()

    Reads a byte value from the message without advancing the read cursor.

    Declaration
    byte PeekByte()
    Returns
    Type Description
    System.Byte

    The value read.

    | Improve this Doc View Source

    ReadAsBytesInfo()

    Reads information sent in the message as bytes.

    Declaration
    IBytesInfo ReadAsBytesInfo()
    Returns
    Type Description
    IBytesInfo

    The information read.

    | Improve this Doc View Source

    ReadBytesFromStream(NetworkStream, UInt16)

    Reads numberOfBytesToRead bytes from the supplied network stream into the message buffer.

    Declaration
    void ReadBytesFromStream(NetworkStream stream, ushort numberOfBytesToRead)
    Parameters
    Type Name Description
    System.Net.Sockets.NetworkStream stream

    The stream to read from.

    System.UInt16 numberOfBytesToRead

    The number of bytes to read.

    | Improve this Doc View Source

    Reset()

    Resets the message.

    Declaration
    void Reset()
    | Improve this Doc View Source

    Resize(Int32, Boolean)

    Changes the Length of this message and resets its Cursor.

    Declaration
    void Resize(int size, bool resetCursor = true)
    Parameters
    Type Name Description
    System.Int32 size

    The new size of the message.

    System.Boolean resetCursor

    Optional. A value indicating whether to reset the cursor in the message to zero.

    | Improve this Doc View Source

    SkipBytes(Int32)

    Moves the read pointer in the message, essentially skipping a number of bytes.

    Declaration
    void SkipBytes(int count)
    Parameters
    Type Name Description
    System.Int32 count

    The number of bytes to skip.

    Extension Methods

    ObjectExtensions.YieldSingleItem<T>(T)
    ObjectExtensions.GetPropertyValue(Object, String)
    Validate.ThrowIfNull(Object, String)
    NetworkMessageExtensions.XteaDecrypt(INetworkMessage, UInt32[])
    NetworkMessageExtensions.XteaEncrypt(INetworkMessage, UInt32[])
    NetworkMessageExtensions.PrepareToSend(INetworkMessage, UInt32[])
    NetworkMessageExtensions.AddLocation(INetworkMessage, Location)
    NetworkMessageExtensions.AddCreature(INetworkMessage, ICreature, Boolean, UInt32)
    NetworkMessageExtensions.AddOutfit(INetworkMessage, Outfit)
    NetworkMessageExtensions.AddItem(INetworkMessage, IItem)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018-2020 | The Fibula Project
    Generated using DocFX | Jose L. Nuñez de Caceres et al.