[mw-devel] MW3 r1283 - trunk/src/webclient

arthur at sucs.org arthur at sucs.org
Thu Nov 8 11:56:53 GMT 2012


Author: arthur
Date: 2012-11-08 11:56:53 +0000 (Thu, 08 Nov 2012)
New Revision: 1283

Modified:
   trunk/src/webclient/mwpoll.c
Log:
allow alternate ports for webclient


Modified: trunk/src/webclient/mwpoll.c
===================================================================
--- trunk/src/webclient/mwpoll.c	2012-11-08 11:27:21 UTC (rev 1282)
+++ trunk/src/webclient/mwpoll.c	2012-11-08 11:56:53 UTC (rev 1283)
@@ -59,12 +59,13 @@
 
 void usage(const char *name)
 {
-	printf("Usage: %s [-u username] [-c channel] [-dsa]\n", name);
+	printf("Usage: %s [-u username] [-c channel] [-dsa] [-h host:port]\n", name);
 	printf("-u username	Select username\n");
 	printf("-c channel	Initial channel to join\n");
 	printf("-d		Debug (foreground) mode\n");
 	printf("-s		Session mode for sucssite\n");
 	printf("-a		Auto create user if required\n");
+	printf("-h host:port	Specify alternate server to connect to.\n");
 }
 
 int main(int argc, char ** argv)
@@ -75,16 +76,21 @@
 	int debug = 0;
 	int dbsession = 0;
 	int autocreate = 0;
+	char *hostname = NULL;
 	char passwd[80];
 	char rawpw[80];
 
 	username = strdup("Arthur2");
-	while ((opt=getopt(argc,argv,"u:c:dsa"))!=-1) {
+	while ((opt=getopt(argc,argv,"u:c:h:dsa"))!=-1) {
 		switch (opt) {
 			case 'u':
 				if (username) free(username);
 				username = strdup(optarg);
 				break;
+			case 'h':
+				if (hostname) free(hostname);
+				hostname = strdup(optarg);
+				break;
 			case 'c':
 				channel = atoi(optarg);
 				break;
@@ -215,7 +221,7 @@
 
 	/* load us up */
 	create_pipe();
-	open_incoming_fifo("localhost");
+	open_incoming_fifo(hostname);
 	open_command_socket();
 	
 	if (user->status&(1<<3)) {




More information about the mw-devel mailing list