Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26979/include Modified Files: data.h packets.h struct.h Log Message: First pass at generic 32 version b support. Known issues: doesn't pass version b to server via value field yet. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.100 retrieving revision 1.101 diff -u -d -r1.100 -r1.101 --- data.h 19 Apr 2008 20:03:00 -0000 1.100 +++ data.h 12 Jul 2008 03:49:45 -0000 1.101 @@ -833,4 +833,6 @@ extern int mapscaleFactor; /* allows for scaling of galactic window, unused */ extern int fullBitmapRotation; /* draw old bitmap sets to all angles */ extern int hideConsole; /* show console window or not */ + +extern struct context *context; #endif /* _h_data */ Index: packets.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/packets.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- packets.h 8 Jul 2008 02:00:46 -0000 1.13 +++ packets.h 12 Jul 2008 03:49:45 -0000 1.14 @@ -903,21 +903,44 @@ unsigned short s_bitmap; }; +#define GENERIC_32_LENGTH 32 struct generic_32_spacket { - char type; /* SP_GENERIC_32 */ - char version; /* alphabetic */ - short repair_time; /* server estimate of repair time in seconds */ - short pl_orbit; /* what planet player orbiting, -1 if none */ - char pad1[26]; + char type; + char version; /* alphabetic, 0x60 + version */ + u_short repair_time; /* server estimate of repair time, seconds */ + char pl_orbit; /* what planet player orbiting, -1 if none */ + u_short gameup; /* server status flags */ + u_char tournament_teams; /* what teams are involved */ + u_char tournament_age; /* duration of t-mode so far */ + char tournament_age_units; /* units for above, see s2du */ + u_char tournament_remain; /* remaining INL game time */ + char tournament_remain_units; /* units for above, see s2du */ + u_char starbase_remain; /* starbase reconstruction, mins */ + u_char team_remain; /* team surrender time, seconds */ + char pad1[18]; }; -#define GENERIC_32_VERSION 'a' -#define GENERIC_32_LENGTH 32 +#define GENERIC_32_VERSION_B 2 +#define GENERIC_32_VERSION GENERIC_32_VERSION_B /* default */ -/* versioning instructions: we start with version 'a', and each time a - field is added increment the version and reduce the pad size, - keeping the packet the same size ... client is entitled to trust - fields in struct that were defined at a particular version. +/* SP_GENERIC_32 versioning instructions: + + we start with version 'a', and each time a structure is changed + increment the version and reduce the pad size, keeping the packet + the same size ... + + client is entitled to trust fields in struct that were defined at a + particular version ... + + client is to send CP_FEATURE with SP_GENERIC_32 value 1 for version + 'a', value 2 for version 'b', etc ... + + server is to reply with SP_FEATURE with SP_GENERIC_32 value set to + the maximum version it supports (not the version requested by the + client), ... + + server is to send SP_GENERIC_32 packets of the highest version it + knows about, but no higher than the version the client asks for. */ struct flags_all_spacket Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- struct.h 19 Apr 2008 16:22:56 -0000 1.28 +++ struct.h 12 Jul 2008 03:49:45 -0000 1.29 @@ -939,4 +939,17 @@ struct cons_buffer * next; }; -#endif /* _h_struct */ +// Game context variables, sent in generic_32 packet +struct context +{ + u_short gameup; /* server status flags */ + u_char tournament_teams; /* what teams are involved */ + u_char tournament_age; /* duration of t-mode so far */ + char tournament_age_units; /* units for above, see s2du */ + u_char tournament_remain; /* remaining INL game time */ + char tournament_remain_units; /* units for above, see s2du */ + u_char starbase_remain; /* starbase reconstruction, mins */ + u_char team_remain; /* team surrender time, seconds */ +}; + +#endif /* _h_struct */ \ No newline at end of file