صِل بين لاعبي الجلسة عبر Netcode for GameObjects أو شبكة Unreal نفسها، ومن خلال وسيط Flock عند الحاجة.
حين يتشارك اللاعبون جلسة، تصل حزمة التطوير بينهم عبر شبكة لعبتك: Netcode for
GameObjects في Unity، وشبكة المحرّك نفسه في Unreal. لعبة المضيف هي الخادم. يتصل اللاعبون على شبكة
المضيف به مباشرة، ويمرّ الآخرون عبر وسيط Flock، فلا يحتاج أحد إلى فتح منفذ في الموجّه. ولا يُدخل
المضيف إلا لاعبي الجلسة، وحين يتغيّر المضيف تبدأ كل لعبة شبكتها من جديد لدورها الجديد.
النطاق: يُفعَّل الوسيط أو يُوقَف لكل لعبة، من إعدادات اللعب الجماعي.
يعمل وسيط Flock على شبكة Cloudflare، وهو مفعّل لكل لعبة ما لم يُوقَف من إعدادات اللعب الجماعي. وحين يكون موقوفًا،
أو ما دام وسيط الاستوديو معلّقًا حتى تُسدَّد فاتورته، يتصل اللاعبون على شبكة المضيف أو عبر منفذ مُوجَّه إلى المضيف،
ويحصل اللاعب على شبكة أخرى على RelayFailed (في Unreal: relay_failed) مع relay_not_offered أو relay_paused.
استدعاء واحد يتولّى المصافحة كلها، للمضيف ولكل لاعب. فعلى المضيف يبدأ Netcode for GameObjects
مضيفًا ويعلن مكانه. وعلى اللاعب ينتظر ذلك (حتى 60 ثانية)، ثم يتصل، ويثبت مقعد اللاعب.
FlockNetcodeStartResult started = await session.StartNetcodeAsync(NetworkManager.Singleton);switch (started.Outcome){ case FlockNetcodeStartOutcome.Restarted: return; // a newer start on this NetworkManager took over case FlockNetcodeStartOutcome.StartedAsHost: ShowMessage("Hosting. Code: " + session.JoinCode); break; case FlockNetcodeStartOutcome.Connected: ShowMessage(started.ThroughRelay ? "Connected through Flock's relay." : "Connected."); break; case FlockNetcodeStartOutcome.Refused: ShowMessage("The host refused you: " + started.RefusedReason); break; case FlockNetcodeStartOutcome.RelayFailed: ShowMessage("The relay could not be used: " + started.RelayFailureReason); break; default: ShowMessage("Could not connect: " + started.Outcome); break;}
البدء الذي لا يستضيف ولا يتصل يُبقي مقعد اللاعب؛ فاستدعِ session.LeaveAsync() إن لم يكن اللاعب
قادرًا على اللعب.
استدعاء واحد يُدخل كل لعبة في لعبة الجلسة، لعبة المضيف ولعبة كل لاعب: TravelToSession. فعلى
المضيف يفتح مستوى المضيف مستمعًا للاعبين (?listen الخاص بالمحرّك) ويعلن مكانه. وعلى اللاعب ينتظر
ذلك (حتى 60 ثانية)، ثم يطلب من Flock رمز انضمام، وينتقل إلى المضيف، الذي يتحقّق من الرمز قبل أن
يُدخل اللاعب. ويحمل net driver الخاص بالمحرّك كل لاعب، عبر وسيط Flock أيضًا: إذ تقوم حزمة التطوير
مقام الطرف الآخر على عنوان الجهاز المحلي (loopback)، فتبقى شيفرة الشبكة في لعبتك كما هي.استدعِه من Game Instance الخاصة بلعبتك: فهو يكتمل حين تصير اللعبة في مستواها الجديد، ويكون
المستوى الذي جرى منه الاستدعاء قد زال. وTravelOptions هنا من نوع FFlockTravelToSessionOptions
محفوظ في Game Instance، ليمرّره تغيّر المضيف نفسه من جديد.
#include "FlockSubsystem.h"#include "Multiplayer/FlockMultiplayerSession.h"// Every player's game, the host's included, once it holds the session.TravelOptions.HostLevel = TEXT("/Game/Maps/Arena"); // the level the host opens; players travel to whatever the host has openconst TWeakObjectPtr<UMyGameInstance> Game = this;Session->TravelToSession(this, TravelOptions, [Game](TFlockResult<FFlockTravelToSessionResult> Result){ if (!Game.IsValid()) { return; } if (!Result.IsSuccess()) { UE_LOG(LogTemp, Warning, TEXT("%s"), *Result.Error.ToDisplayText()); // a mistake, a refused publish or a cancel, with its fix return; } const FFlockTravelToSessionResult& Travel = Result.Value; if (Travel.Outcome == FlockTravelToSessionOutcomes::Restarted) { return; // a newer Travel To Session took over } if (Travel.Outcome == FlockTravelToSessionOutcomes::StartedAsHost) { Game->ShowMessage(TEXT("Hosting. Code: ") + Game->Session->GetJoinCode()); } else if (Travel.Outcome == FlockTravelToSessionOutcomes::Connected) { Game->ShowMessage(Travel.bThroughRelay ? TEXT("Connected through Flock's relay.") : TEXT("Connected.")); } else if (Travel.Outcome == FlockTravelToSessionOutcomes::Refused) { Game->ShowMessage(TEXT("The host refused you: ") + Travel.RefusedReason); } else if (Travel.Outcome == FlockTravelToSessionOutcomes::RelayFailed) { Game->ShowMessage(TEXT("The relay could not be used: ") + Travel.RelayFailureReason); } else { Game->ShowMessage(TEXT("Could not connect: ") + Travel.Outcome); }});
المعامل الأول أي شيء في عالم اللعبة، مثل Game Instance. والانتقال الذي لا يستضيف ولا يتصل يُبقي
مقعد اللاعب؛ فاستدعِ Session->Leave إن لم يكن اللاعب قادرًا على اللعب.يتحقّق وضع اللعب (game mode) لدى المضيف من كل لاعب ينضم. ابنِه على AFlockGameModeBase أو
AFlockGameMode، أو استدعِ تحقّق Flock من PreLoginAsync الخاص به؛ راجع
من ينضم. والمضيف الذي لا يفعل وضع لعبه أيًّا من ذلك لا يُدخل أحدًا
(join_check_missing).يحتاج Travel To Session إلى شبكة IP الخاصة بالمحرّك. فاللعبة التي يستخدم net driver فيها مقابس
Steam (bUseSteamNetworking في نظام Steam الفرعي على الإنترنت، مفعّل ما لم يُضبط على false) لا
تستطيع الاستماع على عنوان IP، فتنتهي بـ could_not_start. اضبط bUseSteamNetworking=False تحت
[OnlineSubsystemSteam] في Config/DefaultEngine.ini، أو انشر اتصال Steam خاصًّا بك (راجع
شبكات أخرى).وفي Blueprint، استدعِ Flock Travel To Session من Game Instance Blueprint، حيث حدثا المحرّك
NetworkError وTravelError؛ وإن استُدعيت من داخل مستوى، فإنها تكتب تحذيرًا في السجل. وهي
تطلق On Joined (بدأت مضيفًا، أو اتصلت)، أو On Not Joined (ويقول Outcome وRefused Reason في
النتيجة لماذا)، أو On Failure (خطأ في الاستخدام، كجلسة منتهية)، بعد أن يتغيّر المستوى. ويعطي
طرفها Async Action العقدة نفسها، ويوقف Cancel فيها الانتقال. وقارن Outcome بعقد Flock Travel
Outcome، واحتفظ بحالة افتراضية.
نتيجة البدء هي ما انتهى إليه. في Unity تكون قيمة من FlockNetcodeStartOutcome؛ أما في Unreal فهي نصّ
يُقارَن بثوابت FlockTravelToSessionOutcomes، وهي بالأسماء نفسها
(فـ FlockTravelToSessionOutcomes::StartedAsHost هو started_as_host). وقد تأتي نتائج جديدة، فاحتفظ
بحالة افتراضية.
Unity
Unreal
المعنى
StartedAsHost
started_as_host
هذا الجهاز يستضيف، ويستطيع اللاعبون الوصول إليه.
Connected
connected
انضم هذا الجهاز إلى المضيف. ويقول ThroughRelay (في Unreal: bThroughRelay) هل كان ذلك عبر الوسيط.
Refused
refused
رفض المضيف هذا اللاعب؛ ويقول RefusedReason لماذا (راجع من ينضم). وفي Unreal يكون المحرّك قد أعاد اللعبة إلى مستواها الافتراضي.
RelayFailed
relay_failed
احتيج إلى الوسيط ولم يمكن استخدامه؛ ويقول RelayFailureReason لماذا وماذا تفعل (راجع أدناه).
HostNeverPublished
host_never_published
لم يعلن المضيف مكانه خلال 60 ثانية (FlockNetcodeOptions.WaitForHost، أو WaitForHostSeconds في Unreal). تأكّد أن لعبة المضيف بدأت كذلك، ثم ابدأ من جديد.
CouldNotConnect
could_not_connect
لم يجب المضيف. وفي Unreal يستسلم المحرّك بعد مهلته الخاصة (نحو 20 ثانية) ويحمّل المستوى الافتراضي. وخارج شبكة المضيف مع إيقاف الوسيط، وجّه منفذًا إلى المضيف.
CouldNotStart
could_not_start
لم يستطع المضيف البدء. ففي Unity رفض Netcode for GameObjects البدء، كأن يكون المنفذ مستخدمًا: حرّر المنفذ أو اختر غيره. وفي Unreal لم يُفتح مستوى المضيف مستمعًا على عنوان IP، كما يحدث مع مقابس Steam: أوقف bUseSteamNetworking.
SessionEnded
session_ended
انتهت الجلسة أثناء الانتظار. استضِف جلسة أخرى أو انضم إليها.
NotDirect
not_direct
أعلن المضيف اتصالًا من نوعه الخاص، مثل Steam؛ راجع شبكات أخرى.
Restarted
restarted
بدأت اللعبة من جديد قبل انتهاء هذا البدء، وتولّى البدء الأحدث الأمر. لا شيء تفعله: فجواب الأحدث يأتي بعده.
يختار FlockNetcodeOptions.Relay في Unity، وFFlockTravelToSessionOptions::Relay في Unreal، من يمرّ عبر
الوسيط. واضبطه بالقيمة نفسها في لعبة كل لاعب.
FlockRelayUse / EFlockRelayUse
من يمرّ عبر الوسيط
اختره لـ
WhenNeeded (الافتراضي)
يجرّب اللاعبون على شبكة المضيف عنوانه المحلي بضع ثوانٍ، ثم الوسيط إن لم يُجب. ويمرّ الآخرون جميعًا عبر الوسيط، ثم ينتقلون إلى مسار مباشر حين يتمكّنون هم والمضيف من الوصول بعضهم إلى بعض.
معظم الألعاب.
Always
كل لاعب، حتى على شبكة المضيف، ويبقون على الوسيط. ولا يعرف اللاعبون عنوان IP للمضيف أبدًا، ولا يعرف المضيف عناوينهم. وفي Unreal يردّ المضيف اللاعب الذي يصل إليه بطريق آخر (relay_only).
البثّ المباشر واللعب التنافسي، أو الشبكات التي تعزل أجهزتها.
Never
لا أحد. يصل اللاعبون إلى المضيف على شبكته، أو عبر منفذ مُوجَّه إليه.
ألعاب الشبكة المحلية، أو لعبة لا تريد حركة عبر الوسيط.
await session.StartNetcodeAsync(NetworkManager.Singleton, new FlockNetcodeOptions { Relay = FlockRelayUse.Always });
مع WhenNeeded، وبعد أن يُدخل المضيف لاعبًا يمرّ عبر الوسيط، يحاول الطرفان الوصول أحدهما إلى الآخر مباشرة: يسأل كلٌّ منهما
الوسيط، أو خادم STUN يُدرجه Flock، عن العنوان الذي يراه منه، ويتبادلان هذين العنوانين عبر الوسيط، ثم يرسل كلٌّ منهما حزمًا صغيرة إلى الآخر. وحين تصل في
الاتجاهين، تمرّ حزم اللعبة مباشرة، وهو مسار أقصر في العادة من مسار الوسيط، ولا يبقى للوسيط ما يحمله. ويبقى الوسيط جاهزًا: فإذا
سكت المسار المباشر 4 ثوانٍ عادت الحزم إليه. ولا تفعل اللعبة شيئًا في الحالتين. تسمح معظم أجهزة التوجيه المنزلية بذلك؛ أمّا حين
يكون الطرفان كلاهما خلف أجهزة توجيه تمنح كل وجهة منفذًا خاصًا بها (كما تفعل بعض شبكات الجوّال)، فتبقى الحزم على الوسيط. منذ
الإصدار 1.83.0 من Unity SDK والإصدار 1.38.0 من Unreal SDK.وفي Unreal يستمرّ اتصال المحرّك عبر كل انتقال: يسمع مُشغّل الشبكة لدى المضيف اللاعبَ من المنفذ نفسه طوال الوقت. ويُذكَر
كل انتقال مرة واحدة في السجلّ، بمستوى Info. وإن كانت اللعبة في أيّ من الطرفين على Unreal SDK أقدم من 1.38.0 بقي الطرفان على
الوسيط، إذ يُعلن كل طرف أولًا أنه يفهم رسائل المسار المباشر من الطرف الآخر.المقابل: مع WhenNeeded يعرف المضيف واللاعب المارّ عبر الوسيط عنوان IP أحدهما للآخر بعد إدخال اللاعب. وفي
Unreal ينشر المضيف عناوينه الخاصة إلى جانب عنوانه على الوسيط، فيستطيع اللاعبون قراءة عنوانه. استخدم
Always لإبقائهما مخفيّين.حين يتعذّر استخدام الوسيط، يكون RelayFailureReason واحدًا مما يلي، وهو نفسه في المحرّكين ما لم يذكر
السطر غير ذلك:
السبب
متى
ماذا تفعل
relay_not_offered
توزيع بيانات اعتماد الوسيط موقوف للعبة، أو لا يُدرج Flock أي وسيط.
فعّله من إعدادات اللعب الجماعي، أو صِل اللاعبين مباشرة.
relay_paused
وسيط الاستوديو موقوف حتى تُدفع فاتورته.
سدّد الفاتورة من لوحة التحكم؛ وحتى ذلك الحين يتصل اللاعبون مباشرة.
relay_unreachable
الشبكة تحجب UDP عن الوسيط، كما تفعل بعض شبكات المدارس والمكاتب والفنادق.
تأكّد أن الجهاز متصل بالإنترنت وأن جدار الحماية يسمح للعبة بإرسال UDP، أو جرّب شبكة أخرى.
relay_not_on_this_platform
في Unity فقط: لاعب متصفح. لا يستطيع المتصفح إرسال UDP.
العب من نسخة للحاسوب أو الهاتف لاستخدام الوسيط.
relay_not_offered_by_host
لا يُدخل المضيف أحدًا عبر الوسيط: قيمة Relay لديه Never، أو تعذّر فتح وسيطه.
اضبط Relay بالقيمة نفسها في لعبة كل لاعب؛ ويقول سجل المضيف لماذا تعذّر فتح وسيطه.
relay_too_many_logins
أكثر من 12 تسجيل دخول إلى الوسيط في دقيقة، أو 10 للاعب واحد في جلسة واحدة.
لا تبدأ الشبكة (في Unreal: Travel To Session) في حلقة؛ والجلسة الأخرى تعطي مقعدًا خاصًّا بها.
relay_server_not_listed
لا يُدرج Flock لهذا اللاعب خادم الوسيط الذي عليه المضيف.
اجعل المضيف يبدأ من جديد، ليستخدم الطرفان خادم وسيط يُدرجه Flock لكلٍّ منهما.
relay_not_in_session
يقول Flock إن اللاعب لا يشغل مقعدًا في الجلسة.
انضم إلى الجلسة من جديد قبل الاتصال.
flock_unreachable، relay_logins_refused
لم يجب Flock طلب بيانات دخول الوسيط، أو رفضه.
تأكّد أن الجهاز متصل بالإنترنت، ثم ابدأ من جديد؛ ويذكر السجل ما رفضه Flock.
لا يُدخل المضيف إلا اللاعبين الذين يؤكّد Flock مقاعدهم، باتصال واحد لكل لاعب. سمِّ اللاعبين باتصالهم، لا
بما ترسله لعبة اللاعب. ويُحتسب تحقّق المضيف من كل لاعب ينضم استدعاءً مدفوعًا واحدًا.
Unity
Unreal
يتحقّق المضيف الذي بدأه StartNetcodeAsync بنفسه من كل لاعب ينضم. واعرف من صاحب الاتصال:
string playerId = session.PlayerForConnection(clientId); // on the host
أضف تحقّقك الخاص بعد تحقّق Flock، مثل قائمة حظر أو حدّ لعدد الفريق:
يكون RefusedReason للاعب المرفوض واحدًا من no_join_token وjoin_token_invalid وalready_connected
وflock_unreachable وsession_ended وnot_host وrefused_by_the_game وgame_check_failed.
يجب أن يعمل طرفا اللعبة على Flock SDK بالإصدار 1.77.0 أو أحدث، وبالإصدار الرئيسي نفسه من Netcode for
GameObjects: فالمضيف يرفض اللاعبين على Flock SDK أقدم، أو على إصدار رئيسي آخر من Netcode.
يسأل المحرّك وضع اللعب لدى المضيف عن كل لاعب ينضم في PreLoginAsync، فيستدعي وضع اللعب لدى المضيف
تحقّق Flock هناك، بدل تحقّق المحرّك نفسه. وأبسط طريق أن تبنيه على AFlockGameModeBase (المبني على
AGameModeBase) أو AFlockGameMode (المبني على AGameMode، لحالات المباراة): في C++، أو Blueprint
مبنيًّا على Flock Game Mode Base أو Flock Game Mode، مضبوطًا في Project Settings → Maps &
Modes. أو استدعِ التحقّق من وضع لعب خاصّ بك:
// MyGameMode.hvirtual void PreLoginAsync(const FString& Options, const FString& Address, const FUniqueNetIdRepl& UniqueId, const FOnPreLoginCompleteDelegate& OnComplete) override;// MyGameMode.cpp#include "Multiplayer/FlockJoinChecks.h"void AMyGameMode::PreLoginAsync(const FString& Options, const FString& Address, const FUniqueNetIdRepl& UniqueId, const FOnPreLoginCompleteDelegate& OnComplete){ // Flock's check, then the engine's own (PreLogin, such as a full game), then your own below. const TWeakObjectPtr<AMyGameMode> Mode = this; FlockJoinChecks::CheckJoiningPlayer(this, Options, Address, UniqueId, OnComplete, [Mode](const FFlockJoiningPlayer& Player, FString& OutRefusedReason) { if (Mode.IsValid() && Mode->IsBanned(Player.PlayerId)) { OutRefusedReason = TEXT("banned"); // the joining player's RefusedReason return false; } return true; });}
تحقّقك الخاص اختياري، ولا يجري إلا للاعب أدخله Flock. ويصله PlayerId الذي تحقّق منه Flock،
وOptions الخاصة بالانتقال دون رمز Flock، وAddress (127.0.0.1 للاعب جاء عبر وسيط Flock). وفي
أوضاع اللعب الخاصة بـ Flock، تجاوز Approve Joining Player (ApproveJoiningPlayer) بدلًا من ذلك؛
وهو يُدخل الجميع ما لم تتجاوزه.واعرف من صاحب الاتصال، على المضيف، كما في PostLogin:
FString PlayerId = Session->PlayerForConnection(PlayerController); // empty for a connection Flock's check did not let in
يكون RefusedReason للاعب المرفوض واحدًا من FlockTravelToSessionRefusedReasons، أو سببك الخاص، أو
سبب المحرّك (مثل Server full.)، فاحتفظ بحالة افتراضية. ويذكر سجل اللاعب المنضم الإصلاح كذلك.
السبب
متى
ماذا تفعل
no_join_token
لم يحمل انتقال اللاعب أي رمز: لم يأتِ عبر TravelToSession.
اتصل بـ TravelToSession.
join_token_invalid
قال Flock إن الرمز لا يصلح لهذه الجلسة: مختلَق، أو لجلسة أخرى، أو منتهي الصلاحية (تدوم الرموز 60 ثانية)، أو تخلّى لاعبه عن المقعد.
انضم إلى الجلسة من جديد، ثم انتقل.
already_connected
اللاعب نفسه داخلٌ أصلًا عبر اتصال آخر ما يزال المضيف يسمع منه.
أغلق لعبة اللاعب الأخرى، ثم انتقل من جديد.
flock_unreachable
لم يجب Flock المضيف خلال 8 ثوانٍ، أو تجاوز المضيف عدد تحقّقاته في الدقيقة. ولا يدخل أحد دون تحقّق.
تأكّد أن جهاز المضيف متصل بالإنترنت، ثم انتقل من جديد.
session_ended
انتهت الجلسة.
استضِف جلسة أخرى أو انضم إليها.
not_host
الجهاز الذي وُصل إليه لم يعد يستضيف الجلسة.
انتقل من جديد: فهو يجد المضيف الجديد.
refused_by_the_game
ردّ تحقّقك الخاص اللاعب دون سبب خاص به.
أعطِ اللاعب سببًا من عندك.
join_check_missing
لا يستدعي وضع اللعب لدى المضيف تحقّق Flock، فلا يدخل أحد.
ابنِ وضع اللعب على أحد أوضاع Flock، أو استدعِ CheckJoiningPlayer من PreLoginAsync الخاص به.
relay_only
قيمة Relay لدى المضيف Always، ووصل اللاعب إليه بطريق آخر.
اضبط Relay بالقيمة نفسها في لعبة كل لاعب.
وفي Blueprint، تجاوز Approve Joining Player في وضع لعب مبني على Flock Game Mode Base؛ ويصل
Refused Reason فيه إلى Travel To Session لدى اللاعب (والفارغ يُقرأ Refused By The Game). وسمِّ
اللاعبين بـ Player For Connection على الجلسة، كما في OnPostLogin.
شغّل Flock Unreal SDK نفسه في لعبة كل لاعب. فاللاعب على الإصدار 1.30.0 أو أقدم لا يرسل رمز انضمام
(no_join_token)، واللاعب على 1.33.0 أو أقدم لا يستطيع المرور عبر الوسيط.
حين يغادر المضيف أو تتوقف لعبته، يجعل Flock اللاعب الأقدم جلوسًا مضيفًا ويطلق حدث تغيّر المضيف في الجلسة
على كل لعبة (HostChanged في Unity، وOnHostChanged في Unreal). ولا يستطيع Netcode for GameObjects
ولا شبكة Unreal نقل لعبة جارية إلى مضيف جديد، فتبدأ كل لعبة شبكتها من جديد: يستضيف المضيف الجديد، وينضم
إليه الآخرون. وافعل الشيء نفسه حين يتوقف وسيط هذا الجهاز عن العمل (RelayLost في Unity، وOnRelayLost
في Unreal).
Unity
Unreal
أغلق الشبكة وابدأها من جديد:
session.HostChanged += StartAgain;session.RelayLost += reason => StartAgain();async void StartAgain(){ if (session.HasEnded) return; NetworkManager.Singleton.Shutdown(); await session.StartNetcodeAsync(NetworkManager.Singleton); // waits for the shutdown to finish}
يعود اللاعبون إلى اللعب بعد نحو 20 ثانية من مغادرة المضيف، وبعد نحو دقيقة من تعطّل لعبته (مهلة
المضيف). ويضيع كل ما كان يحمله المضيف القديم: كائناته المُنشأة، ومتغيّراته الشبكية، وحالة مشهده.
فاحفظ ما يحتاجه المضيف الجديد لدى كل لاعب، مثل لقطة من حالة اللعبة يرسلها المضيف كل بضع ثوانٍ، وأعد
البناء منها. وأثناء انتظار استبدال مضيف متعطّل، يفقد اللاعبون اتصال الشبكة أولًا؛ فأبقِ الجلسة وانتظر
HostChanged.
استدعِ TravelToSession من جديد بالخيارات نفسها، من Game Instance الخاصة بلعبتك. والانتقال الأحدث
يُنهي الجاري بـ restarted، ويؤدّي دور هذا الجهاز من حيث كانت اللعبة.
// Once the session is held.Session->OnHostChanged.AddDynamic(this, &UMyGameInstance::PlayAgain);Session->OnRelayLost.AddDynamic(this, &UMyGameInstance::PlayAgainAfterRelayLost);void UMyGameInstance::PlayAgain(){ if (!Session->HasEnded()) { Session->TravelToSession(this, TravelOptions, [](TFlockResult<FFlockTravelToSessionResult> Result) { // restarted: a newer call took over, and its own answer follows. }); }}void UMyGameInstance::PlayAgainAfterRelayLost(const FString& Reason){ PlayAgain();}
كانت هذه اللعبة
والآن
ما يفعله Travel To Session
المضيف
ما تزال المضيف
يُبقي مستواه ولاعبيه، ويفتح عنوانه على الوسيط من جديد إن فُقد، وينشر من جديد. والنشر المرفوض، أو الإلغاء، أو استدعاء أحدث، يُبقي المستوى مستمعًا.
يفتح المستوى الذي لعب فيه مع المضيف القديم مستمعًا، ما لم يسمِّ HostLevel غيره، وينشر.
لاعبًا
لاعبًا
ينتظر المضيف الجديد في المستوى الذي هو فيه، ثم يتصل؛ ويُغلق المحرّك الاتصال القديم.
لاعبًا في لعبة المضيف
لاعبًا، والمضيف نفسه
يجيب بـ connected في الحال ويُبقي اتصاله، فيمكن أن يعمل Begin Play لمستوى يستدعيه على كل لاعب.
ويُطلَق On Relay Lost على اللاعب أيضًا حين ينشر مضيفه عنوانًا آخر على الوسيط (إذ فُقد وسيط
المضيف نفسه)، لأن وسيط اللاعب لم يعد يبلغه. أما عنوان مضيف جديد فيخبر به On Host Changed وحده.تتلقّى الألعاب On Host Changed خلال نحو 20 ثانية من مغادرة المضيف، وتعود إلى لعبة المضيف الجديد بعد نحو
10 ثوانٍ أخرى (نحو 30 ثانية في المجموع)؛ أما لعبة المضيف التي تتوقف دون مغادرة فتُستبدل بعد ما يزيد قليلًا
على دقيقة (مهلة المضيف، ثم مسح Flock الدوري)، ويعود لاعبوها بعد نحو 80 ثانية. ويضيع كل ما كان يحمله المضيف القديم: ممثّلوه
(actors)، وحالة لعبته، وحالة مستواه. فاحفظ ما يحتاجه المضيف الجديد لدى كل لاعب، وأعد البناء منه.واتصال اللاعب بمضيف رحل دون كلمة تنتهي مهلته في المحرّك (دقيقة افتراضيًا)، فيطلق المحرّك
NetworkError ويعيد اللعبة إلى مستواها الافتراضي. واستدعاء Travel To Session من جديد من حدث NetworkError في
Game Instance، ما دامت الجلسة قائمة، يأخذ اللاعب إلى مضيف الجلسة، أيًّا كان حينها. ويُدخل المضيف
اتصال اللاعب الأحدث متى لم يسمع شيئًا من الاتصال الأقدم مدة 5 ثوانٍ، برمز الانضمام الجديد الذي
يجلبه Travel To Session.وفي Blueprint، اربط On Host Changed وOn Relay Lost للجلسة في Game Instance Blueprint، كلًّا
منهما بـ Flock Travel To Session بالخيارات نفسها. ويطلق الانتقال الذي يحلّ محلّه On Not Joined
مع Outcome بالقيمة Restarted، ولا يحتاج شيئًا. وهذا بالضبط ما يفعله مثال اللعب الجماعي في الإضافة:
يحفظ Game Instance في المثال الجلسة، ويربط On Host Changed وOn Relay Lost بحدث Travel Again.
Travel Again: عقدة Flock Travel To Session للجلسة المحفوظة. لا تحتاج Restarted شيئًا؛ وأي تعذّر آخر للدخول يتخلّى عن المقعد.
الألعاب التي تستخدم Steam أو Epic Online Services أو شبكتها الخاصة تستفيد كذلك من فرق Flock ومطابقته
وجلساته وتحقّق الانضمام. وهي تنشر الاتصال وتقرؤه بنفسها.
Unity
Unreal
// The host says how to reach it: a kind of its own and the values it needs, under 4 KB.await session.PublishConnectionAsync("steam", new Dictionary<string, object> { ["lobby"] = lobbyId.ToString() });// A player waits for it; null when the time passes or the session ends.FlockMultiplayerSessionConnection connection = await session.WaitForConnectionAsync(TimeSpan.FromSeconds(60));// The player proves its seat with a token, good for 60 seconds, sent over your own networking.FlockMultiplayerSessionJoinToken token = await session.RequestJoinTokenAsync();// The host checks it and learns who the player is; a bad token throws MultiplayerInvalidJoinToken.string playerId = await session.VerifyJoinTokenAsync(tokenFromPlayer);
ينشر PublishDirectConnectionAsync(port) عنوان هذا الجهاز نفسه، ويختار connection.FindDirectAddressAsync()
لدى اللاعب العنوان المناسب: العنوان المحلي للمضيف على شبكة مشتركة، وعنوانه العام فيما عدا ذلك. وخارج
الشبكة المحلية لا يصل اللاعبون إلى ذلك العنوان إلا عبر منفذ مُوجَّه إلى المضيف.
// The host says how to reach it: a mode of its own (32 characters at most) and the values it needs, under 4 KB.Session->PublishConnection(TEXT("steam"), FFlockCommandData().Set(TEXT("lobby"), LobbyId), nullptr);// A player waits for it: the session comes back with HasConnection(), HasEnded(), or neither when the time passes.Session->WaitForConnection(60.f, [this](TFlockResult<UFlockMultiplayerSession*> Waited){ FString Lobby; if (Waited.IsSuccess() && Waited.Value->HasConnection() && Waited.Value->GetConnection().Mode.Equals(TEXT("steam"), ESearchCase::CaseSensitive) && Waited.Value->GetConnection().Values.TryGetString(TEXT("lobby"), Lobby)) { JoinSteamLobby(Lobby); }});// The player proves its seat with a token, good for 60 seconds, sent over your own networking.Session->RequestJoinToken([this](TFlockResult<FFlockMultiplayerSessionJoinToken> Token){ if (Token.IsSuccess()) { SendToHost(Token.Value.Token); }});// The host checks it and learns who the player is; a bad token fails with MultiplayerInvalidJoinToken.Session->VerifyJoinToken(TokenFromPlayer, [this](TFlockResult<FString> PlayerId) { /* PlayerId.Value */ });
وينتهي Travel To Session كذلك بـ not_direct حين ينشر المضيف اتصالًا من نوعه الخاص، ويحمله في
Connection ضمن النتيجة. وينشر PublishDirectConnection(Port) عنوان هذا الجهاز نفسه، ويختار
FindDirectAddress لدى اللاعب العنوان المناسب: العنوان المحلي للمضيف على شبكة مشتركة، وعنوانه العام
فيما عدا ذلك. وخارج الشبكة المحلية لا يصل اللاعبون إلى ذلك العنوان إلا عبر منفذ مُوجَّه إلى المضيف.وفي Blueprint هي Flock Publish Connection، وFlock Wait For Connection (تطلق On Connection أو
On Session Ended أو On Timed Out أو On Failure)، وFlock Request Join Token، وFlock Verify Join
Token، وFlock Publish Direct Connection، وFlock Find Direct Address.
هل كانت هذه الصفحة مفيدة؟
{"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":"ar/guides/connecting-players","slug":"/ar/guides/connecting-players","pageMetadata":{"title":"اتصال اللاعبين","description":"صِل بين لاعبي الجلسة عبر Netcode for GameObjects أو شبكة Unreal نفسها، ومن خلال وسيط Flock عند الحاجة.","href":"/ar/guides/connecting-players"},"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: \"صِل بين لاعبي الجلسة عبر Netcode for GameObjects أو شبكة Unreal نفسها، ومن خلال وسيط Flock عند الحاجة.\"\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:`النطاق:`}),` `,children]})};function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Frame,Heading,Note,OptimizedImage,Tab,Table,Tabs,_MdxComponentBoundary}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,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:[`حين يتشارك اللاعبون `,_jsx(_components.a,{href:`/ar/guides/sessions`,children:`جلسة`}),`، تصل حزمة التطوير بينهم عبر شبكة لعبتك: Netcode for\nGameObjects في Unity، وشبكة المحرّك نفسه في Unreal. لعبة المضيف هي الخادم. يتصل اللاعبون على شبكة\nالمضيف به مباشرة، ويمرّ الآخرون عبر `,_jsx(_components.strong,{children:`وسيط Flock`}),`، فلا يحتاج أحد إلى فتح منفذ في الموجّه. ولا يُدخل\nالمضيف إلا لاعبي الجلسة، وحين يتغيّر المضيف تبدأ كل لعبة شبكتها من جديد لدورها الجديد.`]}),`\n`,_jsx(_MdxComponentBoundary,{name:`Scope`,children:_jsxs(Scope,{children:[`يُفعَّل الوسيط أو يُوقَف لكل `,_jsx(_components.strong,{children:`لعبة`}),`، من `,_jsx(_components.strong,{children:`إعدادات اللعب الجماعي`}),`.`]})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`يعمل وسيط Flock على شبكة Cloudflare، وهو مفعّل لكل لعبة ما لم يُوقَف من `,_jsx(_components.strong,{children:`إعدادات اللعب الجماعي`}),`. وحين يكون موقوفًا،\nأو ما دام وسيط الاستوديو معلّقًا حتى تُسدَّد فاتورته، يتصل اللاعبون على شبكة المضيف أو عبر منفذ مُوجَّه إلى المضيف،\nويحصل اللاعب على شبكة أخرى على `,_jsx(_components.code,{children:`RelayFailed`}),` (في Unreal: `,_jsx(_components.code,{children:`relay_failed`}),`) مع `,_jsx(_components.code,{children:`relay_not_offered`}),` أو `,_jsx(_components.code,{children:`relay_paused`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`starting-the-netcode`,children:`بدء الشبكة`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Unity`,id:`unity`,children:[_jsx(_components.p,{children:`استدعاء واحد يتولّى المصافحة كلها، للمضيف ولكل لاعب. فعلى المضيف يبدأ Netcode for GameObjects\nمضيفًا ويعلن مكانه. وعلى اللاعب ينتظر ذلك (حتى 60 ثانية)، ثم يتصل، ويثبت مقعد اللاعب.`}),_jsx(CodeBlock,{filename:``,numberOfLines:`21`,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:`21`,children:[_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:` 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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`switch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`started`}),_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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FlockNetcodeStartOutcome`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Restarted`}),_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:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// a newer start on this NetworkManager took over`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FlockNetcodeStartOutcome`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`StartedAsHost`}),_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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hosting. Code: \"`}),_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\":`#C586C0`},children:` break`}),_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:` case`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FlockNetcodeStartOutcome`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Connected`}),_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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`started`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ThroughRelay`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ?`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Connected through Flock's relay.\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Connected.\"`}),_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:` break`}),_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:` case`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FlockNetcodeStartOutcome`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Refused`}),_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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The host refused you: \"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` started`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`RefusedReason`}),_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:` break`}),_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:` case`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FlockNetcodeStartOutcome`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`RelayFailed`}),_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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The relay could not be used: \"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` started`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`RelayFailureReason`}),_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:` break`}),_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:` default`}),_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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Could not connect: \"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` started`}),_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.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`}),_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.code,{children:`session.LeaveAsync()`}),` إن لم يكن اللاعب\nقادرًا على اللعب.`]})]}),_jsxs(Tab,{title:`Unreal`,id:`unreal`,children:[_jsxs(_components.p,{children:[`استدعاء واحد يُدخل كل لعبة في لعبة الجلسة، لعبة المضيف ولعبة كل لاعب: `,_jsx(_components.code,{children:`TravelToSession`}),`. فعلى\nالمضيف يفتح مستوى المضيف مستمعًا للاعبين (`,_jsx(_components.code,{children:`?listen`}),` الخاص بالمحرّك) ويعلن مكانه. وعلى اللاعب ينتظر\nذلك (حتى 60 ثانية)، ثم يطلب من Flock رمز انضمام، وينتقل إلى المضيف، الذي يتحقّق من الرمز قبل أن\nيُدخل اللاعب. ويحمل net driver الخاص بالمحرّك كل لاعب، عبر وسيط Flock أيضًا: إذ تقوم حزمة التطوير\nمقام الطرف الآخر على عنوان الجهاز المحلي (loopback)، فتبقى شيفرة الشبكة في لعبتك كما هي.`]}),_jsxs(_components.p,{children:[`استدعِه من Game Instance الخاصة بلعبتك: فهو يكتمل حين تصير اللعبة في مستواها الجديد، ويكون\nالمستوى الذي جرى منه الاستدعاء قد زال. و`,_jsx(_components.code,{children:`TravelOptions`}),` هنا من نوع `,_jsx(_components.code,{children:`FFlockTravelToSessionOptions`}),`\nمحفوظ في Game Instance، ليمرّره تغيّر المضيف نفسه من جديد.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`43`,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:`43`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`#include`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"FlockSubsystem.h\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`#include`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Multiplayer/FlockMultiplayerSession.h\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Every player's game, the host's included, once it holds the session.`})}),`\n`,_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:`HostLevel`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--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:`\"/Game/Maps/Arena\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // the level the host opens; players travel to whatever the host has open`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` TWeakObjectPtr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`UMyGameInstance`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Game `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--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:`;`})]}),`\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\":`#9CDCFE`},children:`Game`}),_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:`FFlockTravelToSessionResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_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:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Game`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`IsValid`}),_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:` return`}),_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:`#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:`#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:` UE_LOG`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(LogTemp, Warning, `}),_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:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#9CDCFE`},children:`%s`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_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:`Result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`ToDisplayText`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // a mistake, a refused publish or a cancel, with its fix`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_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\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FFlockTravelToSessionResult`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Travel `}),_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:`Value`}),_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:`Travel`}),_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:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FlockTravelToSessionOutcomes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::Restarted)`})]}),`\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:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // a newer Travel To Session took over`})]}),`\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:`Travel`}),_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:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FlockTravelToSessionOutcomes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::StartedAsHost)`})]}),`\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:` Game`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`\"Hosting. Code: \"`}),_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:` Game`}),_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`,_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:`Travel`}),_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:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FlockTravelToSessionOutcomes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::Connected)`})]}),`\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:` Game`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Travel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`bThroughRelay`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--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:`\"Connected through Flock's relay.\"`}),_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:`#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:`\"Connected.\"`}),_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:`Travel`}),_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:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FlockTravelToSessionOutcomes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::Refused)`})]}),`\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:` Game`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`\"The host refused you: \"`}),_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:` Travel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`RefusedReason`}),_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:`Travel`}),_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:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FlockTravelToSessionOutcomes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::RelayFailed)`})]}),`\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:` Game`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`\"The relay could not be used: \"`}),_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:` Travel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`RelayFailureReason`}),_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:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` else`})}),`\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:` Game`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`\"Could not connect: \"`}),_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:` Travel`}),_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:[`المعامل الأول أي شيء في عالم اللعبة، مثل Game Instance. والانتقال الذي لا يستضيف ولا يتصل يُبقي\nمقعد اللاعب؛ فاستدعِ `,_jsx(_components.code,{children:`Session->Leave`}),` إن لم يكن اللاعب قادرًا على اللعب.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`يتحقّق وضع اللعب (game mode) لدى المضيف من كل لاعب ينضم.`}),` ابنِه على `,_jsx(_components.code,{children:`AFlockGameModeBase`}),` أو\n`,_jsx(_components.code,{children:`AFlockGameMode`}),`، أو استدعِ تحقّق Flock من `,_jsx(_components.code,{children:`PreLoginAsync`}),` الخاص به؛ راجع\n`,_jsx(_components.a,{href:`#who-is-joining`,children:`من ينضم`}),`. والمضيف الذي لا يفعل وضع لعبه أيًّا من ذلك لا يُدخل أحدًا\n(`,_jsx(_components.code,{children:`join_check_missing`}),`).`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`يحتاج Travel To Session إلى شبكة IP الخاصة بالمحرّك.`}),` فاللعبة التي يستخدم net driver فيها مقابس\nSteam (`,_jsx(_components.code,{children:`bUseSteamNetworking`}),` في نظام Steam الفرعي على الإنترنت، مفعّل ما لم يُضبط على false) لا\nتستطيع الاستماع على عنوان IP، فتنتهي بـ `,_jsx(_components.code,{children:`could_not_start`}),`. اضبط `,_jsx(_components.code,{children:`bUseSteamNetworking=False`}),` تحت\n`,_jsx(_components.code,{children:`[OnlineSubsystemSteam]`}),` في `,_jsx(_components.code,{children:`Config/DefaultEngine.ini`}),`، أو انشر اتصال Steam خاصًّا بك (راجع\n`,_jsx(_components.a,{href:`#other-networking`,children:`شبكات أخرى`}),`).`]}),_jsxs(_components.p,{children:[`وفي Blueprint، استدعِ `,_jsx(_components.strong,{children:`Flock Travel To Session`}),` من Game Instance Blueprint، حيث حدثا المحرّك\n`,_jsx(_components.strong,{children:`NetworkError`}),` و`,_jsx(_components.strong,{children:`TravelError`}),`؛ وإن استُدعيت من داخل مستوى، فإنها تكتب تحذيرًا في السجل. وهي\nتطلق `,_jsx(_components.strong,{children:`On Joined`}),` (بدأت مضيفًا، أو اتصلت)، أو `,_jsx(_components.strong,{children:`On Not Joined`}),` (ويقول Outcome وRefused Reason في\nالنتيجة لماذا)، أو `,_jsx(_components.strong,{children:`On Failure`}),` (خطأ في الاستخدام، كجلسة منتهية)، بعد أن يتغيّر المستوى. ويعطي\nطرفها `,_jsx(_components.strong,{children:`Async Action`}),` العقدة نفسها، ويوقف `,_jsx(_components.strong,{children:`Cancel`}),` فيها الانتقال. وقارن Outcome بعقد `,_jsx(_components.strong,{children:`Flock Travel\nOutcome`}),`، واحتفظ بحالة افتراضية.`]})]})]}),`\n`,_jsxs(_components.p,{children:[`نتيجة البدء هي ما انتهى إليه. في Unity تكون قيمة من `,_jsx(_components.code,{children:`FlockNetcodeStartOutcome`}),`؛ أما في Unreal فهي نصّ\nيُقارَن بثوابت `,_jsx(_components.code,{children:`FlockTravelToSessionOutcomes`}),`، وهي بالأسماء نفسها\n(فـ `,_jsx(_components.code,{children:`FlockTravelToSessionOutcomes::StartedAsHost`}),` هو `,_jsx(_components.code,{children:`started_as_host`}),`). وقد تأتي نتائج جديدة، فاحتفظ\nبحالة افتراضية.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Unity`}),_jsx(_components.th,{children:`Unreal`}),_jsx(_components.th,{children:`المعنى`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`StartedAsHost`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`started_as_host`})}),_jsx(_components.td,{children:`هذا الجهاز يستضيف، ويستطيع اللاعبون الوصول إليه.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Connected`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`connected`})}),_jsxs(_components.td,{children:[`انضم هذا الجهاز إلى المضيف. ويقول `,_jsx(_components.code,{children:`ThroughRelay`}),` (في Unreal: `,_jsx(_components.code,{children:`bThroughRelay`}),`) هل كان ذلك عبر الوسيط.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Refused`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`refused`})}),_jsxs(_components.td,{children:[`رفض المضيف هذا اللاعب؛ ويقول `,_jsx(_components.code,{children:`RefusedReason`}),` لماذا (راجع `,_jsx(_components.a,{href:`#who-is-joining`,children:`من ينضم`}),`). وفي Unreal يكون المحرّك قد أعاد اللعبة إلى مستواها الافتراضي.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`RelayFailed`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`relay_failed`})}),_jsxs(_components.td,{children:[`احتيج إلى الوسيط ولم يمكن استخدامه؛ ويقول `,_jsx(_components.code,{children:`RelayFailureReason`}),` لماذا وماذا تفعل (راجع أدناه).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`HostNeverPublished`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`host_never_published`})}),_jsxs(_components.td,{children:[`لم يعلن المضيف مكانه خلال 60 ثانية (`,_jsx(_components.code,{children:`FlockNetcodeOptions.WaitForHost`}),`، أو `,_jsx(_components.code,{children:`WaitForHostSeconds`}),` في Unreal). تأكّد أن لعبة المضيف بدأت كذلك، ثم ابدأ من جديد.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`CouldNotConnect`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`could_not_connect`})}),_jsx(_components.td,{children:`لم يجب المضيف. وفي Unreal يستسلم المحرّك بعد مهلته الخاصة (نحو 20 ثانية) ويحمّل المستوى الافتراضي. وخارج شبكة المضيف مع إيقاف الوسيط، وجّه منفذًا إلى المضيف.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`CouldNotStart`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`could_not_start`})}),_jsxs(_components.td,{children:[`لم يستطع المضيف البدء. ففي Unity رفض Netcode for GameObjects البدء، كأن يكون المنفذ مستخدمًا: حرّر المنفذ أو اختر غيره. وفي Unreal لم يُفتح مستوى المضيف مستمعًا على عنوان IP، كما يحدث مع مقابس Steam: أوقف `,_jsx(_components.code,{children:`bUseSteamNetworking`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`SessionEnded`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`session_ended`})}),_jsx(_components.td,{children:`انتهت الجلسة أثناء الانتظار. استضِف جلسة أخرى أو انضم إليها.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`NotDirect`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`not_direct`})}),_jsxs(_components.td,{children:[`أعلن المضيف اتصالًا من نوعه الخاص، مثل Steam؛ راجع `,_jsx(_components.a,{href:`#other-networking`,children:`شبكات أخرى`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Restarted`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`restarted`})}),_jsx(_components.td,{children:`بدأت اللعبة من جديد قبل انتهاء هذا البدء، وتولّى البدء الأحدث الأمر. لا شيء تفعله: فجواب الأحدث يأتي بعده.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`through-the-relay-or-directly`,children:`عبر الوسيط، أو مباشرة`}),`\n`,_jsxs(_components.p,{children:[`يختار `,_jsx(_components.code,{children:`FlockNetcodeOptions.Relay`}),` في Unity، و`,_jsx(_components.code,{children:`FFlockTravelToSessionOptions::Relay`}),` في Unreal، من يمرّ عبر\nالوسيط. واضبطه بالقيمة نفسها في لعبة كل لاعب.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsxs(_components.th,{children:[_jsx(_components.code,{children:`FlockRelayUse`}),` / `,_jsx(_components.code,{children:`EFlockRelayUse`})]}),_jsx(_components.th,{children:`من يمرّ عبر الوسيط`}),_jsx(_components.th,{children:`اختره لـ`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`WhenNeeded`}),` (الافتراضي)`]}),_jsx(_components.td,{children:`يجرّب اللاعبون على شبكة المضيف عنوانه المحلي بضع ثوانٍ، ثم الوسيط إن لم يُجب. ويمرّ الآخرون جميعًا عبر الوسيط، ثم ينتقلون إلى مسار مباشر حين يتمكّنون هم والمضيف من الوصول بعضهم إلى بعض.`}),_jsx(_components.td,{children:`معظم الألعاب.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Always`})}),_jsxs(_components.td,{children:[`كل لاعب، حتى على شبكة المضيف، ويبقون على الوسيط. ولا يعرف اللاعبون عنوان IP للمضيف أبدًا، ولا يعرف المضيف عناوينهم. وفي Unreal يردّ المضيف اللاعب الذي يصل إليه بطريق آخر (`,_jsx(_components.code,{children:`relay_only`}),`).`]}),_jsx(_components.td,{children:`البثّ المباشر واللعب التنافسي، أو الشبكات التي تعزل أجهزتها.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Never`})}),_jsx(_components.td,{children:`لا أحد. يصل اللاعبون إلى المضيف على شبكته، أو عبر منفذ مُوجَّه إليه.`}),_jsx(_components.td,{children:`ألعاب الشبكة المحلية، أو لعبة لا تريد حركة عبر الوسيط.`})]})]})]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Unity`,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`]})})}),_jsx(CodeBlock,{filename:`Unreal`,numberOfLines:`2`,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:`2`,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.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:`) {`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /* ... */`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`3`,id:`direct-paths`,children:`المسارات المباشرة`}),`\n`,_jsxs(_components.p,{children:[`مع `,_jsx(_components.code,{children:`WhenNeeded`}),`، وبعد أن يُدخل المضيف لاعبًا يمرّ عبر الوسيط، يحاول الطرفان الوصول أحدهما إلى الآخر مباشرة: يسأل كلٌّ منهما\nالوسيط، أو خادم STUN يُدرجه Flock، عن العنوان الذي يراه منه، ويتبادلان هذين العنوانين عبر الوسيط، ثم يرسل كلٌّ منهما حزمًا صغيرة إلى الآخر. وحين تصل في\nالاتجاهين، تمرّ حزم اللعبة مباشرة، وهو مسار أقصر في العادة من مسار الوسيط، ولا يبقى للوسيط ما يحمله. ويبقى الوسيط جاهزًا: فإذا\nسكت المسار المباشر 4 ثوانٍ عادت الحزم إليه. ولا تفعل اللعبة شيئًا في الحالتين. تسمح معظم أجهزة التوجيه المنزلية بذلك؛ أمّا حين\nيكون الطرفان كلاهما خلف أجهزة توجيه تمنح كل وجهة منفذًا خاصًا بها (كما تفعل بعض شبكات الجوّال)، فتبقى الحزم على الوسيط. منذ\nالإصدار 1.83.0 من Unity SDK والإصدار 1.38.0 من Unreal SDK.`]}),`\n`,_jsx(_components.p,{children:`وفي Unreal يستمرّ اتصال المحرّك عبر كل انتقال: يسمع مُشغّل الشبكة لدى المضيف اللاعبَ من المنفذ نفسه طوال الوقت. ويُذكَر\nكل انتقال مرة واحدة في السجلّ، بمستوى Info. وإن كانت اللعبة في أيّ من الطرفين على Unreal SDK أقدم من 1.38.0 بقي الطرفان على\nالوسيط، إذ يُعلن كل طرف أولًا أنه يفهم رسائل المسار المباشر من الطرف الآخر.`}),`\n`,_jsxs(_components.p,{children:[`المقابل: مع `,_jsx(_components.code,{children:`WhenNeeded`}),` يعرف المضيف واللاعب المارّ عبر الوسيط عنوان IP أحدهما للآخر بعد إدخال اللاعب. وفي\nUnreal ينشر المضيف عناوينه الخاصة إلى جانب عنوانه على الوسيط، فيستطيع اللاعبون قراءة عنوانه. استخدم\n`,_jsx(_components.code,{children:`Always`}),` لإبقائهما مخفيّين.`]}),`\n`,_jsxs(_components.p,{children:[`حين يتعذّر استخدام الوسيط، يكون `,_jsx(_components.code,{children:`RelayFailureReason`}),` واحدًا مما يلي، وهو نفسه في المحرّكين ما لم يذكر\nالسطر غير ذلك:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`السبب`}),_jsx(_components.th,{children:`متى`}),_jsx(_components.th,{children:`ماذا تفعل`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`relay_not_offered`})}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`توزيع بيانات اعتماد الوسيط`}),` موقوف للعبة، أو لا يُدرج Flock أي وسيط.`]}),_jsxs(_components.td,{children:[`فعّله من `,_jsx(_components.strong,{children:`إعدادات اللعب الجماعي`}),`، أو صِل اللاعبين مباشرة.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`relay_paused`})}),_jsx(_components.td,{children:`وسيط الاستوديو موقوف حتى تُدفع فاتورته.`}),_jsx(_components.td,{children:`سدّد الفاتورة من لوحة التحكم؛ وحتى ذلك الحين يتصل اللاعبون مباشرة.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`relay_unreachable`})}),_jsx(_components.td,{children:`الشبكة تحجب UDP عن الوسيط، كما تفعل بعض شبكات المدارس والمكاتب والفنادق.`}),_jsx(_components.td,{children:`تأكّد أن الجهاز متصل بالإنترنت وأن جدار الحماية يسمح للعبة بإرسال UDP، أو جرّب شبكة أخرى.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`relay_not_on_this_platform`})}),_jsx(_components.td,{children:`في Unity فقط: لاعب متصفح. لا يستطيع المتصفح إرسال UDP.`}),_jsx(_components.td,{children:`العب من نسخة للحاسوب أو الهاتف لاستخدام الوسيط.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`relay_not_offered_by_host`})}),_jsxs(_components.td,{children:[`لا يُدخل المضيف أحدًا عبر الوسيط: قيمة `,_jsx(_components.code,{children:`Relay`}),` لديه `,_jsx(_components.code,{children:`Never`}),`، أو تعذّر فتح وسيطه.`]}),_jsxs(_components.td,{children:[`اضبط `,_jsx(_components.code,{children:`Relay`}),` بالقيمة نفسها في لعبة كل لاعب؛ ويقول سجل المضيف لماذا تعذّر فتح وسيطه.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`relay_too_many_logins`})}),_jsx(_components.td,{children:`أكثر من 12 تسجيل دخول إلى الوسيط في دقيقة، أو 10 للاعب واحد في جلسة واحدة.`}),_jsx(_components.td,{children:`لا تبدأ الشبكة (في Unreal: Travel To Session) في حلقة؛ والجلسة الأخرى تعطي مقعدًا خاصًّا بها.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`relay_server_not_listed`})}),_jsx(_components.td,{children:`لا يُدرج Flock لهذا اللاعب خادم الوسيط الذي عليه المضيف.`}),_jsx(_components.td,{children:`اجعل المضيف يبدأ من جديد، ليستخدم الطرفان خادم وسيط يُدرجه Flock لكلٍّ منهما.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`relay_not_in_session`})}),_jsx(_components.td,{children:`يقول Flock إن اللاعب لا يشغل مقعدًا في الجلسة.`}),_jsx(_components.td,{children:`انضم إلى الجلسة من جديد قبل الاتصال.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`flock_unreachable`}),`، `,_jsx(_components.code,{children:`relay_logins_refused`})]}),_jsx(_components.td,{children:`لم يجب Flock طلب بيانات دخول الوسيط، أو رفضه.`}),_jsx(_components.td,{children:`تأكّد أن الجهاز متصل بالإنترنت، ثم ابدأ من جديد؛ ويذكر السجل ما رفضه Flock.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`relay_wrong_login`}),`، `,_jsx(_components.code,{children:`relay_full`}),`، `,_jsx(_components.code,{children:`relay_open_refused`}),`، `,_jsx(_components.code,{children:`relay_refused`})]}),_jsx(_components.td,{children:`رفض خادم الوسيط بيانات الدخول، أو لم يكن فيه متّسع، أو لم يُدخل حزم المضيف، أو رفض لسبب آخر.`}),_jsx(_components.td,{children:`ابدأ من جديد ليعطي Flock بيانات دخول جديدة؛ وإن ظلّ يرفض، صِل اللاعبين مباشرة.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`relay_lost`}),`، `,_jsx(_components.code,{children:`relay_closed`})]}),_jsx(_components.td,{children:`تخلّى الوسيط عن عنوان هذا الجهاز أو لم يردّ بشيء طوال 45 ثانية (فلم تعد حزم هذا الجهاز تصل إليه)، أو أغلقه انتهاء الجلسة.`}),_jsxs(_components.td,{children:[`بعد `,_jsx(_components.code,{children:`relay_lost`}),` ابدأ من جديد؛ وبعد `,_jsx(_components.code,{children:`relay_closed`}),` استضِف جلسة أخرى أو انضم إليها.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`relay_no_thread`})}),_jsxs(_components.td,{children:[`في Unreal فقط: تعمل اللعبة دون خيوط (`,_jsx(_components.code,{children:`-nothreading`}),`)، والوسيط يحتاج خيطًا خاصًّا به.`]}),_jsxs(_components.td,{children:[`شغّل اللعبة دون `,_jsx(_components.code,{children:`-nothreading`}),`.`]})]})]})]}),`\n`,_jsx(_components.p,{children:`وقد يضيف الخادم أسبابًا جديدة، فاحتفظ بحالة افتراضية.`}),`\n`,_jsx(Heading,{level:`2`,id:`who-is-joining`,children:`من ينضم`}),`\n`,_jsx(_components.p,{children:`لا يُدخل المضيف إلا اللاعبين الذين يؤكّد Flock مقاعدهم، باتصال واحد لكل لاعب. سمِّ اللاعبين باتصالهم، لا\nبما ترسله لعبة اللاعب. ويُحتسب تحقّق المضيف من كل لاعب ينضم استدعاءً مدفوعًا واحدًا.`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Unity`,id:`unity-2`,children:[_jsxs(_components.p,{children:[`يتحقّق المضيف الذي بدأه `,_jsx(_components.code,{children:`StartNetcodeAsync`}),` بنفسه من كل لاعب ينضم. واعرف من صاحب الاتصال:`]}),_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:`string`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` playerId`}),_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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`PlayerForConnection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`clientId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// on the host`})]}),`\n`]})})}),_jsx(_components.p,{children:`أضف تحقّقك الخاص بعد تحقّق Flock، مثل قائمة حظر أو حدّ لعدد الفريق:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`11`,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:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockNetcodeOptions`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` options`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--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`})]}),`\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:` ApproveJoiningPlayer`}),_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:`player`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_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:`bannedPlayers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Contains`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`player`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`PlayerId`}),_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:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Approved`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` false`}),_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:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Reason`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"banned\"`}),_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`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`]})})}),_jsxs(_components.p,{children:[`يكون `,_jsx(_components.code,{children:`RefusedReason`}),` للاعب المرفوض واحدًا من `,_jsx(_components.code,{children:`no_join_token`}),` و`,_jsx(_components.code,{children:`join_token_invalid`}),` و`,_jsx(_components.code,{children:`already_connected`}),`\nو`,_jsx(_components.code,{children:`flock_unreachable`}),` و`,_jsx(_components.code,{children:`session_ended`}),` و`,_jsx(_components.code,{children:`not_host`}),` و`,_jsx(_components.code,{children:`refused_by_the_game`}),` و`,_jsx(_components.code,{children:`game_check_failed`}),`.`]}),_jsx(Note,{children:_jsx(_components.p,{children:`يجب أن يعمل طرفا اللعبة على Flock SDK بالإصدار 1.77.0 أو أحدث، وبالإصدار الرئيسي نفسه من Netcode for\nGameObjects: فالمضيف يرفض اللاعبين على Flock SDK أقدم، أو على إصدار رئيسي آخر من Netcode.`})})]}),_jsxs(Tab,{title:`Unreal`,id:`unreal-2`,children:[_jsxs(_components.p,{children:[`يسأل المحرّك وضع اللعب لدى المضيف عن كل لاعب ينضم في `,_jsx(_components.code,{children:`PreLoginAsync`}),`، فيستدعي وضع اللعب لدى المضيف\nتحقّق Flock هناك، بدل تحقّق المحرّك نفسه. وأبسط طريق أن تبنيه على `,_jsx(_components.code,{children:`AFlockGameModeBase`}),` (المبني على\n`,_jsx(_components.code,{children:`AGameModeBase`}),`) أو `,_jsx(_components.code,{children:`AFlockGameMode`}),` (المبني على `,_jsx(_components.code,{children:`AGameMode`}),`، لحالات المباراة): في C++، أو Blueprint\nمبنيًّا على `,_jsx(_components.strong,{children:`Flock Game Mode Base`}),` أو `,_jsx(_components.strong,{children:`Flock Game Mode`}),`، مضبوطًا في `,_jsx(_components.strong,{children:`Project Settings → Maps \u0026\nModes`}),`. أو استدعِ التحقّق من وضع لعب خاصّ بك:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`23`,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:`23`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// MyGameMode.h`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`virtual`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` PreLoginAsync`}),_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:` FString`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` Options`}),_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:` FString`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` Address`}),_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:` FUniqueNetIdRepl`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` UniqueId`}),_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:` const`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FOnPreLoginCompleteDelegate`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` OnComplete`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`override`}),_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:`// MyGameMode.cpp`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`#include`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Multiplayer/FlockJoinChecks.h\"`})]}),`\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:` AMyGameMode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`PreLoginAsync`}),_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:` FString`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` Options`}),_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:` FString`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` Address`}),_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:` FUniqueNetIdRepl`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` UniqueId`}),_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:` const`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FOnPreLoginCompleteDelegate`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` OnComplete`}),_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:` // Flock's check, then the engine's own (PreLogin, such as a full game), then your own below.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` TWeakObjectPtr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`AMyGameMode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Mode `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--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:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` FlockJoinChecks`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`CheckJoiningPlayer`}),_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:`, Options, Address, UniqueId, OnComplete,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Mode`}),_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:` FFlockJoiningPlayer`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` Player`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FString`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` OutRefusedReason`}),_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:`Mode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`IsValid`}),_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:` Mode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`IsBanned`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Player`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`PlayerId`}),_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:` OutRefusedReason `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--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:`\"banned\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // the joining player's RefusedReason`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` false`}),_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:` return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_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:[`تحقّقك الخاص اختياري، ولا يجري إلا للاعب أدخله Flock. ويصله `,_jsx(_components.code,{children:`PlayerId`}),` الذي تحقّق منه Flock،\nو`,_jsx(_components.code,{children:`Options`}),` الخاصة بالانتقال دون رمز Flock، و`,_jsx(_components.code,{children:`Address`}),` (127.0.0.1 للاعب جاء عبر وسيط Flock). وفي\nأوضاع اللعب الخاصة بـ Flock، تجاوز `,_jsx(_components.strong,{children:`Approve Joining Player`}),` (`,_jsx(_components.code,{children:`ApproveJoiningPlayer`}),`) بدلًا من ذلك؛\nوهو يُدخل الجميع ما لم تتجاوزه.`]}),_jsxs(_components.p,{children:[`واعرف من صاحب الاتصال، على المضيف، كما في `,_jsx(_components.code,{children:`PostLogin`}),`:`]}),_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\":`#D4D4D4`},children:`FString PlayerId `}),_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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`PlayerForConnection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(PlayerController);`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // empty for a connection Flock's check did not let in`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`يكون `,_jsx(_components.code,{children:`RefusedReason`}),` للاعب المرفوض واحدًا من `,_jsx(_components.code,{children:`FlockTravelToSessionRefusedReasons`}),`، أو سببك الخاص، أو\nسبب المحرّك (مثل `,_jsx(_components.code,{children:`Server full.`}),`)، فاحتفظ بحالة افتراضية. ويذكر سجل اللاعب المنضم الإصلاح كذلك.`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`السبب`}),_jsx(_components.th,{children:`متى`}),_jsx(_components.th,{children:`ماذا تفعل`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`no_join_token`})}),_jsxs(_components.td,{children:[`لم يحمل انتقال اللاعب أي رمز: لم يأتِ عبر `,_jsx(_components.code,{children:`TravelToSession`}),`.`]}),_jsxs(_components.td,{children:[`اتصل بـ `,_jsx(_components.code,{children:`TravelToSession`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`join_token_invalid`})}),_jsx(_components.td,{children:`قال Flock إن الرمز لا يصلح لهذه الجلسة: مختلَق، أو لجلسة أخرى، أو منتهي الصلاحية (تدوم الرموز 60 ثانية)، أو تخلّى لاعبه عن المقعد.`}),_jsx(_components.td,{children:`انضم إلى الجلسة من جديد، ثم انتقل.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`already_connected`})}),_jsx(_components.td,{children:`اللاعب نفسه داخلٌ أصلًا عبر اتصال آخر ما يزال المضيف يسمع منه.`}),_jsx(_components.td,{children:`أغلق لعبة اللاعب الأخرى، ثم انتقل من جديد.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`flock_unreachable`})}),_jsx(_components.td,{children:`لم يجب Flock المضيف خلال 8 ثوانٍ، أو تجاوز المضيف عدد تحقّقاته في الدقيقة. ولا يدخل أحد دون تحقّق.`}),_jsx(_components.td,{children:`تأكّد أن جهاز المضيف متصل بالإنترنت، ثم انتقل من جديد.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`session_ended`})}),_jsx(_components.td,{children:`انتهت الجلسة.`}),_jsx(_components.td,{children:`استضِف جلسة أخرى أو انضم إليها.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`not_host`})}),_jsx(_components.td,{children:`الجهاز الذي وُصل إليه لم يعد يستضيف الجلسة.`}),_jsx(_components.td,{children:`انتقل من جديد: فهو يجد المضيف الجديد.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`refused_by_the_game`})}),_jsx(_components.td,{children:`ردّ تحقّقك الخاص اللاعب دون سبب خاص به.`}),_jsx(_components.td,{children:`أعطِ اللاعب سببًا من عندك.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`join_check_missing`})}),_jsx(_components.td,{children:`لا يستدعي وضع اللعب لدى المضيف تحقّق Flock، فلا يدخل أحد.`}),_jsxs(_components.td,{children:[`ابنِ وضع اللعب على أحد أوضاع Flock، أو استدعِ `,_jsx(_components.code,{children:`CheckJoiningPlayer`}),` من `,_jsx(_components.code,{children:`PreLoginAsync`}),` الخاص به.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`relay_only`})}),_jsxs(_components.td,{children:[`قيمة `,_jsx(_components.code,{children:`Relay`}),` لدى المضيف `,_jsx(_components.code,{children:`Always`}),`، ووصل اللاعب إليه بطريق آخر.`]}),_jsxs(_components.td,{children:[`اضبط `,_jsx(_components.code,{children:`Relay`}),` بالقيمة نفسها في لعبة كل لاعب.`]})]})]})]}),_jsxs(_components.p,{children:[`وفي Blueprint، تجاوز `,_jsx(_components.strong,{children:`Approve Joining Player`}),` في وضع لعب مبني على `,_jsx(_components.strong,{children:`Flock Game Mode Base`}),`؛ ويصل\nRefused Reason فيه إلى Travel To Session لدى اللاعب (والفارغ يُقرأ Refused By The Game). وسمِّ\nاللاعبين بـ `,_jsx(_components.strong,{children:`Player For Connection`}),` على الجلسة، كما في `,_jsx(_components.strong,{children:`OnPostLogin`}),`.`]}),_jsx(Note,{children:_jsxs(_components.p,{children:[`شغّل Flock Unreal SDK نفسه في لعبة كل لاعب. فاللاعب على الإصدار 1.30.0 أو أقدم لا يرسل رمز انضمام\n(`,_jsx(_components.code,{children:`no_join_token`}),`)، واللاعب على 1.33.0 أو أقدم لا يستطيع المرور عبر الوسيط.`]})})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`when-the-host-changes`,children:`حين يتغيّر المضيف`}),`\n`,_jsxs(_components.p,{children:[`حين يغادر المضيف أو تتوقف لعبته، يجعل Flock اللاعب الأقدم جلوسًا مضيفًا ويطلق حدث تغيّر المضيف في الجلسة\nعلى كل لعبة (`,_jsx(_components.code,{children:`HostChanged`}),` في Unity، و`,_jsx(_components.code,{children:`OnHostChanged`}),` في Unreal). ولا يستطيع Netcode for GameObjects\nولا شبكة Unreal نقل لعبة جارية إلى مضيف جديد، فتبدأ كل لعبة شبكتها من جديد: يستضيف المضيف الجديد، وينضم\nإليه الآخرون. وافعل الشيء نفسه حين يتوقف وسيط هذا الجهاز عن العمل (`,_jsx(_components.code,{children:`RelayLost`}),` في Unity، و`,_jsx(_components.code,{children:`OnRelayLost`}),`\nفي Unreal).`]}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Unity`,id:`unity-3`,children:[_jsx(_components.p,{children:`أغلق الشبكة وابدأها من جديد:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`10`,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:`10`,children:[_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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`HostChanged`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` StartAgain`}),_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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`RelayLost`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +=`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` reason`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` StartAgain`}),_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:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` StartAgain`}),_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:`session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`HasEnded`}),_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:` return`}),_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:` 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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Shutdown`}),_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:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// waits for the shutdown to finish`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[`يعود اللاعبون إلى اللعب بعد نحو 20 ثانية من مغادرة المضيف، وبعد نحو دقيقة من تعطّل لعبته (`,_jsx(_components.strong,{children:`مهلة\nالمضيف`}),`). ويضيع كل ما كان يحمله المضيف القديم: كائناته المُنشأة، ومتغيّراته الشبكية، وحالة مشهده.\nفاحفظ ما يحتاجه المضيف الجديد لدى كل لاعب، مثل لقطة من حالة اللعبة يرسلها المضيف كل بضع ثوانٍ، وأعد\nالبناء منها. وأثناء انتظار استبدال مضيف متعطّل، يفقد اللاعبون اتصال الشبكة أولًا؛ فأبقِ الجلسة وانتظر\n`,_jsx(_components.code,{children:`HostChanged`}),`.`]})]}),_jsxs(Tab,{title:`Unreal`,id:`unreal-3`,children:[_jsxs(_components.p,{children:[`استدعِ `,_jsx(_components.code,{children:`TravelToSession`}),` من جديد بالخيارات نفسها، من Game Instance الخاصة بلعبتك. والانتقال الأحدث\nيُنهي الجاري بـ `,_jsx(_components.code,{children:`restarted`}),`، ويؤدّي دور هذا الجهاز من حيث كانت اللعبة.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`19`,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:`19`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Once the session is held.`})}),`\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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`OnHostChanged`}),_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:`::PlayAgain);`})]}),`\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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`OnRelayLost`}),_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:`::PlayAgainAfterRelayLost);`})]}),`\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:`PlayAgain`}),_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:`#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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`HasEnded`}),_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:` 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:`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`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // restarted: a newer call took over, and its own answer follows.`})}),`\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`,_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:`PlayAgainAfterRelayLost`}),_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:` FString`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` Reason`}),_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:` PlayAgain`}),_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(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`كانت هذه اللعبة`}),_jsx(_components.th,{children:`والآن`}),_jsx(_components.th,{children:`ما يفعله Travel To Session`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`المضيف`}),_jsx(_components.td,{children:`ما تزال المضيف`}),_jsx(_components.td,{children:`يُبقي مستواه ولاعبيه، ويفتح عنوانه على الوسيط من جديد إن فُقد، وينشر من جديد. والنشر المرفوض، أو الإلغاء، أو استدعاء أحدث، يُبقي المستوى مستمعًا.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`المضيف`}),_jsx(_components.td,{children:`لاعبًا`}),_jsx(_components.td,{children:`يتوقف عن الاستماع (فتُغلق اتصالات لاعبيه)، وينتظر المضيف الجديد، وينضم إليه.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`لاعبًا`}),_jsx(_components.td,{children:`المضيف`}),_jsxs(_components.td,{children:[`يفتح المستوى الذي لعب فيه مع المضيف القديم مستمعًا، ما لم يسمِّ `,_jsx(_components.code,{children:`HostLevel`}),` غيره، وينشر.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`لاعبًا`}),_jsx(_components.td,{children:`لاعبًا`}),_jsx(_components.td,{children:`ينتظر المضيف الجديد في المستوى الذي هو فيه، ثم يتصل؛ ويُغلق المحرّك الاتصال القديم.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`لاعبًا في لعبة المضيف`}),_jsx(_components.td,{children:`لاعبًا، والمضيف نفسه`}),_jsxs(_components.td,{children:[`يجيب بـ `,_jsx(_components.code,{children:`connected`}),` في الحال ويُبقي اتصاله، فيمكن أن يعمل Begin Play لمستوى يستدعيه على كل لاعب.`]})]})]})]}),_jsxs(_components.p,{children:[`ويُطلَق `,_jsx(_components.strong,{children:`On Relay Lost`}),` على اللاعب أيضًا حين ينشر مضيفه عنوانًا آخر على الوسيط (إذ فُقد وسيط\nالمضيف نفسه)، لأن وسيط اللاعب لم يعد يبلغه. أما عنوان مضيف جديد فيخبر به `,_jsx(_components.strong,{children:`On Host Changed`}),` وحده.`]}),_jsxs(_components.p,{children:[`تتلقّى الألعاب On Host Changed خلال نحو 20 ثانية من مغادرة المضيف، وتعود إلى لعبة المضيف الجديد بعد نحو\n10 ثوانٍ أخرى (نحو 30 ثانية في المجموع)؛ أما لعبة المضيف التي تتوقف دون مغادرة فتُستبدل بعد ما يزيد قليلًا\nعلى دقيقة (`,_jsx(_components.strong,{children:`مهلة المضيف`}),`، ثم مسح Flock الدوري)، ويعود لاعبوها بعد نحو 80 ثانية. ويضيع كل ما كان يحمله المضيف القديم: ممثّلوه\n(actors)، وحالة لعبته، وحالة مستواه. فاحفظ ما يحتاجه المضيف الجديد لدى كل لاعب، وأعد البناء منه.`]}),_jsxs(_components.p,{children:[`واتصال اللاعب بمضيف رحل دون كلمة تنتهي مهلته في المحرّك (دقيقة افتراضيًا)، فيطلق المحرّك\n`,_jsx(_components.strong,{children:`NetworkError`}),` ويعيد اللعبة إلى مستواها الافتراضي. واستدعاء Travel To Session من جديد من حدث NetworkError في\nGame Instance، ما دامت الجلسة قائمة، يأخذ اللاعب إلى مضيف الجلسة، أيًّا كان حينها. ويُدخل المضيف\nاتصال اللاعب الأحدث متى لم يسمع شيئًا من الاتصال الأقدم مدة 5 ثوانٍ، برمز الانضمام الجديد الذي\nيجلبه Travel To Session.`]}),_jsxs(_components.p,{children:[`وفي Blueprint، اربط `,_jsx(_components.strong,{children:`On Host Changed`}),` و`,_jsx(_components.strong,{children:`On Relay Lost`}),` للجلسة في Game Instance Blueprint، كلًّا\nمنهما بـ `,_jsx(_components.strong,{children:`Flock Travel To Session`}),` بالخيارات نفسها. ويطلق الانتقال الذي يحلّ محلّه `,_jsx(_components.strong,{children:`On Not Joined`}),`\nمع Outcome بالقيمة `,_jsx(_components.strong,{children:`Restarted`}),`، ولا يحتاج شيئًا. وهذا بالضبط ما يفعله مثال اللعب الجماعي في الإضافة:`]}),_jsx(Frame,{caption:`يحفظ Game Instance في المثال الجلسة، ويربط On Host Changed وOn Relay Lost بحدث Travel Again.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-play.png?fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=792db93d3303064888af1fe309d5da21`,alt:`Set Session ثم Bind Event إلى On Host Changed وOn Relay Lost وOn Ended؛ ويستدعي الحدثان HostChanged وRelayLost حدث Travel Again`,\"data-og-width\":`2353`,width:`2353`,\"data-og-height\":`619`,height:`619`,\"data-path\":`images/guides/unreal-multiplayer-sample-play.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-play.png?w=280\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=4c908684aab2dc4d3f169296f45aa9d7 280w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-play.png?w=560\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=c2827c3223d7cc953a9c239c4942b0c1 560w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-play.png?w=840\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=255f13d3e83de18f288fe24fd0137871 840w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-play.png?w=1100\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=c66969e76b4e92ad16321fab6fc64b57 1100w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-play.png?w=1650\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=f7eb027a07a1bb022b7a94b662749531 1650w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-play.png?w=2500\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=985ebef4cca6dd85b9cc1741c711edd1 2500w`})}),_jsx(Frame,{caption:`Travel Again: عقدة Flock Travel To Session للجلسة المحفوظة. لا تحتاج Restarted شيئًا؛ وأي تعذّر آخر للدخول يتخلّى عن المقعد.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-travel-again.png?fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=d4b8c6f1750cf95f0eeae1cf5066f9fe`,alt:`فرعان (Branch)، ثم Flock Travel To Session، وOn Joined يضبط الحالة، وOn Not Joined يقارن Outcome بقيمة Restarted، وOn Failure يغادر الجلسة`,\"data-og-width\":`2338`,width:`2338`,\"data-og-height\":`670`,height:`670`,\"data-path\":`images/guides/unreal-multiplayer-sample-travel-again.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-travel-again.png?w=280\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=6eeaefa2993938f9145e8b073694f625 280w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-travel-again.png?w=560\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=50d607646de55a7d4923be4025a2f2bc 560w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-travel-again.png?w=840\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=d65c1ccdccb714cc241fcffb3d7c5c7f 840w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-travel-again.png?w=1100\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=133d4a385843917f46babedde7670a08 1100w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-travel-again.png?w=1650\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=37833fcb32aaed51549da2a5631b9400 1650w, https://mintcdn.com/qwacks/sKCVX05gMuqzHxSa/images/guides/unreal-multiplayer-sample-travel-again.png?w=2500\u0026fit=max\u0026auto=format\u0026n=sKCVX05gMuqzHxSa\u0026q=85\u0026s=1953bf819237eac0865de75aea4fb335 2500w`})})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`other-networking`,children:`شبكات أخرى`}),`\n`,_jsx(_components.p,{children:`الألعاب التي تستخدم Steam أو Epic Online Services أو شبكتها الخاصة تستفيد كذلك من فرق Flock ومطابقته\nوجلساته وتحقّق الانضمام. وهي تنشر الاتصال وتقرؤه بنفسها.`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Unity`,id:`unity-4`,children:[_jsx(CodeBlock,{filename:``,numberOfLines:`11`,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:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// The host says how to reach it: a kind of its own and the values it needs, under 4 KB.`})}),`\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:`PublishConnectionAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"steam\"`}),_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:` Dictionary`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`object`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> { [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"lobby\"`}),_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:` lobbyId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`ToString`}),_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:`// A player waits for it; null when the time passes or the session ends.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockMultiplayerSessionConnection`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` connection`}),_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:` session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`WaitForConnectionAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`TimeSpan`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`FromSeconds`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`60`}),_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 player proves its seat with a token, good for 60 seconds, sent over your own networking.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockMultiplayerSessionJoinToken`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` token`}),_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:` session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`RequestJoinTokenAsync`}),_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 checks it and learns who the player is; a bad token throws MultiplayerInvalidJoinToken.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`string`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` playerId`}),_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:` session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`VerifyJoinTokenAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`tokenFromPlayer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`ينشر `,_jsx(_components.code,{children:`PublishDirectConnectionAsync(port)`}),` عنوان هذا الجهاز نفسه، ويختار `,_jsx(_components.code,{children:`connection.FindDirectAddressAsync()`}),`\nلدى اللاعب العنوان المناسب: العنوان المحلي للمضيف على شبكة مشتركة، وعنوانه العام فيما عدا ذلك. وخارج\nالشبكة المحلية لا يصل اللاعبون إلى ذلك العنوان إلا عبر منفذ مُوجَّه إلى المضيف.`]})]}),_jsxs(Tab,{title:`Unreal`,id:`unreal-4`,children:[_jsx(CodeBlock,{filename:``,numberOfLines:`23`,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:`23`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// The host says how to reach it: a mode of its own (32 characters at most) and the values it needs, under 4 KB.`})}),`\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:`PublishConnection`}),_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:`\"steam\"`}),_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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Set`}),_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:`\"lobby\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), LobbyId), `}),_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`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// A player waits for it: the session comes back with HasConnection(), HasEnded(), or neither when the time passes.`})}),`\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:`WaitForConnection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`60.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#B5CEA8`},children:`f`}),_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:`Waited`}),_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:` FString Lobby;`})}),`\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:`Waited`}),_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:` Waited`}),_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:`HasConnection`}),_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\":`#D4D4D4`},children:` \u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Waited`}),_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:`GetConnection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Mode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Equals`}),_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:`\"steam\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`ESearchCase`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::CaseSensitive)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Waited`}),_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:`GetConnection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Values`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`TryGetString`}),_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:`\"lobby\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), Lobby))`})]}),`\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:` JoinSteamLobby`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(Lobby);`})]}),`\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:`// The player proves its seat with a token, good for 60 seconds, sent over your own networking.`})}),`\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:`RequestJoinToken`}),_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:`FFlockMultiplayerSessionJoinToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Token`}),_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:`Token`}),_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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`SendToHost`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Token`}),_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:`Token`}),_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:`// The host checks it and learns who the player is; a bad token fails with MultiplayerInvalidJoinToken.`})}),`\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:`VerifyJoinToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(TokenFromPlayer, [`}),_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:`FString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`PlayerId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /* PlayerId.Value */`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`وينتهي Travel To Session كذلك بـ `,_jsx(_components.code,{children:`not_direct`}),` حين ينشر المضيف اتصالًا من نوعه الخاص، ويحمله في\n`,_jsx(_components.code,{children:`Connection`}),` ضمن النتيجة. وينشر `,_jsx(_components.code,{children:`PublishDirectConnection(Port)`}),` عنوان هذا الجهاز نفسه، ويختار\n`,_jsx(_components.code,{children:`FindDirectAddress`}),` لدى اللاعب العنوان المناسب: العنوان المحلي للمضيف على شبكة مشتركة، وعنوانه العام\nفيما عدا ذلك. وخارج الشبكة المحلية لا يصل اللاعبون إلى ذلك العنوان إلا عبر منفذ مُوجَّه إلى المضيف.`]}),_jsxs(_components.p,{children:[`وفي Blueprint هي `,_jsx(_components.strong,{children:`Flock Publish Connection`}),`، و`,_jsx(_components.strong,{children:`Flock Wait For Connection`}),` (تطلق On Connection أو\nOn Session Ended أو On Timed Out أو On Failure)، و`,_jsx(_components.strong,{children:`Flock Request Join Token`}),`، و`,_jsx(_components.strong,{children:`Flock Verify Join\nToken`}),`، و`,_jsx(_components.strong,{children:`Flock Publish Direct Connection`}),`، و`,_jsx(_components.strong,{children:`Flock Find Direct Address`}),`.`]})]})]})]})}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":"اتصال اللاعبين","description":"صِل بين لاعبي الجلسة عبر Netcode for GameObjects أو شبكة Unreal نفسها، ومن خلال وسيط Flock عند الحاجة.","href":"/ar/guides/connecting-players"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"بدء الشبكة","slug":"starting-the-netcode","depth":2,"children":[]},{"title":"عبر الوسيط، أو مباشرة","slug":"through-the-relay-or-directly","depth":2,"children":[{"title":"المسارات المباشرة","slug":"direct-paths","depth":3,"children":[]}]},{"title":"من ينضم","slug":"who-is-joining","depth":2,"children":[]},{"title":"حين يتغيّر المضيف","slug":"when-the-host-changes","depth":2,"children":[]},{"title":"شبكات أخرى","slug":"other-networking","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/qwacks/05763fd4e1d53e37/lang-toggle.js"],"subdomain":"qwacks","siteName":"Qwacks","title":"اتصال اللاعبين - Qwacks","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/guides/connecting-players","matchLevel":1},"ar":{"href":"/ar/guides/connecting-players","matchLevel":0}}},"lastModified":"2026-10-20T11:54:11.016Z","originalFileLocation":"ar/guides/connecting-players.mdx","locale":"ar"},"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=\"صِل بين لاعبي الجلسة عبر Netcode for GameObjects أو شبكة Unreal نفسها، ومن خلال وسيط Flock عند الحاجة.\">\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=\"اتصال اللاعبين - Qwacks\">\u003cmeta data-mint-head property=\"og:description\" content=\"صِل بين لاعبي الجلسة عبر Netcode for GameObjects أو شبكة Unreal نفسها، ومن خلال وسيط Flock عند الحاجة.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Qwacks\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.qwacks.com/ar/guides/connecting-players\">\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=%D8%A7%D9%84%D9%84%D8%B9%D8%A8+%D8%A7%D9%84%D8%AC%D9%85%D8%A7%D8%B9%D9%8A\u0026amp;title=%D8%A7%D8%AA%D8%B5%D8%A7%D9%84+%D8%A7%D9%84%D9%84%D8%A7%D8%B9%D8%A8%D9%8A%D9%86\u0026amp;description=%D8%B5%D9%90%D9%84+%D8%A8%D9%8A%D9%86+%D9%84%D8%A7%D8%B9%D8%A8%D9%8A+%D8%A7%D9%84%D8%AC%D9%84%D8%B3%D8%A9+%D8%B9%D8%A8%D8%B1+Netcode+for+GameObjects+%D8%A3%D9%88+%D8%B4%D8%A8%D9%83%D8%A9+Unreal+%D9%86%D9%81%D8%B3%D9%87%D8%A7%D8%8C+%D9%88%D9%85%D9%86+%D8%AE%D9%84%D8%A7%D9%84+%D9%88%D8%B3%D9%8A%D8%B7+Flock+%D8%B9%D9%86%D8%AF+%D8%A7%D9%84%D8%AD%D8%A7%D8%AC%D8%A9.\u0026amp;theme=c8444a292735843f142f05ff\u0026amp;signature=750f9c4bcbe51f27d831040c44e598a5b09bcc54898d34769eb71c0471ce0007\">\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=\"اتصال اللاعبين - Qwacks\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"صِل بين لاعبي الجلسة عبر Netcode for GameObjects أو شبكة Unreal نفسها، ومن خلال وسيط Flock عند الحاجة.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://qwacks.mintlify.app/_mintlify/api/og/v2?division=%D8%A7%D9%84%D9%84%D8%B9%D8%A8+%D8%A7%D9%84%D8%AC%D9%85%D8%A7%D8%B9%D9%8A\u0026amp;title=%D8%A7%D8%AA%D8%B5%D8%A7%D9%84+%D8%A7%D9%84%D9%84%D8%A7%D8%B9%D8%A8%D9%8A%D9%86\u0026amp;description=%D8%B5%D9%90%D9%84+%D8%A8%D9%8A%D9%86+%D9%84%D8%A7%D8%B9%D8%A8%D9%8A+%D8%A7%D9%84%D8%AC%D9%84%D8%B3%D8%A9+%D8%B9%D8%A8%D8%B1+Netcode+for+GameObjects+%D8%A3%D9%88+%D8%B4%D8%A8%D9%83%D8%A9+Unreal+%D9%86%D9%81%D8%B3%D9%87%D8%A7%D8%8C+%D9%88%D9%85%D9%86+%D8%AE%D9%84%D8%A7%D9%84+%D9%88%D8%B3%D9%8A%D8%B7+Flock+%D8%B9%D9%86%D8%AF+%D8%A7%D9%84%D8%AD%D8%A7%D8%AC%D8%A9.\u0026amp;theme=c8444a292735843f142f05ff\u0026amp;signature=750f9c4bcbe51f27d831040c44e598a5b09bcc54898d34769eb71c0471ce0007\">\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/ar/guides/connecting-players\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/ar/guides/connecting-players.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ar\" href=\"https://docs.qwacks.com/ar/guides/connecting-players\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.qwacks.com/guides/connecting-players\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.qwacks.com/guides/connecting-players\">\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/ar/guides/connecting-players#webpage\",\"url\":\"https://docs.qwacks.com/ar/guides/connecting-players\",\"name\":\"اتصال اللاعبين\",\"description\":\"صِل بين لاعبي الجلسة عبر Netcode for GameObjects أو شبكة Unreal نفسها، ومن خلال وسيط Flock عند الحاجة.\",\"dateModified\":\"2026-10-20T11:54:11.016Z\",\"isPartOf\":{\"@id\":\"https://docs.qwacks.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.qwacks.com/ar/guides/connecting-players#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.qwacks.com/ar/guides/connecting-players#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"اللعب الجماعي\",\"item\":\"https://docs.qwacks.com/ar/guides/multiplayer\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"اتصال اللاعبين\",\"item\":\"https://docs.qwacks.com/ar/guides/connecting-players\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.qwacks.com/ar/guides/connecting-players#article\",\"headline\":\"اتصال اللاعبين\",\"name\":\"اتصال اللاعبين\",\"description\":\"صِل بين لاعبي الجلسة عبر Netcode for GameObjects أو شبكة Unreal نفسها، ومن خلال وسيط Flock عند الحاجة.\",\"url\":\"https://docs.qwacks.com/ar/guides/connecting-players\",\"mainEntityOfPage\":{\"@id\":\"https://docs.qwacks.com/ar/guides/connecting-players#webpage\"},\"dateModified\":\"2026-10-20T11:54:11.016Z\",\"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,"pages":[{"title":"en","href":"/guides/connecting-players"}]},{"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"}},"tabs":[{"tab":"Qwacks","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/qwacks.svg","pages":[{"title":"Qwacks","href":"/ar/welcome"}]},{"tab":"Flock","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/flock.svg","groups":[{"group":"بدء الاستخدام","pages":[{"title":"Flock","href":"/ar/introduction"},{"title":"البداية السريعة","href":"/ar/quickstart"},{"title":"المصادقة","href":"/ar/authentication"}]},{"group":"المفاهيم","pages":[{"title":"الاستوديوهات والألعاب","href":"/ar/concepts/studios-and-games"},{"title":"الإصدارات","href":"/ar/concepts/versions"},{"title":"اللاعبون","href":"/ar/concepts/players"}]},{"group":"حزم التطوير","pages":[{"title":"حزمة تطوير Unity","href":"/ar/sdk/unity"},{"title":"حزمة تطوير Unreal","href":"/ar/sdk/unreal"}]},{"group":"الميزات","pages":[{"title":"اللاعبون والمصادقة","href":"/ar/guides/players-and-auth"},{"title":"ربط الحسابات","href":"/ar/guides/account-linking"},{"title":"بيانات اللاعب","href":"/ar/guides/player-data"},{"title":"الإنجازات","href":"/ar/guides/achievements"},{"title":"المتاجر والمخزون","href":"/ar/guides/shops-and-inventory"},{"title":"العملات والمحافظ","href":"/ar/guides/currencies-and-wallets"},{"title":"لوحات الصدارة","href":"/ar/guides/leaderboards"},{"title":"الشرائح","href":"/ar/guides/segments"},{"title":"إشعارات اللعبة","href":"/ar/guides/notifications"},{"title":"الحظر","href":"/ar/guides/bans"},{"title":"الإعدادات عن بُعد","href":"/ar/guides/remote-config"},{"title":"تحديثات اللعبة","href":"/ar/guides/game-patches"},{"title":"الأصول","href":"/ar/guides/assets"},{"title":"التحليلات والأحداث","href":"/ar/guides/analytics-and-events"},{"title":"تنبيهات المطوّرين","href":"/ar/guides/developer-alerts"}]},{"group":"اللعب الجماعي","pages":[{"title":"اللعب الجماعي","href":"/ar/guides/multiplayer"},{"title":"الفرق","href":"/ar/guides/parties"},{"title":"مطابقة اللاعبين","href":"/ar/guides/matchmaking"},{"title":"الجلسات","description":"لعبة واحدة: مضيف ولاعبوه ورمز انضمام.","href":"/ar/guides/sessions"},{"title":"اتصال اللاعبين","href":"/ar/guides/connecting-players"}]},{"group":"المرجع","pages":[{"title":"سجل التغييرات","description":"أبرز التغييرات في Flock وحزم التطوير الخاصة به.","href":"/ar/changelog"}]}]},{"tab":"Protokite","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/protokite.svg","pages":[{"title":"Protokite","href":"/ar/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":"/ar/data-duck/getting-started"}]}]}]},"title":"اتصال اللاعبين - 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"]}