@cdestroy now implemented as per MUX.

This commit is contained in:
Greg Taylor 2007-05-15 14:30:52 +00:00
parent 725b1b2ac0
commit e1f4c2e0da
2 changed files with 22 additions and 3 deletions

View file

@ -28,6 +28,7 @@ ctable = {
"version": commands_general.cmd_version,
"who": commands_general.cmd_who,
"@ccreate": commands_comsys.cmd_ccreate,
"@cdestroy": commands_comsys.cmd_cdestroy,
"@clist": commands_comsys.cmd_clist,
"@create": commands_privileged.cmd_create,
"@description": commands_privileged.cmd_description,

View file

@ -55,9 +55,11 @@ def cmd_clist(cdat):
Lists all available channels on the game.
"""
session = cdat['session']
session.msg("*** Channel Owner Description")
session.msg("** Channel Owner Description")
for chan in functions_comsys.get_all_channels():
session.msg("--- %s %s" % (chan.get_name(), chan.get_owner().get_name()))
session.msg("%s%s %-13.13s %-15.15s %-45.45s" %
('-', '-', chan.get_name(), chan.get_owner().get_name(), 'No Description'))
session.msg("-- End of Channel List --")
def cmd_cdestroy(cdat):
"""
@ -65,7 +67,23 @@ def cmd_cdestroy(cdat):
Destroys a channel.
"""
pass
session = cdat['session']
pobject = session.get_pobject()
uinput= cdat['uinput']['splitted']
cname = ' '.join(uinput[1:])
if cname == '':
session.msg("You must supply a name!")
return
name_matches = functions_comsys.cname_search(cname, exact=True)
if not name_matches:
session.msg("Could not find channel %s." % (cname,))
else:
session.msg("Channel %s destroyed." % (name_matches[0],))
name_matches.delete()
def cmd_cset(cdat):
"""