K 10
svn:author
V 8
wsimpson
K 8
svn:date
V 27
2008-03-18T18:12:11.217376Z
K 7
svn:log
V 1575
(PR#15729) player ordering changes bizarrely when you observe AI players
(PR#39665) set aifill 0 does not remove any ai players
(PR#40037) set aifill 30 has multiple problems
(PR#40149) [Tracking] aifill settings

Reported by (respectively):
  Jason Dorje Short <jdorje@users.sourceforge.net>
  Marko Lindqvist <cazfi74@gmail.com>
  Egor Vyscrebentsov <evyscr@murom.net>
  (me)
Patch by me.

This patch solves only some server-side problems.  Related client issues
will be resolved for each gui separately.

server/srv_main.c
   aifill()
     Slightly reorganized for improved execution efficiency.
     0 now removes all aifill() players.
     AI*n is used for the name, a form not usually allowed for other names,
     preventing (malicious) user confusion with an AI.
     Post-increment AI number, allowing AI*0 to match Team 0.  Since most
     calls are after 1 connection, will be AI*1 to match Team 1, etc.

server/connecthand.c
   attach_connection_to_player()
     Select first uncontrolled player, instead of trying to add another user,
     solving the reported problems with aifill 30.  Has the display advantage
     that humans will now be grouped at the top of listings.
     Remove aifill() call; most calls here don't need it, or are inside a
     loop that makes needless repeated calls.  Instead, added elsewhere
     following the call, as appropriate.

server/stdinhand.c
   create_ai_player()
     Select first uncontrolled player, instead of trying to add another user,
     solving the reported problems with aifill 30.

Other miscellaneous cleanup.

END
