Moving @ccreate from commands_privileged to commands_comsys. Still need to add duplicate name checking.
This commit is contained in:
parent
ac32ab05c1
commit
65df59ff53
3 changed files with 22 additions and 20 deletions
|
|
@ -27,7 +27,7 @@ ctable = {
|
||||||
"uptime": commands_general.cmd_uptime,
|
"uptime": commands_general.cmd_uptime,
|
||||||
"version": commands_general.cmd_version,
|
"version": commands_general.cmd_version,
|
||||||
"who": commands_general.cmd_who,
|
"who": commands_general.cmd_who,
|
||||||
"@ccreate": commands_privileged.cmd_ccreate,
|
"@ccreate": commands_comsys.cmd_ccreate,
|
||||||
"@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,
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import time
|
||||||
import functions_general
|
import functions_general
|
||||||
import functions_db
|
import functions_db
|
||||||
import functions_help
|
import functions_help
|
||||||
|
import functions_comsys
|
||||||
import defines_global as global_defines
|
import defines_global as global_defines
|
||||||
import session_mgr
|
import session_mgr
|
||||||
import ansi
|
import ansi
|
||||||
|
|
@ -122,6 +123,26 @@ def cmd_cwho(cdat):
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def cmd_ccreate(cdat):
|
||||||
|
"""
|
||||||
|
@ccreate
|
||||||
|
|
||||||
|
Creates a new channel with the invoker being the default owner.
|
||||||
|
"""
|
||||||
|
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_cchown(cdat):
|
def cmd_cchown(cdat):
|
||||||
"""
|
"""
|
||||||
@cchown
|
@cchown
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import resource
|
||||||
|
|
||||||
import functions_db
|
import functions_db
|
||||||
import functions_general
|
import functions_general
|
||||||
import functions_comsys
|
|
||||||
import commands_general
|
import commands_general
|
||||||
import commands_unloggedin
|
import commands_unloggedin
|
||||||
import cmdhandler
|
import cmdhandler
|
||||||
|
|
@ -272,24 +271,6 @@ def cmd_emit(cdat):
|
||||||
else:
|
else:
|
||||||
pobject.get_location().emit_to_contents(message)
|
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):
|
def cmd_create(cdat):
|
||||||
"""
|
"""
|
||||||
Creates a new object of type 'THING'.
|
Creates a new object of type 'THING'.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue