-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix some entities wrongly treated by server #2247
base: master
Are you sure you want to change the base?
Fix some entities wrongly treated by server #2247
Conversation
tornac1234
commented
Jan 7, 2025
- Fix random objects on the map having Constructables not being synced
- Fully treat SpawnRandom monobehaviours on server-side spawning
- Add a cache for prefab placeholder and SpawnRandom parsing, reducing parsing to less than a second (on my machine)
…rly deconstructed (starships and stuff)
…cache for prefab placeholder and SpawnRandom parsing
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.
CW review
NitroxServer-Subnautica/Resources/Parsers/PrefabPlaceholderGroupsParser.cs
Outdated
Show resolved
Hide resolved
NitroxServer-Subnautica/Resources/Parsers/PrefabPlaceholderGroupsParser.cs
Outdated
Show resolved
Hide resolved
NitroxServer-Subnautica/Resources/Parsers/PrefabPlaceholderGroupsParser.cs
Outdated
Show resolved
Hide resolved
NitroxServer-Subnautica/Resources/Parsers/PrefabPlaceholderGroupsParser.cs
Outdated
Show resolved
Hide resolved
NitroxServer-Subnautica/Resources/Parsers/PrefabPlaceholderGroupsParser.cs
Outdated
Show resolved
Hide resolved
NitroxServer-Subnautica/Resources/Parsers/PrefabPlaceholderGroupsParser.cs
Outdated
Show resolved
Hide resolved
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.
LGTM CW
} | ||
else if (typeTreeType.TypeHash.data.SequenceEqual(spawnRandomHash)) | ||
{ | ||
AssetsFileInstance assetFileInst = am.LoadBundleWithDependencies(assetPaths); |
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.
Unless I'm really reading this wrong isn't this the same as the AssetsFileInstance before the for loop? Why can't we reuse that rather than reloading the same file?
@@ -102,10 +102,26 @@ public bool ModifyConstructedAmount(ModifyConstructedAmount modifyConstructedAmo | |||
Log.Error($"Trying to modify the constructed amount of a non-registered object (GhostId: {modifyConstructedAmount.GhostId})"); | |||
return false; | |||
} | |||
|
|||
// Certain entities with a Constructable are just "regular" WorldEntities (e.g. starship boxes) and for simplicity we'll just not persist their progress | |||
// since their only use is to be deconstructed to give materials to players |
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.
Do we want to raise a ticket for someone to do this one day?
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.
That's up to you. I could definitely implement it in no time but it'd only be overkill/making the base system persistence a bit more confusing.