On Sat, May 06, 2006 at 05:40:02AM +0000, Bill Balcerski wrote: > *.tamu.edu removed from metaserver listing, and direct connect via -h > servername also removed. This is due to the policy of blocking all > players with the default login that comes with the client. That's a good idea. It will help to reduce the annoyance felt by players who don't yet know of the server policy ... which is quite likely if they are new-be-nice. Please accept the attached patch. It does the following: - factorises the block to a single point in the code, so that adding new blocks will be easier, and removing the block in future will be easier, - skip the block if the user has configured their login correctly, - emit an explanatory message to console when "-h" is used, I'm not able to test this, sorry. Lacking in appropriate OS. I wasn't able to find where "new-be-nice" is initially set. It doesn't appear in the source in CVS. Where is it? How can we get it in there? -- James Cameron mailto:quozl at us.netrek.org http://quozl.netrek.org/ -------------- next part -------------- --- include/parsemeta.h.~1~ 2006-04-28 00:01:08.000000000 +1000 +++ include/parsemeta.h 2006-05-06 21:00:36.000000000 +1000 @@ -48,6 +48,8 @@ * select a server. */ +int metablock(char *host); +/* block connections to known servers not willing to handle new-be-nice */ #endif /* defined META */ #endif /* defined meta_h_header */ --- src/main.c.~1~ 2006-05-06 20:48:56.000000000 +1000 +++ src/main.c 2006-05-06 21:05:20.000000000 +1000 @@ -256,8 +256,10 @@ if (i < argc) { servertmp = argv[i + 1]; - if (strstr(servertmp,".tamu.edu") != NULL) + if (metablock(servertmp) != NULL) { + LineToConsole ("new-be-nice not welcome there\n"); exit (0); + } usemeta = 0; i++; } --- src/parsemeta.c.~1~ 2006-05-06 20:49:41.000000000 +1000 +++ src/parsemeta.c 2006-05-06 21:07:24.000000000 +1000 @@ -168,6 +168,14 @@ return (sock); } +int +metablock (char *host) +/* Block connections to known servers not willing to handle new-be-nice */ +{ + if (strcmp(login, "new-be-nice")) return 0; + if (strstr(slist->address,".tamu.edu") == NULL) return 0; + return 1; +} static void parseInput (char *in, @@ -299,8 +307,8 @@ slist->pkt_rtt[i] = -1; #endif - /* Don't list Paradise Servers or *.tamu.edu */ - if (slist->typeflag != 'P' && strstr(slist->address,".tamu.edu") == NULL) + /* Don't list servers we cannot use */ + if (slist->typeflag != 'P' && !metablock(slist->address)) { #ifdef DEBUG @@ -583,8 +591,7 @@ slist = serverlist + i; - // Don't list *.tamu.edu - if (strstr(slist->address,".tamu.edu") != NULL) + if (metablock(slist->address)) return; #ifdef METAPING -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mailman.us.netrek.org/pipermail/netrek-dev/attachments/20060506/fc35f4d4/attachment.pgp