Parties, matchmaking and sessions, and players connected through Flock’s relay.
Flock’s multiplayer brings players together and connects them. Friends form a
party, the party or a lone player finds a match or joins
a friend’s game by code, and every game is a session: one player hosts, the
others hold seats. The SDK then connects the players over your
game’s networking: Netcode for GameObjects on Unity, the engine’s own networking on Unreal.
Players on the host’s network connect to it directly; everyone else goes through Flock’s relay, so
nobody forwards a port, and on Unity moves to a direct path to the host when the two can reach
each other. When the host leaves, another player takes over.
Scope: matchmaking queues and multiplayer settings are defined per game; parties and seats belong to a player.
Parties
Friends who stay together from one game to the next.
Matchmaking
Fill a game from a queue, alone or as a party.
Sessions
One game: a host, its players and a join code.
Connecting players
Netcode for GameObjects or Unreal’s own networking, the relay, and host changes.
Open Multiplayer → Sessions and click Multiplayer settings. The defaults suit most games:
Setting
Default
What it does
Max players per session
8
Seats in a session a player hosts or a match makes, from 2 to 16.
Participant timeout (seconds)
90
A player silent for longer than this loses their seat.
Host timeout (seconds)
60
A host silent for longer than this is replaced by the player seated longest.
Session max age (seconds)
14400
Every session ends after this long (4 hours), however busy it is.
Create a session when a match forms
On
Matched players get a session to play in.
Hand out relay credentials
On
Players on different networks connect through Flock’s relay. When off, only players on the host’s network, or on a port forwarded to it, can connect.
Then make a queue for each mode under Multiplayer → Matchmaking; see
Matchmaking.
Install Netcode for GameObjects 1.x or 2.x from the Package Manager. Flock’s netcode
support compiles only when it is installed. Every player of a game must use the same major
version. Multiplayer is verified on Unity 2021.3 with Netcode 1.14 and on Unity 6000.3 with
Netcode 2.13.
In Flock → Settings, set Party Refresh Seconds: how often the SDK reads the player’s
party in the background (10 by default; 0 turns it off).
Use one NetworkManager with Unity Transport, left at its default message size.
Sign the player in before any multiplayer call, and make every call from the main thread.
Every multiplayer event is raised on the main thread.
Scripts that use multiplayer start with using Flock; and using Flock.Providers; (add
using Flock.Exceptions; for FlockErrorCode and using Unity.Netcode; for NetworkManager).
A script in an assembly definition of its own references Flock.Runtime, and
Flock.Multiplayer.Netcode for StartNetcodeAsync.
Every call is on FlockClient.Instance.Multiplayer, or on an object it returns.The package’s Samples/Multiplayer folder has two one-screen samples:
FlockPlayWithFriendsSample (host, read out the code, a friend joins it) and
FlockQuickMatchSample (players find each other in a queue). Add either to an empty
GameObject and press Play in two copies of the game.
Use Unreal Engine 5.4 to 5.8 and Flock Unreal SDK 1.35.0 or later. Multiplayer runs on the
engine’s own networking, so there is nothing else to install.
In Project Settings → Plugins → Flock SDK Settings, under Multiplayer, set Party
Refresh Seconds: how often the SDK reads the player’s party in the background (10 by
default, about 6 requests a minute per player; 0 turns it off).
Give the host a game mode that lets in only the session’s players: a Blueprint based on
Flock Game Mode Base (or Flock Game Mode, for match states) set in Project Settings →
Maps & Modes, or a game mode of your own that calls Flock’s check in PreLoginAsync; see
Who is joining. A host without it lets nobody
in (join_check_missing).
Keep the engine’s IP networking. With the Steam online subsystem, set
bUseSteamNetworking=False under [OnlineSubsystemSteam] in Config/DefaultEngine.ini:
Steam’s sockets cannot listen on an IP address, so Travel To Session would end
could_not_start. Signing in through Steam is unaffected.
Sign the player in before any multiplayer call, and make every call from the game thread.
Every multiplayer event is raised on the game thread.
C++ that uses multiplayer includes FlockSubsystem.h and Multiplayer/FlockParty.h or
Multiplayer/FlockMultiplayerSession.h, in a module that depends on Flock in its
.Build.cs.
Every call is on UFlockSubsystem::GetMultiplayerProvider(), or on an object it returns. In
Blueprint, every call is a node under Flock | Multiplayer.The plugin’s Content/Samples/Multiplayer folder (turn on Show Plugin Content in the
Content Browser) holds a sample made of Blueprints only, from SDK 1.36.0:
BP_FlockSampleGameInstance signs in with a device name, hosts, joins by code, quick matches,
travels to the session and travels again when the host changes; FlockMultiplayerSample is its
level, running Flock Game Mode Base. Set Game Instance Class to BP_FlockSampleGameInstance
in Project Settings → Maps & Modes, open the level, and play it in two standalone games,
each signed in with its own device name.
The Unreal sample in a game: its status line shows the join code a friend types to join.
Local co-op: devices on one network (a LAN party, one Wi-Fi)
A session’s join code
Only when needed (the default): players on the host’s network connect directly. Or never, for no relay at all.
Online co-op with friends on other networks
A session’s join code
Only when needed
Online matchmaking with strangers
A queue
Only when needed
Friends matched together, against or with others
A party, then a queue
Only when needed
Streamers and competitive play, where nobody may see another’s IP address
Any of the above
Always, on every game
Steam, Epic Online Services or your own networking
Any of the above
Not used
Several players on one device (split screen, shared controllers) need none of this: that is one game
with one Flock player, and Flock’s multiplayer connects devices.
Dashboard
Unity
Unreal
Local co-op: nothing beyond the multiplayer settings.
Online co-op with friends: leave Hand out relay credentials on.
Online matchmaking: a queue for each mode under Multiplayer → Matchmaking, with its
smallest and largest match.
Friends matched together: a queue whose largest match holds the whole party.
Streamers and competitive play: nothing more; the choice is made in the game.
Local co-op, and online co-op with friends. One player hosts and shares the join code (read out
in the room, or through your game’s own lobby, friends list or chat); the others join with it.
Players on the host’s network connect directly; with the default WhenNeeded, a friend on another
network comes through Flock’s relay, then moves to a direct path when the two can reach each other.
Phones and PCs play together the same way. The FlockPlayWithFriendsSample does exactly this.
// The host's game.FlockMultiplayerSession session = await FlockClient.Instance.Multiplayer.HostSessionAsync(4);joinCodeLabel.text = session.JoinCode;await session.StartNetcodeAsync(NetworkManager.Singleton);// Each other player's game, with the code the host shared.FlockMultiplayerSession joined = await FlockClient.Instance.Multiplayer.JoinSessionAsync(typedCode);FlockNetcodeStartResult started = await joined.StartNetcodeAsync(NetworkManager.Singleton);// started.ThroughRelay is false for a player on the host's network.
For a LAN-only game, pass new FlockNetcodeOptions { Relay = FlockRelayUse.Never } on every game; a
player elsewhere then gets CouldNotConnect unless a port is forwarded to the host.Online matchmaking. The FlockQuickMatchSample does this.
FlockMatchmakingResult found = await FlockClient.Instance.Multiplayer.FindMatchAsync("casual-1v1");if (found.IsMatched && found.Session != null) await found.Session.StartNetcodeAsync(NetworkManager.Singleton); // the player who waited longest hostselse ShowMessage("No match: " + found.Outcome);
Friends matched together. The friends form a party and the leader searches for
all of them; every member’s game hears the result.
party.SearchEnded += async result =>{ if (result.IsMatched && result.Session != null) await result.Session.StartNetcodeAsync(NetworkManager.Singleton);};if (party.IsLeader) await party.FindMatchAsync("squads");
Streamers and competitive play. Every packet goes through Flock’s relay and no game learns
another’s IP address; each packet takes the relay’s extra hop.
await session.StartNetcodeAsync(NetworkManager.Singleton, new FlockNetcodeOptions { Relay = FlockRelayUse.Always });
Steam, Epic Online Services or your own networking: see
Other networking.
The examples run in your game instance, which outlives the level changes Travel To Session
makes. TravelOptions is an FFlockTravelToSessionOptions kept there, its HostLevel set to
the level the host opens.Local co-op, and online co-op with friends. One player hosts and shares the join code (read out
in the room, or through your game’s own lobby, friends list or chat); the others join with it.
Players on the host’s network connect directly; with the default WhenNeeded, a friend on another
network comes through Flock’s relay.
The sample’s Host and Join buttons do exactly this, in Blueprint.
FFlockMultiplayerProvider* Multiplayer = GetSubsystem<UFlockSubsystem>()->GetMultiplayerProvider();// The host's game.Multiplayer->HostSession(4, FFlockCommandData(), true, [this](TFlockResult<UFlockMultiplayerSession*> Hosted){ if (Hosted.IsSuccess()) { Session = Hosted.Value; ShowJoinCode(Session->GetJoinCode()); Session->TravelToSession(this, TravelOptions, [](TFlockResult<FFlockTravelToSessionResult> Travel) {}); }});// Each other player's game, with the code the host shared.Multiplayer->JoinSession(TypedCode, [this](TFlockResult<UFlockMultiplayerSession*> Joined){ if (Joined.IsSuccess()) { Session = Joined.Value; Session->TravelToSession(this, TravelOptions, [](TFlockResult<FFlockTravelToSessionResult> Travel) { // Travel.Value.bThroughRelay is false for a player on the host's network. }); }});
For a LAN-only game, set TravelOptions.Relay = EFlockRelayUse::Never on every game; a player
elsewhere then gets could_not_connect unless a port is forwarded to the host.Online matchmaking.
The sample’s Quick Match button does this, in Blueprint.
Multiplayer->FindMatch(TEXT("casual-1v1"), FFlockMatchmakingOptions(), [this](TFlockResult<FFlockMatchmakingResult> Found){ if (Found.IsSuccess() && Found.Value.IsMatched() && Found.Value.Session != nullptr) { Session = Found.Value.Session; // the player who waited longest hosts Session->TravelToSession(this, TravelOptions, [](TFlockResult<FFlockTravelToSessionResult> Travel) {}); } else if (Found.IsSuccess()) { ShowMessage(TEXT("No match: ") + Found.Value.Outcome); }});
Friends matched together. The friends form a party and the leader searches for
all of them; every member’s game hears the result.
Streamers and competitive play. Every packet goes through Flock’s relay and no game learns
another’s IP address; each packet takes the relay’s extra hop. Set it on every game:
TravelOptions.Relay = EFlockRelayUse::Always;
Steam, Epic Online Services or your own networking: see
Other networking. Travel To Session needs the
engine’s IP networking, so a game on Steam’s sockets publishes a Steam connection of its own.
Keeps each seat. It sends the session’s heartbeat every 20 seconds while the game runs.
Keeps your objects current. It reads the party, a search and the session in the background,
and raises events when something changed: a player joined, the leader or host changed, a search
ended, the session ended.
Finds the session again after the game restarts (GetMySessionAsync, or GetMySession on
Unreal), and the party (GetMyPartyAsync, or GetMyParty).
Gives the seat up when the game quits, so the others see it at once.
The background reads (the party, a search, the session, waiting for the host to say where it is)
and heartbeats are not billed as API calls. They share a limit of 120 a minute per player;
the SDK’s defaults use under 60. Actions are billed as usual: making or joining a party or session,
starting a search, leaving, the host’s check of each joining player, relay logins, and a relayed
player telling the host its relay address (once for each address).
No dedicated servers. A player hosts every session.
No skill or region matching yet. Flock stores what a search sends but matches in the order
players search. Use a queue per mode and region.
A host cannot remove a player, and a session’s data is set once when it is created.
One kind of networking per engine. On Unity, Netcode for GameObjects 1.x and 2.x; on Unreal, the
engine’s own IP networking, not Steam’s sockets. Other networking uses the session’s published
connection and join token directly; see Connecting players.
On Unreal, relayed players stay on the relay. The Unreal SDK has no direct path yet, so each
of their packets takes the relay’s extra hop.
Web players can use parties, matchmaking and sessions, but not the relay: a browser cannot
send UDP.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Qwacks","description":"Developer documentation for the Qwacks platform — Flock, Protokite, and Data Duck.","colors":{"primary":"#0099FF","light":"#33ADFF","dark":"#0077CC"},"logo":{"light":"https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/icons/qwacks.svg?fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=2023abb340d6ec576975601525ab2ce9","dark":"https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/icons/qwacks.svg?fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=2023abb340d6ec576975601525ab2ce9"},"favicon":"https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/icons/qwacks.svg?fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=2023abb340d6ec576975601525ab2ce9","appearance":{"default":"dark","strict":true},"background":{"image":{"light":"https://mintcdn.com/qwacks/YCE61raZ52-QoE_F/officalbg.jpg?fit=max\u0026auto=format\u0026n=YCE61raZ52-QoE_F\u0026q=85\u0026s=5be5500ff5788565cf90d6a3e2111d47","dark":"https://mintcdn.com/qwacks/YCE61raZ52-QoE_F/officalbg.jpg?fit=max\u0026auto=format\u0026n=YCE61raZ52-QoE_F\u0026q=85\u0026s=5be5500ff5788565cf90d6a3e2111d47"},"color":{"light":"#FFFFFF","dark":"#181E2E"}},"navbar":{"links":[{"href":"https://www.qwacks.com/pricing","label":"Pricing"},{"href":"https://github.com/QwackStack/FlockUnitySdk/releases","label":"Unity SDK"},{"href":"https://github.com/QwackStack/FlockUnrealSdk/releases","label":"Unreal SDK"}],"primary":{"type":"button","label":"Dashboard","href":"https://flock-saas.qwacks.com"}},"fonts":{"heading":{"family":"Readex Pro"},"body":{"family":"Inter"}},"styling":{"latex":false},"navigation":{"languages":[{"language":"en","default":true,"href":"welcome"},{"language":"ar","navbar":{"links":[{"href":"https://www.qwacks.com/pricing","label":"الأسعار"},{"href":"https://github.com/QwackStack/FlockUnitySdk/releases","label":"حزمة Unity"},{"href":"https://github.com/QwackStack/FlockUnrealSdk/releases","label":"حزمة Unreal"}],"primary":{"type":"button","label":"لوحة التحكم","href":"https://flock-saas.qwacks.com"}},"href":"ar/welcome"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"qwacks","hasAudioNarration":false,"actualSubdomain":"qwacks","customDomains":["docs.qwacks.com"],"gitSource":{"type":"github","owner":"qwackstack","repo":"qwacksdocs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ad7565dec8f6cfd63f72435","collectionId":"683d8a2a-c390-4740-a56a-0aa4239bfbdc","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ad7565dec8f6cfd63f72435"},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6ad7565dec8f6cfd63f72435","clientVersion":"0.0.3926","searchFilterCounts":[{"language":"ar","tag":"Flock","count":29},{"language":"en","tag":"Flock","count":29},{"language":"ar","tag":"الميزات","count":15},{"language":"en","tag":"Features","count":15},{"language":"ar","tag":"Qwacks","count":12},{"language":"en","tag":"Qwacks","count":12},{"language":"ar","tag":"بدء الاستخدام","count":9},{"language":"en","tag":"Getting Started","count":9},{"language":"ar","tag":"اللعب الجماعي","count":5},{"language":"ar","tag":"Protokite","count":5},{"language":"ar","tag":"المدفوعات والفوترة","count":5},{"language":"en","tag":"Multiplayer","count":5},{"language":"en","tag":"Protokite","count":5},{"language":"en","tag":"Payments \u0026 Billing","count":5},{"language":"ar","tag":"المفاهيم","count":3},{"language":"ar","tag":"الاستوديوهات والفريق","count":3},{"language":"en","tag":"Concepts","count":3},{"language":"en","tag":"Studios \u0026 Team","count":3},{"language":"ar","tag":"Unity","count":2},{"language":"en","tag":"Unity","count":2}]},"assistantConfig":{},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":".nav-logo{height:2.5rem!important;max-width:none!important}#topbar-cta-button .bg-primary-dark{background-color:#feca13!important}#topbar-cta-button:hover .bg-primary-dark{background-color:#f89c1c!important}#topbar-cta-button a,#topbar-cta-button a *{color:#1a1206!important}.qwacks-lang-toggle{display:inline-flex;align-items:center;align-self:center;gap:.5rem;padding:.25rem 1rem;border:1px solid rgba(255,255,255,.1);border-radius:56px;background:0 0;color:#fafafa;font-family:\"Readex Pro\",sans-serif;font-size:.875rem;line-height:1.25rem;white-space:nowrap;margin-inline-start:auto;margin-inline-end:1rem}.qwacks-lang-toggle__option{color:inherit;text-decoration:none;font-weight:400;opacity:.3}.qwacks-lang-toggle__option:hover{opacity:.7}.qwacks-lang-toggle__option.is-active{font-weight:700;opacity:1}@media (min-width:1024px){#localization-select-trigger{display:none!important}}:is(h1, h2, h3, h4){position:relative}:is(h1, h2, h3, h4)>div.absolute{left:auto;right:auto;inset-inline-end:0}:is(h1, h2, h3, h4)>div.absolute>a{margin-inline:0!important}"},{"filePath":"rtl.css","content":"[dir=rtl],html[data-current-path^=\"/ar\"],html[lang=ar]{direction:rtl}@media (min-width:1024px){html[lang=ar] .lg\\:-ml-12{margin-left:0;margin-right:-3rem}html[lang=ar] .lg\\:pl-\\[5\\.7rem\\]{padding-left:.25rem;padding-right:5.7rem}html[lang=ar] .lg\\:pl-\\[23\\.7rem\\]{padding-left:.25rem;padding-right:23.7rem}}[dir=rtl] :is(pre, code, kbd, samp){direction:ltr;text-align:left}[dir=rtl] :not(pre)>code{unicode-bidi:isolate}[dir=rtl] pre>*{direction:ltr}[dir=rtl] .pl-3\\.5{padding-left:0;padding-right:.875rem}[dir=rtl] .pl-3{padding-left:0;padding-right:.75rem}[dir=rtl] .pl-4{padding-left:0;padding-right:1rem}[dir=rtl] .pr-3{padding-right:0;padding-left:.75rem}[dir=rtl] .pr-4{padding-right:0;padding-left:1rem}[dir=rtl] .pr-8{padding-right:0;padding-left:2rem}[dir=rtl] .ml-2{margin-left:0;margin-right:.5rem}[dir=rtl] .ml-4{margin-left:0;margin-right:1rem}[dir=rtl] .-ml-4{margin-left:0;margin-right:-1rem}[dir=rtl] .-ml-10{margin-left:0;margin-right:-2.5rem}[dir=rtl] .mr-2{margin-right:0;margin-left:.5rem}[dir=rtl] .mr-4{margin-right:0;margin-left:1rem}[dir=rtl] .text-left{text-align:right}[dir=rtl] .text-right{text-align:left}[dir=rtl] .left-0{left:auto;right:0}[dir=rtl] .right-0{right:auto;left:0}[dir=rtl] .space-x-2>:not([hidden])~:not([hidden]),[dir=rtl] .space-x-3>:not([hidden])~:not([hidden]),[dir=rtl] .space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}[dir=rtl] .border-l{border-left-width:0;border-right-width:1px}[dir=rtl] .border-r{border-right-width:0;border-left-width:1px}@media (min-width:1024px){[dir=rtl] .lg\\:-ml-12{margin-left:0;margin-right:-3rem}}[dir=rtl] :is(ul, ol){padding-left:0;padding-right:1.5rem}[dir=rtl] blockquote{border-left:0;border-right:4px solid currentColor;padding-left:0;padding-right:1rem}[dir=rtl] :is(th, td){text-align:right}[dir=rtl] .steps{margin-left:0;margin-right:.875rem}[dir=rtl] .step>.absolute:not(.w-px){margin-left:0;margin-right:-13px}[dir=rtl] .step>:not(.absolute){padding-left:1px;padding-right:2rem}[dir=rtl] #table-of-contents{padding-inline-start:.75rem;scrollbar-gutter:stable}[dir=rtl] #sidebar-content a[style*=padding-left]{padding-left:0!important;padding-right:1rem!important}[dir=rtl] .card .absolute{right:auto;left:1.25rem}[dir=rtl] #topbar-cta-button svg,[dir=rtl] .card .absolute svg{transform:scaleX(-1)}[dir=rtl] :is(.qwacks-flip-icon, [data-flip-rtl]) svg{transform:scaleX(-1)}[dir=rtl] .qwacks-lang-toggle svg{transform:none}[dir=rtl],[dir=rtl] body{font-family:\"Readex Pro\",system-ui,sans-serif;letter-spacing:normal;line-height:1.85}[dir=rtl] :is(h1, h2, h3, h4, h5, h6){font-family:\"Readex Pro\",system-ui,sans-serif;letter-spacing:normal;line-height:1.5}[dir=rtl] :is(pre, code, kbd, samp){font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;line-height:1.6}[dir=rtl]{font-variant-numeric:lining-nums}"}],"page":{"pagePath":"guides/multiplayer","slug":"/guides/multiplayer","pageMetadata":{"title":"Multiplayer","description":"Parties, matchmaking and sessions, and players connected through Flock's relay.","href":"/guides/multiplayer"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Parties, matchmaking and sessions, and players connected through Flock’s relay.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const Scope=({children})=>{const{Info}=_provideComponents()||{};if(!Info)_missingMdxReference(`Info`,true);return _jsxs(Info,{children:[_jsx(`b`,{children:`Scope:`}),` `,children]})};function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Frame,Heading,OptimizedImage,Tab,Table,Tabs,_MdxComponentBoundary}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Flock’s `,_jsx(_components.strong,{children:`multiplayer`}),` brings players together and connects them. Friends form a\n`,_jsx(_components.a,{href:`/guides/parties`,children:`party`}),`, the party or a lone player `,_jsx(_components.a,{href:`/guides/matchmaking`,children:`finds a match`}),` or joins\na friend’s game by code, and every game is a `,_jsx(_components.a,{href:`/guides/sessions`,children:`session`}),`: one player hosts, the\nothers hold seats. The SDK then `,_jsx(_components.a,{href:`/guides/connecting-players`,children:`connects the players`}),` over your\ngame’s networking: Netcode for GameObjects on Unity, the engine’s own networking on Unreal.\nPlayers on the host’s network connect to it directly; everyone else goes through Flock’s relay, so\nnobody forwards a port, and on Unity moves to a direct path to the host when the two can reach\neach other. When the host leaves, another player takes over.`]}),`\n`,_jsx(_MdxComponentBoundary,{name:`Scope`,children:_jsxs(Scope,{children:[`matchmaking queues and multiplayer settings are defined per `,_jsx(_components.strong,{children:`game`}),`; parties and seats belong to a player.`]})}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Parties`,icon:`user-group`,href:`/guides/parties`,children:_jsx(_components.p,{children:`Friends who stay together from one game to the next.`})}),_jsx(Card,{title:`Matchmaking`,icon:`users`,href:`/guides/matchmaking`,children:_jsx(_components.p,{children:`Fill a game from a queue, alone or as a party.`})}),_jsx(Card,{title:`Sessions`,icon:`door-open`,href:`/guides/sessions`,children:_jsx(_components.p,{children:`One game: a host, its players and a join code.`})}),_jsx(Card,{title:`Connecting players`,icon:`network-wired`,href:`/guides/connecting-players`,children:_jsx(_components.p,{children:`Netcode for GameObjects or Unreal’s own networking, the relay, and host changes.`})})]}),`\n`,_jsx(Heading,{level:`2`,id:`setting-up`,children:`Setting up`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Dashboard`,id:`dashboard`,children:[_jsxs(_components.p,{children:[`Open `,_jsx(_components.strong,{children:`Multiplayer → Sessions`}),` and click `,_jsx(_components.strong,{children:`Multiplayer settings`}),`. The defaults suit most games:`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Setting`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`What it does`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Max players per session`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`8`}),_jsx(_components.td,{children:`Seats in a session a player hosts or a match makes, from 2 to 16.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Participant timeout (seconds)`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`90`}),_jsx(_components.td,{children:`A player silent for longer than this loses their seat.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Host timeout (seconds)`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`60`}),_jsx(_components.td,{children:`A host silent for longer than this is replaced by the player seated longest.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Session max age (seconds)`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`14400`}),_jsx(_components.td,{children:`Every session ends after this long (4 hours), however busy it is.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Create a session when a match forms`})}),_jsx(_components.td,{children:`On`}),_jsx(_components.td,{children:`Matched players get a session to play in.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Hand out relay credentials`})}),_jsx(_components.td,{children:`On`}),_jsx(_components.td,{children:`Players on different networks connect through Flock’s relay. When off, only players on the host’s network, or on a port forwarded to it, can connect.`})]})]})]}),_jsxs(_components.p,{children:[`Then make a queue for each mode under `,_jsx(_components.strong,{children:`Multiplayer → Matchmaking`}),`; see\n`,_jsx(_components.a,{href:`/guides/matchmaking`,children:`Matchmaking`}),`.`]})]}),_jsxs(Tab,{title:`Unity`,id:`unity`,children:[_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Install `,_jsx(_components.strong,{children:`Netcode for GameObjects`}),` 1.x or 2.x from the Package Manager. Flock’s netcode\nsupport compiles only when it is installed. Every player of a game must use the same major\nversion. Multiplayer is verified on Unity 2021.3 with Netcode 1.14 and on Unity 6000.3 with\nNetcode 2.13.`]}),`\n`,_jsxs(_components.li,{children:[`In `,_jsx(_components.strong,{children:`Flock → Settings`}),`, set `,_jsx(_components.strong,{children:`Party Refresh Seconds`}),`: how often the SDK reads the player’s\nparty in the background (10 by default; 0 turns it off).`]}),`\n`,_jsxs(_components.li,{children:[`Use one `,_jsx(_components.code,{children:`NetworkManager`}),` with Unity Transport, left at its default message size.`]}),`\n`,_jsx(_components.li,{children:`Sign the player in before any multiplayer call, and make every call from the main thread.\nEvery multiplayer event is raised on the main thread.`}),`\n`,_jsxs(_components.li,{children:[`Scripts that use multiplayer start with `,_jsx(_components.code,{children:`using Flock;`}),` and `,_jsx(_components.code,{children:`using Flock.Providers;`}),` (add\n`,_jsx(_components.code,{children:`using Flock.Exceptions;`}),` for `,_jsx(_components.code,{children:`FlockErrorCode`}),` and `,_jsx(_components.code,{children:`using Unity.Netcode;`}),` for `,_jsx(_components.code,{children:`NetworkManager`}),`).\nA script in an assembly definition of its own references `,_jsx(_components.code,{children:`Flock.Runtime`}),`, and\n`,_jsx(_components.code,{children:`Flock.Multiplayer.Netcode`}),` for `,_jsx(_components.code,{children:`StartNetcodeAsync`}),`.`]}),`\n`]}),_jsxs(_components.p,{children:[`Every call is on `,_jsx(_components.code,{children:`FlockClient.Instance.Multiplayer`}),`, or on an object it returns.`]}),_jsxs(_components.p,{children:[`The package’s `,_jsx(_components.strong,{children:`Samples/Multiplayer`}),` folder has two one-screen samples:\n`,_jsx(_components.strong,{children:`FlockPlayWithFriendsSample`}),` (host, read out the code, a friend joins it) and\n`,_jsx(_components.strong,{children:`FlockQuickMatchSample`}),` (players find each other in a queue). Add either to an empty\nGameObject and press Play in two copies of the game.`]})]}),_jsxs(Tab,{title:`Unreal`,id:`unreal`,children:[_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Use Unreal Engine 5.4 to 5.8 and Flock Unreal SDK 1.35.0 or later. Multiplayer runs on the\nengine’s own networking, so there is nothing else to install.`}),`\n`,_jsxs(_components.li,{children:[`In `,_jsx(_components.strong,{children:`Project Settings → Plugins → Flock SDK Settings`}),`, under `,_jsx(_components.strong,{children:`Multiplayer`}),`, set `,_jsx(_components.strong,{children:`Party\nRefresh Seconds`}),`: how often the SDK reads the player’s party in the background (10 by\ndefault, about 6 requests a minute per player; 0 turns it off).`]}),`\n`,_jsxs(_components.li,{children:[`Give the host a game mode that lets in only the session’s players: a Blueprint based on\n`,_jsx(_components.strong,{children:`Flock Game Mode Base`}),` (or `,_jsx(_components.strong,{children:`Flock Game Mode`}),`, for match states) set in `,_jsx(_components.strong,{children:`Project Settings →\nMaps \u0026 Modes`}),`, or a game mode of your own that calls Flock’s check in `,_jsx(_components.code,{children:`PreLoginAsync`}),`; see\n`,_jsx(_components.a,{href:`/guides/connecting-players#who-is-joining`,children:`Who is joining`}),`. A host without it lets nobody\nin (`,_jsx(_components.code,{children:`join_check_missing`}),`).`]}),`\n`,_jsxs(_components.li,{children:[`Keep the engine’s IP networking. With the Steam online subsystem, set\n`,_jsx(_components.code,{children:`bUseSteamNetworking=False`}),` under `,_jsx(_components.code,{children:`[OnlineSubsystemSteam]`}),` in `,_jsx(_components.code,{children:`Config/DefaultEngine.ini`}),`:\nSteam’s sockets cannot listen on an IP address, so Travel To Session would end\n`,_jsx(_components.code,{children:`could_not_start`}),`. Signing in through Steam is unaffected.`]}),`\n`,_jsx(_components.li,{children:`Sign the player in before any multiplayer call, and make every call from the game thread.\nEvery multiplayer event is raised on the game thread.`}),`\n`,_jsxs(_components.li,{children:[`C++ that uses multiplayer includes `,_jsx(_components.code,{children:`FlockSubsystem.h`}),` and `,_jsx(_components.code,{children:`Multiplayer/FlockParty.h`}),` or\n`,_jsx(_components.code,{children:`Multiplayer/FlockMultiplayerSession.h`}),`, in a module that depends on `,_jsx(_components.code,{children:`Flock`}),` in its\n`,_jsx(_components.code,{children:`.Build.cs`}),`.`]}),`\n`]}),_jsxs(_components.p,{children:[`Every call is on `,_jsx(_components.code,{children:`UFlockSubsystem::GetMultiplayerProvider()`}),`, or on an object it returns. In\nBlueprint, every call is a node under `,_jsx(_components.strong,{children:`Flock | Multiplayer`}),`.`]}),_jsxs(_components.p,{children:[`The plugin’s `,_jsx(_components.strong,{children:`Content/Samples/Multiplayer`}),` folder (turn on `,_jsx(_components.strong,{children:`Show Plugin Content`}),` in the\nContent Browser) holds a sample made of Blueprints only, from SDK 1.36.0:\n`,_jsx(_components.strong,{children:`BP_FlockSampleGameInstance`}),` signs in with a device name, hosts, joins by code, quick matches,\ntravels to the session and travels again when the host changes; `,_jsx(_components.strong,{children:`FlockMultiplayerSample`}),` is its\nlevel, running Flock Game Mode Base. Set `,_jsx(_components.strong,{children:`Game Instance Class`}),` to `,_jsx(_components.code,{children:`BP_FlockSampleGameInstance`}),`\nin `,_jsx(_components.strong,{children:`Project Settings → Maps \u0026 Modes`}),`, open the level, and play it in two standalone games,\neach signed in with its own device name.`]}),_jsx(Frame,{caption:`The Unreal sample in a game: its status line shows the join code a friend types to join.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-in-game.png?fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=663013f462f2009675ccf7458de8f357`,alt:`The sample's card: a device name field, Sign In and Host, a join code field and Join, a queue name field, Quick Match and Leave, and the status line In the game with its code`,\"data-og-width\":`360`,width:`360`,\"data-og-height\":`385`,height:`385`,\"data-path\":`images/guides/unreal-multiplayer-sample-in-game.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-in-game.png?w=280\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=0a1091306d0fce6c8965accae06b131f 280w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-in-game.png?w=560\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=367f8e0944c313708a1c467cfd19e368 560w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-in-game.png?w=840\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=39c151d270bfa3cdd4963ad7c316fa49 840w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-in-game.png?w=1100\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=535cf9720226cfd498f4b447f2bdeb23 1100w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-in-game.png?w=1650\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=469a4d442f2af7acf06a19be0d0d4fd8 1650w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-in-game.png?w=2500\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=4b2e4f98338d4103b87a00a6ac074fee 2500w`})})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`which-setup-fits-your-game`,children:`Which setup fits your game`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Your game`}),_jsx(_components.th,{children:`Players meet by`}),_jsx(_components.th,{children:`Relay`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Local co-op: devices on one network (a LAN party, one Wi-Fi)`}),_jsx(_components.td,{children:`A session’s join code`}),_jsx(_components.td,{children:`Only when needed (the default): players on the host’s network connect directly. Or never, for no relay at all.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Online co-op with friends on other networks`}),_jsx(_components.td,{children:`A session’s join code`}),_jsx(_components.td,{children:`Only when needed`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Online matchmaking with strangers`}),_jsx(_components.td,{children:`A queue`}),_jsx(_components.td,{children:`Only when needed`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Friends matched together, against or with others`}),_jsx(_components.td,{children:`A party, then a queue`}),_jsx(_components.td,{children:`Only when needed`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Streamers and competitive play, where nobody may see another’s IP address`}),_jsx(_components.td,{children:`Any of the above`}),_jsx(_components.td,{children:`Always, on every game`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Steam, Epic Online Services or your own networking`}),_jsx(_components.td,{children:`Any of the above`}),_jsx(_components.td,{children:`Not used`})]})]})]}),`\n`,_jsx(_components.p,{children:`Several players on one device (split screen, shared controllers) need none of this: that is one game\nwith one Flock player, and Flock’s multiplayer connects devices.`}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`Dashboard`,id:`dashboard-2`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Local co-op:`}),` nothing beyond the multiplayer settings.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Online co-op with friends:`}),` leave `,_jsx(_components.strong,{children:`Hand out relay credentials`}),` on.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Online matchmaking:`}),` a queue for each mode under `,_jsx(_components.strong,{children:`Multiplayer → Matchmaking`}),`, with its\nsmallest and largest match.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Friends matched together:`}),` a queue whose largest match holds the whole party.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Streamers and competitive play:`}),` nothing more; the choice is made in the game.`]}),`\n`]})}),_jsxs(Tab,{title:`Unity`,id:`unity-2`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Local co-op, and online co-op with friends.`}),` One player hosts and shares the join code (read out\nin the room, or through your game’s own lobby, friends list or chat); the others join with it.\nPlayers on the host’s network connect directly; with the default `,_jsx(_components.code,{children:`WhenNeeded`}),`, a friend on another\nnetwork comes through Flock’s relay, then moves to a direct path when the two can reach each other.\nPhones and PCs play together the same way. The `,_jsx(_components.strong,{children:`FlockPlayWithFriendsSample`}),` does exactly this.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// The host's game.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockMultiplayerSession`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` session`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Multiplayer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`HostSessionAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`joinCodeLabel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`text`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`JoinCode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`StartNetcodeAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`NetworkManager`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Singleton`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Each other player's game, with the code the host shared.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockMultiplayerSession`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` joined`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Multiplayer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`JoinSessionAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`typedCode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockNetcodeStartResult`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` started`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` joined`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`StartNetcodeAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`NetworkManager`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Singleton`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// started.ThroughRelay is false for a player on the host's network.`})}),`\n`]})})}),_jsxs(_components.p,{children:[`For a LAN-only game, pass `,_jsx(_components.code,{children:`new FlockNetcodeOptions { Relay = FlockRelayUse.Never }`}),` on every game; a\nplayer elsewhere then gets `,_jsx(_components.code,{children:`CouldNotConnect`}),` unless a port is forwarded to the host.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Online matchmaking.`}),` The `,_jsx(_components.strong,{children:`FlockQuickMatchSample`}),` does this.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockMatchmakingResult`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` found`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Multiplayer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`FindMatchAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"casual-1v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`found`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`IsMatched`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` found`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Session`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` found`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`StartNetcodeAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`NetworkManager`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Singleton`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// the player who waited longest hosts`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` ShowMessage`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"No match: \"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` found`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Outcome`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Friends matched together.`}),` The friends form a `,_jsx(_components.a,{href:`/guides/parties`,children:`party`}),` and the leader searches for\nall of them; every member’s game hears the result.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`party`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`SearchEnded`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` async`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` result`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`IsMatched`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Session`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`StartNetcodeAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`NetworkManager`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Singleton`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`party`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`IsLeader`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` party`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`FindMatchAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"squads\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Streamers and competitive play.`}),` Every packet goes through Flock’s relay and no game learns\nanother’s IP address; each packet takes the relay’s extra hop.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`StartNetcodeAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`NetworkManager`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Singleton`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FlockNetcodeOptions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Relay`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockRelayUse`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Always`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`]})})}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Steam, Epic Online Services or your own networking:`}),` see\n`,_jsx(_components.a,{href:`/guides/connecting-players#other-networking`,children:`Other networking`}),`.`]})]}),_jsxs(Tab,{title:`Unreal`,id:`unreal-2`,children:[_jsxs(_components.p,{children:[`The examples run in your game instance, which outlives the level changes Travel To Session\nmakes. `,_jsx(_components.code,{children:`TravelOptions`}),` is an `,_jsx(_components.code,{children:`FFlockTravelToSessionOptions`}),` kept there, its `,_jsx(_components.code,{children:`HostLevel`}),` set to\nthe level the host opens.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Local co-op, and online co-op with friends.`}),` One player hosts and shares the join code (read out\nin the room, or through your game’s own lobby, friends list or chat); the others join with it.\nPlayers on the host’s network connect directly; with the default `,_jsx(_components.code,{children:`WhenNeeded`}),`, a friend on another\nnetwork comes through Flock’s relay.\nThe sample’s `,_jsx(_components.strong,{children:`Host`}),` and `,_jsx(_components.strong,{children:`Join`}),` buttons do exactly this, in Blueprint.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`25`,language:`cpp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cpp`,children:_jsxs(_components.code,{language:`cpp`,numberOfLines:`25`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`FFlockMultiplayerProvider`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Multiplayer `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` GetSubsystem`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`UFlockSubsystem`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`>()->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetMultiplayerProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// The host's game.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Multiplayer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`HostSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`FFlockCommandData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(), `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`this`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`TFlockResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`UFlockMultiplayerSession`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Hosted`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Hosted`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`IsSuccess`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`())`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Session `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Hosted`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` ShowJoinCode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetJoinCode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`TravelToSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`this`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, TravelOptions, [](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`TFlockResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FFlockTravelToSessionResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Travel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {});`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Each other player's game, with the code the host shared.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Multiplayer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`JoinSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(TypedCode, [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`this`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`TFlockResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`UFlockMultiplayerSession`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Joined`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Joined`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`IsSuccess`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`())`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Session `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Joined`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`TravelToSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`this`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, TravelOptions, [](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`TFlockResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FFlockTravelToSessionResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Travel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Travel.Value.bThroughRelay is false for a player on the host's network.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsxs(_components.p,{children:[`For a LAN-only game, set `,_jsx(_components.code,{children:`TravelOptions.Relay = EFlockRelayUse::Never`}),` on every game; a player\nelsewhere then gets `,_jsx(_components.code,{children:`could_not_connect`}),` unless a port is forwarded to the host.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Online matchmaking.`}),`\nThe sample’s `,_jsx(_components.strong,{children:`Quick Match`}),` button does this, in Blueprint.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`cpp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cpp`,children:_jsxs(_components.code,{language:`cpp`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Multiplayer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`FindMatch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`TEXT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"casual-1v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`FFlockMatchmakingOptions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(), [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`this`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`TFlockResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FFlockMatchmakingResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Found`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Found`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`IsSuccess`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Found`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`IsMatched`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Found`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Session`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` nullptr`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Session `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Found`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // the player who waited longest hosts`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`TravelToSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`this`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, TravelOptions, [](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`TFlockResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FFlockTravelToSessionResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Travel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {});`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` else`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Found`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`IsSuccess`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`())`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` ShowMessage`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`TEXT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"No match: \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Found`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Outcome`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Friends matched together.`}),` The friends form a `,_jsx(_components.a,{href:`/guides/parties`,children:`party`}),` and the leader searches for\nall of them; every member’s game hears the result.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`cpp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cpp`,children:_jsxs(_components.code,{language:`cpp`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Party`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`OnSearchEnded`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`AddDynamic`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`this`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`UMyGameInstance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::PlayMatch);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Party`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`IsLeader`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`())`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Party`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`FindMatch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`TEXT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"squads\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`FFlockMatchmakingOptions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(), `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`nullptr`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`void`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` UMyGameInstance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`PlayMatch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FFlockMatchmakingResult`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` Result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`IsMatched`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Session`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` nullptr`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Session `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`TravelToSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`this`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, TravelOptions, [](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`TFlockResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FFlockTravelToSessionResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Travel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {});`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Streamers and competitive play.`}),` Every packet goes through Flock’s relay and no game learns\nanother’s IP address; each packet takes the relay’s extra hop. Set it on every game:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`cpp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cpp`,children:_jsxs(_components.code,{language:`cpp`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`TravelOptions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Relay`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` EFlockRelayUse`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::Always;`})]}),`\n`]})})}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Steam, Epic Online Services or your own networking:`}),` see\n`,_jsx(_components.a,{href:`/guides/connecting-players#other-networking`,children:`Other networking`}),`. Travel To Session needs the\nengine’s IP networking, so a game on Steam’s sockets publishes a Steam connection of its own.`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`what-the-sdk-does-for-you`,children:`What the SDK does for you`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Keeps each seat.`}),` It sends the session’s heartbeat every 20 seconds while the game runs.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Keeps your objects current.`}),` It reads the party, a search and the session in the background,\nand raises events when something changed: a player joined, the leader or host changed, a search\nended, the session ended.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Finds the session again`}),` after the game restarts (`,_jsx(_components.code,{children:`GetMySessionAsync`}),`, or `,_jsx(_components.code,{children:`GetMySession`}),` on\nUnreal), and the party (`,_jsx(_components.code,{children:`GetMyPartyAsync`}),`, or `,_jsx(_components.code,{children:`GetMyParty`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Gives the seat up when the game quits`}),`, so the others see it at once.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`what-counts-as-an-api-call`,children:`What counts as an API call`}),`\n`,_jsxs(_components.p,{children:[`The background reads (the party, a search, the session, waiting for the host to say where it is)\nand heartbeats are `,_jsx(_components.strong,{children:`not`}),` billed as API calls. They share a limit of `,_jsx(_components.strong,{children:`120 a minute per player`}),`;\nthe SDK’s defaults use under 60. Actions are billed as usual: making or joining a party or session,\nstarting a search, leaving, the host’s check of each joining player, relay logins, and a relayed\nplayer telling the host its relay address (once for each address).`]}),`\n`,_jsx(Heading,{level:`2`,id:`which-games-it-fits`,children:`Which games it fits`}),`\n`,_jsx(_components.p,{children:`The host is one of the players, sessions hold up to 16, and matching is first come, first served.`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Fits well`}),_jsx(_components.th,{children:`Fits with care`}),_jsx(_components.th,{children:`Not a fit today`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Co-op games for 2 to 8 players: dungeon crawlers, survival, horde shooters`}),_jsx(_components.td,{children:`Casual 1v1 and 2v2 versus, not ranked`}),_jsx(_components.td,{children:`MMOs and always-on worlds`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Party games, brawlers, racing with friends`}),_jsx(_components.td,{children:`Fast shooters: the host has an advantage, and a player who stays on the relay plays through its extra hop`}),_jsx(_components.td,{children:`Battle royale and other games of 50 to 100 players`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Board, card and turn-based games`}),_jsx(_components.td,{children:`9 to 16 players: the host sends to everyone, which counts on a phone`}),_jsx(_components.td,{children:`Ranked play that needs dedicated servers and skill matching`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Phone and PC playing together`}),_jsx(_components.td,{children:`Worlds kept by a player: save the state off the host`}),_jsx(_components.td,{children:`Browser games (a browser cannot send UDP)`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`limits-today`,children:`Limits today`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`No dedicated servers.`}),` A player hosts every session.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`No skill or region matching yet.`}),` Flock stores what a search sends but matches in the order\nplayers search. Use a queue per mode and region.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`A host cannot remove a player, and a session’s data is set once`}),` when it is created.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`One kind of networking per engine.`}),` On Unity, Netcode for GameObjects 1.x and 2.x; on Unreal, the\nengine’s own IP networking, not Steam’s sockets. Other networking uses the session’s published\nconnection and join token directly; see `,_jsx(_components.a,{href:`/guides/connecting-players`,children:`Connecting players`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`On Unreal, relayed players stay on the relay.`}),` The Unreal SDK has no direct path yet, so each\nof their packets takes the relay’s extra hop.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Web players`}),` can use parties, matchmaking and sessions, but not the relay: a browser cannot\nsend UDP.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{Scope,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Multiplayer","description":"Parties, matchmaking and sessions, and players connected through Flock's relay.","href":"/guides/multiplayer"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Setting up","slug":"setting-up","depth":2,"children":[]},{"title":"Which setup fits your game","slug":"which-setup-fits-your-game","depth":2,"children":[]},{"title":"What the SDK does for you","slug":"what-the-sdk-does-for-you","depth":2,"children":[]},{"title":"What counts as an API call","slug":"what-counts-as-an-api-call","depth":2,"children":[]},{"title":"Which games it fits","slug":"which-games-it-fits","depth":2,"children":[]},{"title":"Limits today","slug":"limits-today","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/qwacks/05763fd4e1d53e37/lang-toggle.js"],"subdomain":"qwacks","siteName":"Qwacks","title":"Multiplayer - Qwacks","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/guides/multiplayer","matchLevel":0},"ar":{"href":"/ar/guides/multiplayer","matchLevel":1}}},"lastModified":"2026-10-20T11:54:11.010Z","originalFileLocation":"guides/multiplayer.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Parties, matchmaking and sessions, and players connected through Flock\u0026#x27;s relay.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Qwacks\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Multiplayer - Qwacks\">\u003cmeta data-mint-head property=\"og:description\" content=\"Parties, matchmaking and sessions, and players connected through Flock\u0026#x27;s relay.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Qwacks\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.qwacks.com/guides/multiplayer\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://qwacks.mintlify.app/_mintlify/api/og/v2?division=Multiplayer\u0026amp;title=Multiplayer\u0026amp;description=Parties%2C+matchmaking+and+sessions%2C+and+players+connected+through+Flock%27s+relay.\u0026amp;theme=c8444a292735843f142f05ff\u0026amp;signature=15335bbe676f89f0f51e860d30f86ce54f9f0c2d31c9f8ac114dc124845f0122\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Multiplayer - Qwacks\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Parties, matchmaking and sessions, and players connected through Flock\u0026#x27;s relay.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://qwacks.mintlify.app/_mintlify/api/og/v2?division=Multiplayer\u0026amp;title=Multiplayer\u0026amp;description=Parties%2C+matchmaking+and+sessions%2C+and+players+connected+through+Flock%27s+relay.\u0026amp;theme=c8444a292735843f142f05ff\u0026amp;signature=15335bbe676f89f0f51e860d30f86ce54f9f0c2d31c9f8ac114dc124845f0122\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Qwacks\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0099FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.qwacks.com/guides/multiplayer\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/multiplayer.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.qwacks.com/guides/multiplayer\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ar\" href=\"https://docs.qwacks.com/ar/guides/multiplayer\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.qwacks.com/guides/multiplayer\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.qwacks.com/#organization\",\"name\":\"Qwacks\",\"url\":\"https://docs.qwacks.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/icons/qwacks.svg?fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=2023abb340d6ec576975601525ab2ce9\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.qwacks.com#website\",\"name\":\"Qwacks\",\"url\":\"https://docs.qwacks.com\",\"publisher\":{\"@id\":\"https://docs.qwacks.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.qwacks.com/guides/multiplayer#webpage\",\"url\":\"https://docs.qwacks.com/guides/multiplayer\",\"name\":\"Multiplayer\",\"description\":\"Parties, matchmaking and sessions, and players connected through Flock's relay.\",\"dateModified\":\"2026-10-20T11:54:11.010Z\",\"isPartOf\":{\"@id\":\"https://docs.qwacks.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.qwacks.com/guides/multiplayer#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.qwacks.com/guides/multiplayer#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Qwacks\",\"item\":\"https://docs.qwacks.com\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Multiplayer\",\"item\":\"https://docs.qwacks.com/guides/multiplayer\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.qwacks.com/guides/multiplayer#article\",\"headline\":\"Multiplayer\",\"name\":\"Multiplayer\",\"description\":\"Parties, matchmaking and sessions, and players connected through Flock's relay.\",\"url\":\"https://docs.qwacks.com/guides/multiplayer\",\"mainEntityOfPage\":{\"@id\":\"https://docs.qwacks.com/guides/multiplayer#webpage\"},\"dateModified\":\"2026-10-20T11:54:11.010Z\",\"publisher\":{\"@id\":\"https://docs.qwacks.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.qwacks.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Qwacks\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Qwacks","nav":{"global":null,"languages":[{"language":"en","default":true,"tabs":[{"tab":"Qwacks","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/qwacks.svg","pages":[{"title":"Qwacks","href":"/welcome"}]},{"tab":"Flock","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/flock.svg","groups":[{"group":"Getting Started","pages":[{"title":"Flock","href":"/introduction"},{"title":"Quickstart","href":"/quickstart"},{"title":"Authentication","href":"/authentication"}]},{"group":"Concepts","pages":[{"title":"Studios \u0026 Games","href":"/concepts/studios-and-games"},{"title":"Versions","href":"/concepts/versions"},{"title":"Players","href":"/concepts/players"}]},{"group":"SDKs","pages":[{"title":"Unity SDK","href":"/sdk/unity"},{"title":"Unreal SDK","href":"/sdk/unreal"}]},{"group":"Features","pages":[{"title":"Players \u0026 Auth","href":"/guides/players-and-auth"},{"title":"Account Linking","href":"/guides/account-linking"},{"title":"Player Data","href":"/guides/player-data"},{"title":"Achievements","href":"/guides/achievements"},{"title":"Shops \u0026 Inventory","href":"/guides/shops-and-inventory"},{"title":"Currencies \u0026 Wallets","href":"/guides/currencies-and-wallets"},{"title":"Leaderboards","href":"/guides/leaderboards"},{"title":"Segments","href":"/guides/segments"},{"title":"Game Notifications","href":"/guides/notifications"},{"title":"Bans","href":"/guides/bans"},{"title":"Remote Config","href":"/guides/remote-config"},{"title":"Game Patches","href":"/guides/game-patches"},{"title":"Assets","href":"/guides/assets"},{"title":"Analytics \u0026 Events","href":"/guides/analytics-and-events"},{"title":"Developer Alerts","description":"Get notified when errors spike in your game — before players tell you.","href":"/guides/developer-alerts"}]},{"group":"Multiplayer","pages":[{"title":"Multiplayer","href":"/guides/multiplayer"},{"title":"Parties","description":"Friends who stay together from one game to the next.","href":"/guides/parties"},{"title":"Matchmaking","href":"/guides/matchmaking"},{"title":"Sessions","href":"/guides/sessions"},{"title":"Connecting Players","href":"/guides/connecting-players"}]},{"group":"Reference","pages":[{"title":"Changelog","href":"/changelog"}]}]},{"tab":"Protokite","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/protokite.svg","pages":[{"title":"Protokite","href":"/protokite/getting-started"}]},{"tab":"Data Duck","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/data-duck.svg","pages":[{"title":"Data Duck","href":"/data-duck/getting-started"}]}]},{"language":"ar","navbar":{"links":[{"href":"https://www.qwacks.com/pricing","label":"الأسعار"},{"href":"https://github.com/QwackStack/FlockUnitySdk/releases","label":"حزمة Unity"},{"href":"https://github.com/QwackStack/FlockUnrealSdk/releases","label":"حزمة Unreal"}],"primary":{"type":"button","label":"لوحة التحكم","href":"https://flock-saas.qwacks.com"}},"pages":[{"title":"ar","href":"/ar/guides/multiplayer"}]}]},"title":"Multiplayer - Qwacks","buildId":"dpl_9DauxEjb9gzCtcuhPQFbquJvx7FJ","deploymentId":"dpl_9DauxEjb9gzCtcuhPQFbquJvx7FJ","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-DpBmNN95.js","DynamicMarkdown-BY_qDhTn.js","zoom-image-lightbox-D4WcYaf4.js","PlusIcon-CwhPVjTe.js","lightbox-handle-r17bVUz3.js"]}