Skip to content
This repository has been archived by the owner on Dec 21, 2019. It is now read-only.

Fixed UnturnedPlayerManager.Ban() #72

Merged
merged 2 commits into from
Jul 17, 2018
Merged

Fixed UnturnedPlayerManager.Ban() #72

merged 2 commits into from
Jul 17, 2018

Conversation

Pustalorc
Copy link
Contributor

@Pustalorc Pustalorc commented Jul 17, 2018

It used Provider.ban(), which doesn't actually ban the player, only disconnects them from the server as if they were banned (Changed to SteamBlacklist.ban() which was correctly used for when the player was offline, but not when online).
Also changed var player = ((UnturnedUser)target).Player; for if (!(target is UnturnedUser user)) return false;.
Removed as well the second time it casted Target to UnturnedUser when the cast already had happened.

It used `Provider.ban()`, which doesn't actually ban the player, only disconnects them from the server as if they were banned (Changed to `SteamBlacklist.ban()` which was correctly used for when the player was offline, but not when online).
Also changed `var player = ((UnturnedUser)target).Player;` for `if (target is UnturnedUser user)`.
Removed as well the second time it casted Target to UnturnedUser when player was already defined.
Forgot `false` for `return;` and used `user.CSteamID` instead of `player.CSteamID`
@Trojaner Trojaner merged commit 7de7748 into RocketMod:master Jul 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants