-
Notifications
You must be signed in to change notification settings - Fork 103
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
Add option to disable connection events on filterscript load/unload #869
Add option to disable connection events on filterscript load/unload #869
Conversation
I'd just move this behaviour change into fixes component so it could be easily disabled as it already has a bunch of the other breaking stuff. It is more convenient to throw it all away at once if it's all in one place. |
I don‘t think moving that part to the Fixes component solves the issue. What if people use filterscripts which send messages when a player disconnects? Unloading the script to activate a new version would flood the chat and that can‘t be the intended behavior. Why not let people choose the behavior themselves by simply changing true to false inside their config file? |
Moreover it's in the current discussion here. |
There will be no toggle, no implementing in another component, or anything. The problem with this was not making sense due to the callback names making absolutely zero sense and conflicts with people's scripts. Thanks for your PR but it doesn't suit what our goals are, so I'm closing this. |
Since people still don't seem to be aware of this; open.mp is a direct continuation and successor of fixes.inc, fixes.inc 2.0 as it were. Complaints of "I like open.mp but not fixes.inc" make no sense, they're one and the same. We already had a buggy version of the server, it's called the SA:MP server, and if you like the bugs that's the version to use. However, I'm fine with options to disable things, for those who don't want to fix things, but that's usually for experienced coders with established scripts they don't/won't/can't update (the only ones who actually complain about having to update rather than just getting on with it and updating). New scripts and newbie scripters are the ones who need consistent behaviour, such as |
I don't know what came to your mind to write such a toxic reponse. Amir closed that pull request 5 days ago - what do you think that message will achieve? You may not have seen it, but the default behavior would've been the current, already implemented behavior. There is no reason to react overly emotional over a pull request. It got closed, Amir explained why and that's totally fine. |
"experienced coders with established scripts" is 99% of the remaining audience. |
I have re-read the response, and I am not sure which part you think is so aggressive. Maybe the end showed a little more frustration at the fact that I've had to explain this to some people dozens of times without them ever learning, but I did not intend any of the level of toxicity that you seem to have inferred. Sorry. As to what I hoped to achieve, I was just trying to provide the facts of why some things are the way they are; give some context that I can point others to in the future. The point was not to target this particular PR in any way, it just happened to be a convenient location to explain some things in a static location (rather than Discord, where the explanation has been lost countless times). Maybe a blog post would be better. |
The clear and transparent poll is the best place to refer and point to in the future.
Where did the
"Consistent" is when it is not fake called when players are already connected, only and exactly this way: player connected -> it is called, player did not -> it is not. |
My vote: disagree and commit to a solution the community is asking for. |
That's a perfectly reasonable argument. If they are already on the server, It is also worth considering this from a library writer's point of view. You have some per-player initialisation code run when a player connects. Let's say you move all that code in to a generic function called
If anyone has an actual technical reason as to why either of the first two behaviours are better for coders - simpler, more logical, less cognitive overhead, DRY, etc; I would love to hear them. Rather than just "it changed", which, yes, yes it did. As I said, I'd actually be fine with this PR. If for some reason you can't edit your filterscripts to remove per-player initialisation code on script init, then you can disable the feature, but I also don't believe that this entire argument is over more than two filterscripts in the world where that is the case. |
Rather depends on was the server restarted from gmx or not. When it was restarted without truing on/off, all connected clients received RPC GameModeRestart (40), fully simulating a reconnect on a clientside (clearing pools of everything created before, etc - so it really looks like reconnection) because it's reasonable when you changed gamemode/restarted the server that way. What we have when you decided to spoof the public calling every time it loads or unloads any filterscript? Right, mostly problems, because filterscripts are not gamemode and restarting the whole server (via gmx) not the same as (un)load random fs at runtime.
Exactly, it is worth considering from a scripter's point of view after this change. If he always did a fairly intuitive action in the form of a loop for all clients inside OnFilterScript(Init/Exit), doing something for already existing players if the filterscript was (un)loaded at runtime, and also intuitive per-player action for a really newly (dis)connected player, when the fs is already executing, inside OnPlayer(Connect/Disconnect), that's what he has now:
And in fact, these arguments are on the surface, you just need to discuss any such things before you introduce them without asking anyone, not after, when they are already in and people need to make the whole topics and polls thinking how they can revert this yet another poorly thought out change in behavior, which previously suited everyone and there was no request from anyone to change it at the default level. |
From my point of view, But changing that would come with the consequences you described: FilterScripts have to handle player initialization by looping through all players. Personally I see these options:
Option number two prevents the implementation of new callbacks which have to be called everytime a FilterScript gets (un)loaded and you don't have to implement the function in your codebase. |
Added a possibility to enable legacy behavior. Writing new callbacks seems overkill for me (people discussed that in the linked issue).
Option is called "game.use_filterscript_load_events". Naming can definitely be discussed.
Default is true, false for legacy behavior with no OnPlayerConnect/OnPlayerDisconnect calls when loading/unloading.
That could be an easy solution for #807 which defaults to new logic.