[Freeciv-Dev] Re: packet_conn_ping_info and connections
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Andreas Røsdal wrote:
On Tue, 19 Oct 2004, Mike Kaufman wrote:
On Tue, Oct 19, 2004 at 02:33:27PM -0400, Jason Dorje Short wrote:
packet_conn_ping_info assumes there can be no more than MAX_NUM_PLAYERS
connections. Is this a safe assumption? It seems unlikely.
this is absolutely wrong.
sernet.h:
#define MAX_NUM_CONNECTIONS (2 * (MAX_NUM_PLAYERS + MAX_NUM_BARBARIANS))
the 2 there was put in by me, but it's really arbitrary. For a really
exciting game (league finals?), you might want to have a great many
observers. We might want to raise it sometime in the future.
Why should there be a limit to the number of connections? Also, why should
there be a limit to the number of players?
1. Assumptions in the code.
2. Limitations in the network code (arrays must be bounded).
If the first were fixed then MAX_NUM_PLAYERS could be made much larger.
MAX_NUM_CONNECTIONS could easily be larger. However without
redesigning the network packets or the core network code there must be
_some_ limitation.
The most common code assumption is that
MAX_NUM_PLAYERS+MAX_NUM_BARBARIANS<=32. 4-byte bitfields are used for
players. However this has been fixed in a number of places already.
jason
|
|