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 <process.h>	// 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 {