From quozl at users.sourceforge.net Wed May 6 02:46:10 2009 From: quozl at users.sourceforge.net (James Cameron) Date: Wed, 06 May 2009 07:46:10 +0000 Subject: [netrek-cvs] client/netrekxp/src dmessage.c,1.12,1.13 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14708 Modified Files: dmessage.c Log Message: add client name to version packet Index: dmessage.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dmessage.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- dmessage.c 16 Apr 2008 00:08:10 -0000 1.12 +++ dmessage.c 6 May 2009 07:46:07 -0000 1.13 @@ -398,12 +398,12 @@ void sendVersion (void) { - char client_ver[15]; + char client_ver[80]; if (!version_sent) { version_sent = 1; - sprintf (client_ver, "@%s", mvers); + sprintf (client_ver, "@%s %s", version, mvers); pmessage (client_ver, (short) me->p_no, MINDIV | MCONFIG); } From quozl at us.netrek.org Wed May 6 02:49:00 2009 From: quozl at us.netrek.org (James Cameron) Date: Wed, 6 May 2009 17:49:00 +1000 Subject: [netrek-cvs] add client name to version packet and log Message-ID: <20090506074900.GA15709@us.netrek.org> Wed May 6 17:42:48 EST 2009 quozl at us.netrek.org * add client name to version packet and log Client normally identifies to server using a CP_MESSAGE on first SP_PICKOK, but with a version number only. This was used with RSA on clients that did not support feature packets, and had no other use. This change prints the whole version message to the ERRORS log, for statistical analysis later. Clients are encouraged to send "@name version", any number of spaces are permitted, but the last word will be taken as the version number of the client. Also fixed a valgrind detected failure to free a heap pointer. --- old-netrek-server/Vanilla/ntserv/socket.c 2009-05-06 17:48:30.000000000 +1000 +++ new-netrek-server/Vanilla/ntserv/socket.c 2009-05-06 17:48:30.000000000 +1000 @@ -127,7 +127,7 @@ static void handlePingResponse(struct ping_cpacket *packet); #endif -static int clientVersion(struct mesg_spacket *packet); +static void clientVersion(struct mesg_spacket *packet); static int doRead(int asock); static int gwrite(int fd, char *wbuf, size_t size); static void logmessage(char *string); @@ -2011,17 +2011,23 @@ } } -static int clientVersion(struct mesg_spacket *packet) +static void clientVersionFree() { - - if (packet->mesg[0] != '@') - return FALSE; - - /* FIXME: never freed */ - version = (char *)strdup(INDEX(packet->mesg,'@')+1); - return TRUE; + if (version == NULL) return; + free(version); + version = NULL; } +static void clientVersion(struct mesg_spacket *packet) +{ + char *mesg = packet->mesg; + if (*mesg == '@') { + mesg++; + atexit(clientVersionFree); + version = strdup(mesg); + ERROR(1,("%s: version %s\n", whoami(), version)); + } +} #ifdef RSA From quozl at us.netrek.org Wed May 6 02:48:07 2009 From: quozl at us.netrek.org (James Cameron) Date: Wed, 6 May 2009 17:48:07 +1000 Subject: [netrek-cvs] add client name to version packet Message-ID: <20090506074807.GA15634@us.netrek.org> Wed May 6 17:41:47 EST 2009 quozl at us.netrek.org * add client name to version packet diff -rN -u old-netrek-client-cow/dmessage.c new-netrek-client-cow/dmessage.c --- old-netrek-client-cow/dmessage.c 2009-05-06 17:47:07.000000000 +1000 +++ new-netrek-client-cow/dmessage.c 2009-05-06 17:47:07.000000000 +1000 @@ -362,12 +362,12 @@ void sendVersion(void) { - char client_ver[15]; + char client_ver[80]; if (!version_sent) { version_sent = 1; - sprintf(client_ver, "@%s.%d", mvers, PATCHLEVEL); + sprintf(client_ver, "@netrek-client-cow %s.%d", mvers, PATCHLEVEL); pmessage(client_ver, me->p_no, MINDIV | MCONFIG); } From modemhero at users.sourceforge.net Wed May 6 16:40:52 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 06 May 2009 21:40:52 +0000 Subject: [netrek-cvs] client/netrekxp/src parsemeta.c,1.44,1.45 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3329 Modified Files: parsemeta.c Log Message: version_s bug fix, don't show server as open if no players Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- parsemeta.c 16 Jul 2008 23:23:07 -0000 1.44 +++ parsemeta.c 6 May 2009 21:40:49 -0000 1.45 @@ -695,7 +695,10 @@ sp->refresh = 1; sp->lifetime = MAX_LIFETIME; sp->players = players; - sp->status = statusOpen; + if (players == 0) + sp->status = statusNobody; + else + sp->status = statusOpen; sp->typeflag = type; strncpy(sp->comment, comment, LINE); free(comment); From quozl at users.sourceforge.net Thu May 7 01:52:02 2009 From: quozl at users.sourceforge.net (James Cameron) Date: Thu, 07 May 2009 06:52:02 +0000 Subject: [netrek-cvs] client/netrekxp/src parsemeta.c,1.45,1.46 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9466 Modified Files: parsemeta.c Log Message: identify version to metaserver, untested Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- parsemeta.c 6 May 2009 21:40:49 -0000 1.45 +++ parsemeta.c 7 May 2009 06:52:00 -0000 1.46 @@ -55,6 +55,7 @@ #include "struct.h" #include "data.h" #include "proto.h" +#include "version.h" #ifdef METAPING #include // for _getpid #endif @@ -354,6 +355,8 @@ char *metaservers; /* our copy of the metaserver host names */ char *token; /* current metaserver host name */ struct sockaddr_in address; /* the address of the metaservers */ + char *req; /* the request packet for the metaserver */ + int reqlen; /* the length of the request packet */ /* create the socket */ if (msock < 0) { @@ -369,6 +372,9 @@ closesocket(msock); return 0; } + req = malloc(80); + snprintf(req, 80, "?version=%s %s", version, mvers); + reqlen = strlen(req); } /* send request to a multicast metaserver on local area network */ @@ -378,7 +384,7 @@ if (metaVerbose) LineToConsole ("Requesting player list from nearby servers on %s\n", inet_ntoa(address.sin_addr)); - if (sendto(msock, "?", 1, 0, (struct sockaddr *)&address, + if (sendto(msock, req, reqlen, 0, (struct sockaddr *)&address, sizeof(address)) < 0) { perror("ReadMetasSend: sendto"); } else { @@ -417,7 +423,7 @@ if (metaVerbose) LineToConsole ("Requesting player list from metaserver %s at %s\n", token, inet_ntoa(address.sin_addr)); - if (sendto(msock, "?", 1, 0, (struct sockaddr *)&address, + if (sendto(msock, req, reqlen, 0, (struct sockaddr *)&address, sizeof(address)) < 0) { perror("ReadMetasSend: sendto"); } else { @@ -430,7 +436,7 @@ if (metaVerbose) LineToConsole ("Requesting player list from metaserver %s\n", inet_ntoa(address.sin_addr)); - if (sendto(msock, "?", 1, 0, (struct sockaddr *)&address, + if (sendto(msock, req, reqlen, 0, (struct sockaddr *)&address, sizeof(address)) < 0) { perror("ReadMetasSend: sendto"); } else { From modemhero at users.sourceforge.net Thu May 7 17:24:05 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 07 May 2009 22:24:05 +0000 Subject: [netrek-cvs] client/netrekxp/src parsemeta.c,1.46,1.47 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17480 Modified Files: parsemeta.c Log Message: Fix quozl patch Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- parsemeta.c 7 May 2009 06:52:00 -0000 1.46 +++ parsemeta.c 7 May 2009 22:24:03 -0000 1.47 @@ -355,7 +355,7 @@ char *metaservers; /* our copy of the metaserver host names */ char *token; /* current metaserver host name */ struct sockaddr_in address; /* the address of the metaservers */ - char *req; /* the request packet for the metaserver */ + char req[80]; /* the request packet for the metaserver */ int reqlen; /* the length of the request packet */ /* create the socket */ @@ -372,10 +372,9 @@ closesocket(msock); return 0; } - req = malloc(80); - snprintf(req, 80, "?version=%s %s", version, mvers); - reqlen = strlen(req); } + sprintf(req, "?version=%s %s", version, mvers); + reqlen = strlen(req); /* send request to a multicast metaserver on local area network */ address.sin_family = AF_INET; From modemhero at users.sourceforge.net Thu May 7 18:57:37 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 07 May 2009 23:57:37 +0000 Subject: [netrek-cvs] client/netrekxp/src parsemeta.c,1.47,1.48 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29313 Modified Files: parsemeta.c Log Message: Use static variables for req and reqlen, only call once Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- parsemeta.c 7 May 2009 22:24:03 -0000 1.47 +++ parsemeta.c 7 May 2009 23:57:35 -0000 1.48 @@ -355,8 +355,8 @@ char *metaservers; /* our copy of the metaserver host names */ char *token; /* current metaserver host name */ struct sockaddr_in address; /* the address of the metaservers */ - char req[80]; /* the request packet for the metaserver */ - int reqlen; /* the length of the request packet */ + static char *req; /* the request packet for the metaserver */ + static int reqlen; /* the length of the request packet */ /* create the socket */ if (msock < 0) { @@ -372,9 +372,10 @@ closesocket(msock); return 0; } + req = (char *) malloc(80); + sprintf(req, "?version=%s %s", version, mvers); + reqlen = strlen(req); } - sprintf(req, "?version=%s %s", version, mvers); - reqlen = strlen(req); /* send request to a multicast metaserver on local area network */ address.sin_family = AF_INET; From modemhero at users.sourceforge.net Sat May 9 16:21:44 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 09 May 2009 21:21:44 +0000 Subject: [netrek-cvs] client/netrekxp build.cmd, 1.33, 1.34 clientr.vcproj, 1.13, 1.14 compile.txt, 1.15, 1.16 rsa.txt, 1.2, NONE Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16034 Modified Files: build.cmd clientr.vcproj compile.txt Removed Files: rsa.txt Log Message: Remove RSA code from source and makefiles,as it is deprecated. Keep reference in socket code to SP_RSA_KEY and CP_RSA_KEY as these values are fixed server side. Refer to RSA as deprecated in documentation. Index: compile.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/compile.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- compile.txt 6 Apr 2008 23:29:54 -0000 1.15 +++ compile.txt 9 May 2009 21:21:41 -0000 1.16 @@ -11,15 +11,10 @@ -------- Edit build.cmd to set following variables: -RSAKey = path to your RSA-KEY.secret file Compiler = VCC or BCC (default VCC) InstCWD = path to folder to copy files to (default \netrek_files) HelpCompiler = path to hhc.exe from Microsoft's HTML Help Workshop (available from microsoft.com) -Step 1a: --------- -Generate your rsa_box files, see rsa.txt for instructions. - Step 2: -------- --- rsa.txt DELETED --- Index: clientr.vcproj =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.vcproj,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- clientr.vcproj 7 Jun 2007 04:43:36 -0000 1.13 +++ clientr.vcproj 9 May 2009 21:21:41 -0000 1.14 @@ -47,7 +47,7 @@ Optimization="0" WholeProgramOptimization="false" AdditionalIncludeDirectories="win32;win32\h;win32\SDL;include" - PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;RSA;_CONSOLE" + PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;_CONSOLE" MinimalRebuild="false" RuntimeLibrary="1" PrecompiledHeaderFile="\netrek_files\tmp\src\Debug/clientr.pch" @@ -1180,144 +1180,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16034/resources/htmlhelp/html Modified Files: commandline.html generalconfig.html serversettings.html Log Message: Remove RSA code from source and makefiles,as it is deprecated. Keep reference in socket code to SP_RSA_KEY and CP_RSA_KEY as these values are fixed server side. Refer to RSA as deprecated in documentation. Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- generalconfig.html 16 Jul 2008 00:17:00 -0000 1.58 +++ generalconfig.html 9 May 2009 21:21:43 -0000 1.59 @@ -1530,16 +1530,6 @@ -useRsa -Use RSA client verification - -
    -
  • on (default)
  • -
  • off
  • -
- - - useLite Use beeplite Index: commandline.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/commandline.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- commandline.html 21 Apr 2006 11:37:05 -0000 1.2 +++ commandline.html 9 May 2009 21:21:43 -0000 1.3 @@ -28,8 +28,6 @@ -A <password> : specify character password -C <name> : specify character name -U <udp port> : specify UDP port - -o : use old style binary verification - -R : use RSA binary verification -P : log server packets -c : check players on server and return list -f <file name> : record game to file (can be viewed later with -F) Index: serversettings.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/serversettings.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- serversettings.html 21 Apr 2006 11:37:05 -0000 1.2 +++ serversettings.html 9 May 2009 21:21:43 -0000 1.3 @@ -18,7 +18,7 @@

Here is a list of options with brief explanations:

    -
  • Binary verification - whether the client binary should support some kind of verification
  • +
  • Binary verification - whether the client binary should support some kind of verification (deprecated)
  • Tournament mode - how many players per side are required to start T-mode
  • Ships allowed - what types of ships are allowed to play on this server
  • Tractor/Pressor beams - whether tractor/pressor beams are allowed on the server
  • From modemhero at users.sourceforge.net Sat May 9 16:21:45 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 09 May 2009 21:21:45 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.211, 1.212 netrekrc_options.txt, 1.57, 1.58 netrekxp.doc, 1.16, 1.17 newbie.txt, 1.1.1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16034/resources/docs Modified Files: changes.txt netrekrc_options.txt netrekxp.doc newbie.txt Log Message: Remove RSA code from source and makefiles,as it is deprecated. Keep reference in socket code to SP_RSA_KEY and CP_RSA_KEY as these values are fixed server side. Refer to RSA as deprecated in documentation. Index: newbie.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/newbie.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- newbie.txt 21 Jan 2003 21:28:04 -0000 1.1.1.1 +++ newbie.txt 9 May 2009 21:21:43 -0000 1.2 @@ -1956,6 +1956,8 @@ simply disable the particular key you are using, without causing too much disruption. [ Shekter ] +RSA is now deprecated server side and is no longer used (May 2009). + Scum: Of course I like that one definition I read on this group a while back, that a ___ scum is someone who does ___ more than I do. [ Walter Index: netrekxp.doc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekxp.doc,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- netrekxp.doc 13 Apr 2007 08:08:19 -0000 1.16 +++ netrekxp.doc 9 May 2009 21:21:43 -0000 1.17 @@ -94,8 +94,6 @@ -A : specify character password -C : specify character name -U : specify UDP port - -o : use old style binary verification - -R : use RSA binary verification -P : log server packets -c : check players on server and return list -f : record game to file (can be viewed later with -F) Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.211 retrieving revision 1.212 diff -u -d -r1.211 -r1.212 --- changes.txt 28 Mar 2009 09:35:37 -0000 1.211 +++ changes.txt 9 May 2009 21:21:43 -0000 1.212 @@ -16,6 +16,8 @@ 1) Warning messages are no longer logged. Cuts down on logfile spam. 2) Add hint about options menu to the startup hint list. 3) Cambot playback now works for paradise recordings made by paradise clients. +4) Removed RSA verification as this is now deprecated server side. Using new +client identification method as defined in server. Netrek XP 2009, Version 1.0: (Released July-2008) Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- netrekrc_options.txt 16 Jul 2008 00:16:51 -0000 1.57 +++ netrekrc_options.txt 9 May 2009 21:21:43 -0000 1.58 @@ -330,8 +330,6 @@ useGeneric32: (on/off) receive generic_32 server packets which carry repair time, etc. useLite: (on/off) use beeplite defLite: (on/off) use default beeplite settings -useRSA: (on/off) use RSA client verification -useRSA. (on/off) user RSA for varyShields: (on/off) change shields graphic on shield damage varyShieldsColor: (on/off) change shields color on shield damage viewBox: (on/off) show tactical window boundaries on map From modemhero at users.sourceforge.net Sat May 9 16:21:46 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 09 May 2009 21:21:46 +0000 Subject: [netrek-cvs] client/netrekxp/win32 config.h,1.21,1.22 Message-ID: Update of /cvsroot/netrek/client/netrekxp/win32 In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16034/win32 Modified Files: config.h Log Message: Remove RSA code from source and makefiles,as it is deprecated. Keep reference in socket code to SP_RSA_KEY and CP_RSA_KEY as these values are fixed server side. Refer to RSA as deprecated in documentation. Index: config.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/win32/config.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- config.h 19 Apr 2008 16:23:01 -0000 1.21 +++ config.h 9 May 2009 21:21:44 -0000 1.22 @@ -188,9 +188,6 @@ /* NO_UNWARRING_BOMBING - No 3rd space bombing */ #define NO_UNWARRING_BOMBING -/* SHOW_RSA - Display the client type at login */ -#define SHOW_RSA - /* RESETGALAXY - Reset the galaxy after each conquer */ #define RESETGALAXY @@ -373,18 +370,6 @@ /* System dependend Include files */ -/* Some GMP/RSA based stuff SRS 2/9/98 */ -#ifdef RSA - -#define MPTYPEDEF typedef MINT *MPTYPE; -#define assignItom(x,i) x= itom(i) -/* I had to rename pow in the gmp libraries to mpow */ -#define mp_pow(x, y, z, a) mpow(x, y, z, a) -#define INC_MP - -#endif -/* End of GMP/RSA based stuff SRS 2/9/98 */ - /* Unchecked machine dependencies */ #ifdef WIN32 From modemhero at users.sourceforge.net Sat May 9 16:21:46 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 09 May 2009 21:21:46 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.117, 1.118 defaults.c, 1.95, 1.96 defwin.c, 1.6, 1.7 feature.c, 1.25, 1.26 main.c, 1.15, 1.16 makecyg, 1.3, 1.4 makefile, 1.13, 1.14 socket.c, 1.58, 1.59 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16034/src Modified Files: data.c defaults.c defwin.c feature.c main.c makecyg makefile socket.c Log Message: Remove RSA code from source and makefiles,as it is deprecated. Keep reference in socket code to SP_RSA_KEY and CP_RSA_KEY as these values are fixed server side. Refer to RSA as deprecated in documentation. Index: makecyg =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/makecyg,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- makecyg 28 Feb 2007 12:21:50 -0000 1.3 +++ makecyg 9 May 2009 21:21:43 -0000 1.4 @@ -3,7 +3,6 @@ # #DEBUG = 1 -RSA = 1 # Cygwin cc = gcc @@ -67,15 +66,6 @@ MAINOBJ = main.o MAINSRC = main.c -ifndef RSA -GMPLIB = ..\Win32\lib\libgmp.lib -RSADEFS = -DRSA -RSASRC = rsa_box.c rsa_box_0.c rsa_box_1.c rsa_box_2.c\ - rsa_box_3.c rsa_box_4.c -RSAOBJ = rsa_box.o rsa_box_0.o rsa_box_1.o rsa_box_2.o\ - rsa_box_3.o rsa_box_4.o -endif - WIN32_SRCS = winmain.c mswindow.c WIN32_OBJS = winmain.o mswindow.o @@ -87,9 +77,9 @@ all: netrek.exe -OBJS = $(ROBJ) $(MAINOBJ) $(RSAOBJ) $(INPUTOBJ) $(WIN32_OBJS) +OBJS = $(ROBJ) $(MAINOBJ) $(INPUTOBJ) $(WIN32_OBJS) .c.o: - $(cc) $(cflags) $(ccompileonly) $(cdebug) $(DEFS) $(RSADEFS) $(DEBUGDEFS) $(INCS) $< + $(cc) $(cflags) $(ccompileonly) $(cdebug) $(DEFS) $(DEBUGDEFS) $(INCS) $< RESOURCES = vccnetrek.o Index: makefile =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/makefile,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- makefile 28 Feb 2007 12:21:50 -0000 1.13 +++ makefile 9 May 2009 21:21:43 -0000 1.14 @@ -3,7 +3,6 @@ # DEBUG = 1 -RSA = 1 # Borland C++ 5.5 cc = bcc32 @@ -56,15 +55,6 @@ MAINOBJ = main.obj MAINSRC = main.c -!ifdef RSA -GMPLIB = ..\Win32\lib\BCC\libgmpbcc.lib -RSADEFS = -DRSA -RSASRC = rsa_box.c rsa_box_0.c rsa_box_1.c rsa_box_2.c\ - rsa_box_3.c rsa_box_4.c -RSAOBJ = rsa_box.obj rsa_box_0.obj rsa_box_1.obj rsa_box_2.obj\ - rsa_box_3.obj rsa_box_4.obj -!endif - WIN32_SRCS = winmain.c mswindow.c WIN32_OBJS = winmain.obj mswindow.obj @@ -76,9 +66,9 @@ all: netrek.exe -OBJS = $(ROBJ) $(MAINOBJ) $(RSAOBJ) $(INPUTOBJ) $(WIN32_OBJS) +OBJS = $(ROBJ) $(MAINOBJ) $(INPUTOBJ) $(WIN32_OBJS) .c.obj: - $(cc) $(cflags) $(ccompileonly) $(cdebug) $(DEFS) $(RSADEFS) $(DEBUGDEFS) $(INCS) $< + $(cc) $(cflags) $(ccompileonly) $(cdebug) $(DEFS) $(DEBUGDEFS) $(INCS) $< RESOURCES = bccnetrek.res Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- defaults.c 28 Mar 2009 09:35:38 -0000 1.95 +++ defaults.c 9 May 2009 21:21:43 -0000 1.96 @@ -957,14 +957,6 @@ NULL } }, -#endif -#ifdef RSA - {"useRsa", &useRsa, RC_BOOL, - { - "Use RSA verification", - NULL - } - }, #endif #ifdef VSHIELD_BITMAPS {"varyShields", &varyShields, RC_BOOL, @@ -1711,7 +1703,6 @@ resetdefaults (void) { char *pek; - char tmp[100]; if (strlen (pigcall) == 0) sprintf (pigcall, "Netrek XP 2009 (%s) - the smarter netrek eXPerience!", mvers); @@ -1820,21 +1811,6 @@ warnShields = booleanDefault ("warnShields", warnShields); vary_hull = booleanDefault("warnHull", vary_hull); -#ifdef RSA - if (useRsa >= 0) - { - useRsa = booleanDefault ("useRsa", useRsa); - sprintf (tmp, "useRSA.%s", serverName); - useRsa = booleanDefault (tmp, useRsa); - - } - else - { - /* RSA mode was specified in the command line args */ - useRsa = (useRsa == -2) ? 1 : 0; - } -#endif - #ifdef METAPING metaPing = booleanDefault ("metaPing", metaPing); #endif Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.117 retrieving revision 1.118 diff -u -d -r1.117 -r1.118 --- data.c 15 Mar 2009 12:16:42 -0000 1.117 +++ data.c 9 May 2009 21:21:43 -0000 1.118 @@ -241,12 +241,6 @@ int messageon = 0; -#ifdef RSA -char testdata[16]; -int useRsa = 1; - -#endif - int SBhours = 0; #ifdef SHORT_PACKETS Index: defwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defwin.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- defwin.c 24 Feb 2007 10:19:55 -0000 1.6 +++ defwin.c 9 May 2009 21:21:43 -0000 1.7 @@ -16,63 +16,7 @@ * health and/or system. Its use is at your own risk. I assume no * responsibility for damages, real, potential, or imagined, resulting from * the use of it.) - * - * $Log$ - * Revision 1.6 2007/02/24 10:19:55 modemhero - * Cygwin makefile changes: fixed up a bunch of problems to get build to work, still not - * perfect as libdir not resolving correctly. Also removed CYGWIN define from code and - * placed it as a compiler runtime define. Progress of Cygwin build is that client runs, but - * select() is broken. Most likely related to struct fd_set definition. - * Added observer support for shrink phasers, color phaser, warn and vary shields, and - * removed observer support for detcircle. - * Fixed detcircle so turning it off really does turn it off (oops). - * Fixed color phaser with regards to FPS changes, so it works at all framerates. - * Added observer support for showArmy for locking onto planets. - * Split varyShields into 2 netrekrc options, varyShields and varyShieldsColor, to be - * able to vary either/neither/both shield graphic and shield color with damage. - * Changed defaults for FPS client/server values back to 10 from 50. Let the user - * have it in netrekrc if they want to request a higher rate, and don't assume servers - * are running at 50 FPS. Require that feature packet to be sent to increase the - * update rate. - * - * Revision 1.5 2006/05/14 02:14:54 modemhero - * New planet bitmaps! Using Defcom's art. Changeable via planets menu. - * New netrekrc option, "planetBitmapGalaxy: (0-3)", same options as planetBitmap, but now you have - * the choice to change map display planets too! And have map and local planets use different - * bitmap sets - * Fixed bug where map window border wasn't being redrawn on death - * Shortpackets is now off by default. In the current state of internet connectivity, most people - * don't need the reduced packets, which don't send complete information and break certain features - * such as which direction other players are moving, robot shields, observer geno messages, - * shield/cloak status for warp 0 players, etc. - * Fix to problem with bottom and right borders in certain windows (like map) getting overwritten - thanks Stas! - * Client now recognizes planets that are flagged as "core", waiting on server patch to - * actually get this information and do something with it - * - * Revision 1.4 2006/05/07 16:59:27 modemhero - * Major features in this patch are: - * Merge of Stas' latest source into client. - * - Lots of double buffering code - * - Cleanup of protoyping functions and proper variable initialization - * - Addition of working RSA key generator mkkey.exe (this necessitates another DLL in the source) - * - Updated compile instructions, and a new document on how to make a RSA key - * - Working version of winkey with BCC compiler - * - Bug fixes as per listed in his change log - * Cleanup of changes list to remove bug fix/stuff only coders need to know. - * Removal of buildexe script - Stas rewrote build to make this obsolete - * Addition of HR bitmap set (including a few placeholder bitmaps until art is done) - * Metablock patch accepted (not working proper yet though due to retrieving login issue) - * Probably a few other things I forgot about! - * - * Revision 1.2 2004/08/11 00:12:56 stas_p - * replaced printf by more generic console functions fro console.c - * - * Revision 1.2 1999/06/13 05:51:49 sheldon - * Added code for Cambot playback - * - * Revision 1.1.1.1 1999/03/10 06:21:13 sheldon - * Initial public release of Netrek:1999 - * */ + */ #include #include @@ -405,16 +349,6 @@ ,} ,} , -#ifdef RSA - { - "useRSA", BOOL_DEF, "Use RSA checking", &useRsa, - { - {0, NULL, ""}, - {0, NULL, NULL} - ,} - ,} - , -#endif #ifdef VSHIELD_BITMAPS { "varyShields", BOOL_DEF, "Vary shields based on damage", Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- feature.c 9 Jan 2009 03:34:07 -0000 1.25 +++ feature.c 9 May 2009 21:21:43 -0000 1.26 @@ -5,8 +5,7 @@ /*** March, 1994. Joe Rumsey, Tedd Hadley ***/ /*** ***/ /*** most of the functions needed to handle SP_FEATURE/CP_FEATURE packets. ***/ -/*** fill in the features list below for your client, and add a call to ***/ -/*** reportFeatures just before the RSA response is sent. handleFeature ***/ +/*** fill in the features list below for your client, handleFeature ***/ /*** should just call checkFeature, which will search the list and set the ***/ /*** appropriate variable. features unknown to the server are set to the ***/ /*** desired value for client features, and off for server/client features. ***/ @@ -111,7 +110,6 @@ /******************************************************************************/ /*** reportFeatures() ***/ /******************************************************************************/ -/* call this from handleRSAKey, before sending the response. */ static void reportFeatures (void) { Index: main.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/main.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- main.c 29 Jul 2007 01:38:44 -0000 1.15 +++ main.c 9 May 2009 21:21:43 -0000 1.16 @@ -55,11 +55,6 @@ LineToConsole (" [-H] specify host (via gateway)\n"); #endif -#ifdef RSA - LineToConsole (" [-o] use old style binary verification\n"); - LineToConsole (" [-R] use RSA binary verification\n"); -#endif - #ifdef PACKET_LOG LineToConsole (" [-P] log server packets, repeat for increased information\n"); #endif @@ -246,31 +241,6 @@ break; #endif -#ifdef RSA - case 'o': /* try old binary verification */ - useRsa = -1; /* will be reset leter, set - * negative here * to flag - * that it should override - * xtrekrc */ - LineToConsole ("Using standard binary verification\n"); - break; - - case 'R': /* try RSA verification */ - useRsa = -2; /* will be reset leter, set - * negative here * to flag - * that it should override - * xtrekrc */ - LineToConsole ("Using RSA verification\n"); - break; -#else - case 'R': - LineToConsole ("This client does not support RSA verification\n"); - - case 'o': - LineToConsole ("Using standard binary verification\n"); - break; -#endif - case 'h': /* server to connect to */ if (i < argc && argv[i + 1]) { @@ -362,13 +332,6 @@ case 'v': /* output version info */ LineToConsole ("%s %s\n", version, mvers); LineToConsole ("%s\n", CBUGS); -#ifdef RSA - LineToConsole ("RSA key installed: %s --- Created by: %s\n", key_name, client_creator); - LineToConsole ("Client type: %s\n", client_type); - LineToConsole ("Client arch: %s\n", client_arch); - LineToConsole ("Key permutation date: %s\n", client_key_date); - LineToConsole ("Comments: %s\n", client_comments); -#endif exit (0); break; Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- socket.c 29 Mar 2009 14:59:50 -0000 1.58 +++ socket.c 9 May 2009 21:21:43 -0000 1.59 @@ -133,13 +133,7 @@ {sizeof (struct udp_reply_spacket), handleUdpReply}, /* SP_UDP_STAT */ {sizeof (struct sequence_spacket), handleSequence}, /* SP_SEQUENCE */ {sizeof (struct sc_sequence_spacket), handleSequence}, /* SP_SC_SEQUENCE */ - -#ifdef RSA - {sizeof (struct rsa_key_spacket), handleRSAKey}, /* SP_RSA_KEY */ -#else - {0, dummy}, /* #31, and dummy won't */ -#endif - + {0, dummy}, /* #31, old SP_RSA_KEY */ {-1, handlePacket32}, /* SP_MOTD_PIC and SP_GENERIC_32 */ {-1, handlePacket33}, /* SP_STATS2 and SP_FLAGS_ALL */ {sizeof (struct status_spacket2), handleStatus2}, /* SP_STATUS2 */ @@ -244,13 +238,7 @@ sizeof (struct scan_cpacket), /* CP_SCAN (ATM) */ sizeof (struct udp_req_cpacket), /* CP_UDP_REQ */ sizeof (struct sequence_cpacket), /* CP_SEQUENCE */ - -#ifdef RSA - sizeof (struct rsa_key_cpacket), /* CP_RSA_KEY */ -#else - 0, /* 37 */ -#endif - + 0, /* 37 old CP_RSA_KEY*/ sizeof (struct planet_cpacket), /* CP_PLANET */ 0, /* 39 */ 0, /* 40 */ @@ -2674,41 +2662,9 @@ #endif #if !defined(BORG) - -#ifndef RSA encryptReservedPacket (packet, &response, me->p_no); sendServerPacket ((struct player_spacket *) &response); -#else - - if (useRsa) - { /* can use -o option for old - * blessing */ - /* client sends back a 'reserved' packet just saying RSA_VERSION info */ - /* theoretically, the server then sends off a rsa_key_spacket * for the - * client to then respond to */ - warning (RSA_VERSION); - STRNCPY (response.resp, RSA_VERSION, RESERVED_SIZE); - MCOPY (packet->data, response.data, RESERVED_SIZE); - response.type = CP_RESERVED; - -#ifdef DEBUG - LineToConsole ("Sending RSA reserved response\n"); #endif - } - else - { - /* If server gods don't like NEWMACRO/SMARTMACRO they better install - * RSA... */ - UseNewMacro = 1; - UseSmartMacro = 1; -// SRS - Parameter 3 is incorrect? - encryptReservedPacket (packet, &response, me->p_no); - } - - sendServerPacket ((struct player_spacket *) &response); -#endif /* RSA */ - -#endif /* defined(BORG) */ } /* SP_SHIP_CAP packets are sent frequently by bronco servers but only @@ -2853,76 +2809,6 @@ new_flags(ntohl(packet->flags), packet->offset); } -#ifdef RSA -void -handleRSAKey (struct rsa_key_spacket *packet) -{ - struct rsa_key_cpacket response; - struct sockaddr_in saddr; - int len; - unsigned char *data; - -#ifdef GATEWAY - extern unsigned LONG netaddr; - extern int serv_port; - -#endif - - response.type = CP_RSA_KEY; - /* encryptRSAPacket (packet, &response); old style rsa-client */ - -#ifdef GATEWAY - /* if we didn't get it from -H, go ahead and query the socket */ - if (netaddr == 0) - { - len = sizeof (saddr); - if (getpeername (sock, (struct sockaddr *) &saddr, &len) < 0) - { - perror ("getpeername(sock)"); -#ifdef THREADED - terminate2 (RETURNBASE + 1); -#else - terminate (1); -#endif - } - } - else - { - saddr.sin_addr.s_addr = htonl (netaddr); - saddr.sin_port = htons (serv_port); - } -#else - /* query the socket to determine the remote host (ATM) */ - len = sizeof (saddr); - if (getpeername (sock, (struct sockaddr *) &saddr, &len) < 0) - { - perror ("getpeername(sock)"); -#ifdef THREADED - terminate2 (RETURNBASE + 1); -#else - terminate (1); -#endif - } -#endif - - /* replace the first few bytes of the message */ - /* will be the low order bytes of the number */ - data = packet->data; - MCOPY (&saddr.sin_addr.s_addr, data, sizeof (saddr.sin_addr.s_addr)); - data += sizeof (saddr.sin_addr.s_addr); - MCOPY (&saddr.sin_port, data, sizeof (saddr.sin_port)); - - rsa_black_box (response.resp, packet->data, response.public, - response.global); - - sendServerPacket ((struct player_spacket *) &response); - /* #ifdef DEBUG */ - LineToConsole ("RSA verification requested.\n"); - /* #endif */ -} - -#endif - void initialize_players(void) { @@ -5084,19 +4970,6 @@ LineToConsole(" sequence=%u,", ntohs(((struct sc_sequence_spacket *) packet)->sequence) ); break; -#ifdef RSA - case SP_RSA_KEY : /* handles binary * * - * verification */ - LineToConsole("\nS->C SP_RSA_KEY\t"); - if(log_packets > 1) - { - LineToConsole(" data="); - for(i = 0; i < KEY_SIZE; i++) - LineToConsole("0x%0X ",((struct rsa_key_spacket *) packet)->data[i]); - LineToConsole(","); - } - break; -#endif case SP_GENERIC_32 : //case SP_MOTD_PIC : if (paradise) @@ -5716,27 +5589,6 @@ LineToConsole(" sequence=%u,", ntohs(((struct sequence_cpacket *) packet)->sequence) ); break; -#ifdef RSA - case CP_RSA_KEY : /* handles binary * * - * verification */ - LineToConsole("\nC->S CP_RSA_KEY\t"); - if (log_packets > 1) - { - LineToConsole(" global="); - for(i = 0; i < KEY_SIZE; i++) - LineToConsole("0x%0X ",((struct rsa_key_cpacket *)packet)->global[i]); - fprintf(stderr,","); - LineToConsole(" public="); - for(i = 0; i < KEY_SIZE; i++) - LineToConsole("0x%0X ",((struct rsa_key_cpacket *)packet)->public[i]); - fprintf(stderr,","); - LineToConsole(" resp="); - for(i = 0; i < KEY_SIZE; i++) - LineToConsole("0x%0X ",((struct rsa_key_cpacket *)packet)->resp[i]); - fprintf(stderr,","); - } - break; -#endif case CP_PING_RESPONSE : /* client response */ LineToConsole("\nC->S CP_PING_RESPONSE\t"); if (log_packets > 1) From modemhero at users.sourceforge.net Sat May 9 16:21:46 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 09 May 2009 21:21:46 +0000 Subject: [netrek-cvs] client/netrekxp/tools mkkey.exe,1.2,NONE Message-ID: Update of /cvsroot/netrek/client/netrekxp/tools In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16034/tools Removed Files: mkkey.exe Log Message: Remove RSA code from source and makefiles,as it is deprecated. Keep reference in socket code to SP_RSA_KEY and CP_RSA_KEY as these values are fixed server side. Refer to RSA as deprecated in documentation. --- mkkey.exe DELETED --- From modemhero at users.sourceforge.net Sat May 9 16:21:45 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 09 May 2009 21:21:45 +0000 Subject: [netrek-cvs] client/netrekxp/include cowapi.h, 1.1.1.1, 1.2 data.h, 1.105, 1.106 defs.h, 1.34, 1.35 packets.h, 1.19, 1.20 proto.h, 1.64, 1.65 struct.h, 1.32, 1.33 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16034/include Modified Files: cowapi.h data.h defs.h packets.h proto.h struct.h Log Message: Remove RSA code from source and makefiles,as it is deprecated. Keep reference in socket code to SP_RSA_KEY and CP_RSA_KEY as these values are fixed server side. Refer to RSA as deprecated in documentation. Index: defs.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/defs.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- defs.h 16 Jul 2008 00:16:08 -0000 1.34 +++ defs.h 9 May 2009 21:21:43 -0000 1.35 @@ -125,17 +125,6 @@ #define TRACTCOST 20 /* fuel cost of activated * tractor beam */ - -#ifdef RSA -/* RSA stuff */ -#define RSA_VERSION "RSA v2.0 CLIENT" /* string must begin with - * characters "RSA" */ -#define KEY_SIZE 32 -#define RESERVED_SIZE 16 -#define NAME_LEN 16 -#define KEYMAP_LEN 96 -#endif - #define MSG_LEN 80 Index: packets.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/packets.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- packets.h 6 Mar 2009 04:09:27 -0000 1.19 +++ packets.h 9 May 2009 21:21:43 -0000 1.20 @@ -77,10 +77,8 @@ #define SP_SC_SEQUENCE 30 /* this trans is * semi-critical info */ -#ifdef RSA -#define SP_RSA_KEY 31 /* handles binary - * verification */ -#endif +#define SP_RSA_KEY 31 /* deprecated - handles binary verification */ + // Note the conflicting defines for types 32 and 33 #define SP_MOTD_PIC 32 /* paradise - motd bitmap pictures */ @@ -187,10 +185,7 @@ #define CP_UDP_REQ 35 /* request UDP on/off */ #define CP_SEQUENCE 36 /* sequence # packet */ -#ifdef RSA -#define CP_RSA_KEY 37 /* handles binary - * verification */ -#endif +#define CP_RSA_KEY 37 /* deprecated - handles binary verification */ /* Note the conflicting defines for packet type 38*/ #define CP_ASK_MOTD 38 /* paradise - request MOTD */ @@ -857,29 +852,6 @@ #endif -#ifdef RSA -struct rsa_key_spacket -{ - char type; /* SP_RSA_KEY */ - char pad1; - char pad2; - char pad3; - unsigned char data[KEY_SIZE]; -}; - -struct rsa_key_cpacket -{ - char type; /* CP_RSA_KEY */ - char pad1; - char pad2; - char pad3; - unsigned char global[KEY_SIZE]; - unsigned char public[KEY_SIZE]; - unsigned char resp[KEY_SIZE]; -}; - -#endif - struct ship_cap_spacket { /* Server configuration of * client */ Index: cowapi.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/cowapi.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- cowapi.h 21 Jan 2003 21:27:54 -0000 1.1.1.1 +++ cowapi.h 9 May 2009 21:21:42 -0000 1.2 @@ -65,15 +65,4 @@ extern unsigned LONG netaddr; #endif -#ifdef RSA -extern int useRsa; -extern char key_name[]; -extern char client_type[]; -extern char client_arch[]; -extern char client_creator[]; -extern char client_comments[]; -extern char client_key_date[]; - -#endif - #endif /* _h_cow */ Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- struct.h 9 Jan 2009 03:34:07 -0000 1.32 +++ struct.h 9 May 2009 21:21:43 -0000 1.33 @@ -521,17 +521,6 @@ }; -#ifdef RSA -struct rsa_key -{ - unsigned char client_type[KEY_SIZE]; - unsigned char architecture[KEY_SIZE]; - unsigned char global[KEY_SIZE]; - unsigned char public[KEY_SIZE]; -}; - -#endif - /* An important note concerning planets: The game assumes that the planets * are in a 'known' order. Ten planets per team, the first being the home * planet. */ Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- proto.h 16 Jul 2008 00:16:09 -0000 1.64 +++ proto.h 9 May 2009 21:21:43 -0000 1.65 @@ -979,28 +979,6 @@ int cy); void rotateGalaxy (void); -/******************************************************************************/ -/*** rsa_box.c -/******************************************************************************/ -void rsa_black_box (unsigned char *out, - unsigned char *in, - unsigned char *public, - unsigned char *global); -void rsa_partial_box_0 (MP_INT * m, - MP_INT * r, - MP_INT * g); -void rsa_partial_box_1 (MP_INT * m, - MP_INT * r, - MP_INT * g); -void rsa_partial_box_2 (MP_INT * m, - MP_INT * r, - MP_INT * g); -void rsa_partial_box_3 (MP_INT * m, - MP_INT * r, - MP_INT * g); -void rsa_partial_box_4 (MP_INT * m, - MP_INT * r, - MP_INT * g); /******************************************************************************/ /*** senddist.c @@ -1155,8 +1133,6 @@ void handleGeneric32 (struct generic_32_spacket *packet); struct flags_all_spacket; void handleFlagsAll (struct flags_all_spacket *packet); -struct rsa_key_spacket; -void handleRSAKey (struct rsa_key_spacket *packet); void initialize_players (void); void initialize_plasmas (void); void initialize_torps (void); Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.105 retrieving revision 1.106 diff -u -d -r1.105 -r1.106 --- data.h 15 Mar 2009 12:16:42 -0000 1.105 +++ data.h 9 May 2009 21:21:43 -0000 1.106 @@ -126,18 +126,6 @@ extern int messageon; -#ifdef RSA -extern char testdata[]; -extern int useRsa; -extern char key_name[]; -extern char client_type[]; -extern char client_arch[]; -extern char client_creator[]; -extern char client_comments[]; -extern char client_key_date[]; - -#endif - #ifdef META extern char *metaServer; extern int metaPort; From modemhero at users.sourceforge.net Sat May 9 16:21:45 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 09 May 2009 21:21:45 +0000 Subject: [netrek-cvs] client/netrekxp/resources/netrekrc netrekrc.txt, 1.10, 1.11 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/netrekrc In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16034/resources/netrekrc Modified Files: netrekrc.txt Log Message: Remove RSA code from source and makefiles,as it is deprecated. Keep reference in socket code to SP_RSA_KEY and CP_RSA_KEY as these values are fixed server side. Refer to RSA as deprecated in documentation. Index: netrekrc.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/netrekrc/netrekrc.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- netrekrc.txt 28 Mar 2009 09:35:38 -0000 1.10 +++ netrekrc.txt 9 May 2009 21:21:43 -0000 1.11 @@ -534,9 +534,6 @@ # Use default beeplite settings defLite: on -# Use RSA verification -useRsa: on - # Change shields graphic on shield damage varyShields: on From modemhero at users.sourceforge.net Wed May 20 19:15:05 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 21 May 2009 00:15:05 +0000 Subject: [netrek-cvs] client/netrekxp/src option.c, 1.56, 1.57 parsemeta.c, 1.48, 1.49 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32747/src Modified Files: option.c parsemeta.c Log Message: Adopt COW patches for updates/sec and metaserver. Resolves metawin display bug with unresolvable host name. Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- parsemeta.c 7 May 2009 23:57:35 -0000 1.48 +++ parsemeta.c 21 May 2009 00:15:03 -0000 1.49 @@ -1796,10 +1796,10 @@ { if (type == 1) { - do - { - if (ReadMetasRecv(W_Socket())) metawindow(); - } while (!W_EventsPending()); + while (1) { + if (W_EventsPending()) break; + if (ReadMetasRecv(W_Socket())) metawindow(); + } } /* wait for any event */ W_NextEvent (&data); Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- option.c 16 Jul 2008 00:16:11 -0000 1.56 +++ option.c 21 May 2009 00:15:03 -0000 1.57 @@ -856,10 +856,10 @@ /* Is it a special non-linear option range? i.e updatesPerSec */ else if (op->op_range && op->op_option == &updatesPerSec) { - if (data->key == W_RBUTTON) - { - if (++updatesPerSec > server_fps) ; /* Don't exceed server fps */ - else + if (data->key == W_RBUTTON) + { + if (++updatesPerSec > server_fps) ; /* Don't exceed server fps */ + else while (server_fps % updatesPerSec != 0) updatesPerSec++; } else if (data->key == W_MBUTTON) @@ -875,6 +875,11 @@ updatesPerSec = 1; if (updatesPerSec < 1) updatesPerSec = server_fps; + if (updatesPerSec != lastUpdateSpeed) + { + sendUpdatePacket (1000000 / updatesPerSec); + lastUpdateSpeed = updatesPerSec; + } } /* Does the button have a range of values? */ @@ -1056,11 +1061,6 @@ STRNCPY (login, newlogin, PSEUDOSIZE); *newlogin = '\0'; } - if (updatesPerSec != lastUpdateSpeed) - { - sendUpdatePacket (1000000 / updatesPerSec); - lastUpdateSpeed = updatesPerSec; - } sendOptionsPacket (); /* update server as to the * client's options */ From modemhero at users.sourceforge.net Wed May 20 21:37:30 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 21 May 2009 02:37:30 +0000 Subject: [netrek-cvs] client/netrekxp clientr.vcproj,1.14,1.15 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13775 Modified Files: clientr.vcproj Log Message: Added netrekrc option "useAllFeatures" to ignore server settings for info/control feature packets. Added netrekrc option "autoPhaser" to phaser exact location of enemy target closest to cursor. Works on local or map window. To do for autophaser: 1) Add sanity check to location (such as ship max phaser range). 2) Add support for phasering plasmas. Index: clientr.vcproj =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.vcproj,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- clientr.vcproj 9 May 2009 21:21:41 -0000 1.14 +++ clientr.vcproj 21 May 2009 02:37:28 -0000 1.15 @@ -47,7 +47,7 @@ Optimization="0" WholeProgramOptimization="false" AdditionalIncludeDirectories="win32;win32\h;win32\SDL;include" - PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;RSA;_CONSOLE" MinimalRebuild="false" RuntimeLibrary="1" PrecompiledHeaderFile="\netrek_files\tmp\src\Debug/clientr.pch" From modemhero at users.sourceforge.net Wed May 20 21:37:30 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 21 May 2009 02:37:30 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.59, 1.60 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13775/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Added netrekrc option "useAllFeatures" to ignore server settings for info/control feature packets. Added netrekrc option "autoPhaser" to phaser exact location of enemy target closest to cursor. Works on local or map window. To do for autophaser: 1) Add sanity check to location (such as ship max phaser range). 2) Add support for phasering plasmas. Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- generalconfig.html 9 May 2009 21:21:43 -0000 1.59 +++ generalconfig.html 21 May 2009 02:37:28 -0000 1.60 @@ -46,6 +46,16 @@ +autoPhaser +Automatically phaser enemy ship closest to cursor (within phaser range) + +
      +
    • on (default)
    • +
    • off
    • +
    + + + autoQuit Autoquit timer integer
    default: 60 @@ -1490,6 +1500,16 @@ 1-50
    default: 50 +useAllFeatures +Turn on all feature packets regardless of server setting + +
      +
    • on (default)
    • +
    • off
    • +
    + + + useCheckPlanets Crosscheck with server to make sure planet info always correct From modemhero at users.sourceforge.net Wed May 20 21:37:30 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 21 May 2009 02:37:30 +0000 Subject: [netrek-cvs] client/netrekxp/resources/netrekrc netrekrc.txt, 1.11, 1.12 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/netrekrc In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13775/resources/netrekrc Modified Files: netrekrc.txt Log Message: Added netrekrc option "useAllFeatures" to ignore server settings for info/control feature packets. Added netrekrc option "autoPhaser" to phaser exact location of enemy target closest to cursor. Works on local or map window. To do for autophaser: 1) Add sanity check to location (such as ship max phaser range). 2) Add support for phasering plasmas. Index: netrekrc.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/netrekrc/netrekrc.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- netrekrc.txt 9 May 2009 21:21:43 -0000 1.11 +++ netrekrc.txt 21 May 2009 02:37:28 -0000 1.12 @@ -48,6 +48,10 @@ # Autoquit timer (default 60) autoQuit: 60 +# Phaser exact location of enemy target closest to cursor +# Enemy must be within phaser range of your ship +autoPhaser: on + # Automatically rotate galaxy so teams are on left side of map autoRotate: off @@ -503,6 +507,13 @@ # by server frame rate updatesPerSec: 50 +# Ignore server settings for info/control feature packets. +# This will automatically turn on motion mouse steering +# show army counts, show other's speed, show cloakers, turn +# keys, visibility range and beeplite regardless of what +# features the server requests that you turn off. +useAllFeatures: on + # Crosscheck with server to make sure all planet information is # correct. Prevents against lost planet updates which can cause # problems like phantom armies or not realizing a planet has From modemhero at users.sourceforge.net Wed May 20 21:37:30 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 21 May 2009 02:37:30 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.212, 1.213 netrekrc_options.txt, 1.58, 1.59 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13775/resources/docs Modified Files: changes.txt netrekrc_options.txt Log Message: Added netrekrc option "useAllFeatures" to ignore server settings for info/control feature packets. Added netrekrc option "autoPhaser" to phaser exact location of enemy target closest to cursor. Works on local or map window. To do for autophaser: 1) Add sanity check to location (such as ship max phaser range). 2) Add support for phasering plasmas. Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- netrekrc_options.txt 9 May 2009 21:21:43 -0000 1.58 +++ netrekrc_options.txt 21 May 2009 02:37:28 -0000 1.59 @@ -8,6 +8,7 @@ # 2 - gray allowWheelActions: (on/off) allow mouse wheel to work in non-scrolling windows +autoPhaser: (on/off) auto aim phasers autoQuit: (int) autoquit time after death autoRotate: (on/off) automatically rotate galaxy so teams are on left side of map autoSetWar: (0-2) declare war with enemy races when you first join @@ -324,6 +325,7 @@ udpDebug: (0/1) debug UDP traffic udpSequenceCheck: (on/off) check UDP sequence updatesPerSec: (1-50 generally) how many data updates per second to request from server +useAllFeatures: (on/off) turn on all feature packets regardless of server setting useCheckPlanets: (on/off) crosscheck with server to make sure planet info always correct useFullShipInfo: (on/off) display other ships to 256 directions instead of 16 useFullWeapInfo: (on/off) support showing more weapon info on galaxy map Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.212 retrieving revision 1.213 diff -u -d -r1.212 -r1.213 --- changes.txt 9 May 2009 21:21:43 -0000 1.212 +++ changes.txt 21 May 2009 02:37:28 -0000 1.213 @@ -18,6 +18,10 @@ 3) Cambot playback now works for paradise recordings made by paradise clients. 4) Removed RSA verification as this is now deprecated server side. Using new client identification method as defined in server. +5) Added netrekrc option "useAllFeatures" to ignore server settings for +info/control feature packets. +6) Added netrekrc option "autoPhaser" to phaser exact location of enemy target +closest to cursor. Enemy must be within phaser range of your ship. Netrek XP 2009, Version 1.0: (Released July-2008) From modemhero at users.sourceforge.net Wed May 20 21:37:30 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 21 May 2009 02:37:30 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h,1.106,1.107 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13775/include Modified Files: data.h Log Message: Added netrekrc option "useAllFeatures" to ignore server settings for info/control feature packets. Added netrekrc option "autoPhaser" to phaser exact location of enemy target closest to cursor. Works on local or map window. To do for autophaser: 1) Add sanity check to location (such as ship max phaser range). 2) Add support for phasering plasmas. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.106 retrieving revision 1.107 diff -u -d -r1.106 -r1.107 --- data.h 9 May 2009 21:21:43 -0000 1.106 +++ data.h 21 May 2009 02:37:28 -0000 1.107 @@ -824,6 +824,8 @@ 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 int autoPhaser; /* phaser exact location of enemy target closest to cursor */ +extern int useAllFeatures; /* ignore server settings for info/control feature packets */ extern struct context *context; #endif /* _h_data */ From modemhero at users.sourceforge.net Wed May 20 21:37:31 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 21 May 2009 02:37:31 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.118, 1.119 defaults.c, 1.96, 1.97 feature.c, 1.26, 1.27 input.c, 1.47, 1.48 option.c, 1.57, 1.58 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13775/src Modified Files: data.c defaults.c feature.c input.c option.c Log Message: Added netrekrc option "useAllFeatures" to ignore server settings for info/control feature packets. Added netrekrc option "autoPhaser" to phaser exact location of enemy target closest to cursor. Works on local or map window. To do for autophaser: 1) Add sanity check to location (such as ship max phaser range). 2) Add support for phasering plasmas. Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- input.c 23 Jul 2008 10:09:34 -0000 1.47 +++ input.c 21 May 2009 02:37:28 -0000 1.48 @@ -54,6 +54,8 @@ struct obtype *target; unsigned char key = ' '; +void phaseraction (W_Event * data); + /* this used to be 177 for an unknown reason...I think it may * have included * various control characters. We don't support * those anyway right?? - jn */ #define MAXKEY 224 @@ -1697,8 +1699,7 @@ } else if (data->key == W_MBUTTON) { - course = (unsigned char) (getcourse (data->Window, data->x, data->y)); - sendPhaserReq (course); + phaseraction(data); } else if (data->key == W_XBUTTON1) { @@ -1913,6 +1914,48 @@ } /******************************************************************************/ +/*** phaseraction() ***/ +/******************************************************************************/ +void +phaseraction (W_Event * data) +{ + unsigned char course; + int x, y; + register struct player *j; + struct obtype *gettarget (W_Window ww, + int x, + int y, + int targtype), + *target; + + if (autoPhaser) /* add range check here */ { + target = gettarget (data->Window, data->x, data->y, TARG_ENEMY | TARG_CLOAK); + if (target->o_num == -1) { /* failed to find a target */ + course = (unsigned char) (getcourse (data->Window, data->x, data->y)); + sendPhaserReq (course); + return; + } + j = &players[target->o_num]; + if (data->Window == mapw) + { + x = j->p_x * GWINSIDE / GWIDTH; + y = j->p_y * GWINSIDE / GWIDTH; + } + else + { + x = (j->p_x - me->p_x) / scaleFactor + TWINSIDE / 2; + y = (j->p_y - me->p_y) / scaleFactor + TWINSIDE / 2; + } + /* Sanity check on x, y? Use ship max phaser range? */ + /* How about phasering plasma? */ + course = (unsigned char) (getcourse (data->Window, x, y)); + } + else + course = (unsigned char) (getcourse (data->Window, data->x, data->y)); + sendPhaserReq (course); +} + +/******************************************************************************/ /*** getcourse() ***/ /******************************************************************************/ int @@ -3333,19 +3376,13 @@ void Key112 (W_Event * data) { - unsigned char course; - #ifdef AUTOKEY if (autoKey) autoKeyPhaserReqOn (); else - { - course = getcourse (data->Window, data->x, data->y); - sendPhaserReq (course); - } + phaseraction(data); #else - course = (unsigned char) (getcourse (data->Window, data->x, data->y)); - sendPhaserReq (course); + phaseraction (data); #endif /* AUTOKEY */ } Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- defaults.c 9 May 2009 21:21:43 -0000 1.96 +++ defaults.c 21 May 2009 02:37:28 -0000 1.97 @@ -43,6 +43,13 @@ NULL } }, + {"autoPhaser", &autoPhaser, RC_INT, + { + "Phaser exact location of enemy target closest to cursor", + "Enemy must be within phaser range of your ship", + NULL + } + }, {"autoQuit", &autoQuit, RC_INT, { "Autoquit timer (default 60)", @@ -907,6 +914,16 @@ NULL } }, + {"useAllFeatures", &useAllFeatures, RC_INT, + { + "Ignore server settings for info/control feature packets.", + "This will automatically turn on motion mouse steering", + "show army counts, show other's speed, show cloakers, turn", + "keys, visibility range and beeplite regardless of what", + "features the server requests that you turn off.", + NULL + } + }, {"useCheckPlanets", &useCheckPlanets, RC_BOOL, { "Crosscheck with server to make sure all planet information is", Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.118 retrieving revision 1.119 diff -u -d -r1.118 -r1.119 --- data.c 9 May 2009 21:21:43 -0000 1.118 +++ data.c 21 May 2009 02:37:28 -0000 1.119 @@ -924,5 +924,7 @@ int mapscaleFactor = 40; /* allows for scaling of galactic window, unused */ int fullBitmapRotation = 1; /* draw old bitmap sets to all angles */ int hideConsole = 0; /* show console window or not */ +int autoPhaser = 1; /* phaser exact location of enemy target closest to cursor */ +int useAllFeatures = 1; /* ignore server settings for info/control feature packets */ struct context *context; Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- feature.c 9 May 2009 21:21:43 -0000 1.26 +++ feature.c 21 May 2009 02:37:28 -0000 1.27 @@ -302,16 +302,26 @@ break; } } - /* Ignore these feature packets for testing purposes */ -#if DEBUG - motion_mouse_steering = 1; - F_show_army_count = 1; - F_show_other_speed = 1; - F_show_cloakers = 1; - F_turn_keys = 1; - F_show_visibility_range = 1; -#endif #endif /* BEEPLITE */ + /* Ignore these feature packets? */ + if (useAllFeatures) + { + motion_mouse_steering = 1; + F_show_army_count = 1; + F_show_other_speed = 1; + F_show_cloakers = 1; + F_turn_keys = 1; + F_show_visibility_range = 1; +#ifdef BEEPLITE + F_beeplite_flags = LITE_PLAYERS_MAP | + LITE_PLAYERS_LOCAL | + LITE_SELF | + LITE_PLANETS | + LITE_SOUNDS | + LITE_COLOR | + LITE_TTS; +#endif + } } /******************************************************************************/ Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- option.c 21 May 2009 00:15:03 -0000 1.57 +++ option.c 21 May 2009 02:37:28 -0000 1.58 @@ -298,6 +298,7 @@ struct option Weapons_Menu[] = { {0, "Weapons Menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range}, {1, "Page %d (click to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range}, + {1, "use auto aim phasers", &autoPhaser, 0, 0, 0, NULL, NULL}, {1, "use color weapon bitmaps", &colorWeapons, 0, 0, 0, NULL, NULL}, {1, "show weapons on galactic", &weaponsOnMap, 0, 0, 0, NULL, NULL}, #ifdef JUBILEE_PHASERS @@ -438,6 +439,7 @@ {1, "", &messageHUD, 0, 0, 0, messagehudmess, &messagehud_range}, #endif {1, "use double buffering", &doubleBuffering, 0, 0, 0, NULL, NULL}, + {1, "turn on all feature packets", &useAllFeatures, 0, 0, 0, NULL, NULL}, {1, "done", ¬done, 0, 0, 0, NULL, NULL}, {-1, NULL, 0, 0, 0, 0, NULL, NULL} }; From modemhero at users.sourceforge.net Thu May 21 23:08:47 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 22 May 2009 04:08:47 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.119, 1.120 defaults.c, 1.97, 1.98 feature.c, 1.27, 1.28 input.c, 1.48, 1.49 option.c, 1.58, 1.59 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28304/src Modified Files: data.c defaults.c feature.c input.c option.c Log Message: Revert useAllFeatures, return to previous code. Remove autoPhaser use option, ifdef out autophaser code. Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- input.c 21 May 2009 02:37:28 -0000 1.48 +++ input.c 22 May 2009 04:08:45 -0000 1.49 @@ -1928,6 +1928,7 @@ int targtype), *target; +#if DEBUG if (autoPhaser) /* add range check here */ { target = gettarget (data->Window, data->x, data->y, TARG_ENEMY | TARG_CLOAK); if (target->o_num == -1) { /* failed to find a target */ @@ -1951,6 +1952,7 @@ course = (unsigned char) (getcourse (data->Window, x, y)); } else +#endif course = (unsigned char) (getcourse (data->Window, data->x, data->y)); sendPhaserReq (course); } Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.119 retrieving revision 1.120 diff -u -d -r1.119 -r1.120 --- data.c 21 May 2009 02:37:28 -0000 1.119 +++ data.c 22 May 2009 04:08:45 -0000 1.120 @@ -925,6 +925,5 @@ int fullBitmapRotation = 1; /* draw old bitmap sets to all angles */ int hideConsole = 0; /* show console window or not */ int autoPhaser = 1; /* phaser exact location of enemy target closest to cursor */ -int useAllFeatures = 1; /* ignore server settings for info/control feature packets */ struct context *context; Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- feature.c 21 May 2009 02:37:28 -0000 1.27 +++ feature.c 22 May 2009 04:08:45 -0000 1.28 @@ -303,9 +303,10 @@ } } #endif /* BEEPLITE */ - /* Ignore these feature packets? */ - if (useAllFeatures) - { + + +#if DEBUG + /* Ignore these feature packets? */ motion_mouse_steering = 1; F_show_army_count = 1; F_show_other_speed = 1; @@ -321,7 +322,7 @@ LITE_COLOR | LITE_TTS; #endif - } +#endif } /******************************************************************************/ Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- option.c 21 May 2009 02:37:28 -0000 1.58 +++ option.c 22 May 2009 04:08:45 -0000 1.59 @@ -298,7 +298,6 @@ struct option Weapons_Menu[] = { {0, "Weapons Menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range}, {1, "Page %d (click to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range}, - {1, "use auto aim phasers", &autoPhaser, 0, 0, 0, NULL, NULL}, {1, "use color weapon bitmaps", &colorWeapons, 0, 0, 0, NULL, NULL}, {1, "show weapons on galactic", &weaponsOnMap, 0, 0, 0, NULL, NULL}, #ifdef JUBILEE_PHASERS @@ -439,7 +438,6 @@ {1, "", &messageHUD, 0, 0, 0, messagehudmess, &messagehud_range}, #endif {1, "use double buffering", &doubleBuffering, 0, 0, 0, NULL, NULL}, - {1, "turn on all feature packets", &useAllFeatures, 0, 0, 0, NULL, NULL}, {1, "done", ¬done, 0, 0, 0, NULL, NULL}, {-1, NULL, 0, 0, 0, 0, NULL, NULL} }; Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- defaults.c 21 May 2009 02:37:28 -0000 1.97 +++ defaults.c 22 May 2009 04:08:45 -0000 1.98 @@ -43,13 +43,6 @@ NULL } }, - {"autoPhaser", &autoPhaser, RC_INT, - { - "Phaser exact location of enemy target closest to cursor", - "Enemy must be within phaser range of your ship", - NULL - } - }, {"autoQuit", &autoQuit, RC_INT, { "Autoquit timer (default 60)", @@ -914,16 +907,6 @@ NULL } }, - {"useAllFeatures", &useAllFeatures, RC_INT, - { - "Ignore server settings for info/control feature packets.", - "This will automatically turn on motion mouse steering", - "show army counts, show other's speed, show cloakers, turn", - "keys, visibility range and beeplite regardless of what", - "features the server requests that you turn off.", - NULL - } - }, {"useCheckPlanets", &useCheckPlanets, RC_BOOL, { "Crosscheck with server to make sure all planet information is", From modemhero at users.sourceforge.net Thu May 21 23:08:59 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 22 May 2009 04:08:59 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.60, 1.61 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28353 Modified Files: generalconfig.html Log Message: Revert useAllFeatures, return to previous code. Remove autoPhaser use option, ifdef out autophaser code. Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- generalconfig.html 21 May 2009 02:37:28 -0000 1.60 +++ generalconfig.html 22 May 2009 04:08:57 -0000 1.61 @@ -46,16 +46,6 @@ -autoPhaser -Automatically phaser enemy ship closest to cursor (within phaser range) - -
      -
    • on (default)
    • -
    • off
    • -
    - - - autoQuit Autoquit timer integer
    default: 60 @@ -1500,16 +1490,6 @@ 1-50
    default: 50 -useAllFeatures -Turn on all feature packets regardless of server setting - -
      -
    • on (default)
    • -
    • off
    • -
    - - - useCheckPlanets Crosscheck with server to make sure planet info always correct From modemhero at users.sourceforge.net Thu May 21 23:11:23 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 22 May 2009 04:11:23 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c,1.120,1.121 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28711 Modified Files: data.c Log Message: Add metaserver for listing non-bronco servers. Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.120 retrieving revision 1.121 diff -u -d -r1.120 -r1.121 --- data.c 22 May 2009 04:08:45 -0000 1.120 +++ data.c 22 May 2009 04:11:21 -0000 1.121 @@ -265,7 +265,7 @@ #ifdef META /* Metaservers list - comma delimited */ -char *metaServer = "metaserver.us.netrek.org, metaserver2.us.netrek.org, metaserver3.us.netrek.org"; +char *metaServer = "metaserver.us.netrek.org, metaserver2.us.netrek.org, metaserver3.us.netrek.org, metaserver.servegame.org"; int metaPort = 3521; int metaVerbose = 0; char *metaCache = NULL; From modemhero at users.sourceforge.net Thu May 21 23:08:53 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 22 May 2009 04:08:53 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.213, 1.214 netrekrc_options.txt, 1.59, 1.60 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28330/docs Modified Files: changes.txt netrekrc_options.txt Log Message: Revert useAllFeatures, return to previous code. Remove autoPhaser use option, ifdef out autophaser code. Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- netrekrc_options.txt 21 May 2009 02:37:28 -0000 1.59 +++ netrekrc_options.txt 22 May 2009 04:08:51 -0000 1.60 @@ -8,7 +8,6 @@ # 2 - gray allowWheelActions: (on/off) allow mouse wheel to work in non-scrolling windows -autoPhaser: (on/off) auto aim phasers autoQuit: (int) autoquit time after death autoRotate: (on/off) automatically rotate galaxy so teams are on left side of map autoSetWar: (0-2) declare war with enemy races when you first join @@ -325,7 +324,6 @@ udpDebug: (0/1) debug UDP traffic udpSequenceCheck: (on/off) check UDP sequence updatesPerSec: (1-50 generally) how many data updates per second to request from server -useAllFeatures: (on/off) turn on all feature packets regardless of server setting useCheckPlanets: (on/off) crosscheck with server to make sure planet info always correct useFullShipInfo: (on/off) display other ships to 256 directions instead of 16 useFullWeapInfo: (on/off) support showing more weapon info on galaxy map Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.213 retrieving revision 1.214 diff -u -d -r1.213 -r1.214 --- changes.txt 21 May 2009 02:37:28 -0000 1.213 +++ changes.txt 22 May 2009 04:08:51 -0000 1.214 @@ -18,10 +18,6 @@ 3) Cambot playback now works for paradise recordings made by paradise clients. 4) Removed RSA verification as this is now deprecated server side. Using new client identification method as defined in server. -5) Added netrekrc option "useAllFeatures" to ignore server settings for -info/control feature packets. -6) Added netrekrc option "autoPhaser" to phaser exact location of enemy target -closest to cursor. Enemy must be within phaser range of your ship. Netrek XP 2009, Version 1.0: (Released July-2008) From modemhero at users.sourceforge.net Thu May 21 23:08:53 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 22 May 2009 04:08:53 +0000 Subject: [netrek-cvs] client/netrekxp/resources/netrekrc netrekrc.txt, 1.12, 1.13 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/netrekrc In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28330/netrekrc Modified Files: netrekrc.txt Log Message: Revert useAllFeatures, return to previous code. Remove autoPhaser use option, ifdef out autophaser code. Index: netrekrc.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/netrekrc/netrekrc.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- netrekrc.txt 21 May 2009 02:37:28 -0000 1.12 +++ netrekrc.txt 22 May 2009 04:08:51 -0000 1.13 @@ -48,10 +48,6 @@ # Autoquit timer (default 60) autoQuit: 60 -# Phaser exact location of enemy target closest to cursor -# Enemy must be within phaser range of your ship -autoPhaser: on - # Automatically rotate galaxy so teams are on left side of map autoRotate: off @@ -507,13 +503,6 @@ # by server frame rate updatesPerSec: 50 -# Ignore server settings for info/control feature packets. -# This will automatically turn on motion mouse steering -# show army counts, show other's speed, show cloakers, turn -# keys, visibility range and beeplite regardless of what -# features the server requests that you turn off. -useAllFeatures: on - # Crosscheck with server to make sure all planet information is # correct. Prevents against lost planet updates which can cause # problems like phantom armies or not realizing a planet has From modemhero at users.sourceforge.net Thu May 21 23:08:47 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 22 May 2009 04:08:47 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h,1.107,1.108 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28304/include Modified Files: data.h Log Message: Revert useAllFeatures, return to previous code. Remove autoPhaser use option, ifdef out autophaser code. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.107 retrieving revision 1.108 diff -u -d -r1.107 -r1.108 --- data.h 21 May 2009 02:37:28 -0000 1.107 +++ data.h 22 May 2009 04:08:45 -0000 1.108 @@ -825,7 +825,6 @@ extern int fullBitmapRotation; /* draw old bitmap sets to all angles */ extern int hideConsole; /* show console window or not */ extern int autoPhaser; /* phaser exact location of enemy target closest to cursor */ -extern int useAllFeatures; /* ignore server settings for info/control feature packets */ extern struct context *context; #endif /* _h_data */ From modemhero at users.sourceforge.net Thu May 21 23:13:19 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 22 May 2009 04:13:19 +0000 Subject: [netrek-cvs] client/netrekxp/src input.c,1.49,1.50 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28809 Modified Files: input.c Log Message: Fix compiler warning. Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- input.c 22 May 2009 04:08:45 -0000 1.49 +++ input.c 22 May 2009 04:13:17 -0000 1.50 @@ -1920,6 +1920,8 @@ phaseraction (W_Event * data) { unsigned char course; + +#if DEBUG int x, y; register struct player *j; struct obtype *gettarget (W_Window ww, @@ -1928,7 +1930,6 @@ int targtype), *target; -#if DEBUG if (autoPhaser) /* add range check here */ { target = gettarget (data->Window, data->x, data->y, TARG_ENEMY | TARG_CLOAK); if (target->o_num == -1) { /* failed to find a target */ From modemhero at users.sourceforge.net Sat May 23 08:23:59 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 23 May 2009 13:23:59 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.61, 1.62 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29168 Modified Files: generalconfig.html Log Message: Add support for feature packet F_auto_weapons. Include autoPhaser as netrekrc option. Only works if server has F_auto_weapons on. Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- generalconfig.html 22 May 2009 04:08:57 -0000 1.61 +++ generalconfig.html 23 May 2009 13:23:57 -0000 1.62 @@ -46,6 +46,16 @@ +autoPhaser +Automatically phaser enemy ship closest to cursor (within phaser range) + +
      +
    • on (default)
    • +
    • off
    • +
    + + + autoQuit Autoquit timer integer
    default: 60 From modemhero at users.sourceforge.net Sat May 23 08:23:52 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 23 May 2009 13:23:52 +0000 Subject: [netrek-cvs] client/netrekxp/resources/netrekrc netrekrc.txt, 1.13, 1.14 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/netrekrc In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29141/netrekrc Modified Files: netrekrc.txt Log Message: Add support for feature packet F_auto_weapons. Include autoPhaser as netrekrc option. Only works if server has F_auto_weapons on. Index: netrekrc.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/netrekrc/netrekrc.txt,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- netrekrc.txt 22 May 2009 04:08:51 -0000 1.13 +++ netrekrc.txt 23 May 2009 13:23:50 -0000 1.14 @@ -45,6 +45,11 @@ # allow mouse wheel to produce action in non-scrollable windows allowWheelActions: on +# Phaser exact location of enemy target closest to cursor +# Enemy must be within phaser range of your ship +# Server god decides whether to enable it on server +autoPhaser: on + # Autoquit timer (default 60) autoQuit: 60 From modemhero at users.sourceforge.net Sat May 23 08:23:52 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 23 May 2009 13:23:52 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.214, 1.215 netrekrc_options.txt, 1.60, 1.61 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29141/docs Modified Files: changes.txt netrekrc_options.txt Log Message: Add support for feature packet F_auto_weapons. Include autoPhaser as netrekrc option. Only works if server has F_auto_weapons on. Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- netrekrc_options.txt 22 May 2009 04:08:51 -0000 1.60 +++ netrekrc_options.txt 23 May 2009 13:23:50 -0000 1.61 @@ -8,6 +8,7 @@ # 2 - gray allowWheelActions: (on/off) allow mouse wheel to work in non-scrolling windows +autoPhaser: (on/off) auto aim phasers autoQuit: (int) autoquit time after death autoRotate: (on/off) automatically rotate galaxy so teams are on left side of map autoSetWar: (0-2) declare war with enemy races when you first join Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.214 retrieving revision 1.215 diff -u -d -r1.214 -r1.215 --- changes.txt 22 May 2009 04:08:51 -0000 1.214 +++ changes.txt 23 May 2009 13:23:50 -0000 1.215 @@ -18,7 +18,10 @@ 3) Cambot playback now works for paradise recordings made by paradise clients. 4) Removed RSA verification as this is now deprecated server side. Using new client identification method as defined in server. - +5) Added netrekrc option "autoPhaser" to phaser exact location of enemy target +(enemy ship or enemy plasma) closest to cursor. Can target cloaked ships. +Enemy must be within phaser range of your ship. Only works if server has +feature packet F_auto_weapons enabled. Netrek XP 2009, Version 1.0: (Released July-2008) From modemhero at users.sourceforge.net Sat May 23 08:23:42 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 23 May 2009 13:23:42 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.121, 1.122 defaults.c, 1.98, 1.99 feature.c, 1.28, 1.29 input.c, 1.50, 1.51 option.c, 1.59, 1.60 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29099/src Modified Files: data.c defaults.c feature.c input.c option.c Log Message: Add support for feature packet F_auto_weapons. Include autoPhaser as netrekrc option. Only works if server has F_auto_weapons on. Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- input.c 22 May 2009 04:13:17 -0000 1.50 +++ input.c 23 May 2009 13:23:39 -0000 1.51 @@ -1920,8 +1920,6 @@ phaseraction (W_Event * data) { unsigned char course; - -#if DEBUG int x, y; register struct player *j; struct obtype *gettarget (W_Window ww, @@ -1930,9 +1928,10 @@ int targtype), *target; - if (autoPhaser) /* add range check here */ { + if (F_auto_weapons && autoPhaser) { target = gettarget (data->Window, data->x, data->y, TARG_ENEMY | TARG_CLOAK); - if (target->o_num == -1) { /* failed to find a target */ + if (target->o_num == -1) { + /* failed to find a target */ course = (unsigned char) (getcourse (data->Window, data->x, data->y)); sendPhaserReq (course); return; @@ -1953,7 +1952,6 @@ course = (unsigned char) (getcourse (data->Window, x, y)); } else -#endif course = (unsigned char) (getcourse (data->Window, data->x, data->y)); sendPhaserReq (course); } Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.121 retrieving revision 1.122 diff -u -d -r1.121 -r1.122 --- data.c 22 May 2009 04:11:21 -0000 1.121 +++ data.c 23 May 2009 13:23:39 -0000 1.122 @@ -769,6 +769,7 @@ int F_show_visibility_range = 0; int F_sp_flags_all = 0; int F_why_dead_2 = 0; +int F_auto_weapons = 0; int F_terrain = 0; /* paradise */ int F_armies_shipcap = 0; /* paradise */ Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- feature.c 22 May 2009 04:08:45 -0000 1.28 +++ feature.c 23 May 2009 13:23:39 -0000 1.29 @@ -311,6 +311,7 @@ F_show_army_count = 1; F_show_other_speed = 1; F_show_cloakers = 1; + F_auto_weapons = 1; F_turn_keys = 1; F_show_visibility_range = 1; #ifdef BEEPLITE Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- option.c 22 May 2009 04:08:45 -0000 1.59 +++ option.c 23 May 2009 13:23:39 -0000 1.60 @@ -298,6 +298,7 @@ struct option Weapons_Menu[] = { {0, "Weapons Menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range}, {1, "Page %d (click to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range}, + {1, "use auto aim phasers", &autoPhaser, 0, 0, 0, NULL, NULL}, {1, "use color weapon bitmaps", &colorWeapons, 0, 0, 0, NULL, NULL}, {1, "show weapons on galactic", &weaponsOnMap, 0, 0, 0, NULL, NULL}, #ifdef JUBILEE_PHASERS Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- defaults.c 22 May 2009 04:08:45 -0000 1.98 +++ defaults.c 23 May 2009 13:23:39 -0000 1.99 @@ -43,6 +43,14 @@ NULL } }, + {"autoPhaser", &autoPhaser, RC_INT, + { + "Phaser exact location of enemy target closest to cursor", + "Enemy must be within phaser range of your ship", + "Server god decides whether to enable it on server", + NULL + } + }, {"autoQuit", &autoQuit, RC_INT, { "Autoquit timer (default 60)", @@ -1776,6 +1784,7 @@ puckArrow = booleanDefault ("puckArrow", puckArrow); showArmy = intDefault ("showArmy", showArmy); showCloakers = booleanDefault ("showCloakers", showCloakers); + autoPhaser = booleanDefault ("autoPhaser", autoPhaser); redrawDelay = intDefault ("redrawDelay", redrawDelay); planetHighlighting = booleanDefault ("planetHighlighting", planetHighlighting); rotatePlanets = booleanDefault ("rotatePlanets", rotatePlanets); From modemhero at users.sourceforge.net Sat May 23 08:23:41 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 23 May 2009 13:23:41 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h,1.108,1.109 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29099/include Modified Files: data.h Log Message: Add support for feature packet F_auto_weapons. Include autoPhaser as netrekrc option. Only works if server has F_auto_weapons on. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.108 retrieving revision 1.109 diff -u -d -r1.108 -r1.109 --- data.h 22 May 2009 04:08:45 -0000 1.108 +++ data.h 23 May 2009 13:23:39 -0000 1.109 @@ -659,6 +659,7 @@ extern int F_show_visibility_range; extern int F_sp_flags_all; extern int F_why_dead_2; +extern int F_auto_weapons; extern int F_terrain; /* paradise */ extern int F_armies_shipcap; /* paradise */ From modemhero at users.sourceforge.net Sat May 23 10:21:22 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 23 May 2009 15:21:22 +0000 Subject: [netrek-cvs] client/netrekxp/include defs.h, 1.35, 1.36 struct.h, 1.33, 1.34 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6411/include Modified Files: defs.h struct.h Log Message: Add support for plasma to gettarget. Add sanity and range checks to autophaser. Add plasma check to autophaser. Index: defs.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/defs.h,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- defs.h 9 May 2009 21:21:43 -0000 1.35 +++ defs.h 23 May 2009 15:21:19 -0000 1.36 @@ -169,6 +169,7 @@ #define TARG_SELF 0x8 #define TARG_ENEMY 0x10 #define TARG_FRIEND 0x20 +#define TARG_PLASMA 0x40 #define DEFAULT_PORT 2592 Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- struct.h 9 May 2009 21:21:43 -0000 1.33 +++ struct.h 23 May 2009 15:21:19 -0000 1.34 @@ -726,11 +726,14 @@ #define PLANETTYPE 0x1 #define PLAYERTYPE 0x2 +#define PLASMATYPE 0x4 struct obtype { int o_type; int o_num; + int o_dist_x; + int o_dist_y; }; struct rank From modemhero at users.sourceforge.net Sat May 23 10:21:22 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 23 May 2009 15:21:22 +0000 Subject: [netrek-cvs] client/netrekxp/src input.c,1.51,1.52 util.c,1.8,1.9 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6411/src Modified Files: input.c util.c Log Message: Add support for plasma to gettarget. Add sanity and range checks to autophaser. Add plasma check to autophaser. Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- input.c 23 May 2009 13:23:39 -0000 1.51 +++ input.c 23 May 2009 15:21:20 -0000 1.52 @@ -1921,6 +1921,7 @@ { unsigned char course; int x, y; + int distance; register struct player *j; struct obtype *gettarget (W_Window ww, int x, @@ -1928,27 +1929,57 @@ int targtype), *target; - if (F_auto_weapons && autoPhaser) { - target = gettarget (data->Window, data->x, data->y, TARG_ENEMY | TARG_CLOAK); - if (target->o_num == -1) { + if (F_auto_weapons && autoPhaser) + { + target = gettarget (data->Window, data->x, data->y, TARG_ENEMY | TARG_CLOAK | TARG_PLASMA); + if (target->o_type == PLAYERTYPE && target->o_num == me->p_no) + { /* failed to find a target */ course = (unsigned char) (getcourse (data->Window, data->x, data->y)); sendPhaserReq (course); return; } - j = &players[target->o_num]; - if (data->Window == mapw) + if (target->o_type == PLAYERTYPE) { - x = j->p_x * GWINSIDE / GWIDTH; - y = j->p_y * GWINSIDE / GWIDTH; + j = &players[target->o_num]; + if (data->Window == mapw) + { + x = j->p_x * GWINSIDE / GWIDTH; + y = j->p_y * GWINSIDE / GWIDTH; + } + else if (data->Window == w) + { + x = (j->p_x - me->p_x) / scaleFactor + TWINSIDE / 2; + y = (j->p_y - me->p_y) / scaleFactor + TWINSIDE / 2; + } } - else + else if (target->o_type == PLASMATYPE) { - x = (j->p_x - me->p_x) / scaleFactor + TWINSIDE / 2; - y = (j->p_y - me->p_y) / scaleFactor + TWINSIDE / 2; + x = target->o_dist_x; + y = target->o_dist_y; } - /* Sanity check on x, y? Use ship max phaser range? */ - /* How about phasering plasma? */ + + /* Sanity check on distance. Negative x or y indicates phaser is in local + window but target is outside viewable range. */ + if (x < 0 || y < 0) + { + course = (unsigned char) (getcourse (data->Window, data->x, data->y)); + sendPhaserReq (course); + return; + } + /* Check ship max phaser range for local window phasers. Sometimes phasers + are fired to "point". Not checking galaxy map phasers. */ + if (data->Window == w) + { + distance = (int) sqrt((x- TWINSIDE / 2)*(x - TWINSIDE / 2) + (y - TWINSIDE / 2)*(y - TWINSIDE /2)); + if (distance > (PHASEDIST * j->p_ship.s_phaserdamage / 100 / scaleFactor)) + { + course = (unsigned char) (getcourse (data->Window, data->x, data->y)); + sendPhaserReq (course); + return; + } + } + /* Everything checks out */ course = (unsigned char) (getcourse (data->Window, x, y)); } else Index: util.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/util.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- util.c 16 Apr 2008 00:08:23 -0000 1.8 +++ util.c 23 May 2009 15:21:20 -0000 1.9 @@ -64,6 +64,8 @@ g_y = (y - 4) / W_Textheight; _targ.o_type = PLAYERTYPE; _targ.o_num = GetPlayerFromPlist (g_x, g_y); + _targ.o_dist_x = -1; + _targ.o_dist_y = -1; targ = &_targ; return (targ); } @@ -75,6 +77,8 @@ g_y = (y - 4) / W_Textheight - 2; // Two header lines _targ.o_type = PLANETTYPE; _targ.o_num = GetPlanetFromPlist (g_x, g_y); + _targ.o_dist_x = -1; + _targ.o_dist_y = -1; targ = &_targ; return (targ); } @@ -105,6 +109,7 @@ register int i; register struct player *j; register struct planet *k; + register struct plasmatorp *pt; double dist, closedist; int friendly; @@ -118,6 +123,8 @@ { _target.o_type = PLANETTYPE; _target.o_num = i; + _target.o_dist_x = -1; + _target.o_dist_y = -1; closedist = dist; } @@ -145,6 +152,28 @@ { _target.o_type = PLAYERTYPE; _target.o_num = i; + _target.o_dist_x = -1; + _target.o_dist_y = -1; + closedist = dist; + } + } + } + if (targtype & TARG_PLASMA) + { + for (pt = plasmatorps + (nplasmas * nplayers) - 1; pt >= plasmatorps; --pt) + { + if (!pt->pt_status) + continue; + if (pt->pt_status == PTEXPLODE || pt->pt_status == PTFREE) + continue; + + dist = hypot ((double) (x - pt->pt_x), (double) (y - pt->pt_y)); + if (dist < closedist) + { + _target.o_type = PLASMATYPE; + _target.o_num = -1; + _target.o_dist_x = (int) ((x - pt->pt_x) / scaleFactor + TWINSIDE / 2); + _target.o_dist_y = (int) ((y - pt->pt_y) / scaleFactor + TWINSIDE / 2); closedist = dist; } } @@ -155,6 +184,8 @@ _target.o_type = PLAYERTYPE; _target.o_num = me->p_no; /* Return myself. Oh * well... */ + _target.o_dist_x = -1; + _target.o_dist_y = -1; return (&_target); } else From modemhero at users.sourceforge.net Sat May 23 20:38:57 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 24 May 2009 01:38:57 +0000 Subject: [netrek-cvs] client/netrekxp/src input.c, 1.52, 1.53 util.c, 1.9, 1.10 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11382 Modified Files: input.c util.c Log Message: Autophaser, optimize code to reduce math operations. Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- input.c 23 May 2009 15:21:20 -0000 1.52 +++ input.c 24 May 2009 01:38:55 -0000 1.53 @@ -1920,9 +1920,8 @@ phaseraction (W_Event * data) { unsigned char course; - int x, y; + int x, y, dx, dy; int distance; - register struct player *j; struct obtype *gettarget (W_Window ww, int x, int y, @@ -1939,47 +1938,31 @@ sendPhaserReq (course); return; } - if (target->o_type == PLAYERTYPE) - { - j = &players[target->o_num]; - if (data->Window == mapw) - { - x = j->p_x * GWINSIDE / GWIDTH; - y = j->p_y * GWINSIDE / GWIDTH; - } - else if (data->Window == w) - { - x = (j->p_x - me->p_x) / scaleFactor + TWINSIDE / 2; - y = (j->p_y - me->p_y) / scaleFactor + TWINSIDE / 2; - } - } - else if (target->o_type == PLASMATYPE) - { - x = target->o_dist_x; - y = target->o_dist_y; - } + dx = target->o_dist_x - me->p_x; + dy = target->o_dist_y - me->p_y; - /* Sanity check on distance. Negative x or y indicates phaser is in local - window but target is outside viewable range. */ - if (x < 0 || y < 0) + /* Sanity check on distance. */ + /* Check ship max phaser range for phasers. Sometimes phasers are fired to "point". */ + + distance = (int) sqrt((double) dx*dx + (double) dy*dy); + if (distance > (PHASEDIST * me->p_ship.s_phaserdamage / 100)) { course = (unsigned char) (getcourse (data->Window, data->x, data->y)); sendPhaserReq (course); return; } - /* Check ship max phaser range for local window phasers. Sometimes phasers - are fired to "point". Not checking galaxy map phasers. */ + + /* Everything checks out. Scale to window coordinates. */ if (data->Window == w) { - distance = (int) sqrt((x- TWINSIDE / 2)*(x - TWINSIDE / 2) + (y - TWINSIDE / 2)*(y - TWINSIDE /2)); - if (distance > (PHASEDIST * j->p_ship.s_phaserdamage / 100 / scaleFactor)) - { - course = (unsigned char) (getcourse (data->Window, data->x, data->y)); - sendPhaserReq (course); - return; - } + x = dx / scaleFactor + TWINSIDE / 2; + y = dy / scaleFactor + TWINSIDE / 2; + } + else + { + x = target->o_dist_x * GWINSIDE / GWIDTH; + y = target->o_dist_y * GWINSIDE / GWIDTH; } - /* Everything checks out */ course = (unsigned char) (getcourse (data->Window, x, y)); } else Index: util.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/util.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- util.c 23 May 2009 15:21:20 -0000 1.9 +++ util.c 24 May 2009 01:38:55 -0000 1.10 @@ -123,8 +123,8 @@ { _target.o_type = PLANETTYPE; _target.o_num = i; - _target.o_dist_x = -1; - _target.o_dist_y = -1; + _target.o_dist_x = k->pl_x; + _target.o_dist_y = k->pl_y; closedist = dist; } @@ -152,8 +152,8 @@ { _target.o_type = PLAYERTYPE; _target.o_num = i; - _target.o_dist_x = -1; - _target.o_dist_y = -1; + _target.o_dist_x = j->p_x; + _target.o_dist_y = j->p_y; closedist = dist; } } @@ -172,8 +172,8 @@ { _target.o_type = PLASMATYPE; _target.o_num = -1; - _target.o_dist_x = (int) ((x - pt->pt_x) / scaleFactor + TWINSIDE / 2); - _target.o_dist_y = (int) ((y - pt->pt_y) / scaleFactor + TWINSIDE / 2); + _target.o_dist_x = pt->pt_x; + _target.o_dist_y = pt->pt_y; closedist = dist; } } From modemhero at users.sourceforge.net Mon May 25 09:43:55 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 25 May 2009 14:43:55 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.109, 1.110 defs.h, 1.36, 1.37 packets.h, 1.20, 1.21 proto.h, 1.65, 1.66 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29214/include Modified Files: data.h defs.h packets.h proto.h Log Message: Support for server feature packet SP_RANKS. NUMRANKS removed, replaced with dynamic variable nranks. Nranks treated like nranks2 (paradise), rank table is loaded upon client initialization, table can be resized if server sends additional ranks. Ranklist window will always resize to proper size based on number of ranks. Index: defs.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/defs.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- defs.h 23 May 2009 15:21:19 -0000 1.36 +++ defs.h 25 May 2009 14:43:53 -0000 1.37 @@ -61,7 +61,6 @@ #define CLOAK_PHASES 12 /* number of drawing phases * in a cloak * engage/disengage */ -#define NUMRANKS 9 #define PUCKARROW_LEN 6 #define TIC_DIST 5000 /* distance from ship to draw * heading tic mark */ Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.109 retrieving revision 1.110 diff -u -d -r1.109 -r1.110 --- data.h 23 May 2009 13:23:39 -0000 1.109 +++ data.h 25 May 2009 14:43:52 -0000 1.110 @@ -440,9 +440,10 @@ extern char defpasswd[PSEUDOSIZE]; extern char login[PSEUDOSIZE]; -extern struct rank ranks[NUMRANKS]; +extern struct rank *ranks; extern struct rank2 *ranks2; extern struct royalty *royal; +extern int nranks; extern int nranks2; extern int nroyals; @@ -660,6 +661,7 @@ extern int F_sp_flags_all; extern int F_why_dead_2; extern int F_auto_weapons; +extern int F_sp_ranks; extern int F_terrain; /* paradise */ extern int F_armies_shipcap; /* paradise */ Index: packets.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/packets.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- packets.h 9 May 2009 21:21:43 -0000 1.20 +++ packets.h 25 May 2009 14:43:53 -0000 1.21 @@ -131,6 +131,7 @@ #define SP_S_PHASER 57 /* see struct */ #define SP_S_KILLS 58 /* # of kills player have */ #define SP_S_STATS 59 /* see SP_STATS */ +#define SP_RANKS 61 /* rank data */ /* variable length packets */ #define VPLAYER_SIZE 4 @@ -852,6 +853,19 @@ #endif +struct ranks_spacket +{ + char type; /* SP_RANKS */ + int rankn; /* rank number */ + char name[11]; /* rank name */ + char cname[5]; /* short name */ + unsigned hours; /* where 1234=12.34 hours + * and 0=0.00 hours */ + unsigned ratings; /* as per hours */ + unsigned offense; /* as per hours */ + +}; + struct ship_cap_spacket { /* Server configuration of * client */ Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- proto.h 9 May 2009 21:21:43 -0000 1.65 +++ proto.h 25 May 2009 14:43:53 -0000 1.66 @@ -1133,6 +1133,7 @@ void handleGeneric32 (struct generic_32_spacket *packet); struct flags_all_spacket; void handleFlagsAll (struct flags_all_spacket *packet); +void handleRanks (struct ranks_spacket *packet); void initialize_players (void); void initialize_plasmas (void); void initialize_torps (void); From modemhero at users.sourceforge.net Mon May 25 09:43:55 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 25 May 2009 14:43:55 +0000 Subject: [netrek-cvs] client/netrekxp/src cowmain.c, 1.39, 1.40 data.c, 1.122, 1.123 feature.c, 1.29, 1.30 newwin.c, 1.77, 1.78 playerlist.c, 1.18, 1.19 ranklist.c, 1.6, 1.7 socket.c, 1.59, 1.60 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29214/src Modified Files: cowmain.c data.c feature.c newwin.c playerlist.c ranklist.c socket.c Log Message: Support for server feature packet SP_RANKS. NUMRANKS removed, replaced with dynamic variable nranks. Nranks treated like nranks2 (paradise), rank table is loaded upon client initialization, table can be resized if server sends additional ranks. Ranklist window will always resize to proper size based on number of ranks. Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 --- newwin.c 28 Mar 2009 02:50:24 -0000 1.77 +++ newwin.c 25 May 2009 14:43:53 -0000 1.78 @@ -998,8 +998,8 @@ planetw = W_MakeTextWindow ("planet", TWINSIDE + 2 * THICKBORDER + 10, 10, 57, nplanets + 3, baseWin, 2); W_SetWindowExposeHandler (planetw, planetlist); - // Rank window sized assuming only 9 (NUMRANKS) ranks, resized in paradise, see ranklist.c - rankw = W_MakeTextWindow ("rank", 10, 300, 80, NUMRANKS + 9, baseWin, 2); + // Rank window sized assuming only 9 (nranks) ranks, may be resized, see ranklist.c + rankw = W_MakeTextWindow ("rank", 10, 300, 80, nranks + 9, baseWin, 2); W_SetWindowExposeHandler (rankw, ranklist); // Player list windows will be too small if players > 36, which is possible in paradise @@ -1932,7 +1932,7 @@ (me->p_stats2.st_royal == 0 ? ranks2[me->p_stats2.st_rank].name : royal[me->p_stats2.st_royal].name)); else { - if (me->p_stats.st_rank >= NUMRANKS) + if (me->p_stats.st_rank >= nranks) sprintf (buf, "Welcome aboard!"); else sprintf (buf, "Welcome aboard %s!", ranks[me->p_stats.st_rank].name); Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- cowmain.c 19 Apr 2008 16:22:58 -0000 1.39 +++ cowmain.c 25 May 2009 14:43:53 -0000 1.40 @@ -779,7 +779,7 @@ ind_ship_bmp_HR = stringDefault ("indshipHRbmpfile"); resetdefaults (); - build_default_configuration(); // for paradise + build_default_configuration(); // load ranks/royals newwin (display_host, name); if (hideConsole) Index: playerlist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/playerlist.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- playerlist.c 28 Mar 2009 02:50:24 -0000 1.18 +++ playerlist.c 25 May 2009 14:43:53 -0000 1.19 @@ -1130,7 +1130,7 @@ format (buffPoint, "UNKN", 4, 0); else { - if (j->p_stats.st_rank >= NUMRANKS) + if (j->p_stats.st_rank >= nranks) format (buffPoint, "UNKN", 4, 0); else format (buffPoint, ranks[j->p_stats.st_rank].cname, 4, 0); @@ -1143,7 +1143,7 @@ format (buffPoint, (j->p_stats2.st_royal == 0 ? ranks2[j->p_stats2.st_rank].name : royal[j->p_stats2.st_royal].name), 10, 0); else { - if (j->p_stats.st_rank >= NUMRANKS) + if (j->p_stats.st_rank >= nranks) format (buffPoint, "Unknown! ", 10, 0); else format (buffPoint, ranks[j->p_stats.st_rank].name, 10, 0); Index: ranklist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/ranklist.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ranklist.c 16 Apr 2008 00:08:20 -0000 1.6 +++ ranklist.c 25 May 2009 14:43:53 -0000 1.7 @@ -117,9 +117,10 @@ char buf[100]; /* W_ClearWindow(rankw); */ + W_ResizeTextWindow(rankw, 80, nranks2 + 9); (void) strcpy (buf, " Rank Hours Offense Ratings DI"); W_WriteText (rankw, 1, 1, textColor, buf, strlen (buf), W_BoldFont); - for (i = 0; i < NUMRANKS; i++) + for (i = 0; i < nranks; i++) { sprintf (buf, "%-11.11s %5.0f %8.2f %8.2f %7.2f", ranks[i].name, @@ -128,7 +129,7 @@ ranks[i].ratings, ranks[i].ratings * ranks[i].hours); if (mystats->st_rank == i) { - if (i < NUMRANKS-1) + if (i < nranks-1) { char buf2[35]; float DI; Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.122 retrieving revision 1.123 diff -u -d -r1.122 -r1.123 --- data.c 23 May 2009 13:23:39 -0000 1.122 +++ data.c 25 May 2009 14:43:53 -0000 1.123 @@ -453,19 +453,9 @@ struct ship shipvals[NUM_TYPES_BRONCO]; -/* 10 Aug 96 - Added curt (short) names -SAC */ -struct rank ranks[NUMRANKS] = { - {0.0, 0.0, 0.0, "Ensign", "Esgn"}, - {2.0, 1.0, 0.0, "Lieutenant", "Lt "}, - {4.0, 2.0, 0.0, "Lt. Cmdr.", "LtCm"}, - {8.0, 3.0, 0.0, "Commander", "Cder",}, - {15.0, 4.0, 0.0, "Captain", "Capt"}, - {20.0, 5.0, 0.0, "Flt. Capt.", "FltC"}, - {25.0, 6.0, 0.0, "Commodore", "Cdor"}, - {30.0, 7.0, 0.0, "Rear Adm.", "RAdm"}, - {40.0, 8.0, 0.0, "Admiral", "Admr"} -}; +int nranks = 9; int nranks2 = 18; +struct rank *ranks; struct rank2 *ranks2; int nroyals = 5; struct royalty *royal = 0; @@ -770,6 +760,7 @@ int F_sp_flags_all = 0; int F_why_dead_2 = 0; int F_auto_weapons = 0; +int F_sp_ranks = 0; int F_terrain = 0; /* paradise */ int F_armies_shipcap = 0; /* paradise */ Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- feature.c 23 May 2009 13:23:39 -0000 1.29 +++ feature.c 25 May 2009 14:43:53 -0000 1.30 @@ -104,6 +104,7 @@ {"TERRAIN", &F_terrain, 'S', 1, 0, 0}, /* armies in paradise ship_cap_spacket */ {"ARMIES_IN_SHIPCAP", &F_armies_shipcap, 'S', 1, 0, 0}, + {"SP_RANKS", &F_sp_ranks, 'S', 1, 0, 0}, {0, 0, 0, 0, 0, 0} }; Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- socket.c 9 May 2009 21:21:43 -0000 1.59 +++ socket.c 25 May 2009 14:43:53 -0000 1.60 @@ -197,7 +197,7 @@ #ifdef FEATURE_PACKETS {sizeof (struct feature_cpacket), handleFeature}, /* CP_FEATURE; 60 */ #endif - + {sizeof (struct ranks_spacket), handleRanks}, /* SP_RANKS */ }; int sizes[] = { @@ -2448,7 +2448,7 @@ servers. Sanity check on pl->p_stats.st_rank moved to playerlist.c and newwin.c as needed. BB*/ /* - if (packet->rank >= NUMRANKS) + if (packet->rank >= nranks) { LineToConsole ("handlePlyrLogin: bad rank %d\n", packet->rank); return; @@ -2810,6 +2810,36 @@ } void +handleRanks (struct ranks_spacket *packet) +{ + int rankn; + int size; + +#ifdef CORRUPTED_PACKETS + if (packet->rankn > nranks) + { + LineToConsole ("handleRanks: bad index\n"); + return; + } +#endif + /* A new rank. Reallocate memory as necessary. */ + if (packet->rankn == nranks) + { + size = sizeof(struct rank) * ( nranks + 1 ); + ranks = (struct rank *) realloc(ranks, size); + ranks[nranks].name = strdup("blank"); + ranks[nranks].cname = strdup("UNKN"); + nranks++; + } + rankn = packet->rankn; + STRNCPY(ranks[rankn].name, packet->name, 11); + STRNCPY(ranks[rankn].cname, packet->cname, 5); + ranks[rankn].hours = (float) (ntohl (packet->hours) / 100.0); + ranks[rankn].ratings = (float) (ntohl (packet->ratings) / 100.0); + ranks[rankn].offense = (float) (ntohl (packet->offense) / 100.0); +} + +void initialize_players(void) { int i; @@ -3333,7 +3363,63 @@ void initialize_ranks(void) { + ranks = (struct rank *) malloc(sizeof(*ranks) * nranks); ranks2 = (struct rank2 *) malloc(sizeof(*ranks2) * nranks2); + + ranks[0].hours = 0.0; + ranks[0].ratings = 0.0; + ranks[0].offense = 0.0; + ranks[0].name = strdup("Ensign"); + ranks[0].cname = strdup("Esgn"); + + ranks[1].hours = 2.0; + ranks[1].ratings = 1.0; + ranks[1].offense = 0.0; + ranks[1].name = strdup("Lieutenant"); + ranks[1].cname = strdup("Lt "); + + ranks[2].hours = 4.0; + ranks[2].ratings = 2.0; + ranks[2].offense = 0.0; + ranks[2].name = strdup("Lt. Cmdr."); + ranks[2].cname = strdup("LtCm"); + + ranks[3].hours = 8.0; + ranks[3].ratings = 3.0; + ranks[3].offense = 0.0; + ranks[3].name = strdup("Commander"); + ranks[3].cname = strdup("Cder"); + + ranks[4].hours = 15.0; + ranks[4].ratings = 4.0; + ranks[4].offense = 0.0; + ranks[4].name = strdup("Captain"); + ranks[4].cname = strdup("Capt"); + + ranks[5].hours = 20.0; + ranks[5].ratings = 5.0; + ranks[5].offense = 0.0; + ranks[5].name = strdup("Flt. Capt."); + ranks[5].cname = strdup("FltC"); + + ranks[6].hours = 25.0; + ranks[6].ratings = 6.0; + ranks[6].offense = 0.0; + ranks[6].name = strdup("Commodore"); + ranks[6].cname = strdup("Cdor"); + + ranks[7].hours = 30.0; + ranks[7].ratings = 7.0; + ranks[7].offense = 0.0; + ranks[7].name = strdup("Rear Adm."); + ranks[7].cname = strdup("RAdm"); + + ranks[8].hours = 40.0; + ranks[8].ratings = 8.0; + ranks[8].offense = 0.0; + ranks[8].name = strdup("Admiral"); + ranks[8].cname = strdup("Admr"); + ranks2[0].genocides = 0; ranks2[0].di = 0; ranks2[0].battle = 0.0; @@ -3476,6 +3562,7 @@ void reinitialize_ranks(void) { + // Only used by paradise (when receive GPsizes packet) int i; ranks2 = (struct rank2 *) malloc(sizeof(*ranks2) * nranks2); @@ -3625,11 +3712,20 @@ void free_ranks(void) { - int i; + int i; + for (i = 0; i < nranks; i++) + { + if (ranks[i].name) + free(ranks[i].name); + if (ranks[i].cname) + free(ranks[i].cname); + } for (i = 0; i < nranks2; i++) - if (ranks2[i].name) - free(ranks2[i].name); + if (ranks2[i].name) + free(ranks2[i].name); + free(ranks); free(ranks2); + ranks = 0; ranks2 = 0; } From modemhero at users.sourceforge.net Mon May 25 09:44:00 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 25 May 2009 14:44:00 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.215, 1.216 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29257 Modified Files: changes.txt Log Message: Support for server feature packet SP_RANKS. NUMRANKS removed, replaced with dynamic variable nranks. Nranks treated like nranks2 (paradise), rank table is loaded upon client initialization, table can be resized if server sends additional ranks. Ranklist window will always resize to proper size based on number of ranks. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.215 retrieving revision 1.216 diff -u -d -r1.215 -r1.216 --- changes.txt 23 May 2009 13:23:50 -0000 1.215 +++ changes.txt 25 May 2009 14:43:58 -0000 1.216 @@ -22,6 +22,11 @@ (enemy ship or enemy plasma) closest to cursor. Can target cloaked ships. Enemy must be within phaser range of your ship. Only works if server has feature packet F_auto_weapons enabled. +6) Added support for server feature packet SP_RANKS. This allows the rank +table to be dynamic rather than static. In short, it allows servers to +have more or less ranks than normal. Practical application - grand admiral +rank on sturgeon now displays correctly in player list and rank window. + Netrek XP 2009, Version 1.0: (Released July-2008) From modemhero at users.sourceforge.net Mon May 25 11:29:45 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 25 May 2009 16:29:45 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C,1.168,1.169 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19415 Modified Files: NetrekXP to do list.C Log Message: SP_rank, documentation cleanup. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.168 retrieving revision 1.169 diff -u -d -r1.168 -r1.169 --- NetrekXP to do list.C 29 Mar 2009 14:59:49 -0000 1.168 +++ NetrekXP to do list.C 25 May 2009 16:29:43 -0000 1.169 @@ -29,7 +29,6 @@ if you fly into the NW corner of the galaxy. this was never anticipated! 5) Tractor on/off and pressor on/off option, rather than just tractor on, pressor on. Maybe with enforced state? -6) Make server packet for variable rank requirements like min offense. Paradise issues: 1) Motd paging system gutted for sake of simplicity From modemhero at users.sourceforge.net Mon May 25 11:29:45 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 25 May 2009 16:29:45 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.216, 1.217 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19415/resources/docs Modified Files: changes.txt Log Message: SP_rank, documentation cleanup. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.216 retrieving revision 1.217 diff -u -d -r1.216 -r1.217 --- changes.txt 25 May 2009 14:43:58 -0000 1.216 +++ changes.txt 25 May 2009 16:29:43 -0000 1.217 @@ -25,7 +25,8 @@ 6) Added support for server feature packet SP_RANKS. This allows the rank table to be dynamic rather than static. In short, it allows servers to have more or less ranks than normal. Practical application - grand admiral -rank on sturgeon now displays correctly in player list and rank window. +rank on sturgeon now displays correctly in player list and rank window. And +rank window now properly displays offense requirements for rank. Netrek XP 2009, Version 1.0: (Released July-2008) From modemhero at users.sourceforge.net Mon May 25 12:00:55 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 25 May 2009 17:00:55 +0000 Subject: [netrek-cvs] client/netrekxp/src ranklist.c, 1.7, 1.8 socket.c, 1.60, 1.61 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24856 Modified Files: ranklist.c socket.c Log Message: Resize rank window upon receiving rank data from the server, rather than every time rank window is opened. Index: ranklist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/ranklist.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ranklist.c 25 May 2009 14:43:53 -0000 1.7 +++ ranklist.c 25 May 2009 17:00:53 -0000 1.8 @@ -78,8 +78,6 @@ register int i; char buf[80]; - W_ResizeTextWindow(rankw, 65, nranks2 + 8); - (void) strcpy(buf, " Rank genocides DI battle strategy special ships"); W_WriteText(rankw, 1, 1, textColor, buf, strlen(buf), W_BoldFont); for (i = 0; i < nranks2; i++) { @@ -117,7 +115,7 @@ char buf[100]; /* W_ClearWindow(rankw); */ - W_ResizeTextWindow(rankw, 80, nranks2 + 9); + (void) strcpy (buf, " Rank Hours Offense Ratings DI"); W_WriteText (rankw, 1, 1, textColor, buf, strlen (buf), W_BoldFont); for (i = 0; i < nranks; i++) Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- socket.c 25 May 2009 14:43:53 -0000 1.60 +++ socket.c 25 May 2009 17:00:53 -0000 1.61 @@ -2830,6 +2830,7 @@ ranks[nranks].name = strdup("blank"); ranks[nranks].cname = strdup("UNKN"); nranks++; + W_ResizeTextWindow(rankw, 80, nranks + 9); } rankn = packet->rankn; STRNCPY(ranks[rankn].name, packet->name, 11); @@ -3772,6 +3773,8 @@ reinitialize_royal(); resize_players(); + // Resize rank window + W_ResizeTextWindow(rankw, 65, nranks2 + 8); // Reinit playerlist - necessary as max number of players (nplayers) may have changed InitPlayerList(); initialize_torps(); From modemhero at users.sourceforge.net Mon May 25 21:18:25 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 26 May 2009 02:18:25 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.217, 1.218 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12222 Modified Files: changes.txt Log Message: SP_RANK, change naming and packet definitions to match server protocol. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.217 retrieving revision 1.218 diff -u -d -r1.217 -r1.218 --- changes.txt 25 May 2009 16:29:43 -0000 1.217 +++ changes.txt 26 May 2009 02:18:23 -0000 1.218 @@ -22,7 +22,7 @@ (enemy ship or enemy plasma) closest to cursor. Can target cloaked ships. Enemy must be within phaser range of your ship. Only works if server has feature packet F_auto_weapons enabled. -6) Added support for server feature packet SP_RANKS. This allows the rank +6) Added support for server feature packet SP_RANK. This allows the rank table to be dynamic rather than static. In short, it allows servers to have more or less ranks than normal. Practical application - grand admiral rank on sturgeon now displays correctly in player list and rank window. And From modemhero at users.sourceforge.net Mon May 25 21:18:19 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 26 May 2009 02:18:19 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.123, 1.124 feature.c, 1.30, 1.31 socket.c, 1.61, 1.62 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12195/src Modified Files: data.c feature.c socket.c Log Message: SP_RANK, change naming and packet definitions to match server protocol. Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- feature.c 25 May 2009 14:43:53 -0000 1.30 +++ feature.c 26 May 2009 02:18:17 -0000 1.31 @@ -104,7 +104,7 @@ {"TERRAIN", &F_terrain, 'S', 1, 0, 0}, /* armies in paradise ship_cap_spacket */ {"ARMIES_IN_SHIPCAP", &F_armies_shipcap, 'S', 1, 0, 0}, - {"SP_RANKS", &F_sp_ranks, 'S', 1, 0, 0}, + {"SP_RANK", &F_sp_rank, 'S', 1, 0, 0}, {0, 0, 0, 0, 0, 0} }; Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- socket.c 25 May 2009 17:00:53 -0000 1.61 +++ socket.c 26 May 2009 02:18:17 -0000 1.62 @@ -197,7 +197,7 @@ #ifdef FEATURE_PACKETS {sizeof (struct feature_cpacket), handleFeature}, /* CP_FEATURE; 60 */ #endif - {sizeof (struct ranks_spacket), handleRanks}, /* SP_RANKS */ + {sizeof (struct rank_spacket), handleRank}, /* SP_RANK */ }; int sizes[] = { @@ -2810,7 +2810,7 @@ } void -handleRanks (struct ranks_spacket *packet) +handleRank (struct rank_spacket *packet) { int rankn; int size; Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.123 retrieving revision 1.124 diff -u -d -r1.123 -r1.124 --- data.c 25 May 2009 14:43:53 -0000 1.123 +++ data.c 26 May 2009 02:18:17 -0000 1.124 @@ -760,7 +760,7 @@ int F_sp_flags_all = 0; int F_why_dead_2 = 0; int F_auto_weapons = 0; -int F_sp_ranks = 0; +int F_sp_rank = 0; int F_terrain = 0; /* paradise */ int F_armies_shipcap = 0; /* paradise */ From modemhero at users.sourceforge.net Mon May 25 21:18:19 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 26 May 2009 02:18:19 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.110, 1.111 packets.h, 1.21, 1.22 proto.h, 1.66, 1.67 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12195/include Modified Files: data.h packets.h proto.h Log Message: SP_RANK, change naming and packet definitions to match server protocol. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.110 retrieving revision 1.111 diff -u -d -r1.110 -r1.111 --- data.h 25 May 2009 14:43:52 -0000 1.110 +++ data.h 26 May 2009 02:18:17 -0000 1.111 @@ -661,7 +661,7 @@ extern int F_sp_flags_all; extern int F_why_dead_2; extern int F_auto_weapons; -extern int F_sp_ranks; +extern int F_sp_rank; extern int F_terrain; /* paradise */ extern int F_armies_shipcap; /* paradise */ Index: packets.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/packets.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- packets.h 25 May 2009 14:43:53 -0000 1.21 +++ packets.h 26 May 2009 02:18:17 -0000 1.22 @@ -131,7 +131,7 @@ #define SP_S_PHASER 57 /* see struct */ #define SP_S_KILLS 58 /* # of kills player have */ #define SP_S_STATS 59 /* see SP_STATS */ -#define SP_RANKS 61 /* rank data */ +#define SP_RANK 61 /* rank data */ /* variable length packets */ #define VPLAYER_SIZE 4 @@ -853,17 +853,16 @@ #endif -struct ranks_spacket +struct rank_spacket { - char type; /* SP_RANKS */ + char type; /* SP_RANK */ + char pad[3]; int rankn; /* rank number */ - char name[11]; /* rank name */ - char cname[5]; /* short name */ - unsigned hours; /* where 1234=12.34 hours - * and 0=0.00 hours */ - unsigned ratings; /* as per hours */ - unsigned offense; /* as per hours */ - + char name[16]; /* full rank name */ + int hours; /* hundredths of hours required */ + int ratings; /* hundredths of ratings required */ + int offense; /* hundredths of offense required */ + char cname[8]; /* short 'curt' rank name */ }; struct ship_cap_spacket Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- proto.h 25 May 2009 14:43:53 -0000 1.66 +++ proto.h 26 May 2009 02:18:17 -0000 1.67 @@ -1133,7 +1133,7 @@ void handleGeneric32 (struct generic_32_spacket *packet); struct flags_all_spacket; void handleFlagsAll (struct flags_all_spacket *packet); -void handleRanks (struct ranks_spacket *packet); +void handleRank (struct rank_spacket *packet); void initialize_players (void); void initialize_plasmas (void); void initialize_torps (void); From quozl at users.sourceforge.net Wed May 27 05:40:11 2009 From: quozl at users.sourceforge.net (James Cameron) Date: Wed, 27 May 2009 10:40:11 +0000 Subject: [netrek-cvs] client/netrekxp/src ranklist.c,1.8,1.9 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11788 Modified Files: ranklist.c Log Message: typo boming Index: ranklist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/ranklist.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ranklist.c 25 May 2009 17:00:53 -0000 1.8 +++ ranklist.c 27 May 2009 10:40:08 -0000 1.9 @@ -154,7 +154,7 @@ strcpy (buf, "in less than the hours allowed (DI = ratings x hours)."); W_WriteText (rankw, 1, i + 4, textColor, buf, strlen (buf), W_RegularFont); - strcpy (buf, "OR, get offense+boming+planets above corresponding Ratings"); + strcpy (buf, "OR, get offense+bombing+planets above corresponding Ratings"); W_WriteText (rankw, 1, i + 5, textColor, buf, strlen (buf), W_RegularFont); strcpy (buf, "Promotions also occur at 2xDI with Ratings - 1"); From modemhero at users.sourceforge.net Wed May 27 18:07:07 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 27 May 2009 23:07:07 +0000 Subject: [netrek-cvs] client/netrekxp/src socket.c,1.62,1.63 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7735 Modified Files: socket.c Log Message: Add SP_RANK to packet log. Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- socket.c 26 May 2009 02:18:17 -0000 1.62 +++ socket.c 27 May 2009 23:07:05 -0000 1.63 @@ -2812,18 +2812,18 @@ void handleRank (struct rank_spacket *packet) { - int rankn; + int i = packet->rankn; int size; #ifdef CORRUPTED_PACKETS - if (packet->rankn > nranks) + if (i > nranks) { LineToConsole ("handleRanks: bad index\n"); return; } #endif /* A new rank. Reallocate memory as necessary. */ - if (packet->rankn == nranks) + if (i == nranks) { size = sizeof(struct rank) * ( nranks + 1 ); ranks = (struct rank *) realloc(ranks, size); @@ -2832,12 +2832,13 @@ nranks++; W_ResizeTextWindow(rankw, 80, nranks + 9); } - rankn = packet->rankn; - STRNCPY(ranks[rankn].name, packet->name, 11); - STRNCPY(ranks[rankn].cname, packet->cname, 5); - ranks[rankn].hours = (float) (ntohl (packet->hours) / 100.0); - ranks[rankn].ratings = (float) (ntohl (packet->ratings) / 100.0); - ranks[rankn].offense = (float) (ntohl (packet->offense) / 100.0); + packet->name[15] = 0; + packet->cname[7] = 0; + ranks[i].name = strdup(packet->name); + ranks[i].cname = strdup(packet->cname); + ranks[i].hours = (float) (ntohl (packet->hours) / 100.0); + ranks[i].ratings = (float) (ntohl (packet->ratings) / 100.0); + ranks[i].offense = (float) (ntohl (packet->offense) / 100.0); } void @@ -5314,7 +5315,18 @@ ntohl(((struct feature_cpacket *) packet)->value), ((struct feature_cpacket *) packet)->name ); break; -#endif +#endif + case SP_RANK : + LineToConsole("\nS->C SP_RANK\t"); + if (log_packets > 1) + LineToConsole(" rankn=%d, name=\"%s\", hours=%d, ratings=%d, offense=%d, cname=\"%s\"", + ((struct rank_spacket *) packet)->rankn, + ((struct rank_spacket *) packet)->name, + ntohl(((struct rank_spacket *) packet)->hours), + ntohl(((struct rank_spacket *) packet)->ratings), + ntohl(((struct rank_spacket *) packet)->offense), + ((struct rank_spacket *) packet)->cname ); + break; #ifdef SHORT_PACKETS case SP_S_TORP : /* variable length torp * * * packet */ From modemhero at users.sourceforge.net Wed May 27 20:19:18 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 28 May 2009 01:19:18 +0000 Subject: [netrek-cvs] client/netrekxp/src death.c, 1.22, 1.23 socket.c, 1.63, 1.64 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20255/src Modified Files: death.c socket.c Log Message: SP_RANK, update to new packet protocol. Adopt COW handleRank(), more robust code. Add check to promotion message for valid rank. Index: death.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/death.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- death.c 16 Apr 2008 00:08:09 -0000 1.22 +++ death.c 28 May 2009 01:19:16 -0000 1.23 @@ -89,7 +89,10 @@ if (promoted) { - sprintf (rankmessage, "Congratulations, You have scummed up to %s", + if (mystats->st_rank >= nranks) + sprintf (rankmessage, "Congratulations, you have been promoted!"); + else + sprintf (rankmessage, "Congratulations, you have scummed up to %s!", paradise ? ranks2[mystats->st_rank].name : ranks[mystats->st_rank].name); W_WriteText (w, 50, 80, W_Yellow, rankmessage, strlen (rankmessage), W_BoldFont); Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- socket.c 27 May 2009 23:07:05 -0000 1.63 +++ socket.c 28 May 2009 01:19:16 -0000 1.64 @@ -2812,24 +2812,22 @@ void handleRank (struct rank_spacket *packet) { - int i = packet->rankn; - int size; + int i = packet->rnum; + int j = packet->rmax + 1; #ifdef CORRUPTED_PACKETS - if (i > nranks) + if (i < 0 || j < 0 || i > j) { - LineToConsole ("handleRanks: bad index\n"); + LineToConsole ("handleRanks: invalid rnum or rmax\n"); return; } #endif - /* A new rank. Reallocate memory as necessary. */ - if (i == nranks) + /* Reallocate rank memory as necessary. */ + if (j > nranks) { - size = sizeof(struct rank) * ( nranks + 1 ); - ranks = (struct rank *) realloc(ranks, size); - ranks[nranks].name = strdup("blank"); - ranks[nranks].cname = strdup("UNKN"); - nranks++; + ranks = (struct rank *) realloc(ranks, j * sizeof(struct rank)); + memset(&ranks[nranks], 0, (j - nranks) * sizeof(struct rank)); + nranks = j; W_ResizeTextWindow(rankw, 80, nranks + 9); } packet->name[15] = 0; @@ -5319,8 +5317,9 @@ case SP_RANK : LineToConsole("\nS->C SP_RANK\t"); if (log_packets > 1) - LineToConsole(" rankn=%d, name=\"%s\", hours=%d, ratings=%d, offense=%d, cname=\"%s\"", - ((struct rank_spacket *) packet)->rankn, + LineToConsole(" rnum=%d, rmax=%d, name=\"%s\", hours=%d, ratings=%d, offense=%d, cname=\"%s\"", + ((struct rank_spacket *) packet)->rnum, + ((struct rank_spacket *) packet)->rmax, ((struct rank_spacket *) packet)->name, ntohl(((struct rank_spacket *) packet)->hours), ntohl(((struct rank_spacket *) packet)->ratings), From modemhero at users.sourceforge.net Wed May 27 20:19:18 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 28 May 2009 01:19:18 +0000 Subject: [netrek-cvs] client/netrekxp/include packets.h,1.22,1.23 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20255/include Modified Files: packets.h Log Message: SP_RANK, update to new packet protocol. Adopt COW handleRank(), more robust code. Add check to promotion message for valid rank. Index: packets.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/packets.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- packets.h 26 May 2009 02:18:17 -0000 1.22 +++ packets.h 28 May 2009 01:19:16 -0000 1.23 @@ -856,8 +856,9 @@ struct rank_spacket { char type; /* SP_RANK */ - char pad[3]; - int rankn; /* rank number */ + char rnum; /* rank number */ + char rmax; /* rank number maximum */ + char pad; char name[16]; /* full rank name */ int hours; /* hundredths of hours required */ int ratings; /* hundredths of ratings required */ From modemhero at users.sourceforge.net Fri May 29 17:05:43 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 29 May 2009 22:05:43 +0000 Subject: [netrek-cvs] client/netrekxp/src ranklist.c, 1.9, 1.10 socket.c, 1.64, 1.65 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8103 Modified Files: ranklist.c socket.c Log Message: SP_RANK, handle case where nranks decreases during gamplay. Move resize rank window back to ranklist. Index: ranklist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/ranklist.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ranklist.c 27 May 2009 10:40:08 -0000 1.9 +++ ranklist.c 29 May 2009 22:05:41 -0000 1.10 @@ -112,9 +112,15 @@ else { register int i; + static int size = 0; char buf[100]; - /* W_ClearWindow(rankw); */ + if (size != nranks) + { + W_ClearWindow(rankw); + W_ResizeTextWindow(rankw, 80, nranks + 9); + size = nranks; + } (void) strcpy (buf, " Rank Hours Offense Ratings DI"); W_WriteText (rankw, 1, 1, textColor, buf, strlen (buf), W_BoldFont); Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- socket.c 28 May 2009 01:19:16 -0000 1.64 +++ socket.c 29 May 2009 22:05:41 -0000 1.65 @@ -2827,9 +2827,8 @@ { ranks = (struct rank *) realloc(ranks, j * sizeof(struct rank)); memset(&ranks[nranks], 0, (j - nranks) * sizeof(struct rank)); - nranks = j; - W_ResizeTextWindow(rankw, 80, nranks + 9); } + nranks = j; packet->name[15] = 0; packet->cname[7] = 0; ranks[i].name = strdup(packet->name); From modemhero at users.sourceforge.net Sat May 30 11:03:41 2009 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 30 May 2009 16:03:41 +0000 Subject: [netrek-cvs] client/netrekxp/src socket.c,1.65,1.66 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1227 Modified Files: socket.c Log Message: Remove ranks struct from reinit and free ranks, as it is handled elsewhere. Ranks2 struct for paradise continues to use these functions though. Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- socket.c 29 May 2009 22:05:41 -0000 1.65 +++ socket.c 30 May 2009 16:03:38 -0000 1.66 @@ -3711,20 +3711,13 @@ void free_ranks(void) { + // Only used by paradise (when receive GPsizes packet) int i; - for (i = 0; i < nranks; i++) - { - if (ranks[i].name) - free(ranks[i].name); - if (ranks[i].cname) - free(ranks[i].cname); - } + for (i = 0; i < nranks2; i++) if (ranks2[i].name) free(ranks2[i].name); - free(ranks); free(ranks2); - ranks = 0; ranks2 = 0; }