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

tswsl1989 at sucs.org tswsl1989 at sucs.org
Fri Oct 8 08:34:59 BST 2010


Author: tswsl1989
Date: 2010-10-08 08:34:59 +0100 (Fri, 08 Oct 2010)
New Revision: 1190

Modified:
   trunk/src/webclient/comms.c
Log:
Server side support for emotes from webclient

Modified: trunk/src/webclient/comms.c
===================================================================
--- trunk/src/webclient/comms.c	2010-10-07 22:15:13 UTC (rev 1189)
+++ trunk/src/webclient/comms.c	2010-10-08 07:34:59 UTC (rev 1190)
@@ -383,6 +383,17 @@
 		send(co->fd, buff, strlen(buff), 0);
 		return 0; // dont close
 	}else
+        if (co->authd && strncasecmp(buff, "emote ", 6)==0) {
+                struct filter_info f_info;
+                char line[8192];
+                memset(&f_info, 0, sizeof(f_info));
+                f_info.channel = user->room;
+                snprintf(line, sizeof line, "%s %s", user->name, &buff[6]);
+                ipc_send_to_all(IPC_TEXT, line, send_filter_oneroom, &f_info);
+                snprintf(buff, sizeof buff, "{\"status\":\"Emote Sent to channel %d\"}", user->room);
+                send(co->fd, buff, strlen(buff), 0);
+                return 1;
+        }else
 	if (co->authd && strcasecmp(buff, "who")==0) {
 		struct person u;
 		struct who w;




More information about the mw-devel mailing list