-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Nautilus compatibility for GameInput keybinds #2663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
bf6c7f9
18e71aa
e589582
743bbf5
cb6d14f
4098923
ed1ba8f
3b956de
1eb300b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -247,6 +247,41 @@ public void Dispose() | |
| serverRefreshCts.Dispose(); | ||
| WeakReferenceMessenger.Default.UnregisterAll(this); | ||
| watcher?.Dispose(); | ||
|
|
||
| // Stop all embedded servers when launcher closes | ||
| // Non-embedded servers are left running as they have their own console window | ||
| lock (serversLock) | ||
| { | ||
| List<Task> stopTasks = []; | ||
| foreach (ServerEntry server in servers) | ||
| { | ||
| if (server.IsOnline && server.IsEmbedded && server.Process != null) | ||
| { | ||
| try | ||
| { | ||
| Log.Info($"Stopping embedded server {server.Name} during launcher shutdown"); | ||
| stopTasks.Add(server.StopAsync()); | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| Log.Error(ex, $"Error stopping server {server.Name} during shutdown"); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Wait for all servers to stop with a timeout | ||
| if (stopTasks.Count > 0) | ||
| { | ||
| try | ||
| { | ||
| Task.WaitAll([.. stopTasks], TimeSpan.FromSeconds(30)); | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| Log.Error(ex, "Error waiting for servers to stop during shutdown"); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
Comment on lines
+250
to
285
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this code ever called? No debugger breakpoint hits on launcher exit. I think the code can be removed. MainWindowViewModel also already handles server exit. |
||
|
|
||
| public ServerEntry[] Servers | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,7 +77,7 @@ public static PropertyInfo Property<T>(Expression<Func<T, object>> expression) | |
| return (PropertyInfo)GetMemberInfo(expression); | ||
| } | ||
|
|
||
| private static MemberInfo GetMemberInfo(LambdaExpression expression, Type implementingType = null) | ||
| private static MemberInfo GetMemberInfo(LambdaExpression expression, Type? implementingType = null) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for improving this code. Added in #2674 in case your PR stays unmerged for a while. |
||
| { | ||
| Expression currentExpression = expression.Body; | ||
| while (true) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,12 +147,8 @@ private async Task CreateOrLoadPrefabCacheAsync(string nitroxCachePath) | |
| { | ||
| logger.ZLogWarning($"An error occurred while deserializing the prefab cache. Re-creating it: {ex.Message:@Error}"); | ||
| } | ||
| if (cache.HasValue) | ||
| if (cache.HasValue && cache.Value.Version == CACHE_VERSION) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for noticing this bug. Fixed in #2674 in case your PR stays unmerged for a while. |
||
| { | ||
| if (cache.Value.Version != CACHE_VERSION) | ||
| { | ||
| logger.ZLogInformation($"Found outdated cache ({cache.Value.Version}, expected {CACHE_VERSION})"); | ||
| } | ||
| prefabPlaceholdersGroupPaths = cache.Value.PrefabPlaceholdersGroupPaths; | ||
| randomPossibilitiesByClassId = cache.Value.RandomPossibilitiesByClassId; | ||
| groupsByClassId = cache.Value.GroupsByClassId; | ||
|
|
@@ -162,7 +158,14 @@ private async Task CreateOrLoadPrefabCacheAsync(string nitroxCachePath) | |
| // Fallback solution | ||
| else | ||
| { | ||
| logger.ZLogInformation($"Building cache, this may take a while..."); | ||
| if (cache.HasValue) | ||
| { | ||
| logger.ZLogInformation($"Found outdated cache ({cache.Value.Version}, expected {CACHE_VERSION}). Rebuilding cache, this may take a while..."); | ||
| } | ||
| else | ||
| { | ||
| logger.ZLogInformation($"Building cache, this may take a while..."); | ||
| } | ||
| // Get all prefab-classIds linked to the (partial) bundle path | ||
| string prefabDatabasePath = Path.Combine(options.Value.GetSubnauticaResourcesPath(), "StreamingAssets", "SNUnmanagedData", "prefabs.db"); | ||
| Dictionary<string, string> prefabDatabase = LoadPrefabDatabase(prefabDatabasePath); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,21 +87,13 @@ | |
| Condition="!Exists('$(OutputDirectory)')" | ||
| ContinueOnError="WarnAndContinue" /> | ||
|
|
||
| <!-- Copy in debug because some systems break when they don't use our assembly resolve to look inside lib folder --> | ||
| <!-- Copy (don't Move) so dependencies stay in output root. Some code paths load assemblies before/when AssemblyResolve runs or from contexts that don't use it (e.g. Release vs Debug), causing empty UI or missing types when DLLs are only in lib/. --> | ||
| <Copy SourceFiles="@(FilesToMove)" | ||
| DestinationFolder="$(OutputDirectory)" | ||
| OverwriteReadOnlyFiles="True" | ||
| SkipUnchangedFiles="True" | ||
| Retries="3" | ||
| RetryDelayMilliseconds="100" | ||
| Condition="'$(Configuration)' == 'Debug'" | ||
| ContinueOnError="ErrorAndContinue" /> | ||
|
|
||
| <!-- Move every matching files to OutputDirectory --> | ||
| <Move SourceFiles="@(FilesToMove)" | ||
| DestinationFolder="$(OutputDirectory)" | ||
| OverwriteReadOnlyFiles="True" | ||
| Condition="'$(Configuration)' == 'Release'" | ||
| ContinueOnError="ErrorAndContinue" /> | ||
|
Comment on lines
+90
to
97
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is intended behavior. Avalonia doesn't use our |
||
| </Target> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ namespace NitroxClient.MonoBehaviours.Gui.Input.KeyBindings.Actions; | |
|
|
||
| public class ChatKeyBindingAction : KeyBinding | ||
| { | ||
| public ChatKeyBindingAction() : base("Nitrox_Settings_Keybind_OpenChat", "y") { } | ||
| public ChatKeyBindingAction() : base("Nitrox_Settings_Keybind_OpenChat", "y", "dpad/up") { } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these universal across all unity controllers? Will it only work for say playstation but not Xbox? |
||
|
|
||
| public override void Execute(InputAction.CallbackContext _) | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert file changes. |
||
|
|
||
| <PropertyGroup> | ||
| <TargetFrameworks>net472;net10.0</TargetFrameworks> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Terminating the server on timeout can break server saving. I'd prefer we investigate why the server doesn't exit and fix instead of terminating it.
If you know how to trigger the bug, please create a new issue with steps. Then we fix this in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree, I think it could also help with speed of merging the prs. Here it feels like three prs in one