RocketMod / Rocket.Unturned

Unturned 3 implementation of the RocketMod — .NET Game Server Plugin Framework
MIT License
83 stars 109 forks source link

Fixed Rocket returning a fake UnturnedPlayer reference. #66

Closed SomeCatIDK closed 6 years ago

SomeCatIDK commented 6 years ago

If someone were to specify the CSteamID of an offline or non-existent player, UnturnedPlayer.FromCSteamID will return a non-null UnturnedPlayer reference.

The PR will instead cause it to return a null reference.

(yes I know I screwed the commit message up :D)

CLAassistant commented 6 years ago

CLA assistant check
All committers have signed the CLA.

Trojaner commented 6 years ago

This will probably break some plugins

Edsparr commented 6 years ago

Can't wait xd

SomeCatIDK commented 6 years ago

Yeah, I can see where it could break some plugins, but I still think it would be useful.

Edsparr commented 6 years ago

Wouden't it just be better if you made a bool where it said if the player is offline?

SomeCatIDK commented 6 years ago

Possibly, but that would require changing the arguments or return type of this method, or creating a second.

fr34kyn01535 commented 6 years ago

I'd prefer a boolean on the player that says its offline. This would prevent using methods that require an IRocketPlayer when people are offline.