diff --git a/dgl-common.c b/dgl-common.c index dbe910a..95050de 100644 --- a/dgl-common.c +++ b/dgl-common.c @@ -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); diff --git a/examples/dgamelaunch.conf b/examples/dgamelaunch.conf index e642b23..a6028bd 100644 --- a/examples/dgamelaunch.conf +++ b/examples/dgamelaunch.conf @@ -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.