tMetaServer.Password and LocalName now sent to metaserver - vaccinewars - be a doctor and try to vaccinate the world
git clone git://src.adamsgaard.dk/vaccinewars
Log
Files
Refs
README
LICENSE
---
commit e9534a5a4e2366aec9dcfc6056b352138c0a520c
parent f94eee147bb0aae14b9b07cd5d068acc5c98801b
Author: Ben Webb 
Date:   Sun, 17 Jun 2001 19:44:52 +0000

MetaServer.Password and LocalName now sent to metaserver


Diffstat:
  M src/serverside.c                    |      30 +++++++++---------------------

1 file changed, 9 insertions(+), 21 deletions(-)
---
diff --git a/src/serverside.c b/src/serverside.c
t@@ -108,27 +108,6 @@ static char HelpText[] = {
 int SendSingleHighScore(Player *Play,struct HISCORE *Score,
                         int index,char Bold);
 
-int SendToMetaServer(char Up,int MetaSock,char *data,
-                     struct sockaddr_in *MetaAddr) {
-/* Sends server details, and any additional data, to the metaserver */
-   GString *text;
-   int numbytes;
-   text=g_string_new("");
-   g_string_sprintf(text,"R:%d\n%d\n%s\n%s",
-                    METAVERSION,Port,MetaServer.LocalName,MetaServer.Password);
-   if (data) { g_string_append(text,"\n"); g_string_append(text,data); }
-   numbytes=sendto(MetaSock,text->str,strlen(text->str),0,
-                   (struct sockaddr *)MetaAddr,sizeof(struct sockaddr));
-   g_string_free(text,TRUE);
-   if (numbytes==-1) {
-/* Warning message displayed if data was not properly sent over the
-   network to the metaserver */
-      g_warning(_("cannot send data to metaserver\n"));
-      return 0;
-   }
-   return 1;
-}
-
 void RegisterWithMetaServer(gboolean Up,gboolean SendData,
                             gboolean RespectTimeout) {
 /* Sends server details to the metaserver, if specified. If "Up" is  */
t@@ -183,6 +162,15 @@ void RegisterWithMetaServer(gboolean Up,gboolean SendData,
                      CountPlayers(FirstServer),MaxClients);
    AddURLEnc(query,MetaServer.Comment);
 
+   if (MetaServer.LocalName[0]) {
+      g_string_append(query,"&hostname=");
+      AddURLEnc(query,MetaServer.LocalName);
+   }
+   if (MetaServer.Password[0]) {
+      g_string_append(query,"&password=");
+      AddURLEnc(query,MetaServer.Password);
+   }
+
    if (SendData && HighScoreRead(MultiScore,AntiqueScore)) {
       for (i=0;i