colyseus / proxy

🔀⚔ Proxy and Service Discovery for Colyseus 0.10 ~ 0.14 (Not recommended on 0.15+)
https://docs.colyseus.io/scalability/
MIT License
37 stars 25 forks source link

Add validation to prevent multiple deduction on same proxy #11

Closed mramadhanrh closed 3 years ago

mramadhanrh commented 3 years ago

currProxy variable could be turned into 0, but it happens randomly.

the culprit is that when crashing and then shutting down the server, that unregister function in proxy executed 2 times, and that made the proxy happen to deduct currProxy into minus value if there's only 2 proxy for example.