-
Notifications
You must be signed in to change notification settings - Fork 2
update forward to work with bhoptimer 4.0 #22
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
base: main
Are you sure you want to change the base?
update forward to work with bhoptimer 4.0 #22
Conversation
|
What were you thinking for keeping backwards compatibility working, using Ill fix up the forward and redefinitions aswell just not sure how to keep the backwards compatibility up |
|
like i described over steam message, you will use after the already present includes keep in mind, this backwards compatibility would only be able to be done for people who are compiling the plugin themselves (as they should). there's not a way to have a pre-compiled plugin that does both versions, since we can check the version during compiling, based on the shavit include file. |
|
if you want to have pre-compiled plugins, now there would have to be one for pre-4.0, and one for 4.0+ |
|
@mourningsickness if you could sanity check this that would be great, worked fine on my lan as far as i can tell |
|
it worked because you have the shavit includes in your scripting folder. let me make some notes, one sec |
|
|
||
| #define API_BASE_URL "https://offstyles.tommyy.dev/api" | ||
|
|
||
| #undef REQUIRE_PLUGIN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the point of this line is to say the shavit includes are not required (so other timer users can also use this plugin) so the #include <shavit*> go after this.. move this undef line to line 6
|
|
||
| public void OnPluginStart() | ||
| { | ||
| if (SHAVIT_VERSION_MAJOR < 4) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this won't work if you don't have the shavit includes, better to do
#if defined SHAVIT_MAJOR_VERSION
~do the stuff for v4+~
#else
~do the backward compatibility stuff~
#endif
then you can also do the same for the foward itself (line 511) because you need different parameters depending on version.
|
this can actually be refactored into one single plugin that can check the cvar "shavit_version" in runtime, so we don't "need" the includes (though i think that's a good change), and you won't need two separate versions anyway. you can do this using a handle and HookConVarChange then GetConVarString to check what the timer sets it as, in realtime on the server. |
|
That convar string can be checked like this |
|
we spoke over steam some more. it'll be pretty cancer, but with a #define that takes variable inputs, this will be able to be done and keep backwards compatibility in one plugin, whether people compile it themselves or not (^: anything is possible with enough autism |
|
that should be everything, ill merge this later today after a private island gets it setup so i dont have to make sure they download the v3 branch |
the OnReplaySaved forward was tweaked in bhoptimer 4.0 and needs to be updated to not crash when a wr is achieved