Open aviadmini opened 3 years ago
What do you propose?
Adding a null check and a warning about event not being processed by rocket component. It's debatably better than exceptions.
I currently do not know of a good solution. Somehow we'd need to ensure that rocket component UnturnedPlayerEvents
gets attached before OpenMod events are fired.
Maybe this is possible to do by reordering delegates in Provider.onServerConnected += OnPlayerConnected;
?
Sorry for my delay. Maybe it should just silently check for null.
That doesn't solve the inconsistency issue. Ideally we want both openmod and rocketmod to assign their delegates before this event fires. So that neither of them misses it
Here: https://github.com/SmartlyDressedGames/Legally-Distinct-Missile/blob/master/Rocket.Unturned/Events/UnturnedPlayerEvents.cs#L206-L212
In some cases when a player connects and an OpenMod plugin modifies player experience
UnturnedPlayerEvents.InternalOnExperienceChanged
throws NRE. I suspect it's because an instance ofUnturnedPlayerEvents
component hasn't been attached to the player yet.This could be fixed by adding a null check in the method but that's not a good solution because it would cause inconsistency in events.