NetworkServer
A server-side service that manages all NetworkReplicator instances and handles incoming client connections.
| Memory category | Instances |
|---|
Member index 1
Removed member index 11
| History | Member | |
|---|---|---|
| 438 | Port: int | |
| 310 | ConfigureAsCloudEditServer(): void | |
| 310 | ConfigureAsTeamTestServer(): void | |
| 419 | GetClientCount(): int | |
| 139 | SetGameId(newGameId: string): void | |
| 310 | SetIsPlayerAuthenticationRequired(value: bool): void | |
| 311 | Start(port: int = 0, threadSleepTime: int = 20): void | |
| 310 | Stop(blockDuration: int = 1000): void | |
| 310 | DataBasicFiltered(peer: Instance, result: FilterResult, instance: Instance, member: string) | |
| 310 | DataCustomFiltered(peer: Instance, result: FilterResult, instance: Instance, member: string) | |
| 310 | IncommingConnection(peer: string, replicator: Instance) |
Description
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.
History 36
- 462 Change ThreadSafety of EncryptStringForPlayerId from to Unsafe
- 452 Add EncryptStringForPlayerId
- 438 Remove Port
- 419 Remove GetClientCount
- 311 Remove Start
- 310 Remove IncommingConnection
- 310 Remove DataCustomFiltered
- 310 Remove DataBasicFiltered
- 310 Remove Stop
- 310 Remove SetIsPlayerAuthenticationRequired
- 310 Remove ConfigureAsTeamTestServer
- 310 Remove ConfigureAsCloudEditServer
- 240 Add ConfigureAsTeamTestServer
- 223 Add ConfigureAsCloudEditServer
- 222 Remove ConfigureAsCloudEditServer
- 223 Add ConfigureAsCloudEditServer
- 151 Change Security of Start from security1 to PluginSecurity
- 150 Change Security of Start from LocalUserSecurity to security1
- 139 Remove SetGameId
- 138 Add SetGameId
- 79 Change Tags of DataCustomFiltered from [preliminary] to []
- 79 Change Tags of DataBasicFiltered from [preliminary] to []
- 78 Change Tags of DataCustomFiltered from [] to [preliminary]
- 78 Change Tags of DataBasicFiltered from [] to [preliminary]
- 79 Change Tags of DataCustomFiltered from [preliminary] to []
- 79 Change Tags of DataBasicFiltered from [preliminary] to []
- 59 Add DataCustomFiltered
- 59 Add DataBasicFiltered
- 51 Change Security of IncommingConnection from None to RobloxScriptSecurity
- 47 Add IncommingConnection
- 47 Add Stop
- 47 Add Start
- 47 Add SetIsPlayerAuthenticationRequired
- 47 Add GetClientCount
- 47 Add Port
- 47 Add NetworkServer
Members 1
EncryptStringForPlayerId
| Parameters (2) | ||
|---|---|---|
| toEncrypt | string | |
| playerId | int64 | |
| Returns (1) | ||
| string | ||
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.
| Thread safety | Unsafe |
|---|
History 2
- 462 Change ThreadSafety of EncryptStringForPlayerId from to Unsafe
- 452 Add EncryptStringForPlayerId
Removed members 11
ConfigureAsCloudEditServer
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Returns (1) | ||
| void | ||
| Security | RobloxSecurity |
|---|
History 4
ConfigureAsTeamTestServer
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Returns (1) | ||
| void | ||
| Security | RobloxSecurity |
|---|
History 2
DataBasicFiltered
| Parameters (4) | |
|---|---|
| peer | Instance |
| result | FilterResult |
| instance | Instance |
| member | string |
| Security | LocalUserSecurity |
|---|
History 5
- 310 Remove DataBasicFiltered
- 79 Change Tags of DataBasicFiltered from [preliminary] to []
- 78 Change Tags of DataBasicFiltered from [] to [preliminary]
- 79 Change Tags of DataBasicFiltered from [preliminary] to []
- 59 Add DataBasicFiltered
DataCustomFiltered
| Parameters (4) | |
|---|---|
| peer | Instance |
| result | FilterResult |
| instance | Instance |
| member | string |
| Security | LocalUserSecurity |
|---|
History 5
- 310 Remove DataCustomFiltered
- 79 Change Tags of DataCustomFiltered from [preliminary] to []
- 78 Change Tags of DataCustomFiltered from [] to [preliminary]
- 79 Change Tags of DataCustomFiltered from [preliminary] to []
- 59 Add DataCustomFiltered
GetClientCount
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Returns (1) | ||
| int | ||
| Security | LocalUserSecurity |
|---|
History 2
- 419 Remove GetClientCount
- 47 Add GetClientCount
IncommingConnection
| Parameters (2) | |
|---|---|
| peer | string |
| replicator | Instance |
| Security | RobloxScriptSecurity |
|---|
History 3
- 310 Remove IncommingConnection
- 51 Change Security of IncommingConnection from None to RobloxScriptSecurity
- 47 Add IncommingConnection
Port
| Type | Default | |
|---|---|---|
| int | ||
| Category | Data |
|---|---|
| Loaded/Saved | false/true |
SetGameId
| Parameters (1) | ||
|---|---|---|
| newGameId | string | |
| Returns (1) | ||
| void | ||
| Security | RobloxSecurity |
|---|
SetIsPlayerAuthenticationRequired
| Parameters (1) | ||
|---|---|---|
| value | bool | |
| Returns (1) | ||
| void | ||
| Security | RobloxSecurity |
|---|
History 2
Start
| Parameters (2) | Default | |
|---|---|---|
| port | int | 0 |
| threadSleepTime | int | 20 |
| Returns (1) | ||
| void | ||
| Security | PluginSecurity |
|---|
Stop
| Parameters (1) | Default | |
|---|---|---|
| blockDuration | int | 1000 |
| Returns (1) | ||
| void | ||
| Security | LocalUserSecurity |
|---|