|
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Wed Jul 26, 2006 8:03 pm Post subject: chatmenu |
|
|
|
|
This is the module behind the menu system in my Pirates! zone. It doesn't do anything on its own but makes it easier for other modules to start chat based votes and stuff (often used in elim-like events).
I'm not providing binaries because as I said before it's no good on it's own so anyone that wants this should already be able to compile from source.
This is also the patch I use to prevent pub chat getting spammed with numbers:
--- core/chat.c 2006-06-08 23:41:24.000000000 +0100
+++ new/chat1.c 2006-07-03 20:30:16.000000000 +0100
@@ -1,3 +1,8 @@
+/* chat1
+ *
+ * modified to filter out lines in pub chat with just a number in them. smong.
+ *
+ */
/* dist: public */
@@ -441,7 +446,11 @@
int type = ismacro ? MSG_PUBMACRO : MSG_PUB;
LinkedList set = LL_INITIALIZER;
get_arena_set(&set, arena, p);
- send_reply(&set, type, sound, p, p->pid, msg, 0);
+
+ /* hack: eat integers between 1 and 9 inclusive */
+ if (msg[1] != 0 || *msg < '1' || *msg > '9')
+ send_reply(&set, type, sound, p, p->pid, msg, 0);
+
DO_CBS(CB_CHATMSG, arena, ChatMsgFunc, (p, type, sound, NULL, -1, msg));
lm->LogP(L_DRIVEL, "chat", p, "pub msg: %s", msg);
}
@@ -879,7 +888,7 @@
};
-EXPORT int MM_chat(int action, Imodman *mm_, Arena *arena)
+EXPORT int MM_chat1(int action, Imodman *mm_, Arena *arena)
{
if (action == MM_LOAD)
{
|
1.4.3 doc src
asss-chatmenu-1.1.zip - 1.81 KB
File downloaded or viewed 50 time(s)
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Fri Jul 28, 2006 12:14 pm Post subject: |
|
|
|
|
I have attached an example module called cm_tkmenu. Should you get tk'd it will ask you if you want to forgive them or punish them. The punishment is engine shutdown and energy depletion.
cm_tkmenu.c - 1.93 KB
File downloaded or viewed 36 time(s)
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Fri Jul 28, 2006 12:17 pm Post subject: |
|
|
|
|
If you haven't been asked a question, will it still stop numbers from going into pub chat? _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Fri Jul 28, 2006 12:23 pm Post subject: |
|
|
|
|
The patch to chat.c will stop single digit numbers being forwarded to everyone else.
Edit: Er, with the patch it always filters, there's no communication between chat and chatmenu to toggle the filtering on/off.
|
|
Back to top |
|
|
Grelminar Creator of Asss
Joined: Feb 26 2003 Posts: 378 Offline
|
Posted: Sat Jul 29, 2006 1:45 am Post subject: |
|
|
|
|
Yeah, something along those lines would be what I would want if I wanted to merge this.
Maybe a new Ichat function AskQuestion(player, text, callback, clos), which would send one or more lines of chat (split on newlines), then take the next line of pub chat from the player that consisted of just a number, and pass that number to the callback function. Numbers wouldn't be filtered out normally, and only from pub chat.
|
|
Back to top |
|
|
Elnino Newbie
Joined: Aug 10 2006 Posts: 14 Offline
|
Posted: Thu Aug 17, 2006 2:00 pm Post subject: |
|
|
|
|
whoa that's a GREAT module
simple, effective and fun good job Smong
|
|
Back to top |
|
|
Animate Dreams Gotta buy them all! (Consumer whore)
Age:36 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Fri Aug 18, 2006 3:11 pm Post subject: |
|
|
|
|
I just had an amazing idea. Filtering out duplicate macros. Or maybe every macro past the 2nd. Really, it should be an option in global.conf.
|
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Fri Aug 18, 2006 3:38 pm Post subject: |
|
|
|
|
or you could just put it in the client itself, that way everyone could have their own setting... maybe even make it accessable with a quick keyboard shortcut like ESC + I or something... that'd be the day _________________ SubSpace Discretion: A Third Generation SubSpace Client
|
|
Back to top |
|
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 1199 page(s) served in previous 5 minutes.
|