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

UCL improvements #99

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

Conversation

thecraftianman
Copy link

@thecraftianman thecraftianman commented Aug 5, 2024

NOTE: This change also requires the matching ULX pull request to avoid breakage: TeamUlysses/ulx#226

This PR has two main changes that impact UCL:

  • UCL networking updates no longer resend all player and group data at once; instead, only the data for the applicable player/group will be networked to users upon an update
    • To facilitate this, two new clientside functions have been added: ucl.updateClientUCLPlayer( id, data ) and ucl.updateClientUCLGroup( name, data )
  • ucl.authed now uses SteamID64 internally instead of UniqueID
    • All functions that have been impacted by this change now support SteamID64 as a parameter as well, but all of this can be reverted if just using SteamID would be preferred

Tested both in a local server and on a public server for a couple weeks now with no regressions found.

A couple uses of UniqueID in functions have been kept for backwards compatibility, but honestly I'm not sure if those need to remain either
@Reycko
Copy link

Reycko commented Oct 23, 2024

Won't this break ULX extensions that access ucl.authed?
ULib.ucl.authed[player:UniqueID()] wouldn't work anymore on those.

@thecraftianman
Copy link
Author

That's true, I assumed that there was no need for other addons to access that table directly when I wrote this. Maybe it could just be able to use multiple player identifiers as a key like ULib.ucl.users instead?

Copy link

@JarosLucky JarosLucky left a comment

Choose a reason for hiding this comment

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

Hey, without call PLAYER:UniqueID() somehere in PlayerInitialSpawn before PLAYER.query. Hook call PlayerInitialSpawn sendAutocompletes, gives instant error.

@Reycko
Copy link

Reycko commented Nov 23, 2024

Won't this break ULX extensions that access ucl.authed? ULib.ucl.authed[player:UniqueID()] wouldn't work anymore on those.

Thought about it for a bit, got an idea for a (sorta) compatibility fix:

Using a metatable, we can make __newindex give/set SteamIDs internally even when UniqueIDs are passed.
Not sure about __index (getter), though.

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.

3 participants