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:
parent
2d206c5e68
commit
d14b014611
2 changed files with 9 additions and 2 deletions
|
|
@ -132,7 +132,6 @@ class CmdUnconnectedCreate(MuxCommand):
|
||||||
session.msg(string)
|
session.msg(string)
|
||||||
return
|
return
|
||||||
playername, password = parts
|
playername, password = parts
|
||||||
print "playername '%s', password: '%s'" % (playername, password)
|
|
||||||
|
|
||||||
# sanity checks
|
# sanity checks
|
||||||
if not re.findall('^[\w. @+-]+$', playername) or not (0 < len(playername) <= 30):
|
if not re.findall('^[\w. @+-]+$', playername) or not (0 < len(playername) <= 30):
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ from src.utils.utils import is_iter, to_str, crop, make_iter
|
||||||
|
|
||||||
__all__ = ("Msg", "TempMsg", "Channel", "PlayerChannelConnection", "ExternalChannelConnection")
|
__all__ = ("Msg", "TempMsg", "Channel", "PlayerChannelConnection", "ExternalChannelConnection")
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Msg
|
# Msg
|
||||||
|
|
@ -546,6 +545,15 @@ class Channel(SharedMemoryModel):
|
||||||
Checks so this player is actually listening
|
Checks so this player is actually listening
|
||||||
to this channel.
|
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)
|
return PlayerChannelConnection.objects.has_player_connection(player, self)
|
||||||
|
|
||||||
def msg(self, msgobj, header=None, senders=None, persistent=True):
|
def msg(self, msgobj, header=None, senders=None, persistent=True):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue