Skip to content

Bug fixes, code cleanup, and TPA teleport protection.#8

Open
cartman-2000 wants to merge 11 commits into
LeeIzaZombie:masterfrom
cartman-2000:master
Open

Bug fixes, code cleanup, and TPA teleport protection.#8
cartman-2000 wants to merge 11 commits into
LeeIzaZombie:masterfrom
cartman-2000:master

Conversation

@cartman-2000

@cartman-2000 cartman-2000 commented Dec 18, 2016

Copy link
Copy Markdown

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.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant