[mw-devel] MW3 r1161 - trunk/src
dez at sucs.org
dez at sucs.org
Thu Jul 29 14:13:15 BST 2010
Author: dez
Date: 2010-07-29 14:13:15 +0100 (Thu, 29 Jul 2010)
New Revision: 1161
Modified:
trunk/src/chattable.c
trunk/src/talker.c
trunk/src/talker.h
Log:
Adds .e'll and .e'd commands, resolving #43
Modified: trunk/src/chattable.c
===================================================================
--- trunk/src/chattable.c 2010-07-23 13:50:47 UTC (rev 1160)
+++ trunk/src/chattable.c 2010-07-29 13:13:15 UTC (rev 1161)
@@ -30,10 +30,14 @@
{"doing" ,0x0000 ,0, "Usage: doing <status...>", "Set status message", c_doing, 1},
{"e" ,0x0000 ,1, "Usage: e <message>", "Emote message", t_emote, 1},
{"e'" ,0x0000 ,1, "Usage: e' <message>", "Emote' message", t_emotes2, 0},
+{"e'd" ,0x0000 ,1, "Usage: e's <message>", "Emote's message", t_emoted, 0},
+{"e'll" ,0x0000 ,1, "Usage: e's <message>", "Emote's message", t_emotell, 0},
{"e's" ,0x0000 ,1, "Usage: e's <message>", "Emote's message", t_emotes, 0},
{"em" ,0x0000 ,1, "Usage: em <message>", "Emote message", t_emote, 0},
{"emote" ,0x0000 ,1, "Usage: emote <message>", "Emote message", t_emote, 1},
{"emote'" ,0x0000 ,1, "Usage: emote' <message>", "Emote' message", t_emotes2, 0},
+{"emote'd" ,0x0000 ,1, "Usage: emote's <message>", "Emote's message", t_emoted, 0},
+{"emote'll" ,0x0000 ,1, "Usage: emote's <message>", "Emote's message", t_emotell, 0},
{"emote's" ,0x0000 ,1, "Usage: emote's <message>", "Emote's message", t_emotes, 0},
{"event" ,0x0200 ,0, "Usage: event <function>", "Add text event handler function", t_event, 1},
{"floodlimit" ,0x2200 ,1, "Usage: floodlimit <number>", "Set the number of lines before a script floods", t_flood, 1},
Modified: trunk/src/talker.c
===================================================================
--- trunk/src/talker.c 2010-07-23 13:50:47 UTC (rev 1160)
+++ trunk/src/talker.c 2010-07-29 13:13:15 UTC (rev 1161)
@@ -182,17 +182,23 @@
ipc_send_to_all(IPC_TEXT, buff, send_filter_global, &f_info);
}
-void talk_send_emote(char * text, int channel, int pleural){
+void talk_send_emote(char * text, int channel, int plural){
char buff[MAXTEXTLENGTH];
catchuri(text);
- switch (pleural) {
+ switch (plural) {
case 1:
snprintf(buff, MAXTEXTLENGTH, "%s's %s", user->name, text);
break;
case 2:
snprintf(buff, MAXTEXTLENGTH, "%s' %s", user->name, text);
break;
+ case 3:
+ snprintf(buff, MAXTEXTLENGTH, "%s'd %s", user->name, text);
+ break;
+ case 4:
+ snprintf(buff, MAXTEXTLENGTH, "%s'll %s", user->name, text);
+ break;
default:
snprintf(buff, MAXTEXTLENGTH, "%s %s", user->name, text);
}
@@ -620,6 +626,28 @@
talk_send_emote(text,user->room,2);
}
+void t_emoted(CommandList *cm, int argc, char **argv, char *args)
+{
+ char text[MAXTEXTLENGTH];
+
+ text[0] = 0;
+ strncat(text, args, MAXTEXTLENGTH - strlen(text) - 1);
+
+ apply_gag(text);
+ talk_send_emote(text,user->room,3);
+}
+
+void t_emotell(CommandList *cm, int argc, char **argv, char *args)
+{
+ char text[MAXTEXTLENGTH];
+
+ text[0] = 0;
+ strncat(text, args, MAXTEXTLENGTH - strlen(text) - 1);
+
+ apply_gag(text);
+ talk_send_emote(text,user->room,4);
+}
+
void t_global(CommandList *cm, int argc, char **argv, char *args)
{
int z=BoolOpt(argv[1]);
Modified: trunk/src/talker.h
===================================================================
--- trunk/src/talker.h 2010-07-23 13:50:47 UTC (rev 1160)
+++ trunk/src/talker.h 2010-07-29 13:13:15 UTC (rev 1161)
@@ -29,6 +29,8 @@
void t_emote(CommandList *cm, int argc, char **argv, char *args);
void t_emotes(CommandList *cm, int argc, char **argv, char *args);
void t_emotes2(CommandList *cm, int argc, char **argv, char *args);
+void t_emoted(CommandList *cm, int argc, char **argv, char *args);
+void t_emotell(CommandList *cm, int argc, char **argv, char *args);
void t_event(CommandList *cm, int argc, char **argv, char *args);
void t_unevent(CommandList *cm, int argc, char **argv, char *args);
void t_global(CommandList *cm, int argc, char **argv, char *args);
@@ -62,7 +64,7 @@
void chat_say(char *text);
void chat_sayto(char *to,char *text, int exclude);
void set_talk_rights(void);
-void talk_send_emote(char * text, int channel, int pleural);
+void talk_send_emote(char * text, int channel, int plural);
void talk_send_rawbcast(char * text);
void talk_send_raw(char * text, int channel);
void talk_send_shout(char * text);
More information about the mw-devel
mailing list