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

Clientprefs support #373

Open
ghost opened this issue Dec 19, 2022 · 4 comments
Open

Clientprefs support #373

ghost opened this issue Dec 19, 2022 · 4 comments
Assignees
Labels
backend Pull requests that update Go code enhancement New feature or request Sourcemod
Milestone

Comments

@ghost
Copy link

ghost commented Dec 19, 2022

Will there be support for clientprefs in the future?

For example there is the centerprojectiles plugin on uncletopia, if I want to keep it enabled I would have to enable it on every server I join.

I understand that this is using postreges which sourcemod also supports and I could just edit the database file for clientprefs.

@leighmacdonald leighmacdonald added the enhancement New feature or request label Dec 19, 2022
@leighmacdonald leighmacdonald self-assigned this Dec 19, 2022
@leighmacdonald
Copy link
Owner

I do plan to eventually support this, in a centralized manner, but its a bit more complicated than just pointing to our pg as that will only ever listen on localhost. Id prefer to implement this via the https api that we already use. Unfortunately all the salient clientprefs functionality is in an extension so its a bit more work to make happen.

@leighmacdonald leighmacdonald moved this to Planning/TODO in Uncletopia May 1, 2024
@leighmacdonald leighmacdonald added this to the v0.8.0 milestone May 17, 2024
@leighmacdonald leighmacdonald added the backend Pull requests that update Go code label May 17, 2024
@Gcommer
Copy link
Contributor

Gcommer commented May 21, 2024

Are you interested in a contribution here?

I feel it's something like:

  • Add clientprefs DB, and CRUD options to the website for users
  • Expose clientprefs via an HTTP API
  • Have sourcemod ping that API on user connect, and wire the results to relevant plugins

Assuming the prefs are small enough it honestly wouldn't be that bad to do push-based instead -- ie send all players' prefs to every server proactively. Maybe scp it every 5 minutes? With a binary file format it would likely be a few MB max.

@Gcommer Gcommer mentioned this issue May 21, 2024
@leighmacdonald
Copy link
Owner

leighmacdonald commented May 22, 2024

This was actually going to come up pretty soon, Once the sql admin stuff is in place, since it makes sense to also support this now using the same database. Database will be exposed with a limited privileged user bound only to the wireguard interface so im not too worried about it anymore. We didn't originally have this vpn network setup previously.

The plan i had was to basically just implement https://github.com/alliedmodders/sourcemod/blob/master/configs/sql-init-scripts/pgsql/clientprefs-pgsql.sql and use the built in clientprefs extension. I had no intentions of doing anything on the site itself, but it seems reasonable if you think there is some value to that. Feel free to tackle it if you want.

@Gcommer
Copy link
Contributor

Gcommer commented May 26, 2024

Awesome I got clientprefs pointing to my gbans psql instance and it works great with no changes to the tf2centerprojectiles plugin.

Wrote #536 based on that architecture. Other than that its probably just infra changes on your end to close this bug.

@leighmacdonald leighmacdonald moved this from Planning to In Progress in Uncletopia Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Pull requests that update Go code enhancement New feature or request Sourcemod
Projects
Status: In Progress
Development

No branches or pull requests

2 participants