+-update dgamelaunch.8
+
-occasionally dgl crashes, leaving the shmem semaphore in a state
where the shmem block has to be freed.
(needs some way to name the options given as keys... maybe another
format for the keys that includes a string to be used as the name)
--document the exit (error) codes.
-
-cursor keys are not restored after watching a game of
curses-nethack.
-configurable stuff: allowed chars in usernames,
allow char stripping, ...
-- Flags for operators/staff/admins or (optionally) user-bans.
-
- Localization of variables, code clean up
- Use /var/run/nologin and/or dgl-specific nologin file
char *
-bannerstrmangle(char *buf, char *fromstr, char *tostr)
+bannerstrmangle(char *buf, char *bufnew, int buflen, char *fromstr, char *tostr)
{
- static char bufnew[81];
char *loc;
char *b = buf;
- memset (bufnew, 0, 80);
+ memset (bufnew, 0, buflen);
if (strstr(b, fromstr)) {
int i = 0;
while ((loc = strstr (b, fromstr)) != NULL) {
- for (; i < 80; i++) {
+ for (; i < buflen; i++) {
if (loc != b)
bufnew[i] = *(b++);
else {
- strlcat (bufnew, tostr, 80);
+ strlcat (bufnew, tostr, buflen);
b += strlen(fromstr);
i += strlen(tostr);
break;
}
if (*b)
- strlcat(bufnew, b, 80);
- } else strncpy(bufnew, buf, 80);
-
+ strlcat(bufnew, b, buflen);
+ } else strncpy(bufnew, buf, buflen);
return bufnew;
}
}
}
} else {
+ char tmpbufnew[80];
struct dg_banner_var *bv = globalconfig.banner_var_list;
while (bv) {
- strncpy(bufnew, bannerstrmangle(bufnew, bv->name, bv->value), 80);
+ strncpy(bufnew, bannerstrmangle(bufnew, tmpbufnew, 80, bv->name, bv->value), 80);
bv = bv->next;
}
- strncpy(bufnew, bannerstrmangle(bufnew, "$VERSION", PACKAGE_STRING), 80);
+ strncpy(bufnew, bannerstrmangle(bufnew, tmpbufnew, 80, "$VERSION", PACKAGE_STRING), 80);
if (me && loggedin) {
- strncpy(bufnew, bannerstrmangle(bufnew, "$USERNAME", me->username), 80);
+ strncpy(bufnew, bannerstrmangle(bufnew, tmpbufnew, 80, "$USERNAME", me->username), 80);
} else {
- strncpy(bufnew, bannerstrmangle(bufnew, "$USERNAME", "[Anonymous]"), 80);
+ strncpy(bufnew, bannerstrmangle(bufnew, tmpbufnew, 80, "$USERNAME", "[Anonymous]"), 80);
}
banner_addline(ban, bufnew);
}