[mw-devel] MW3 r1272 - in trunk/src: . webclient

arthur at sucs.org arthur at sucs.org
Tue Nov 6 15:32:42 GMT 2012


Author: arthur
Date: 2012-11-06 15:32:42 +0000 (Tue, 06 Nov 2012)
New Revision: 1272

Modified:
   trunk/src/files.c
   trunk/src/files.h
   trunk/src/main.c
   trunk/src/webclient/mwpoll.c
Log:
allow setting of host:port with -server option


Modified: trunk/src/files.c
===================================================================
--- trunk/src/files.c	2012-11-05 13:44:50 UTC (rev 1271)
+++ trunk/src/files.c	2012-11-06 15:32:42 UTC (rev 1272)
@@ -33,9 +33,12 @@
 {
 }
 
-void open_incoming_fifo(void)
+void open_incoming_fifo(const char *host)
 {
-	ipc_connect("localhost");
+	if (host == NULL)
+		ipc_connect("localhost");
+	else
+		ipc_connect(host);
 }
 
 int open_outgoing_fifo(pid_t dest_pid)

Modified: trunk/src/files.h
===================================================================
--- trunk/src/files.h	2012-11-05 13:44:50 UTC (rev 1271)
+++ trunk/src/files.h	2012-11-06 15:32:42 UTC (rev 1272)
@@ -11,7 +11,7 @@
 #define WHOFILE     MSGDIR"/who.bb"
 
 void create_pipe(void);
-void open_incoming_fifo(void);
+void open_incoming_fifo(const char *host);
 int open_outgoing_fifo(pid_t dest_pid);
 void close_fifo(void);
 void Lock_File(int f);

Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c	2012-11-05 13:44:50 UTC (rev 1271)
+++ trunk/src/main.c	2012-11-06 15:32:42 UTC (rev 1272)
@@ -92,6 +92,7 @@
 int autowho=0;
 int runautoexec=1;
 char *autoexec_arg;
+char *targethost = NULL;
 
 struct alarm *timeout_event_1, *timeout_event_2;
 extern int script_terminate;
@@ -452,6 +453,18 @@
 			else view_help = 1;
 		}
 
+		/* view all messages as a particular user */
+		if (match_arg_str(argv[al], "server"))
+		{
+			if (al < (argc - 1))
+			{
+				targethost = argv[al+1];
+				al++;
+				continue;
+			}
+			else view_help = 1;
+		}
+
 		/* write message in folder from user */
 		if (match_arg_str(argv[al], "f"))
 		{
@@ -475,6 +488,7 @@
 		printf(_("  -autowho    Show a 'who' list automatically on log on to talker\n"));
 		printf(_("  -i          Internet mode (no readline)\n"));
 		printf(_("  -new        Summary of new messages and quit\n"));
+		printf(_("  -server <a> Connect to server <a>\n"));
 		printf(_("  -since      Lists people logged on between now and when you last logged on\n"));
 		printf(_("  -who        Show a list of users logged on and quit\n"));
 		printf(_("  -what       Show a list of what users are doing\n"));
@@ -588,7 +602,7 @@
 
 	close_fifo();
 	create_pipe();
-	open_incoming_fifo();
+	open_incoming_fifo(targethost);
 
 	/* display all new messages for given user */
 	if (msguser_num>-1 && god_mode())

Modified: trunk/src/webclient/mwpoll.c
===================================================================
--- trunk/src/webclient/mwpoll.c	2012-11-05 13:44:50 UTC (rev 1271)
+++ trunk/src/webclient/mwpoll.c	2012-11-06 15:32:42 UTC (rev 1272)
@@ -215,7 +215,7 @@
 
 	/* load us up */
 	create_pipe();
-	open_incoming_fifo();
+	open_incoming_fifo("localhost");
 	open_command_socket();
 	
 	if (user->status&(1<<3)) {




More information about the mw-devel mailing list