Author |
Message |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Sun Nov 19, 2006 5:43 pm Post subject: Silencing ip address |
 |
|
|
|
I am trying to silence by IP address using a python module. There are a few things I need to do in order to do this.
Get the player's ip when they enter the zone
Query the database for that ip and check the column 'banlength'
Compar that time to the current time to decide if they are still silenced.
Apply a new silence for the remaining time.
Any help would make me really happy. I'm working on it now. If I figure it out I will edit my post. |
|
Back to top |
|
 |
Smong Server Help Squatter

Joined: 1043048991 Posts: 0x91E Offline
|
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Sun Nov 19, 2006 6:25 pm Post subject: |
 |
|
|
|
How do I query the db and see if the ip entering matches a row with an ip that has a banlength on it? I need to know how to Query the database before I begin any of it. |
|
Back to top |
|
 |
Smong Server Help Squatter

Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Mon Nov 20, 2006 4:46 am Post subject: |
 |
|
|
|
Just look at the alias module. |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Mon Nov 20, 2006 5:04 pm Post subject: |
 |
|
|
|
New problem: I looked at setcm in playercmd.c but chat.SetPlayerChatMask doesn't seem to silence people. Could you help me out with this? |
|
Back to top |
|
 |
Smong Server Help Squatter

Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Tue Nov 21, 2006 5:38 pm Post subject: |
 |
|
|
|
Post your code. |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
|
Back to top |
|
 |
Smong Server Help Squatter

Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Tue Nov 21, 2006 6:39 pm Post subject: |
 |
|
|
|
Ok this works for me:
from asss import *
chat = get_interface(I_CHAT)
def c_silence(cmd, params, p, targ):
# get integer parameter
timeout = 0
try: timeout = int(params)
except: pass
# check for priv command
if isinstance(targ, PlayerType) and timeout >= 1:
newmask = 1 << MSG_CHAT
chat.SetPlayerChatMask(targ, newmask, timeout)
cmd1 = add_command("t1", c_silence) |
Silencing chat channels for 60 seconds:
Smong> ?getcm
getcm: +pub +pubmacro +freq +nmefreq +priv +chat +modchat
Smong> ?t1 60
Smong> ?getcm
getcm: +pub +pubmacro +freq +nmefreq +priv -chat +modchat |
|
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Tue Nov 21, 2006 7:39 pm Post subject: |
 |
|
|
|
thanks  |
|
Back to top |
|
 |
|