Skip to content

Service · inherits NetworkPeer

NetworkServer

Official docs ↗

A server-side service that manages all NetworkReplicator instances and handles incoming client connections.

About NetworkServer

The NetworkServer stores all the NetworkReplicator in the game and handles all connections. NetworkPeer.SetOutgoingKBPSLimit can be used to imitate latency while using Start Server.

Methods 1

  • EncryptStringForPlayerId(toEncrypt: string, playerId: int64) → stringEncrypts a string with the session key of the connection belonging to the player with the given playerId, returning the ciphertext.

    Encrypts toEncrypt using the per-session encryption key of the connected player whose Player.UserId equals playerId, then returns the ciphertext. Only that player's client can decrypt the result.

    This supports the encrypted-assets workflow: the server session-encrypts an asset encryption key for a single player, and that client decrypts and registers it through ContentProvider.RegisterSessionEncryptedAsset (or ContentProvider.RegisterDefaultSessionKey), so the raw key is never transmitted in plain text.

    Returns an empty string when no player with the given playerId is currently connected.

NetworkServer also has every member of NetworkPeer. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.