Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs16:/tmp/cvs-serv31037/src
Modified Files:
option.c
Log Message:
Add ability to change login name via options menu
Index: option.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- option.c 6 Apr 2007 06:46:32 -0000 1.45
+++ option.c 10 Apr 2007 01:14:32 -0000 1.46
@@ -27,6 +27,7 @@
static char newkeys[14];
static char newbuttons[10];
+static char newlogin[PSEUDOSIZE];
char *localmes[] = { "Show owner on local planets",
"Show resources on local planets",
@@ -347,6 +348,7 @@
{1, "allow wheel actions", &allowWheelActions, 0, 0, 0, NULL, NULL},
{1, "new keymap entries: %s", 0, 0, newkeys, 13, NULL, NULL},
{1, "new buttonmap entries: %s", 0, 0, newbuttons, 9, NULL, NULL},
+ {1, "new login name: %s", 0, 0, newlogin, PSEUDOSIZE, NULL, NULL},
{1, "ignore the capslock key", &ignoreCaps, 0, 0, 0, NULL, NULL},
{1, "%d updates per second", &updatesPerSec, 0, 0, 0, 0, &updates_range},
{1, "%d 1/10 sec screen refresh delay", &redrawDelay, 0, 0, 0, 0,
@@ -486,6 +488,7 @@
*newkeys = '\0';
*newbuttons = '\0';
+ *newlogin = '\0';
if (FirstMenu == NULL)
{
MaxOptions = InitOptionMenus ();
@@ -1125,7 +1128,13 @@
}
}
*newbuttons = '\0';
-
+
+ /* update login */
+ if (newlogin)
+ {
+ STRNCPY (login, newlogin, PSEUDOSIZE);
+ *newlogin = '\0';
+ }
if (updatesPerSec != lastUpdateSpeed)
{
sendUpdatePacket (1000000 / updatesPerSec);