From 24e9c787ca5751b65594737eb9ce1f42656de1be Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 15 May 2014 23:42:22 +0000 Subject: [PATCH] Convert command data file to YAML --- etc/mudpy.conf | 2 +- share/command.mpy | 81 ------------------------------------------------------ share/command.yaml | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 82 deletions(-) delete mode 100644 share/command.mpy create mode 100644 share/command.yaml diff --git a/etc/mudpy.conf b/etc/mudpy.conf index 4a1a922..d6f07f3 100644 --- a/etc/mudpy.conf +++ b/etc/mudpy.conf @@ -3,7 +3,7 @@ # terms provided in the LICENSE file distributed with this software. [__control__] -default_files = { "account": "account.mpy", "actor": "actor.mpy", "area": "area.mpy", "command": "command.mpy", "internal": "internal.mpy", "menu": "menu.mpy", "other": "other.mpy", "prop": "prop.mpy" } +default_files = { "account": "account.mpy", "actor": "actor.mpy", "area": "area.mpy", "command": "command.yaml", "internal": "internal.mpy", "menu": "menu.mpy", "other": "other.mpy", "prop": "prop.mpy" } include_dirs = "sample" include_files = "archetype.yaml" private_files = "account.mpy" diff --git a/share/command.mpy b/share/command.mpy deleted file mode 100644 index eed6a74..0000000 --- a/share/command.mpy +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright (c) 2004-2014 Jeremy Stanley . Permission -# to use, copy, modify, and distribute this software is granted under -# terms provided in the LICENSE file distributed with this software. - -[__control__] -read_only = yes - -[command:chat] -action = command_chat(actor) -description = Enter and leave chat mode. -help = The chat command toggles chat mode. When in chat mode, all input is passed as a parameter to the say command, unless prepended by an exclamation mark (!). For example, to leave chat mode, use:$(eol)$(eol) !chat -see_also = say - -[command:create] -action = command_create(actor, parameters) -administrative = yes -description = Create a new element in the universe. -help = Ways to create an element:$(eol)$(eol) create actor:fred$(eol) create other:garply foo/bar/baz - -[command:delete] -action = command_delete(actor, parameters) -administrative = yes -description = Delete an existing facet from an element. -help = You can delete any facet of an element as follows:$(eol)$(eol) delete area:boardroom terrain - -[command:destroy] -action = command_destroy(actor, parameters) -administrative = yes -description = Destroy an existing element in the universe. -help = You can destroy any element in the universe as follows:$(eol)$(eol) destroy prop:dagger - -[command:halt] -action = command_halt(actor, parameters) -administrative = yes -description = Shut down the world. -help = This will save all active accounts, disconnect all clients and stop the entire program. - -[command:help] -action = command_help(actor, parameters) -description = List commands or get help on one. -help = This will list all comand words available to you along with a brief description or, alternatively, give you detailed information on one command. - -[command:look] -action = command_look(actor, parameters) -description = Look around. -help = With the look command, you can see where you are. - -[command:move] -action = command_move(actor, parameters) -description = Move in a specific direction. -help = You move in a direction by entering:$(eol)$(eol) move north - -[command:quit] -action = command_quit(actor) -description = Leave Example. -help = This will deactivate your avatar and return you to the main menu. - -[command:reload] -action = command_reload(actor) -administrative = yes -description = Reload modules and data. -help = This will reload all python modules and read-only data files. - -[command:say] -action = command_say(actor, parameters) -description = State something out loud. -help = This allows you to speak to other characters within the same area. If you end your sentence with punctuation, the message displayed will incorporate an appropriate action (ask, exclaim, et cetera). It will also correct common typographical errors, add punctuation and capitalize your sentence as needed (assuming you speak one sentence per line). For example:$(eol)$(eol) > say youre sure i went teh wrong way?$(eol) You ask, "You're sure I went the wrong way?"$(eol)$(eol)If necessary, enclose literal statements in quotation marks:$(eol)$(eol) > say "youre sure i went teh wrong way?"$(eol) You say, "youre sure i went teh wrong way?" -see_also = chat - -[command:set] -action = command_set(actor, parameters) -administrative = yes -description = Set a facet of an element. -help = Invoke it like this:$(eol)$(eol) set actor:dominique description You see nothing special. - -[command:show] -action = command_show(actor, parameters) -administrative = yes -description = Show various data. -help = Here are the possible incantations ( is required, [option] is optional, (note) is a note):$(eol)$(eol) show categories (list all element category names)$(eol) show category (list the elements in a category)$(eol) show element (list facet definitions for an element)$(eol) show file (list elements in a file)$(eol) show files (list all element data files)$(eol) show log [level [start [stop]]] (list logs above level from start to stop)$(eol) show result (evaluates a python expression)$(eol) show time (returns several current timer values) - diff --git a/share/command.yaml b/share/command.yaml new file mode 100644 index 0000000..4a3e226 --- /dev/null +++ b/share/command.yaml @@ -0,0 +1,80 @@ +# Copyright (c) 2004-2014 Jeremy Stanley . Permission +# to use, copy, modify, and distribute this software is granted under +# terms provided in the LICENSE file distributed with this software. + +__control__: + read_only: yes + +command:chat: + action: command_chat(actor) + description: Enter and leave chat mode. + help: The chat command toggles chat mode. When in chat mode, all input is passed as a parameter to the say command, unless prepended by an exclamation mark (!). For example, to leave chat mode, use:$(eol)$(eol) !chat + see_also: say + +command:create: + action: command_create(actor, parameters) + administrative: yes + description: Create a new element in the universe. + help: Ways to create an element:$(eol)$(eol) create actor:fred$(eol) create other:garply foo/bar/baz + +command:delete: + action: command_delete(actor, parameters) + administrative: yes + description: Delete an existing facet from an element. + help: You can delete any facet of an element as follows:$(eol)$(eol) delete area:boardroom terrain + +command:destroy: + action: command_destroy(actor, parameters) + administrative: yes + description: Destroy an existing element in the universe. + help: You can destroy any element in the universe as follows:$(eol)$(eol) destroy prop:dagger + +command:halt: + action: command_halt(actor, parameters) + administrative: yes + description: Shut down the world. + help: This will save all active accounts, disconnect all clients and stop the entire program. + +command:help: + action: command_help(actor, parameters) + description: List commands or get help on one. + help: This will list all comand words available to you along with a brief description or, alternatively, give you detailed information on one command. + +command:look: + action: command_look(actor, parameters) + description: Look around. + help: With the look command, you can see where you are. + +command:move: + action: command_move(actor, parameters) + description: Move in a specific direction. + help: You move in a direction by entering:$(eol)$(eol) move north + +command:quit: + action: command_quit(actor) + description: Leave Example. + help: This will deactivate your avatar and return you to the main menu. + +command:reload: + action: command_reload(actor) + administrative: yes + description: Reload modules and data. + help: This will reload all python modules and read-only data files. + +command:say: + action: command_say(actor, parameters) + description: State something out loud. + help: This allows you to speak to other characters within the same area. If you end your sentence with punctuation, the message displayed will incorporate an appropriate action (ask, exclaim, et cetera). It will also correct common typographical errors, add punctuation and capitalize your sentence as needed (assuming you speak one sentence per line). For example:$(eol)$(eol) > say youre sure i went teh wrong way?$(eol) You ask, "You're sure I went the wrong way?"$(eol)$(eol)If necessary, enclose literal statements in quotation marks:$(eol)$(eol) > say "youre sure i went teh wrong way?"$(eol) You say, "youre sure i went teh wrong way?" + see_also: chat + +command:set: + action: command_set(actor, parameters) + administrative: yes + description: Set a facet of an element. + help: Invoke it like this:$(eol)$(eol) set actor:dominique description You see nothing special. + +command:show: + action: command_show(actor, parameters) + administrative: yes + description: Show various data. + help: Here are the possible incantations ( is required, [option] is optional, (note) is a note):$(eol)$(eol) show categories (list all element category names)$(eol) show category (list the elements in a category)$(eol) show element (list facet definitions for an element)$(eol) show file (list elements in a file)$(eol) show files (list all element data files)$(eol) show log [level [start [stop]]] (list logs above level from start to stop)$(eol) show result (evaluates a python expression)$(eol) show time (returns several current timer values) -- 2.11.0