Fixed the auto-subscription to channels by non-superusers. Resolves Issue 336. Removed a spurious print statement in the unloggedin create command.

This commit is contained in:
Griatch 2012-12-12 22:57:03 +01:00
parent 2d206c5e68
commit d14b014611
2 changed files with 9 additions and 2 deletions

View file

@ -132,7 +132,6 @@ class CmdUnconnectedCreate(MuxCommand):
session.msg(string)
return
playername, password = parts
print "playername '%s', password: '%s'" % (playername, password)
# sanity checks
if not re.findall('^[\w. @+-]+$', playername) or not (0 < len(playername) <= 30):

View file

@ -30,7 +30,6 @@ from src.utils.utils import is_iter, to_str, crop, make_iter
__all__ = ("Msg", "TempMsg", "Channel", "PlayerChannelConnection", "ExternalChannelConnection")
#------------------------------------------------------------
#
# Msg
@ -546,6 +545,15 @@ class Channel(SharedMemoryModel):
Checks so this player is actually listening
to this channel.
"""
# also handle object.player calls
player, typ = identify_object(player)
if typ == 'object':
player = player.player
player, typ = identify_object(player)
if player and not typ == "player":
logger.log_errmsg("Channel.has_connection received object of type '%s'. It only accepts players/characters." % typ)
return
# do the check
return PlayerChannelConnection.objects.has_player_connection(player, self)
def msg(self, msgobj, header=None, senders=None, persistent=True):