Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs16:/tmp/cvs-serv30344/include Modified Files: data.h defs.h packets.h proto.h struct.h Log Message: Add new #define PARADISE for trying to add support for paradise servers. There are some issues that make bronco and paradise not compatable, namely overlapping definitions of packet types (see CP_PLANET or GENERIC_32). Also paradise uses a different set of global constants (GWIDTH and MAXPLAYER come to mind as the biggest changes). So for now, for testing with paradise, I will simply flip the PARADISE define in config.h. Added in the paradise packet types and packet handlers. The actual functionality is commented out, it needs a lot more work. Client is able to connect to paradise server with no broken packet types, so that's a good start. Don't save INL servers in UDP metacache. Rename xtrekrc to netrekrc.txt in the help window. Index: defs.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/defs.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- defs.h 28 Apr 2007 12:09:50 -0000 1.24 +++ defs.h 16 May 2007 00:05:11 -0000 1.25 @@ -8,6 +8,32 @@ #include "copyright.h" +#ifdef PARADISE +/* defs for updatePlayer [BDyess] */ +#define NO_UPDATE 0 +#define SMALL_UPDATE 1 /* update non-blk_bozo players */ +#define LARGE_UPDATE 2 /* update blk_bozo players */ +#define ALL_UPDATE (SMALL_UPDATE|LARGE_UPDATE) /* update both */ + +/* defs for terrain */ +#define TERRAIN_STARTED 1 +#define TERRAIN_DONE 2 + +/* defs for timer [BDyess] */ +#define T_NONE 0 /* no timer */ +#define T_DAY 1 /* time of day */ +#define T_SERVER 2 /* time on server */ +#define T_SHIP 3 /* time in ship */ +#define T_USER 4 /* user reset timer */ +#define T_TOTAL 5 /* number of T_ defs */ +#define TIMESTRLEN 10 /* used in db_timer(), timeString() */ + +/* defs for mapmode */ +#define GMAP_NEVER 0 +#define GMAP_FREQUENT 1 +#define GMAP_INFREQUENT 2 +#endif /* PARADISE */ + /* Error handling */ #define RETURNBASE 10 @@ -18,13 +44,19 @@ #define MAX_MACRO 500 #endif -#ifndef MAXPLAYER -#define MAXPLAYER 36 /* Defined in config.h as well */ +#ifdef PARADISE +#define MAXPLAYER 257 +#else +#define MAXPLAYER 36 #endif #define TESTERS 4 /* Priveledged slots for * robots and game 'testers' */ +#ifdef PARADISE +#define MAXPLANETS 60 +#else #define MAXPLANETS 40 +#endif #define MAXTORP 8 #define MAXPLASMA 1 #define PKEY 128 @@ -44,9 +76,12 @@ #define DESIRED_TIC_LEN 10 /* for desired heading */ /* These are configuration definitions */ - +#ifdef PARADISE +#define GWIDTH 200000 +#else #define GWIDTH 100000 /* galaxy is 100000 spaces * on a side */ +#endif #define SCALE 40 /* Window will be one pixel for these # spaces */ #define WARP1 20 /* warp one will move 20 Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- data.h 14 May 2007 02:56:38 -0000 1.84 +++ data.h 16 May 2007 00:05:11 -0000 1.85 @@ -37,6 +37,9 @@ extern struct torp *torps; extern struct plasmatorp *plasmatorps; extern struct status *status; +#ifdef PARADISE +extern struct status2 *status2; +#endif extern struct ship *myship; extern struct stats *mystats; extern struct planet *planets; @@ -95,6 +98,10 @@ extern int warncount; extern int warntimer; extern int infomapped; +extern void *infothing; /* infow contents [BDyess] */ +extern int infoupdate; /* update flag for infow [BDyess] */ +extern int infotype; /* type of info thing [BDyess] */ +extern int scanmapped; /* ATM - scanner stuff */ extern int mustexit; extern int messtime; extern int keepPeace; Index: packets.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/packets.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- packets.h 25 Apr 2007 06:50:41 -0000 1.7 +++ packets.h 16 May 2007 00:05:12 -0000 1.8 @@ -68,9 +68,10 @@ #define SP_RESERVED 25 /* for future use */ #define SP_PLANET_LOC 26 /* planet name, x, y */ -/* NOTE: not implemented */ +#ifdef PARADISE #define SP_SCAN 27 /* ATM: results of player * scan */ +#endif #define SP_UDP_REPLY 28 /* notify client of UDP * status */ @@ -83,8 +84,19 @@ * verification */ #endif +#ifdef PARADISE +#define SP_MOTD_PIC 32 /* motd bitmap pictures */ +#define SP_STATS2 33 /* new stats packet */ +#define SP_STATUS2 34 /* new status packet */ +#define SP_PLANET2 35 /* new planet packet */ +#define SP_NEW_MOTD 36 /* New MOTD info notification uses */ +#define SP_THINGY 37 /* thingy location */ +#define SP_THINGY_INFO 38 /* thingy status */ +#else #define SP_GENERIC_32 32 /* 32 byte generic, see struct */ #define SP_FLAGS_ALL 33 /* abbreviated flags for all players */ +#endif + #define SP_SHIP_CAP 39 /* Handles server ship mods */ #ifdef SHORT_PACKETS @@ -110,6 +122,18 @@ #define SP_S_8_TORP 49 /* optimized SP_S_TORP */ #define SP_S_PLANET 50 /* see SP_PLANET */ +#ifdef PARADISE +#define SP_GPARAM 51 /* game params packet */ +/* the following is a family of packets with the same type, but a + discriminating subtype */ +#define SP_PARADISE_EXT1 52 +#define SP_PE1_MISSING_BITMAP 0 +#define SP_PE1_NUM_MISSILES 1 +/* end of packet 52 subtypes */ +#define SP_TERRAIN2 53 /* Terrain packets */ +#define SP_TERRAIN_INFO2 54 /* Terrain info */ +#endif + /* S_P2 */ #define SP_S_SEQUENCE 56 /* SP_SEQUENCE for * compressed packets */ @@ -1095,3 +1119,180 @@ }; #endif + +#ifdef PARADISE +/* Shapes of thingys. It would be best to add to the end of this list and + try to coordinate your additions with other hackers. */ +enum thingy_types { + SHP_BLANK, SHP_MISSILE, SHP_BOOM, SHP_TORP, SHP_PLASMA, SHP_MINE, + SHP_PBOOM, SHP_FIGHTER, SHP_WARP_BEACON, SHP_FBOOM, SHP_DBOOM +}; + +struct thingy_info_spacket { + char type; /* SP_THINGY_INFO */ + char war; + unsigned short shape; /* a thingy_types */ + unsigned short tnum; + unsigned short owner; +}; + +struct thingy_spacket { + char type; /* SP_THINGY */ + char dir; + unsigned short tnum; + LONG x, y; +}; + +/* terrain info for Paradise terrain */ +/* 5/16/95 rpg */ + +struct terrain_info_packet2 { + char type; /* SP_TERRAIN_INFO2 */ + char pad; + unsigned short pad2; + unsigned short xdim; + unsigned short ydim; +}; + +struct terrain_packet2 { + char type; /* SP_TERRAIN2 */ + char sequence; + char total_pkts; + char length; + char terrain_type[128]; /* Ugh... this needs to be fixed 5/16/95 rpg */ + /* unsigned short terrain_alt1[128]; */ + /* unsigned short terrain_alt2[128]; */ +}; + +struct scan_spacket { /* ATM */ + char type; /* SP_SCAN */ + char pnum; + char success; + char pad1; + LONG p_fuel; + LONG p_armies; + LONG p_shield; + LONG p_damage; + LONG p_etemp; + LONG p_wtemp; +}; + +struct motd_pic_spacket { + char type; /* SP_MOTD_PIC */ + char pad1; + unsigned short x, y, page; + unsigned short width, height; + char bits[1016]; +}; + + /* This is used to send paradise style stats */ +struct stats_spacket2 { + char type; /* SP_STATS2 */ + char pnum; + char pad1; + char pad2; + + LONG genocides; /* number of genocides participated in */ + LONG maxkills; /* max kills ever * 100 */ + LONG di; /* destruction inflicted for all time * 100 */ + LONG kills; /* Kills in tournament play */ + LONG losses; /* Losses in tournament play */ + LONG armsbomb; /* Tournament armies bombed */ + LONG resbomb; /* resources bombed off */ + LONG dooshes; /* armies killed while being carried */ + LONG planets; /* Tournament planets conquered */ + LONG tticks; /* Tournament ticks */ + /* SB/WB/JS stats are entirely separate */ + LONG sbkills; /* Kills as starbase */ + LONG sblosses; /* Losses as starbase */ + LONG sbticks; /* Time as starbase */ + LONG sbmaxkills; /* Max kills as starbase * 100 */ + LONG wbkills; /* Kills as warbase */ + LONG wblosses; /* Losses as warbase */ + LONG wbticks; /* Time as warbase */ + LONG wbmaxkills; /* Max kills as warbase * 100 */ + LONG jsplanets; /* planets assisted with in JS */ + LONG jsticks; /* ticks played as a JS */ + LONG rank; /* Ranking of the player */ + LONG royal; /* royaly, specialty, rank */ +}; + + /* status info for paradise stats */ +struct status_spacket2 { + char type; /* SP_STATUS2 */ + char tourn; + char pad1; + char pad2; + unsigned int dooshes; /* total number of armies dooshed */ + unsigned int armsbomb; /* all t-mode armies bombed */ + unsigned int resbomb; /* resources bombed */ + unsigned int planets; /* all t-mode planets taken */ + unsigned int kills; /* all t-mode kills made */ + unsigned int losses; /* all t-mode losses */ + unsigned int sbkills; /* total kills in SB's */ + unsigned int sblosses; /* total losses in Sb's */ + unsigned int sbtime; /* total time in SB's */ + unsigned int wbkills; /* kills in warbases */ + unsigned int wblosses; /* losses in warbases */ + unsigned int wbtime; /* total time played in wb's */ + unsigned int jsplanets; /* total planets taken by jump ships */ + unsigned int jstime; /* total time in a jump ship */ + unsigned int time; /* t mode time in this game */ + unsigned int timeprod; /* t-mode ship ticks--sort of like */ +}; + + + /* planet info for a paradise planet */ +struct planet_spacket2 { + char type; /* SP_PLANET2 */ + char pnum; /* planet number */ + char owner; /* owner of the planet */ + char info; /* who has touched planet */ + LONG flags; /* planet's flags */ + LONG timestamp; /* timestamp for info on planet */ + LONG armies; /* armies on the planet */ +}; + +struct obvious_packet { + char type; /* SP_NEW_MOTD */ + char pad1; /* CP_ASK_MOTD */ +}; + +struct paradiseext1_spacket { + char type; + char subtype; + short pad; +}; + +struct pe1_missing_bitmap_spacket { + char type; + char subtype; + + short page; + + short x, y; + short width, height; +}; + +struct pe1_num_missiles_spacket { + char type; /* SP_PARADISE_EXT1 */ + char subtype; /* SP_PE1_NUM_MISSILES */ + + short num; /* number of missiles */ +}; + +struct scan_cpacket { /* ATM */ + char type; /* CP_SCAN */ + char pnum; + char pad1; + char pad2; +}; + +struct gameparam_spacket { + char type; + char subtype; /* this packet is not real */ + /* generic game parameter packet */ + int pad; +}; + +#endif Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- struct.h 10 Apr 2007 00:44:02 -0000 1.18 +++ struct.h 16 May 2007 00:05:13 -0000 1.19 @@ -44,6 +44,35 @@ unsigned LONG timeprod; }; +#ifdef PARADISE +struct status2 { /* paradise status struct */ + int active; /* for interfacing with people who */ + unsigned int wait, count; /* want to get into the game */ + unsigned int number, request, answer; + unsigned char tourn; /* Tournament mode? */ + unsigned long dooshes; /* total number of armies dooshed */ + unsigned long armsbomb; /* all t-mode armies bombed */ + unsigned long resbomb; /* resources bombed */ + unsigned long planets; /* all t-mode planets taken */ + unsigned long kills; /* all t-mode kills made */ + unsigned long losses; /* all t-mode losses */ + unsigned long genocides; /* number of genocides */ + unsigned long sbkills; /* total kills in SB's */ + unsigned long sblosses; /* total losses in Sb's */ + unsigned long sbtime; /* total time in SB's */ + unsigned long wbkills; /* kills in warbases */ + unsigned long wblosses; /* losses in warbases */ + unsigned long wbtime; /* total time played in wb's */ + unsigned long jsplanets; /* total planets taken by jump ships */ + unsigned long jstime; /* total time in a jump ship */ + unsigned long time; /* t-mode time */ + unsigned long timeprod; /* t-mode ship ticks--sort of like */ + /* manhours in t-mode */ + int gameup; /* is game up */ + unsigned long clock; /* clock for planet info timestamp */ +}; +#endif + enum dist_type { /* help me do series */ @@ -214,6 +243,37 @@ int st_rank; /* Ranking of the player */ }; +#ifdef PARADISE +struct stats2 { /* paradise stats */ + int st_genocides; /* number of genocides participated in */ + float st_tmaxkills; /* max kills ever */ + float st_di; /* total destruction inflicted for all time */ + int st_tkills; /* Kills in tournament play */ + int st_tlosses; /* Losses in tournament play */ + int st_tarmsbomb; /* Tournament armies bombed */ + int st_tresbomb; /* resources bombed off */ + int st_tdooshes; /* armies killed while being carried */ + int st_tplanets; /* Tournament planets conquered */ + int st_tticks; /* Tournament ticks */ + /* SB/WB/JS stats are entirely separate */ + int st_sbkills; /* Kills as starbase */ + int st_sblosses; /* Losses as starbase */ + int st_sbticks; /* Time as starbase */ + float st_sbmaxkills; /* Max kills as starbase */ + int st_wbkills; /* Kills as warbase */ + int st_wblosses; /* Losses as warbase */ + int st_wbticks; /* Time as warbase */ + float st_wbmaxkills; /* Max kills as warbase */ + int st_jsplanets; /* planets assisted with in JS */ + int st_jsticks; /* ticks played as a JS */ + long st_lastlogin; /* Last time this player was played */ + int st_flags; /* Misc option flags */ + unsigned char st_keymap[256]; /* keymap for this player */ + int st_rank; /* Ranking of the player */ + int st_royal; /* royaly, specialty, rank */ +}; +#endif + #define ST_MAPMODE 1 #define ST_NAMEMODE 2 #define ST_SHOWSHIELDS 4 @@ -277,6 +337,9 @@ short p_whydead; /* Tells you why you died */ short p_whodead; /* Tells you who killed you */ struct stats p_stats; /* player statistics */ +#ifdef PARADISE + struct stats2 p_stats2; /* Paradise stats */ +#endif short p_genoplanets; /* planets taken since last * genocide */ short p_genoarmsbomb; /* armies bombed since last Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- proto.h 28 Apr 2007 12:09:50 -0000 1.54 +++ proto.h 16 May 2007 00:05:12 -0000 1.55 @@ -1142,10 +1142,19 @@ void handleFlagsAll (struct flags_all_spacket *packet); struct rsa_key_spacket; void handleRSAKey (struct rsa_key_spacket *packet); -#ifdef INCLUDE_SCAN -void -handleScan (packet) - struct scan_spacket *packet; +#ifdef PARADISE +void handleScan (struct scan_spacket *packet); +void handleMotdPic (struct motd_pic_spacket * packet); +void handleStats2 (struct stats_spacket2 * packet); +void handleStatus2 (struct status_spacket2 * packet); +void handlePlanet2 (struct planet_spacket2 * packet); +void handleTerrain2 (struct terrain_packet2 * pkt); +void handleTerrainInfo2 (struct terrain_info_packet2 *pkt); +void handleTempPack (struct obvious_packet * packet); +void handleThingy (struct thingy_spacket * packet); +void handleThingyInfo (struct thingy_info_spacket * packet); +void handleExtension1 (struct paradiseext1_spacket * packet); +void handleGameparams (struct gameparam_spacket * packet); #endif void sendUdpReq (int req); struct udp_reply_spacket;