Author: cazfi
Date: Thu Nov 27 07:38:01 2014
New Revision: 27135

URL: http://svn.gna.org/viewcvs/freeciv?rev=27135&view=rev
Log:
Made LAN announcements to respect --identity

See patch #5436

Modified:
    branches/S2_5/server/civserver.c
    branches/S2_5/server/meta.c
    branches/S2_5/server/sernet.c
    branches/S2_5/server/srv_main.c
    branches/S2_5/server/srv_main.h

Modified: branches/S2_5/server/civserver.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/civserver.c?rev=27135&r1=27134&r2=27135&view=diff
==============================================================================
--- branches/S2_5/server/civserver.c    (original)
+++ branches/S2_5/server/civserver.c    Thu Nov 27 07:38:01 2014
@@ -237,7 +237,7 @@
       srvarg.metaserver_no_send = FALSE;      /* --Metaserver implies --meta */
     } else if ((option = get_option_malloc("--identity",
                                           argv, &inx, argc))) {
-      sz_strlcpy(srvarg.metaserver_name, option);
+      sz_strlcpy(srvarg.identity_name, option);
       free(option);
     } else if ((option = get_option_malloc("--port", argv, &inx, argc))) {
       if (!str_to_int(option, &srvarg.port)) {
@@ -377,7 +377,7 @@
     cmdhelp_add(help, "i",
                 /* TRANS: "identity" is exactly what user must type, do not 
translate. */
                 _("identity ADDR"),
-                _("Be known as ADDR at metaserver"));
+                _("Be known as ADDR at metaserver or LAN client"));
     cmdhelp_add(help, "l",
                 /* TRANS: "log" is exactly what user must type, do not 
translate. */
                 _("log FILE"),

Modified: branches/S2_5/server/meta.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/meta.c?rev=27135&r1=27134&r2=27135&view=diff
==============================================================================
--- branches/S2_5/server/meta.c (original)
+++ branches/S2_5/server/meta.c Thu Nov 27 07:38:01 2014
@@ -263,8 +263,8 @@
   }
 
   /* get hostname */
-  if (srvarg.metaserver_name[0] != '\0') {
-    sz_strlcpy(host, srvarg.metaserver_name);
+  if (srvarg.identity_name[0] != '\0') {
+    sz_strlcpy(host, srvarg.identity_name);
   } else if (fc_gethostname(host, sizeof(host)) != 0) {
     sz_strlcpy(host, "unknown");
   }

Modified: branches/S2_5/server/sernet.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/sernet.c?rev=27135&r1=27134&r2=27135&view=diff
==============================================================================
--- branches/S2_5/server/sernet.c       (original)
+++ branches/S2_5/server/sernet.c       Thu Nov 27 07:38:01 2014
@@ -1497,7 +1497,9 @@
   }
 
   /* Create a description of server state to send to clients.  */
-  if (fc_gethostname(hostname, sizeof(hostname)) != 0) {
+  if (srvarg.identity_name[0] != '\0') {
+    sz_strlcpy(hostname, srvarg.identity_name);
+  } else if (fc_gethostname(hostname, sizeof(hostname)) != 0) {
     sz_strlcpy(hostname, "none");
   }
 

Modified: branches/S2_5/server/srv_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/srv_main.c?rev=27135&r1=27134&r2=27135&view=diff
==============================================================================
--- branches/S2_5/server/srv_main.c     (original)
+++ branches/S2_5/server/srv_main.c     Thu Nov 27 07:38:01 2014
@@ -216,7 +216,7 @@
 
   srvarg.metaserver_no_send = DEFAULT_META_SERVER_NO_SEND;
   sz_strlcpy(srvarg.metaserver_addr, DEFAULT_META_SERVER_ADDR);
-  srvarg.metaserver_name[0] = '\0';
+  srvarg.identity_name[0] = '\0';
   srvarg.serverid[0] = '\0';
 
   srvarg.bind_addr = NULL;

Modified: branches/S2_5/server/srv_main.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/srv_main.h?rev=27135&r1=27134&r2=27135&view=diff
==============================================================================
--- branches/S2_5/server/srv_main.h     (original)
+++ branches/S2_5/server/srv_main.h     Thu Nov 27 07:38:01 2014
@@ -27,7 +27,7 @@
   /* metaserver information */
   bool metaserver_no_send;
   char metaserver_addr[256];
-  char metaserver_name[256];
+  char identity_name[256];
   unsigned short int metaserver_port;
   /* address this server is to listen on (NULL => INADDR_ANY) */
   char *bind_addr;


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to