Open cartman-2000 opened 4 years ago
Other ways that it could be done, without breaking plugins that use UnturnedPlayer.Teleport, would be to implement it in the Teleport method the position and rotation parameters, this doesn't allow it to work with /tphere though, and it wouldn't be compatible with failure messages, the other would be to bypass that altogether and plug directly into the SDG Player.teleportToLocation and Player.teleportToLocationUnsafe methods. The second method would still need plugins to update on their own with a code chnage to support an ability to bypass the clearance check (teleportToLocationUnsafe), With this PR as it is as of this comment, would only need plugins that use rocket's Teleport method to be recompiled, with no code change(if they don't care about supporting it.).
If you want to keep it backwards compatible, create an overload instead of adding a new parameter, like:
public bool Teleport(string nodeName)
public bool Teleport(string nodeName, bool blabla)
This is currently, with the least amount of modified code in UnturnedPlayer, but yes, this would still allow backwards compatibility with old plugins.
Uploaded commit for this, leaving the commands as they are though.
Modified the UnturnedPlayer.Teleport methods to allow bypass of the clearance check, and modified /home, /tp, and /tphere to make use for it for those that have internal Unturned admin.
Add teleport obstruction error messages to /tp and /tphere.
Added the ability to use a formatted location in the /tp command (eg. /tp (0, 0, 0) or /tp 0, 0, 0 )