Repository navigation
Conversation
Co-authored-by: Claude <noreply@anthropic.com>
NutyoPR
marked this pull request as ready for review
November 12, 2026 22:14
Author
|
tested in game with 2 clients on 1.7.104: both clients find the export and report the same leader id, and it stays correct when the other player reconnects with a new id. haven’t tested handing leadership over yet, will update if i do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin API: expose the party leader
Adds
SkyrimTogetherGetPartyLeaderId, an optional export next toSkyrimTogetherRegisterScopedChannel, returning the party leader's player ID (0 while not in a party).Why: the party leader hosts the world's NPCs and quest scenes, so plugins that move NPCs or start scenes need to do it on the leader's client only. Today a plugin can only approximate that (e.g. "lowest player ID"), which picks the wrong client whenever the leader isn't the lowest ID, and changes after a reconnect. Enderal AllTogether https://github.com/NutyoPR/EnderalAllTogether needs this for patched quest scenes that otherwise move the same NPC on both clients and leave it frozen.
How: same pattern as scoped channels, nothing in the V1 vtable changes.
SkyrimTogetherAPI.h:GetPartyLeaderId_tandkGetPartyLeaderIdName, documented.PluginAPI.cpp: the export.PluginService: cachesPartyService::GetLeaderPlayerId()in the existing per-update snapshot (underm_lock, likem_inParty), so it's callable from any thread.plugin_api/README.md: a short "Party leader" section with a lookup example and fallback.Older executables simply don't have the symbol, so plugins fall back gracefully. No protocol change.
Tested: not yet in game; needs a build and a two-client check that both clients report the same leader ID and that it follows a leadership change.