Skip to content
FutureBlitz

    Install

    Import std.net.game.settings

    GameSettings

    std.net.game.settings

    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.

    Examples

    Local settings = GameSettings([ChannelKind.RELIABLE_ORDERED, ChannelKind.UNRELIABLE])
    settings.MaxPeers = 8
    Expect(settings.Channels.Count == 2)

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

    • 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.