]> skyeroc.xyz Git - dgamelaunch/commitdiff
Add %N string mangling that returns the first character of the user's name.
authorPasi Kallinen <paxed@alt.org>
Tue, 12 Oct 2010 13:47:40 +0000 (13:47 +0000)
committerPasi Kallinen <paxed@alt.org>
Tue, 12 Oct 2010 13:47:40 +0000 (13:47 +0000)
This is a hack to work around the userdata directory limits.

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@577 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgl-common.c
examples/dgamelaunch.conf

index dbe910a12ea32e02cac92c88956614d12b1bbd5b..95050de1f562d00ec18b00d82868dbece4dc45ee 100644 (file)
@@ -138,6 +138,13 @@ dgl_format_str(int game, struct dg_user *me, char *str, char *plrname)
                while (*p != '\0')
                    p++;
                break;
+           case 'N':
+               if (me) *p = me->username[0];
+               else if (plrname) *p = plrname[0];
+               else return NULL;
+               p++;
+               *p = '\0';
+               break;
            case 'n':
                if (me) snprintf (p, end + 1 - p, "%s", me->username);
                else if (plrname) snprintf(p, end + 1 - p, "%s", plrname);
index e642b23a36722163d2aac2565cd8ebfab316c01b..a6028bdb4a40fd794ae42b5ddbecf967b6b9465c 100644 (file)
@@ -109,6 +109,7 @@ lockfile = "/dgl-lock"
 # Parameters to the commands are subject to variable substitution:
 #   %r = dglroot, as defined above
 #   %n = user nick, if user is logged in
+#   %N = first character of user name, if user is logged in
 #   %u = shed_uid, as defined above, but numeric
 #   %g = game name, if user has selected a game.
 #   %s = short game name, if user has selected a game.