[DGD] kernel library:solutions

Natasha Koroleva natasha.i.koroleva at gmail.com
Mon Apr 22 00:25:46 CEST 2013


On Sun, Apr 21, 2013 at 5:02 PM, Littlefield, Tyler <tyler at tysdomain.com> wrote:

> Second, I'm curious how to handle commands. right now it's a huge switch
> statement. I'd like to be able to have a file per command that a daemon can
> handle (maybe with access flags to determine who can run it. I can create a
> daemon since I have the code, but I'm curious how commands usually get
> loaded. Would you just iterate through the directory and clone objects, then
> add those to the command daemon?

You will not need to clone, just use call_other() in your daemon after
it proves if at all the command file exist (which you can do with
get_dir() and will not need to iterate the directory). If you put into
/path/to/look.c what you want to execute when player types verb
"look", then you just can do call_other("/path/to/look", "execute",
str); This will compile /path/to/look.c, if it will be necessary.



More information about the DGD mailing list