OBS: You need to resync your database! The Nickname system is now a separate database model with the result that also channel nicks are more robust. Also nickname replacement has been adjusted to fix some exceptional circumstances. Fixed a host of issues in the channel and nick handlers and adjoining commands that caused the channel-syscommands to fail in some situations. Resolves issue131. Resolves issue 132. Resolves issue 134.

This commit is contained in:
Griatch 2011-02-27 22:27:56 +00:00
parent 7ebcefae2e
commit 2bdaf034c8
17 changed files with 298 additions and 305 deletions

View file

@ -34,14 +34,15 @@ class ChannelCommand(command.Command):
Usage:
<channel name or alias> <message>
This is a channel. You can send to it by entering
its name or alias, followed by the text you want to send.
This is a channel. If you have subscribed to it, you can send to
it by entering its name or alias, followed by the text you want to
send.
"""
# this flag is what identifies this cmd as a channel cmd
# and branches off to the system send-to-channel command
# (which is customizable by admin)
key = "general"
help_category = "Channels"
help_category = "Channel Names"
permissions = "cmd:use_channels"
is_channel = True
obj = None
@ -64,6 +65,7 @@ class ChannelCommand(command.Command):
caller.msg("Say what?")
return
channel = Channel.objects.get_channel(channelkey)
if not channel:
caller.msg("Channel '%s' not found." % channelkey)
return
@ -93,8 +95,8 @@ class ChannelHandler(object):
def __str__(self):
return ", ".join(str(cmd) for cmd in self.cached_channel_cmds)
def reset(self):
def clear(self):
"""
Reset the cache storage.
"""

View file

@ -232,13 +232,7 @@ class ChannelManager(models.Manager):
from src.comms.channelhandler import CHANNELHANDLER
CHANNELHANDLER.update()
return None
def has_connection(self, player, channel):
"Check so the player is really listening to this channel."
ChannelConnection = ContentType.objects.get(app_label="comms",
model="channelconnection").model_class()
return ChannelConnection.objects.has_connection(player, channel)
def get_all_connections(self, channel):
"""
Return the connections of all players listening

View file

@ -474,7 +474,7 @@ class Channel(SharedMemoryModel):
Checks so this player is actually listening
to this channel.
"""
return Channel.objects.has_connection(player, self)
return ChannelConnection.objects.has_connection(player, self)
def msg(self, msgobj, from_obj=None):
"""