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

Gamedata - Auto updater #15

Open
Kenzzer opened this issue Nov 16, 2021 · 3 comments
Open

Gamedata - Auto updater #15

Kenzzer opened this issue Nov 16, 2021 · 3 comments

Comments

@Kenzzer
Copy link
Collaborator

Kenzzer commented Nov 16, 2021

I haven't dug the question a whole lot, but it might be important to introduce a gamedata updater, especially considering our ext aims to be a big framework that lifts the gamedata off of plugins.

I have no idea whether gamedata updater is offered by sourcemod, or if we need to bring in curl / other dependency in.
But the end goal is to use https://raw.githubusercontent.com/TF2-DMB/CBaseNPC/master/gamedata/cbasenpc.txt as permanent download point.

@KitRifty
Copy link
Collaborator

I have no idea whether gamedata updater is offered by sourcemod

If talking about if it exposes some of its functionality publicly, it doesn't. Gamedata updating is handled by the updater extension, and it grabs all gamedata from its own URL which, obviously, we can't change. However we can look into how updater does it: https://github.com/alliedmodders/sourcemod/blob/1fbe5e1daaee9ba44164078fe7f59d862786e612/extensions/updater/extension.cpp

Basically, the general idea is this:

  • Create thread
  • Thread downloads gamedata
  • Checks old gamedata against new gamedata for any changes
    • If changes are detected, replace old gamedata.

If we use the gamedata directly in this repo, the only caveat to that is that there can be cases where the gamedata isn't updated immediately in this repo when a TF2 update happens. A PR might come in before added to the repo and server owners may try to use the updated gamedata from that PR, but the extension would immediately overwrite it. We could control this by a ConVar, either to completely disable the auto-updater or allow the updater url to be changed.

@Kenzzer
Copy link
Collaborator Author

Kenzzer commented Nov 16, 2021

We could control this by a ConVar, either to completely disable the auto-updater or allow the updater url to be changed.

While that would indeed solve the issue of your scenario. I do not think that's the right move to make, Sourcemod allows its auto updater to be disabled but it results in server owners forgetting to turn it back on, which causes a great deal of troubles when the next update comes around.
So I'm against any measures to disable the updater we would make.

Furthermore I believe Sourcemod allows gamedata(s) to be overriden thanks to a custom directory. This will require some edition to our gamedata, but that's the only viable solution I can see for this problem.

@KitRifty
Copy link
Collaborator

Furthermore I believe Sourcemod allows gamedata(s) to be overridden thanks to a custom directory. This will require some edition to our gamedata, but that's the only viable solution I can see for this problem.

I wasn't aware that gamedata could be overridden. I had to look it up, but you're right. And I don't think any changes to the current gamedata structure is needed to make this work.

For posterity's sake, gamedata can be overridden by placing gamedata in the custom subdirectory of the usual gamedata directory.

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

No branches or pull requests

2 participants