Finally caved in and created a command table. It's just going to get too messy with @-commands doing straight module lookups, plus the dict is probably a little faster. Feel free to start moving non-privved @-commands to commands_general and vice-versa since we now have the ability to do so.
This commit is contained in:
parent
2fc06adcfa
commit
ac32ab05c1
7 changed files with 174 additions and 43 deletions
|
|
@ -3,6 +3,7 @@ import resource
|
|||
|
||||
import functions_db
|
||||
import functions_general
|
||||
import functions_comsys
|
||||
import commands_general
|
||||
import commands_unloggedin
|
||||
import cmdhandler
|
||||
|
|
@ -270,6 +271,24 @@ def cmd_emit(cdat):
|
|||
session.msg("Emit what?")
|
||||
else:
|
||||
pobject.get_location().emit_to_contents(message)
|
||||
|
||||
def cmd_ccreate(cdat):
|
||||
"""
|
||||
Creates a new channel.
|
||||
"""
|
||||
session = cdat['session']
|
||||
pobject = session.get_pobject()
|
||||
uinput= cdat['uinput']['splitted']
|
||||
cname = ' '.join(uinput[1:])
|
||||
|
||||
if cname == '':
|
||||
session.msg("You must supply a name!")
|
||||
else:
|
||||
# Create and set the object up.
|
||||
cdat = {"name": cname, "owner": pobject}
|
||||
new_chan = functions_comsys.create_channel(cdat)
|
||||
|
||||
session.msg("Channel %s created." % (new_chan.get_name(),))
|
||||
|
||||
def cmd_create(cdat):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue