Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2025/src

Modified Files:
	data.c defaults.c local.c parsemeta.c 
Log Message:
Added global variable for metacache name.
Added name, login, metacache to list of saved options.
Added a good default netrekrc to source, removed crappy sample_xtrekrc.
Fixed wrong planet positions in earth bitmap.
Logic fix to detcircle display.

Index: local.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- local.c	24 May 2006 09:10:08 -0000	1.30
+++ local.c	25 May 2006 08:43:57 -0000	1.31
@@ -2538,7 +2538,7 @@
     /* Keep redrawing for double buffered observers who get set out of normal gameplay bounds,
        whether due to locking onto an ineligible planet, or observing a player who dies -
        otherwise screen doesn't refresh*/
-    if (me->p_x < 0 && !doubleBuffering && !(me->p_flags & PFOBSERV))
+    if (me->p_x < 0 && !(doubleBuffering && (me->p_flags & PFOBSERV)))
         return;
 
     DrawPlanets ();

Index: defaults.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- defaults.c	24 May 2006 01:14:39 -0000	1.20
+++ defaults.c	25 May 2006 08:43:57 -0000	1.21
@@ -84,7 +84,7 @@
             "0 - mono",
             "1 - new color bitmaps (default)",
             "2 - old color bitmaps",
-            "3 - shaded old color bitmaps"
+            "3 - shaded old color bitmaps",
             "4 - experimental high res bitmaps",
             NULL
         }
@@ -1819,6 +1819,28 @@
     sprintf (str, "Saving options to: %s", save_file);
     warning (str);
     
+    // Default character name
+    if (pseudo != NULL)
+    {
+	    if (saveBig)
+	        fputs ("# Default character name\n", fp);
+	    sprintf (str, "name: %s\n", pseudo);
+	    fputs (str, fp);
+	    if (saveBig)
+	        fputs ("\n", fp);
+    }
+    
+    // Login
+    if (login != NULL)
+    {
+	    if (saveBig)
+	        fputs ("# Login name\n", fp);
+	    sprintf (str, "login: %s\n", login);
+	    fputs (str, fp);
+	    if (saveBig)
+	        fputs ("\n", fp);
+    }
+    
     // Let's print buttonmap
     str[0] = '\0';
     str1[0] = '\0';
@@ -1960,6 +1982,17 @@
 	    if (saveBig)
 	        fputs ("\n", fp);
     }
+    
+    // metacache
+    if (metaCache != NULL)
+    {
+	    if (saveBig)
+	        fputs ("# Metacache file\n", fp);
+	    sprintf (str, "metaCache: %s\n", metaCache);
+	    fputs (str, fp);
+	    if (saveBig)
+	        fputs ("\n", fp);
+    }
 
     // player list
     if (strlen (plistLayout) != 0)

Index: data.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- data.c	24 May 2006 01:14:39 -0000	1.27
+++ data.c	25 May 2006 08:43:57 -0000	1.28
@@ -226,6 +226,7 @@
 char *metaServer[] = {"metaserver.us.netrek.org",
                       "metaserever2.us.netrek.org"};
 int metaPort = 3521;
+char *metaCache = NULL;
 #ifdef METAPING
 int metaPing = 1;				/*  ICMP ping the metaserverlist */
 #endif

Index: parsemeta.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- parsemeta.c	24 May 2006 01:41:57 -0000	1.8
+++ parsemeta.c	25 May 2006 08:43:57 -0000	1.9
@@ -332,7 +332,6 @@
 /* Read from the meta-server.  Return TRUE on success and FALSE on failure. */
 {
     FILE *out;
-    char *cacheName;
     char cacheFileName[PATH_MAX];
     char tmpFileName[PATH_MAX];
     char *sockbuf, *buf;
@@ -387,11 +386,11 @@
         return 0;
     }
 
-    cacheName = stringDefault ("metaCache");
-    if (cacheName && !findfile (cacheName, cacheFileName))
-        strcpy (cacheFileName, cacheName);      /* overwrite existing file if possible */
+    metaCache = stringDefault ("metaCache");
+    if (metaCache && !findfile (metaCache, cacheFileName))
+        strcpy (cacheFileName, metaCache);      /* overwrite existing file if possible */
 
-    if (cacheName)
+    if (metaCache)
     {
         len = strlen (cacheFileName);
         strcpy (tmpFileName, cacheFileName);
@@ -427,11 +426,11 @@
 
         /* Can't rename file to existing name under NT */
 #ifdef _MSC_VER
-        _unlink (cacheName);
+        _unlink (metaCache);
 #else
-        unlink (cacheName);
+        unlink (metaCache);
 #endif
-        if (rename (tmpFileName, cacheName) == -1)
+        if (rename (tmpFileName, metaCache) == -1)
             perror ("Could not write to cache file");
     }
 
@@ -447,27 +446,26 @@
 /* Read from the cache.  Return TRUE on success and FALSE on failure. */
 {
     FILE *in;
-    char *cacheName;
     struct servers *slist;
     char *sockbuf, *buf;
     int bufleft = BUF - 1;
     int len;
     char cacheFileName[PATH_MAX];
 
-    cacheName = stringDefault ("metaCache");
+    metaCache = stringDefault ("metaCache");
 
-    if (!cacheName)
+    if (!metaCache)
     {
-        LineToConsole ("You must define the .xtrekrc variable `metaCache' in\n");
+        LineToConsole ("You must define the netrekrc variable `metaCache' in\n");
         LineToConsole ("order to use the `show known servers' option.\n");
         return 0;
     }
-    else if (!findfile (cacheName, cacheFileName)
+    else if (!findfile (metaCache, cacheFileName)
              || !(in = fopen (cacheFileName, "r")))
     {
         LineToConsole (
                  "The metaCache file `%s' is empty or not accessable.\n",
-                 cacheName);
+                 metaCache);
         return 0;
     }