Bug fixes, code cleanup, and TPA teleport protection.#8
Open
cartman-2000 wants to merge 11 commits into
Open
Conversation
…de code into the plugin and modified it to not "reset" the player's life stats when protection is active.
…enabled.). Fix NRE's when accepting/denying a player that is now longer on the server.
…ancel on moved feature for delay teleports(it will cancel the tpa if they've moved more than a certain distance after it was accepted.).
…delayed TPA request of of the teleporting player, if they enter a vehicle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes some of the bugs in the TPA plugin, cleans up the code, and adds a TPA teleport protection feature.
About the cleanup on the config class, you really only need to use the LoadDefaults() method to load default values in a List/array type of variable, other types of variables can have their default values set where they're declared. Deserialization will only use the default value that is declared in the class if it can't find a value for a variable in the configuration file, this also allows new variables to be defined in an old configuration file without coming up as null when the configuration file is loaded.
A TPA teleport protection feature has also been added that will toggle god mode on player for a set period of time to prevent players from TPA killing other players after they teleport to them. This feature is intended for PVE type servers primarily as the player would be unkillable for a time after they teleport to a player, with the feature active. The feature uses the god mode feature in Rocket's UnturnedPlayerFeatures player component class.
Edit: I ported the god code in Rocket into the plugin to create a custom version of it, that doesn't reset the player's life states to full when it's active.