Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tornac1234
Copy link
Collaborator

  • 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)

…cache for prefab placeholder and SpawnRandom parsing
@tornac1234 tornac1234 changed the title Fix Fix some entities wrongly treated by server Jan 7, 2025
Copy link
Collaborator

@Measurity Measurity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CW review

@Jannify Jannify linked an issue Jan 8, 2025 that may be closed by this pull request
Copy link
Member

@Jannify Jannify left a 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);
Copy link
Collaborator

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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fragments duplicate
5 participants