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

Update Ancient urban ruins compat #468

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

SokyranTheDragon
Copy link
Member

A recent update added a main tab for multi-floor map schedules to allow/disallow pawns from automatically going to specific floors at specific times of the day. There were also a couple of other features, but looks like this is the only one that needed syncing.

Because MP right now can't handle syncing pocket map world objects (fixed by rwmt/Multiplayer#504), a new sync worker for it needed to be added. However, since PocketMapParent would be synced implicitly by WorldObject sync worker, we need to skip the HasSyncWorker check as it would return true and gives us a warning.

I've added a HashSet<Type> that holds all types that were passed to this method, skipping execution if it already contained it. This ensures that sync workers skipping HasSyncWorker check will only be registered once at most, as well as preventing warnings that "sync worker exists in MP" if we attempt to register the same one 2 or more times. This will also ensure that warning due to MP having the sync worker and errors due to unsupported types will at most be displayed once per type.

A recent update added a main tab for multi-floor map schedules to allow/disallow pawns from automatically going to specific floors at specific times of the day. There were also a couple of other features, but looks like this is the only one that needed syncing.

Because MP right now can't handle syncing pocket map world objects, a new sync worker for it needed to be added. However, since `PocketMapParent` would be synced implicitly by `WorldObject` sync worker, we need to skip the `HasSyncWorker` check as it would return true and gives us a warning.

I've added a `HashSet<Type>` that holds all types that were passed to this method, skipping execution if it already contained it. This ensures that sync workers skipping `HasSyncWorker` check will only be registered 1 at most, as well as preventing warnings that "sync worker exists in MP" if we attempt to register the same one 2 or more times. This will also ensure that warning due to MP having the sync worker and errors due to unsupported types will at most be displayed once per type.
@notfood
Copy link
Member

notfood commented Sep 2, 2024

Registering the same sync worker multiple times

Which mods are causing this?

@notfood notfood merged commit 51e86ac into rwmt:master Sep 2, 2024
@SokyranTheDragon
Copy link
Member Author

Registering the same sync worker multiple times

Which mods are causing this?

At the moment, none. This was mostly done as a precaution for the future, as well as to try to avoid making mistakes with sync worker delegates that don't check for HasSyncWorker results, like here.

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

Successfully merging this pull request may close these issues.

2 participants