Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
chatmenu

 
Post new topic   Reply to topic Printable version
 View previous topic  Invoking Mono from an ASSS Module Post :: Post controllable doors  View next topic  
Author Message
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Wed Jul 26, 2006 8:03 pm    Post subject: chatmenu Reply to topic Reply with quote

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:
Code: Show/Hide
--- 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 48 time(s)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Fri Jul 28, 2006 12:14 pm    Post subject: Reply to topic Reply with quote

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 35 time(s)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Fri Jul 28, 2006 12:17 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Fri Jul 28, 2006 12:23 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Sat Jul 29, 2006 1:45 am    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email Visit posters website
Elnino
Newbie


Joined: Aug 10 2006
Posts: 14
Offline

PostPosted: Thu Aug 17, 2006 2:00 pm    Post subject: Reply to topic Reply with quote

whoa that's a GREAT module

simple, effective and fun good job Smong
Back to top
View users profile Send private message Add User to Ignore List
Animate Dreams
Gotta buy them all!
(Consumer whore)


Age:36
Gender:Gender:Male
Joined: May 01 2004
Posts: 821
Location: Middle Tennessee
Offline

PostPosted: Fri Aug 18, 2006 3:11 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
Bak
?ls -s
0 in


Age:24
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Fri Aug 18, 2006 3:38 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Custom Projects All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 675 page(s) served in previous 5 minutes.

phpBB Created this page in 0.443110 seconds : 35 queries executed (93.0%): GZIP compression disabled