Update of /cvsroot/netrek/client/netrekxp
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25812

Modified Files:
	NetrekXP to do list.C clientr.suo 
Log Message:
This massive patch solves most of the issues that prevented the client from
working on bronco and paradise servers simultaneously.  The end goal is to
remove all the #ifdef PARADISE defines and have a unified client.  These
patch notes will describe some of the obstacles, and what was done to work
around them.

Obstacles/Solutions:
1) One obstacle was the reliance on MAX* values in the client for things like
MAXPLAYER, MAXTORP, and MAXPHASER.  The solution was to copy the paradise client and define both a theoretical server maximum (i.e. MAXPLAYER) and then the actual value defined by the server (nplayers).  Thus, many checks in the code were changed to use these new dynamic variables.  MAXPLAYER is now 257 instead of 36.  But the default value for nplayers is 36, and will only be changed if the client receives a paradise game parameters packet.  So there is no impact on playing on bronco servers since the default value is always the same.  Likewise, ntorps, nplasmas and nphasers are now dynamic, with the default values being the bronco defaults.
2) Another obstacle was conflicting defines for some server packets.   Namely
SP_GENERIC_32/SP_MOTD_PIC and SP_FLAGS_ALL/SP_STATS2.  The solution was to treat these packets as having dynamic size, with the size being determined on whether the server is paradise or not.  One complication was that a paradise server will send the client a SP_STATS2 packet before it even acknowledges the client is paradise comptable, thus corrupting the data stream!  The solution is to treat all SP_FLAGS_ALL/SP_STATS2 packets as being SP_STATS2 if the login packet was not received yet (the login packet identifies whether the server is paradise or not).
3) Yet another obstacle was conflicting player flag states, namely PFOBSERV/PFWARP, and PFTWARP/PFSNAKE.  The solution was to change all checks in the code involving observers and twarp and paradise warp to check if the server is paradise or not.
4) A minor obstacle was overlapping p_whydead states between bronco and paradise.  Solved by a simple if (paradise) check.

General Changes:
1) Most #ifdef PARADISE removed and replaced, where necessary, by if (paradise)
checks.  Some areas which required more work were the planet window, rank window, motd paging and layout, initializing and sorting the playerlist.
2) Load all paradise bitmaps upon startup.
3) Struct ship updated to include fields the server has been sending via ship cap
packets but we have been ignoring.  Will be necessary for future changes to how
ship caps are handled.
4) Initialization of most data structs (players, torps, phasers, plasmas, teams)
now moved into their own functions rather than all being done in openmem().  In
paradise sometimes they need to be reinitialized, so this was necessary.
5) New funcion isMe() to check if a player X is me, or if I am an observer locked
onto player X.
6) Metaserver now lists paradise servers.
7) Added afterburner/warpprep/impulse indicator to the plain text dashboard.
8) Added a bunch of safety checks for many of the packet types.
9) Added a bunch of the new packet types to the print_packet function.
10) Removed unused compute_extension1_size()
11) Added load_default_teams().  It sets up the classic bronco teams into
a data structure called teaminfo.

Index: NetrekXP to do list.C
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -d -r1.161 -r1.162
--- NetrekXP to do list.C	13 Apr 2008 02:25:49 -0000	1.161
+++ NetrekXP to do list.C	16 Apr 2008 00:07:54 -0000	1.162
@@ -35,6 +35,7 @@
 6) Tractor on/off and pressor on/off option, rather than just tractor on, pressor on.
 Maybe with enforced state?
 7) Verbosity setting for logfile..phaser and torp warn messages can be very spammy.
+8) Make server packet for variable rank requirements like min offense.
 
 Paradise issues:
 1) Motd paging system gutted for sake of simplicity
@@ -43,10 +44,6 @@
 3) A bunch of gridline/zoom options should be made into netrekrc options.
 4) The galactic zoom doesn't work
 5) Some of the paradise packet types may need some work
-6) Many many places in code where things are based on MAXSOMETHING whether it be players
-torps planets plasmas.  Whereas paradise wants to use dynamic variables.  It's a
-mess.  And paradise has nphasers, the entire concept of multiple phasers
-per ship is not compliant with current code.
 7) Still missing asteroids and (flashing) warpbeacons.
 8) Show ratings on full/wide playerlist.
 9) CV army capacity is wrong - waiting on word from server experts to the right value
@@ -55,6 +52,7 @@
 13) Issue with phaser misses on latest paradise server? on whitestar at least
 14) Don't think there is gettarget support for astral bodies like nebulae and stars
 and black holes.  Might be an issue with macros.
+15) support variable # of ship types
 
 Wish list:
 1) Rewrite graphics engine using SDL

Index: clientr.suo
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
Binary files /tmp/cvsmWy1cQ and /tmp/cvskxMBsG differ