]> skyeroc.xyz Git - dgamelaunch/commitdiff
Add new config-file commands for quit, watch_menu, ask_login and ask_register
authorPasi Kallinen <paxed@alt.org>
Mon, 14 Jan 2008 22:06:32 +0000 (22:06 +0000)
committerPasi Kallinen <paxed@alt.org>
Mon, 14 Jan 2008 22:06:32 +0000 (22:06 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@422 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

TODO
config.l
dgamelaunch.h
dgl-common.c
examples/dgamelaunch.conf

diff --git a/TODO b/TODO
index e83c6e4aac0f68e2602b94928317ecd30bfccb43..c43275f47978d65e5452a03cbdcf92647f14f784 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,10 +1,10 @@
 -add new config file commands:
   x -chpasswd       (change user's password)
-  -chmail         (change user's email address)
-  -watch_menu     (go to the watching menu)
-  -login          (login user)
-  -newuser        (register new user)
-  -quit           (quit from dgl)
+  -chmail         (change user's email address)
+  -watch_menu     (go to the watching menu)
+  -login          (login user)
+  -newuser        (register new user)
+  -quit           (quit from dgl)
   -game_menu "x"  (go to game menu "x")
   -return         (return to main menu)
   -start_game     (start the selected game)
 
  and maybe allow changing the watching-screen layout too?
 
+ struct dg_menuoption
+ {
+     char *keys;
+     struct dg_cmdpart *cmdqueue;
+     struct dg_menuoption *next;
+ };
+
+ struct dg_menu
+ {
+     char *banner_fn;
+     int cursor_x, cursor_y; /* coord to put cursor after drawing banner */
+     struct dg_menuoption *options;
+ };
+
+
+
+
 
 -add commandline parameters to dgamelaunch:
    dgamelaunch --chpasswd "nick" "newpass"
 -some games (robotfindskitten?) are not worth saving into ttyrecs, make it configurable.
 -allow configuring ttyplay.c; some games may use different clear-screen
  commands. (see for example crawl)
+-allow configuring the gfx stripping. (number of chars, types of stripping,
+ include unicode stripping from crawl dgl, etc)
 -public (no-password) accounts? (a per-user flag) what happens when someone
  is playing on the account and someone else logins and we start playing?
 -change the watching screen not to show the 'press 'm' to mail user'
index 0de9362de8b6c3f1e2034ba26e195a44072bd1eb..7c77b8191a03276f38250494dd9e56a2732cac2d 100644 (file)
--- a/config.l
+++ b/config.l
@@ -94,6 +94,10 @@ setenv               { yylval.i = DGLCMD_SETENV; return TYPE_DGLCMD2; }
 exec           { yylval.i = DGLCMD_EXEC;   return TYPE_DGLCMD2; }
 chpasswd       { yylval.i = DGLCMD_CHPASSWD;   return TYPE_DGLCMD0; }
 chmail         { yylval.i = DGLCMD_CHMAIL;     return TYPE_DGLCMD0; }
+watch_menu     { yylval.i = DGLCMD_WATCH_MENU; return TYPE_DGLCMD0; }
+ask_login      { yylval.i = DGLCMD_LOGIN;      return TYPE_DGLCMD0; }
+ask_register   { yylval.i = DGLCMD_REGISTER;   return TYPE_DGLCMD0; }
+quit           { yylval.i = DGLCMD_QUIT;       return TYPE_DGLCMD0; }
 DEFINE         { return TYPE_DEFINE_GAME; }
 
 
index c409ace52c18f74f9534c2238b038e1b124efd7a..7feca6d5679871b53817c039a39bac9dc7b94368 100644 (file)
@@ -104,6 +104,10 @@ typedef enum
     DGLCMD_UNLINK,     /* unlink foo */
     DGLCMD_EXEC,       /* exec foo bar */
     DGLCMD_SETENV,     /* setenv foo bar */
+    DGLCMD_WATCH_MENU,  /* watch_menu */
+    DGLCMD_LOGIN,       /* ask_login */
+    DGLCMD_REGISTER,   /* ask_register */
+    DGLCMD_QUIT,       /* quit */
     DGLCMD_CHMAIL,     /* chmail */
     DGLCMD_CHPASSWD    /* chpasswd */
 } dglcmd_actions;
index 8cf41e90342eb5102aab356e40d059f03ed2a701..a7f81378d0b32885ff2b9ffd3635c6cb851029c1 100644 (file)
@@ -203,6 +203,19 @@ dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me)
        case DGLCMD_CHMAIL:
            if (loggedin) change_email();
            break;
+       case DGLCMD_WATCH_MENU:
+           inprogressmenu(game);
+           break;
+       case DGLCMD_LOGIN:
+           if (!loggedin) loginprompt(0);
+           break;
+       case DGLCMD_REGISTER:
+           if (!loggedin && globalconfig.allow_registration) newuser();
+           break;
+       case DGLCMD_QUIT:
+           endwin();
+           graceful_exit(0);
+           /* break; */
        }
        free(p1);
        free(p2);
index 5fd52d8c40be4f43c79f0f2d5b479a713fa4d084..d20e5ea61cabd0ee41ad73613d6cd4669dd15e1b 100644 (file)
@@ -77,6 +77,11 @@ lockfile = "/dgl-lock"
 #   exec "foo" "bar"  = execute "foo" with "bar" as it's param
 #   chpasswd          = do the change password prompting, if logged in
 #   chmail            = do the change email prompting, if logged in
+#   watch_menu        = go to the watching menu
+#   quit              = quit dgl
+#   ask_login         = do the login prompting, if not logged in
+#   ask_register      = do register new user prompting, if not logged in and
+#                       registration of new nicks is allowed.
 #
 # The commands will be done inside the chroot and with the uid and gid
 # defined above.