TF2-DMB / CBaseNPC

Provides a friendly interface for plugins to use in order to create custom NPCs on the game Team Fortress 2
37 stars 6 forks source link

Gamedata - Auto updater #15

Open Kenzzer opened 2 years ago

Kenzzer commented 2 years ago

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 commented 2 years ago

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:

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 commented 2 years ago

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 commented 2 years ago

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.