I would kindly like to ask why no one has emplimented an /ignore Command. This has been one thing I've hated about Aos, is no /ignore command.
So is it possiable to implement?
Fyi:obviously this would work well for ignore the 60% population of kids on Aos.
-Slyph
Add /ignore Command
-
Slyph
Deuce - Posts: 2
- Joined: Tue Jan 08, 2013 6:19 am
-
Sasquatch
Mapper
- Posts: 141
- Joined: Wed Nov 14, 2012 5:18 pm
Would be nice but you would have to type a lost of people you want to ignore each game. Maybe an option on the controls file where you can add names that you can ignore?
I make maps :3
My [url=aos://199772608:32887]dedicated server[/url] is NOT up and running... soz
-
Slyph
Deuce - Posts: 2
- Joined: Tue Jan 08, 2013 6:19 am
Sasquatch wrote:Would be nice but you would have to type a lost of people you want to ignore each game. Maybe an option on the controls file where you can add names that you can ignore?Ya, like a text documents listing people who you ignored.
-
GreaseMonkey
Coder
- Posts: 733
- Joined: Tue Oct 30, 2012 11:07 pm
How about /ignorefrom? That would make it much easier.
-
mr.f
Deuced Up - Posts: 37
- Joined: Thu Jan 03, 2013 5:16 am
Slyph wrote:I don't think this is possible currently.. cause the server would need access to a client-side text document. Maybe a client-side hack would work. But I don't really know what I'm talking about hahaSasquatch wrote:Would be nice but you would have to type a lost of people you want to ignore each game. Maybe an option on the controls file where you can add names that you can ignore?Ya, like a text documents listing people who you ignored.
I did whip up a server-side script for this, but it ended up being really ugly. There was no good way to intercept the chats without making it so that no one got them. I ended up overriding send_contained.. which is bad.
Well it seems to work anyway, but someone else should probably take a look over to make sure. And maybe see if there's a better way to implement the actual ignoring part, while you're at it.
Code: Select all
"""
ignore.py
Adds the ability to 'ignore' certain players (all their chats will not be
received). Use the command again to unignore. No arguments returns the list
of people you're currently ignoring.
Author: mr.f
"""
from pyspades import contained as loaders
from functools import partial
from twisted.internet import reactor
from commands import add, get_player
S_IGNORE = "You're now ignoring {player}"
S_UNIGNORE = "You've unignored {player}"
S_IGNORED = "{player} is ignoring you"
S_IGNORE_LIST = "You're currently ignoring: "
NOTIFY_IGNORED_PLAYER = True
ANON_NOTIFICATION = True
def ignore(connection, player = None):
#no args tells you everyone you're ingoring
if player is None:
return S_IGNORE_LIST + ", ".join(connection.ignoreList)
player = get_player(connection.protocol, player)
## if player is connection: return
#optionally notify ignored player
name = "Anon" if ANON_NOTIFICATION else connection.name
if NOTIFY_IGNORED_PLAYER:
player.send_chat(S_IGNORED.format(player = name))
if connection.add_ignore(player.name):
return S_IGNORE.format(player = player.name)
return S_UNIGNORE.format(player = player.name)
add(ignore)
def apply_script(protocol, connection, config):
class IgnoreConnection(connection):
def __init__(self, *arg, **kw):
connection.__init__(self, *arg, **kw)
self.ignoreList = [] #names of people this player is ignoring
def add_ignore(self, player_name):
if player_name not in self.ignoreList:
self.ignoreList.append(player_name)
return True
self.ignoreList.remove(player_name)
return False
class IgnoreProtocol(protocol):
def can_hear(self, target,chatter):
return chatter.name not in target.ignoreList
#copied from BaseProtocol
def send_contained(self, contained, unsequenced = False, sender = None,
team = None, save = False, rule = None):
if contained.id == loaders.ChatMessage.id:
chatter = self.players[contained.player_id]
rule = partial(self.can_hear, chatter)
protocol.send_contained(self,contained,unsequenced,sender,
team,save,rule)
return IgnoreProtocol, IgnoreConnection
Last edited by mr.f on Tue Jan 08, 2013 9:17 pm, edited 1 time in total.
-
rakiru
Coder
- Posts: 1349
- Joined: Sun Nov 11, 2012 12:26 pm
-
-
mr.f
Deuced Up - Posts: 37
- Joined: Thu Jan 03, 2013 5:16 am
Thanks for the tip. Ended up using the rule parameter for send_contained.. much cleaner now.
-
Jdrew
Mapper
- Posts: 4808
- Joined: Tue Oct 30, 2012 10:48 pm
I don't think it is needed because most people never PM anyone let alone spam there PMs.
-
mr.f
Deuced Up - Posts: 37
- Joined: Thu Jan 03, 2013 5:16 am
jdrew wrote:I don't think it is needed because most people never PM anyone let alone spam there PMs.It ignores certain people in the main chat. At least that's what I assume everyone was talking about.
-
Jdrew
Mapper
- Posts: 4808
- Joined: Tue Oct 30, 2012 10:48 pm
mr.f wrote:Ohh I get it so like a local mute thing for chat? It probably isn't posable but maybe?jdrew wrote:I don't think it is needed because most people never PM anyone let alone spam there PMs.It ignores certain people in the main chat. At least that's what I assume everyone was talking about.
-
White Hot
Deuced Up - Posts: 360
- Joined: Tue Nov 06, 2012 1:33 am
I think it could be possible if the script worked so that it could detect when players talked, and check who had them local muted, (locally muted?) and not display the text for them. Would probably cause chat lag though.
-
rakiru
Coder
- Posts: 1349
- Joined: Sun Nov 11, 2012 12:26 pm
-
jdrew wrote:Of course it's fucking possible. Ignoring the fact that he just wrote a script to do exactly that, the server is in complete control of who gets sent to what. Something as simple as allowing users to ignore other users is easy.mr.f wrote:Ohh I get it so like a local mute thing for chat? It probably isn't posable but maybe?jdrew wrote:I don't think it is needed because most people never PM anyone let alone spam there PMs.It ignores certain people in the main chat. At least that's what I assume everyone was talking about.
-
White Hot
Deuced Up - Posts: 360
- Joined: Tue Nov 06, 2012 1:33 am
rakiru wrote:No, Rakiru, he said it's not posable. He's right, you can't really make a script pose.jdrew wrote:Of course it's fucking possible. Ignoring the fact that he just wrote a script to do exactly that, the server is in complete control of who gets sent to what. Something as simple as allowing users to ignore other users is easy.
Ohh I get it so like a local mute thing for chat? It probably isn't posable but maybe?
-
mr.f
Deuced Up - Posts: 37
- Joined: Thu Jan 03, 2013 5:16 am
White Hot wrote:Hmm.. I'll have to make some modifications...rakiru wrote:No, Rakiru, he said it's not posable. He's right, you can't really make a script pose.jdrew wrote:Of course it's fucking possible. Ignoring the fact that he just wrote a script to do exactly that, the server is in complete control of who gets sent to what. Something as simple as allowing users to ignore other users is easy.
Ohh I get it so like a local mute thing for chat? It probably isn't posable but maybe?
EDIT:
Code: Select all
There. Now fully posable. """
O
/|\/
/ |
/\
/ \
ignore.py
Adds the ability to 'ignore' certain players (all their chats will not be
received). Use the command again to unignore. No arguments returns the list
of people you're currently ignoring.
Author: mr.f
"""
from pyspades import contained as loaders
from functools import partial
from twisted.internet import reactor
from commands import add, get_player
S_IGNORE = "You're now ignoring {player}"
S_UNIGNORE = "You've unignored {player}"
S_IGNORED = "{player} is ignoring you"
S_IGNORE_LIST = "You're currently ignoring: "
NOTIFY_IGNORED_PLAYER = True
ANON_NOTIFICATION = True
def ignore(connection, player = None):
#no args tells you everyone you're ingoring
if player is None:
return S_IGNORE_LIST + ", ".join(connection.ignoreList)
player = get_player(connection.protocol, player)
## if player is connection: return
#optionally notify ignored player
name = "Anon" if ANON_NOTIFICATION else connection.name
if NOTIFY_IGNORED_PLAYER:
player.send_chat(S_IGNORED.format(player = name))
if connection.add_ignore(player.name):
return S_IGNORE.format(player = player.name)
return S_UNIGNORE.format(player = player.name)
add(ignore)
def apply_script(protocol, connection, config):
class IgnoreConnection(connection):
def __init__(self, *arg, **kw):
connection.__init__(self, *arg, **kw)
self.ignoreList = [] #names of people this player is ignoring
def add_ignore(self, player_name):
if player_name not in self.ignoreList:
self.ignoreList.append(player_name)
return True
self.ignoreList.remove(player_name)
return False
class IgnoreProtocol(protocol):
def can_hear(self, target,chatter):
return chatter.name not in target.ignoreList
#copied from BaseProtocol
def send_contained(self, contained, unsequenced = False, sender = None,
team = None, save = False, rule = None):
if contained.id == loaders.ChatMessage.id:
chatter = self.players[contained.player_id]
rule = partial(self.can_hear, chatter)
protocol.send_contained(self,contained,unsequenced,sender,
team,save,rule)
return IgnoreProtocol, IgnoreConnection
Who is online
Users browsing this forum: No registered users and 17 guests

