EnhancedNetwork / TownofHost-Enhanced

TOHE is the best Host-Only mod for anyone who wants to change their Among Us Experience!
https://tohe.weareten.ca
GNU General Public License v3.0
79 stars 68 forks source link

Cached RpcCloseVent #1197

Closed NikoCat233 closed 4 days ago

NikoCat233 commented 3 weeks ago

Previously RpcCloseVent is sent by host at every fixed update to every block vent players I add some codes to send the close vent only when the closest vent to a player changed.

Sorry I merged latest dev 2.1.0 into my branch. Just check the last commit

Known issues: if players in a game is too little (like only 2-3 players) then the amount of vents that can be closed to a player is the player count in that game. So if we get too little players, some may still be able to vent before host could update the close vent calls

Tommy-XL commented 1 week ago

This code is designed for the fact that some ventilation will be blocked? for example by new role

NikoCat233 commented 1 week ago

Nope This code is here to stop the fact that vents is being serialized 30 times a second

NikoCat233 commented 1 week ago

I think it can be moved into fixed update low load