hengineer / CaptainsMess

A local multiplayer networking library for making games like Spaceteam in Unity
MIT License
184 stars 20 forks source link

Bug fix: maxConnections not changed #4

Closed AvinZarlez closed 8 years ago

AvinZarlez commented 8 years ago

Problem

maxConnections stays at the default value, 4, no matter what maxPlayers is set to.

Solution

Added SetMaxPlayers function that sets both maxPlayers variable as well as maxConnections.

In CaptainsMess, now calling that function rather than set directly. This enables games with more than 4 players.

Tested this fix in my game, seems to work.

Alternate Solutions?

Is maxPlayers redundant, should it be replaced by maxConnections?

Argument for keeping two variables:

Arguments for removing

I believe it makes sense to keep them separate, as I like the idea of adding a spectator mode to my game at some point.