SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
83 stars 17 forks source link

Vanish - packet sending #4430

Closed Harry5656 closed 4 weeks ago

Harry5656 commented 4 weeks ago

Hello! I'm going to make a player creator plugin which will let the player create their own character on rp server. To achieve this i wanna spawn a player in an empty room infront of bot which will have selected assets. Player could choose their hair, skin etc. Bot will be updated per every click on options.

What i need? I know how to summon a bot, but if more players join, they will see each other etc in the creator room.... So i wanna make a specific Vanish which will make them see only specific players (only their bot). To achieve this I wanna overwrite method which send level, especially player info to the others. I know that Provider class in its accept method does but there should be something like that in some update too. If I overwrite only accept it will be still sending these messages in update.

QUESTION. Dear Nelson, where can I find an update method which uses the netmessages things and sends these packets in which class?

GazziFX commented 4 weeks ago

look at PlayerManager.sendPlayerStates

Harry5656 commented 4 weeks ago

look at PlayerManager.sendPlayerStates Yup, I'll check it. I think i've done it already but didn't check yet. It was a long time ago and I dont remember clearly what was there exactly. I made a file txt with tons of methods to check. That's why I created this thread, just wanted to be sure what should check, i wanted to spend less time.

SDGNelson commented 4 weeks ago

Thanks GazziFX. Sorry to say, however, this isn't something that's officially supported because it will involve a lot of patching of vanilla code.

Harry5656 commented 4 weeks ago

But it's still possible