Search Results for

    Show / Hide Table of Contents

    Class NetworkLagDriver

    Low-level network transport interface implementation that is proxy of another nested INetworkDriver implementation but with lag simulation feature.

    Inheritance
    Object
    ScriptingObject
    NetworkLagDriver
    Inherited Members
    ScriptingObject::_gcHandle
    ScriptingObject::_id
    ScriptingObject::_type
    ScriptingObject::CanCast(const ScriptingTypeHandle& from, const ScriptingTypeHandle& to)
    ScriptingObject::CanCast(const MClass* from, const MClass* to)
    ScriptingObject::Cast(ScriptingObject* obj)
    ScriptingObject::ChangeID(const Guid& newId)
    ScriptingObject::CreateManaged()
    ScriptingObject::CreateManagedInternal()
    ScriptingObject::Deleted
    Object::DeleteObject(float timeToLive = 0.0f, bool useGameTime=false)
    Object::DeleteObjectNow()
    ScriptingObject::DestroyManaged()
    Object::Flags
    ScriptingObject::FromInterface(void* interfaceObj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::FromInterface(T* interfaceObj)
    ScriptingObject::GetClass()
    ScriptingObject::GetID()
    ScriptingObject::GetManagedInstance()
    ScriptingObject::GetOrCreateManagedInstance()
    ScriptingObject::GetType()
    ScriptingObject::GetTypeHandle()
    ScriptingObject::HasManagedInstance()
    ScriptingObject::Is(const ScriptingTypeHandle& type)
    ScriptingObject::Is(const MClass* type)
    ScriptingObject::Is()
    ScriptingObject::IsRegistered()
    ScriptingObject::NewObject(const ScriptingTypeHandle& typeHandle)
    ScriptingObject::NewObject()
    ScriptingObject::OnDeleteObject()
    ScriptingObject::OnManagedInstanceDeleted()
    ScriptingObject::OnScriptingDispose()
    ScriptingObject::RegisterObject()
    ScriptingObject::ScriptingObject(const SpawnParams& params)
    ScriptingObject::SetManagedInstance(MObject* instance)
    NetworkLagDriver
    ScriptingObject::ToInterface(ScriptingObject* obj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::ToInterface(ScriptingObject* obj)
    ScriptingObject::ToManaged(const ScriptingObject* obj)
    ScriptingObject::ToNative(MObject* obj)
    ScriptingObject::ToString()
    ScriptingObject::UnregisterObject()
    INetworkDriver::~INetworkDriver()
    Object::~Object()
    ScriptingObject::~ScriptingObject()
    Assembly: FlaxEngine.dll
    File: Engine/Networking/Drivers/NetworkLagDriver.h
    Syntax
    public class NetworkLagDriver : public ScriptingObject, public INetworkDriver

    Constructors

    ~NetworkLagDriver()

    Declaration
    public ~NetworkLagDriver()

    Fields

    Lag

    Network lag value in milliseconds. Adds a delay between sending and receiving messages (2 * Lag is TTL).

    Declaration
    public float Lag = 100.0f
    Field Value
    float

    Methods

    Connect()

    Starts connection handshake with the end point specified in the

    NetworkConfig

    structure. Once this is called, this driver becomes a client.

    Declaration
    public virtual bool Connect() override
    Returns
    bool

    True when succeeded.

    Overrides
    INetworkDriver::Connect()

    Disconnect()

    Disconnects from the server.

    Can be used only by the client!

    Declaration
    public virtual void Disconnect() override
    Overrides
    INetworkDriver::Disconnect()

    Disconnect(const NetworkConnection& connection)

    Disconnects given connection from the server.

    Can be used only by the server!

    Declaration
    public virtual void Disconnect(const NetworkConnection& connection) override
    Parameters
    NetworkConnection connection

    Overrides
    INetworkDriver::Disconnect(const NetworkConnection& connection)

    Dispose()

    Disposes this driver making it no longer usable. Reserved for resource deallocation etc.

    Declaration
    public virtual void Dispose() override
    Overrides
    INetworkDriver::Dispose()

    DriverName()

    Return name of this network driver implementation.

    Declaration
    public virtual String DriverName() override
    Returns
    String

    Overrides
    INetworkDriver::DriverName()

    GetDriver()

    Gets or sets the nested INetworkDriver to use as a proxy with lags.

    Declaration
    public INetworkDriver* GetDriver() const
    Returns
    INetworkDriver

    GetStats()

    Gets the network transport layer stats.

    Declaration
    public virtual NetworkDriverStats GetStats() override
    Returns
    NetworkDriverStats

    Network transport statistics data for a given connection.

    Overrides
    INetworkDriver::GetStats()

    GetStats(NetworkConnection target)

    Gets the network transport layer stats for a given connection.

    Declaration
    public virtual NetworkDriverStats GetStats(NetworkConnection target) override
    Parameters
    NetworkConnection target

    The client connection to retrieve statistics for.

    Returns
    NetworkDriverStats

    Network transport statistics data for a given connection.

    Overrides
    INetworkDriver::GetStats(NetworkConnection target)

    Initialize(NetworkPeer* host, const NetworkConfig& config)

    Initializes the instance of this network driver using given configuration.

    Declaration
    public virtual bool Initialize(NetworkPeer* host, const NetworkConfig& config) override
    Parameters
    NetworkPeer host

    The peer that this driver has been assigned to.

    NetworkConfig config

    The network config to use to configure this driver.

    Returns
    bool

    True if failed to initialize network driver, false otherwise.

    Overrides
    INetworkDriver::Initialize(NetworkPeer* host, const NetworkConfig& config)

    Listen()

    Starts listening for incoming connections. Once this is called, this driver becomes a server.

    Declaration
    public virtual bool Listen() override
    Returns
    bool

    True when succeeded.

    Overrides
    INetworkDriver::Listen()

    PopEvent(NetworkEvent& eventPtr)

    Tries to pop an network event from the queue.

    Declaration
    public virtual bool PopEvent(NetworkEvent& eventPtr) override
    Parameters
    NetworkEvent eventPtr

    The pointer to event structure.

    Returns
    bool

    True when succeeded and the event can be processed.

    Overrides
    INetworkDriver::PopEvent(NetworkEvent& eventPtr)

    SendMessage(NetworkChannelType channelType, const NetworkMessage& message)

    Sends given message over specified channel to the server.

    Can be used only by the client!

    Declaration
    public virtual void SendMessage(NetworkChannelType channelType, const NetworkMessage& message) override
    Parameters
    NetworkChannelType channelType

    The channel to send the message over.

    NetworkMessage message

    The message.

    Overrides
    INetworkDriver::SendMessage(NetworkChannelType channelType, const NetworkMessage& message)

    SendMessage(NetworkChannelType channelType, const NetworkMessage& message, const Array<NetworkConnection, HeapAllocation>& targets)

    Sends given message over specified channel to the given client connection (target).

    Can be used only by the server!

    Declaration
    public virtual void SendMessage(NetworkChannelType channelType, const NetworkMessage& message, const Array<NetworkConnection, HeapAllocation>& targets) override
    Parameters
    NetworkChannelType channelType

    The channel to send the message over.

    NetworkMessage message

    The message.

    Array<NetworkConnection, HeapAllocation> targets

    The connections list to send the message to.

    Overrides
    INetworkDriver::SendMessage(NetworkChannelType channelType, const NetworkMessage& message, const Array<NetworkConnection, HeapAllocation>& targets)

    SendMessage(NetworkChannelType channelType, const NetworkMessage& message, NetworkConnection target)

    Sends given message over specified channel to the given client connection (target).

    Can be used only by the server!

    Declaration
    public virtual void SendMessage(NetworkChannelType channelType, const NetworkMessage& message, NetworkConnection target) override
    Parameters
    NetworkChannelType channelType

    The channel to send the message over.

    NetworkMessage message

    The message.

    NetworkConnection target

    The client connection to send the message to.

    Overrides
    INetworkDriver::SendMessage(NetworkChannelType channelType, const NetworkMessage& message, NetworkConnection target)

    SetDriver(INetworkDriver* value)

    Gets or sets the nested INetworkDriver to use as a proxy with lags.

    Declaration
    public void SetDriver(INetworkDriver* value)
    Parameters
    INetworkDriver value

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat