Skip to content

Commit

Permalink
Address request changes and bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannify committed May 10, 2024
1 parent cfbe84c commit 4a037fe
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 39 deletions.
15 changes: 6 additions & 9 deletions Nitrox.Assets.Subnautica/LanguageFiles/en.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"Nitrox_AddServer": "Add Server",
"Nitrox_AddServer_NameDescription": "Name:",
"Nitrox_AddServer_AddressDescription": "Host:",
"Nitrox_AddServer_PortDescription": "Port:",
"Nitrox_AddServer_NamePlaceholder": "Enter a name for the server",
"Nitrox_AddServer_AddressPlaceholder": "Enter the IP or address of the server",
"Nitrox_AddServer_PortPlaceholder": "Enter the numeric port of the server",
"Nitrox_AddServer_Confirm": "Create server",
"Nitrox_AddServer_Back": "Back",
"Nitrox_AddServer_InvalidInput": "You input is invalid. Please check if all text boxes are filled out.",
"Nitrox_AddServerAdd": "Add",
"Nitrox_AddServerHost": "Host:",
"Nitrox_AddServerName": "Name:",
"Nitrox_AddServerPort": "Port:",
"Nitrox_BuildingDesyncDetected": "Server detected a desync with the local client's buildings (go to Nitrox settings to request a resync)",
"Nitrox_BuildingSettings": "Base building",
"Nitrox_Cancel": "Cancel",
"Nitrox_CommandNotAvailable": "This command is not available in Nitrox",
"Nitrox_ConnectTo": "Connect to",
Expand Down
1 change: 0 additions & 1 deletion NitroxClient/GameLogic/Settings/NitroxSettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ private void MakeSettings()
BuildingHandler.Main.AskForResync();
}
}));
MainMenuServerListPanel.Main.RefreshServerEntries();

AddSetting("Nitrox_BuildingSettings", new Setting("Nitrox_SafeBuilding", NitroxPrefs.SafeBuilding, safe => NitroxPrefs.SafeBuilding.Value = safe));
AddSetting("Nitrox_BuildingSettings", new Setting("Nitrox_SafeBuildingLog", NitroxPrefs.SafeBuildingLog, safeLog => NitroxPrefs.SafeBuildingLog.Value = safeLog));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Collections;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using NitroxClient.Communication.Abstract;
using NitroxClient.Communication.Exceptions;
Expand Down Expand Up @@ -100,7 +99,6 @@ private static void SessionConnectionStateChangedHandler(IMultiplayerSessionConn
}
}

[SuppressMessage("Usage", "DIMA001:Dependency Injection container is used directly")]
public static async Task StartMultiplayerClientAsync(string ip, int port)
{
serverIp = ip;
Expand Down Expand Up @@ -147,7 +145,6 @@ public static async Task StartMultiplayerClientAsync(string ip, int port)
}
}

[SuppressMessage("Usage", "DIMA001:Dependency Injection container is used directly")]
public static void StopMultiplayerClient()
{
if (!multiplayerClient || !Multiplayer.Main)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private static void OnCancelClick()

public void UpdatePanelValues(string ip, string playerName, Vector3 hsb)
{
header.text = $" {Language.main.Get("Nitrox_JoinServer")}{ip}";
header.text = $" {Language.main.Get("Nitrox_JoinServer")} {ip}";
playerNameInputField.text = playerName;
colorPicker.SetHSB(hsb);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ public void Setup(GameObject savedGamesRef)

CreateAddServerButton();
LoadSavedServers();
_ = FindLANServersAsync();
FindLANServersAsync().ContinueWith(t =>
{
if (t is { IsFaulted: true, Exception: { } ex })
{
Log.Warn($"Failed to execute FindLANServersAsync: {ex.GetFirstNonAggregateMessage()}");
}
});
}

public bool OnButtonDown(GameInput.Button button)
Expand Down Expand Up @@ -272,6 +278,12 @@ public void RefreshServerEntries()

CreateAddServerButton();
LoadSavedServers();
_ = FindLANServersAsync();
FindLANServersAsync().ContinueWith(t =>
{
if (t is { IsFaulted: true, Exception: { } ex })
{
Log.Warn($"Failed to execute FindLANServersAsync: {ex.GetFirstNonAggregateMessage()}");
}
});
}
}
2 changes: 1 addition & 1 deletion NitroxModel/Core/NitroxServiceLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private static T LocateServicePreLifetimeAndRegister()
/// <summary>
/// Invalidates the cache for type <see cref="T" />. The next <see cref="Value" /> access will request from <see cref="NitroxServiceLocator" /> again.
/// </summary>
public static void Invalidate(object _, EventArgs __)
private static void Invalidate(object _, EventArgs __)
{
value = null;
LifetimeScopeEnded -= Invalidate;
Expand Down

This file was deleted.

0 comments on commit 4a037fe

Please sign in to comment.