Skip to content

Commit

Permalink
Add alert to check if passthrough environment is active
Browse files Browse the repository at this point in the history
  • Loading branch information
sbanca committed Dec 19, 2024
1 parent d20bc4c commit 7b9f6a1
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 4 deletions.
9 changes: 9 additions & 0 deletions Assets/Prefabs/Panels/MultiplayerPanel.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,15 @@ MonoBehaviour:
m_FallbackState: 0
m_WaitForCompletion: 0
m_LocalVariables: []
m_AlertsPassThroughAcive:
m_TableReference:
m_TableCollectionName: GUID:c84355079ab3f3e4f8f3812258805f86
m_TableEntryReference:
m_KeyId: 156198200358006784
m_Key:
m_FallbackState: 0
m_WaitForCompletion: 0
m_LocalVariables: []
references:
version: 2
RefIds: []
Expand Down
18 changes: 17 additions & 1 deletion Assets/Scripts/GUI/MultiplayerPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class MultiplayerPanel : BasePanel
[SerializeField] private TextMeshPro m_AlertsErrors;
[SerializeField] private LocalizedString m_AlertsErrorBeginnerModeActive;
[SerializeField] private LocalizedString m_AlertsRoomAlreadyExistent;

[SerializeField] private LocalizedString m_AlertsPassThroughAcive;

private PlayerPrefsDataStore m_multiplayer;
private bool updateDisplay = false;
Expand Down Expand Up @@ -91,6 +91,7 @@ public void Awake()
alertChecks = new List<Func<Tuple<bool, string>>>
{
CheckAdvancedModeActive,
CheckIfPassThroughEnvironment,
CheckMultiplayerManagerErrors,
CheckIfRoomExist,
};
Expand Down Expand Up @@ -297,6 +298,21 @@ private Tuple<bool, string> CheckIfRoomExist()

}

// hardoded copied from LightingPopUpWindow
private const string PASSTHROUGH_GUID = "e38af599-4575-46ff-a040-459703dbcd36";
private Tuple<bool, string> CheckIfPassThroughEnvironment()
{

if (MultiplayerManager.m_Instance != null && MultiplayerManager.m_Instance.State == ConnectionState.IN_LOBBY)
{
TiltBrush.Environment targetEnvironment = SceneSettings.m_Instance.GetDesiredPreset();
if (targetEnvironment.m_Guid.ToString() == PASSTHROUGH_GUID)
return Tuple.Create(true, m_AlertsPassThroughAcive.GetLocalizedString());
}

return Tuple.Create(false, "");
}

private void Alerts()
{
if (m_AlertsErrors)
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Multiplayer/Photon/PhotonManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ public async Task<bool> JoinRoom(RoomCreateData roomCreateData)
//m_Runner.ReliableDataSendRate = 60;
//m_Runner.Config.Network.ReliableDataTransferModes = NetworkConfiguration.ReliableDataTransfers.ClientToClientWithServerProxy;


if (result.Ok)
{
// Verify if the room is actually full
Expand All @@ -163,6 +162,7 @@ public async Task<bool> JoinRoom(RoomCreateData roomCreateData)
State = ConnectionState.ERROR;
LastError = "[PhotonManager] Room is full.";
ControllerConsoleScript.m_Instance.AddNewLine(LastError);
Disconnect();
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3300,7 +3300,7 @@ MonoBehaviour:
m_Metadata:
m_Items: []
- m_Id: 156198200358006784
m_Key: ADMIN_PANEL_MULTIPLAYER_BUTTON_DESCRIPTION
m_Key: MULTIPLAYER_PANEL_ALERT_PASSTHROUGH_ACTIVE
m_Metadata:
m_Items: []
- m_Id: 157582826200739840
Expand Down Expand Up @@ -3427,6 +3427,10 @@ MonoBehaviour:
m_Key: MULTIPLAYER_PANEL_ALERT_ROOM_EXIST
m_Metadata:
m_Items: []
- m_Id: 313081115495178240
m_Key: MULTIPLAYER_PANEL_ALERT_PASSTHROUGH_EXIST
m_Metadata:
m_Items: []
m_Metadata:
m_Items: []
m_KeyGenerator:
Expand Down
5 changes: 5 additions & 0 deletions Assets/Settings/Localization/Strings/Strings_de.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3629,6 +3629,11 @@ MonoBehaviour:
beitreten.
m_Metadata:
m_Items: []
- m_Id: 156198200358006784
m_Localized: Schalten Sie den Passthrough-Modus aus, um den Mehrspielermodus
zu nutzen.
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
2 changes: 1 addition & 1 deletion Assets/Settings/Localization/Strings/Strings_en.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3521,7 +3521,7 @@ MonoBehaviour:
m_Metadata:
m_Items: []
- m_Id: 156198200358006784
m_Localized: Multiplayer (Alpha)
m_Localized: Switch off passthrough environment mode to use Multiplayer
m_Metadata:
m_Items: []
- m_Id: 238556149774557184
Expand Down
4 changes: 4 additions & 0 deletions Assets/Settings/Localization/Strings/Strings_es.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3600,6 +3600,10 @@ MonoBehaviour:
m_Localized: "La sala ya existe. Te unir\xE1s a una sesi\xF3n existente."
m_Metadata:
m_Items: []
- m_Id: 156198200358006784
m_Localized: Desactiva el modo de entorno de passthrough para usar el multijugador.
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
5 changes: 5 additions & 0 deletions Assets/Settings/Localization/Strings/Strings_fr.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3569,6 +3569,11 @@ MonoBehaviour:
m_Localized: "La salle existe d\xE9j\xE0. Vous allez rejoindre une session existante."
m_Metadata:
m_Items: []
- m_Id: 156198200358006784
m_Localized: "D\xE9sactivez le mode environnement de transparence pour utiliser
le multijoueur."
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
4 changes: 4 additions & 0 deletions Assets/Settings/Localization/Strings/Strings_ja.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3522,6 +3522,10 @@ MonoBehaviour:
m_Localized: "\u30EB\u30FC\u30E0\u306F\u65E2\u306B\u5B58\u5728\u3057\u307E\u3059\u3002\u65E2\u5B58\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u53C2\u52A0\u3057\u307E\u3059\u3002"
m_Metadata:
m_Items: []
- m_Id: 156198200358006784
m_Localized: "\u30DE\u30EB\u30C1\u30D7\u30EC\u30A4\u30E4\u30FC\u3092\u4F7F\u7528\u3059\u308B\u306B\u306F\u3001\u900F\u904E\u74B0\u5883\u30E2\u30FC\u30C9\u3092\u30AA\u30D5\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
5 changes: 5 additions & 0 deletions Assets/Settings/Localization/Strings/Strings_ko.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3590,6 +3590,11 @@ MonoBehaviour:
\uC138\uC158\uC5D0 \uCC38\uC5EC\uD569\uB2C8\uB2E4."
m_Metadata:
m_Items: []
- m_Id: 156198200358006784
m_Localized: "\uBA40\uD2F0\uD50C\uB808\uC774\uC5B4\uB97C \uC0AC\uC6A9\uD558\uB824\uBA74
\uD328\uC2A4\uC2A4\uB8E8 \uD658\uACBD \uBAA8\uB4DC\uB97C \uB044\uC138\uC694."
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
4 changes: 4 additions & 0 deletions Assets/Settings/Localization/Strings/Strings_zh.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3518,6 +3518,10 @@ MonoBehaviour:
m_Localized: "\u623F\u95F4\u5DF2\u5B58\u5728\u3002\u60A8\u5C06\u52A0\u5165\u4E00\u4E2A\u73B0\u6709\u7684\u4F1A\u8BDD\u3002"
m_Metadata:
m_Items: []
- m_Id: 156198200358006784
m_Localized: "\u5173\u95ED\u900F\u89C6\u73AF\u5883\u6A21\u5F0F\u4EE5\u4F7F\u7528\u591A\u4EBA\u6E38\u620F\u3002"
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []

0 comments on commit 7b9f6a1

Please sign in to comment.