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

Modified Files:
	data.c defaults.c helpwin.c newwin.c option.c parsemeta.c 
	winmain.c 
Log Message:
Restore old perror() function.
Add more debug info on failed metaping requests.
New netrekrc feature messageKeyOnly which disables the somewhat
annoying feature where any key pressed while mouse is over a message
window will attempt to send a message to that player slot #.

Index: newwin.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- newwin.c	28 Feb 2007 12:21:50 -0000	1.49
+++ newwin.c	2 Mar 2007 12:57:53 -0000	1.50
@@ -769,7 +769,15 @@
 static void
 handleMessageWindowKeyDown (W_Event * event)
 {
-    smessage (event->key);
+    if (messageKeyOnly && messageon == 0)
+    {
+    	if (mystats->st_keymap[(event->key)-32] != 109) /* Not a message key (Key109)*/
+    	    return;
+    	else /* It is a message key, allow them to start a message */
+    	    Key109();
+    }
+    else  /* Attempt to send message to whatever key was pressed */
+        smessage (event->key);
 }
 
 /******************************************************************************/

Index: winmain.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/winmain.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- winmain.c	26 Feb 2007 06:54:50 -0000	1.5
+++ winmain.c	2 Mar 2007 12:57:55 -0000	1.6
@@ -22,7 +22,6 @@
 #include <pwd.h>
 #include <math.h>
 #include <process.h>
-#include <errno.h>
 
 #include "Wlib.h"
 #include "defs.h"
@@ -262,13 +261,13 @@
 
 
 //A more useful perror(), reports last winsock error as well
-/*
+
 void
 perror (const char *str)
 {
     LineToConsole ("%s: errno = %d, WSALast = %d\n", str, errno, WSAGetLastError ());
 }
-*/
+
 
 #ifdef NEW_SELECT
 // ********************************* select ********************************

Index: defaults.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- defaults.c	1 Mar 2007 11:21:46 -0000	1.50
+++ defaults.c	2 Mar 2007 12:57:52 -0000	1.51
@@ -253,6 +253,13 @@
             NULL
         }
     },
+    {"messageKeyOnly", &messageKeyOnly, RC_BOOL,
+        {
+            "Only start messages with the actual message key(s)",
+            "if cursor is in the message windows",
+            NULL
+        }
+    },
 #endif
 #ifdef META
     {"metaPort", &metaPort, RC_INT,
@@ -1689,6 +1696,7 @@
     agriColor = intDefault ("agriColor", agriColor);
 
     playerListMessaging = booleanDefault ("playerListMessaging", playerListMessaging);
+    messageKeyOnly = booleanDefault ("messageKeyOnly", messageKeyOnly);
 
     highlightFriendlyPhasers = booleanDefault ("highlightFriendlyPhasers",
                                                highlightFriendlyPhasers);

Index: data.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- data.c	1 Mar 2007 11:13:21 -0000	1.58
+++ data.c	2 Mar 2007 12:57:52 -0000	1.59
@@ -431,6 +431,7 @@
 int playerListBlankZeroKills = 1;
 int playerListHack = 0;
 int playerListMessaging = 1;
+int messageKeyOnly = 1;
 
 int showMySpeed = 0;
 

Index: parsemeta.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- parsemeta.c	23 Feb 2007 13:43:56 -0000	1.31
+++ parsemeta.c	2 Mar 2007 12:57:54 -0000	1.32
@@ -1921,8 +1921,11 @@
 				 (LPSOCKADDR)lpstToAddr,	/* destination */
 				 sizeof(SOCKADDR_IN));		/* address length */
 
-	if (nRet == SOCKET_ERROR) 
-	metaPing_ReportError("sendto()");
+	if (nRet == SOCKET_ERROR)
+	{
+	    metaPing_ReportError("sendto()");
+	    LineToConsole("IP address %s\n", lpstToAddr->sin_addr.s_addr);
+	}
 	return (nRet);
 }
 
@@ -1949,6 +1952,7 @@
 	if (nRet == SOCKET_ERROR) 
 	{
 		metaPing_ReportError("recvfrom()");
+		LineToConsole("IP address %s\n", lpsaFrom->sin_addr.s_addr);
 		return SOCKET_ERROR;
 	}
 

Index: helpwin.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/helpwin.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- helpwin.c	29 Nov 2006 13:37:47 -0000	1.7
+++ helpwin.c	2 Mar 2007 12:57:52 -0000	1.8
@@ -345,25 +345,20 @@
 
 
     if (key < 32 || key > 126)
-    {
         return;
-    }
 
     if (strlen (helpmessage) < 6)
-    {
         return;
-    }
 
     for (i = 0; i < 96; i++)
     {
         if (mystats->st_keymap[i] != key)
             continue;
         if (i + 32 == key)
-		{
-			default_set = 1;
+	{
+	    default_set = 1;
             continue;
-		}						/* it's already there! don't
-                                 * add it! */
+	} /* it's already there! don't add it! */
 
         /* we've found a key mapped to key! */
         /* the key is i+32 */

Index: option.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- option.c	1 Mar 2007 11:13:21 -0000	1.31
+++ option.c	2 Mar 2007 12:57:54 -0000	1.32
@@ -314,6 +314,7 @@
     {1, "", &windowMove, 0, 0, 0, windowmovemess, NULL},
     {1, "avoid message kludge", &niftyNewMessages, 0, 0, 0, NULL, NULL},
     {1, "", &playerListMessaging, 0, 0, 0, plistmessagingmess, NULL},
+    {1, "have only msg key start msg", &messageKeyOnly, 0, 0, 0, NULL, NULL},
     {1, "beep on private message", &beepOnPrivateMessage, 0, 0, 0, NULL, NULL},
     {1, "done", &notdone, 0, 0, 0, NULL, NULL},
     {-1, NULL, 0, 0, 0, 0, NULL, NULL}