Indenting fixes, still need to finish on commands_comsys, will pick it up later unless someone beats me to it.

This commit is contained in:
Greg Taylor 2007-05-11 15:43:06 +00:00
parent 65df59ff53
commit 44701530dc
3 changed files with 94 additions and 85 deletions

View file

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

View file

@ -14,148 +14,150 @@ now.
""" """
def cmd_addcom(cdat): def cmd_addcom(cdat):
""" """
addcom addcom
Adds an alias for a channel. Adds an alias for a channel.
addcom foo=Bar addcom foo=Bar
""" """
pass pass
def cmd_allcom(cdat): def cmd_allcom(cdat):
""" """
allcom allcom
Allows the user to universally turn off or on all channels they are on, Allows the user to universally turn off or on all channels they are on,
as well as perform a "who" for all channels they are on. as well as perform a "who" for all channels they are on.
""" """
pass pass
def cmd_comtitle(cdat): def cmd_comtitle(cdat):
""" """
comtitle comtitle
Sets a prefix to the user's name on the specified channel. Sets a prefix to the user's name on the specified channel.
""" """
pass pass
def cmd_clearcom(cdat): def cmd_clearcom(cdat):
""" """
clearcom clearcom
Effectively runs delcom on all channels the user is on. It will remove their aliases, Effectively runs delcom on all channels the user is on. It will remove their aliases,
remove them from the channel, and clear any titles they have set. remove them from the channel, and clear any titles they have set.
""" """
pass pass
def cmd_clist(cdat): def cmd_clist(cdat):
""" """
@clist @clist
Lists all available channels on the game. Lists all available channels on the game.
""" """
pass session = cdat['session']
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())
def cmd_cdestroy(cdat): def cmd_cdestroy(cdat):
""" """
@cdestroy @cdestroy
Destroys a channel. Destroys a channel.
""" """
pass pass
def cmd_cset(cdat): def cmd_cset(cdat):
""" """
@cset @cset
Sets various flags on a channel. Sets various flags on a channel.
""" """
pass pass
def cmd_cpflags(cdat): def cmd_cpflags(cdat):
""" """
@cpflags @cpflags
Sets various flags on a channel relating to players. Sets various flags on a channel relating to players.
""" """
pass pass
def cmd_coflags(cdat): def cmd_coflags(cdat):
""" """
@coflags @coflags
Sets various flags on a channel relating to objects. Sets various flags on a channel relating to objects.
""" """
pass pass
def cmd_ccharge(cdat): def cmd_ccharge(cdat):
""" """
@ccharge @ccharge
Sets the cost to transmit over a channel. Default is free. Sets the cost to transmit over a channel. Default is free.
""" """
pass pass
def cmd_cboot(cdat): def cmd_cboot(cdat):
""" """
@cboot @cboot
Kicks a player or object from the channel. Kicks a player or object from the channel.
""" """
pass pass
def cmd_cemit(cdat): def cmd_cemit(cdat):
""" """
@cemit @cemit
Allows the user to send a message over a channel as long as Allows the user to send a message over a channel as long as
they own or control it. It does not show the user's name. they own or control it. It does not show the user's name.
""" """
pass pass
def cmd_cwho(cdat): def cmd_cwho(cdat):
""" """
@cwho @cwho
Displays the name, status and object type for a given channel. Displays the name, status and object type for a given channel.
Adding /all after the channel name will list disconnected players Adding /all after the channel name will list disconnected players
as well. as well.
""" """
pass pass
def cmd_ccreate(cdat): def cmd_ccreate(cdat):
""" """
@ccreate @ccreate
Creates a new channel with the invoker being the default owner. Creates a new channel with the invoker being the default owner.
""" """
session = cdat['session'] session = cdat['session']
pobject = session.get_pobject() pobject = session.get_pobject()
uinput= cdat['uinput']['splitted'] uinput= cdat['uinput']['splitted']
cname = ' '.join(uinput[1:]) cname = ' '.join(uinput[1:])
if cname == '': if cname == '':
session.msg("You must supply a name!") session.msg("You must supply a name!")
else: else:
# Create and set the object up. # Create and set the object up.
cdat = {"name": cname, "owner": pobject} cdat = {"name": cname, "owner": pobject}
new_chan = functions_comsys.create_channel(cdat) new_chan = functions_comsys.create_channel(cdat)
session.msg("Channel %s created." % (new_chan.get_name(),)) session.msg("Channel %s created." % (new_chan.get_name(),))
def cmd_cchown(cdat): def cmd_cchown(cdat):
""" """
@cchown @cchown
Changes the owner of a channel. Changes the owner of a channel.
""" """
pass pass
def cmd_delcom(cdat): def cmd_delcom(cdat):
""" """
delcom delcom
Removes the specified alias to a channel. If this is the last alias, Removes the specified alias to a channel. If this is the last alias,
the user is effectively removed from the channel. the user is effectively removed from the channel.
""" """
pass pass

View file

@ -24,6 +24,12 @@ def get_com_who(channel, muted=False, disconnected=False):
def get_user_channels(player): def get_user_channels(player):
pass pass
def get_all_channels():
"""
Returns all channel objects.
"""
return CommChannel.objects.all()
def create_channel(cdat): def create_channel(cdat):
""" """
Create a new channel. cdat is a dictionary that contains the following keys. Create a new channel. cdat is a dictionary that contains the following keys.