Skip to content
FutureBlitz

    Install

    Import std.net.game.settings

    std.net.game.settings

    std.net.game's settings, which a GameHost and its peers share, and why a connection ends.

    std/net/game/settings.fb

    Types

    DisconnectReason enum

    Public Enum DisconnectReason

    Why a connection ended.

    std/net/game/settings.fb, line 8

    • NONE enum member #

      It hasn't: an event other than a disconnect's.

    • LOCAL enum member #

      This side ended it.

    • REMOTE enum member #

      The other side ended it.

    • TIMEOUT enum member #

      Nothing came for the host's Timeout.

    • FULL enum member #

      The other host refused it, as full.

    • MISMATCH enum member #

      The other host refused it, with settings that don't match this one's.

    GameSettings struct

    Public Struct GameSettings

    What a GameHost does: its channels' kinds, which both sides of a connection must have alike, the most peers that can connect to it, the most bytes a packet takes, the largest message, which both sides must have alike too, the most bytes a connection holds of messages waiting for one before them and of fragments, how long it waits to hear from a peer, how often it sends when it has nothing to, and how often it asks again for a connection.

    std/net/game/settings.fb, line 28

    • Public Field Channels: ChannelKind[] field #

      Its channels' kinds, which both sides of a connection must have alike.

    • Public Field MaxPeers: Int field #

      The most peers that can connect to it.

    • Public Field Mtu: Int field #

      The most bytes a packet takes.

    • Public Field MaxMessageSize: Int field #

      The largest message, in bytes, which both sides must have alike.

    • Public Field MaxBuffered: Int field #

      The most bytes a connection holds of messages waiting for one before them, and of fragments.

    • Public Field Timeout: Duration field #

      How long it waits to hear from a peer before it disconnects it.

    • Public Field KeepAlive: Duration field #

      How often it sends when it has nothing to, so its peers hear from it.

    • Public Field ConnectRetry: Duration field #

      How often it asks again for a connection that hasn't answered.

    • Public New(channels: ChannelKind[]? = Null) constructor #

      Channels of those kinds, or else a reliable-ordered, a reliable-unordered, and an unreliable one; 32 peers; packets of 1200 bytes, which any path takes; messages of up to 1 MiB, with 4 MiB held; and a timeout of 10 seconds, with a keepalive and a retry each 250 milliseconds.

    Report an issue with this page or with FutureBlitz on GitHub.