Add %N string mangling that returns the first character of the user's name.

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
This commit is contained in:
Pasi Kallinen 2010-10-12 13:47:40 +00:00
parent 1abe3a1117
commit 30c458d9fc
2 changed files with 8 additions and 0 deletions

View 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);

View 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.