Fixed Win32 dedicated server input
authormolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 5 Apr 2004 06:45:47 +0000 (06:45 +0000)
committermolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 5 Apr 2004 06:45:47 +0000 (06:45 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4082 d7cf8633-e32d-0410-b094-e92efae38249

sys_linux.c
todo

index 9e8b155..ed68eec 100644 (file)
@@ -139,7 +139,7 @@ char *Sys_ConsoleInput(void)
        if (cls.state == ca_dedicated)
        {
                static char text[256];
-               int len = 0;
+               static int len = 0;
 #ifdef WIN32
                int c;
 
@@ -147,30 +147,30 @@ char *Sys_ConsoleInput(void)
                while (_kbhit ())
                {
                        c = _getch ();
-                       putch (c);
                        if (c == '\r')
                        {
-                               text[len] = 0;
+                               text[len] = '\0';
                                putch ('\n');
                                len = 0;
                                return text;
                        }
-                       if (c == 8)
+                       if (c == '\b')
                        {
                                if (len)
                                {
+                                       putch (c);
                                        putch (' ');
                                        putch (c);
                                        len--;
-                                       text[len] = 0;
                                }
                                continue;
                        }
-                       text[len] = c;
-                       len++;
-                       text[len] = 0;
-                       if (len == sizeof (text))
-                               len = 0;
+                       if (len < sizeof (text) - 1)
+                       {
+                               putch (c);
+                               text[len] = c;
+                               len++;
+                       }
                }
 #else
                fd_set fdset;
diff --git a/todo b/todo
index 79d7e5d..e24b45e 100644 (file)
--- a/todo
+++ b/todo
@@ -389,7 +389,7 @@ f darkplaces: pointcontents crash when building harvester in gvb2? (yummyluv)
 4 darkplaces: add qw protocol support (making darkplaces work as a qwcl client) (tell Fuh)
 4 darkplaces: add traceboxwithcontents function (same as tracebox but adds the startcontents parameter) (LTH, SeienAbunae, http://forums.inside3d.com/showflat.pl?Board=Engine&Number=909 )
 4 darkplaces: add wav music playback (tell Joseph Caporale, tell Static_Fiend)
-4 darkplaces: figure out what is wrong with dedicated server console on win32 and fix it (and tell willis@deathmask.net)
+-n darkplaces: figure out what is wrong with dedicated server console on win32 and fix it (and tell willis@deathmask.net)
 4 darkplaces: ingame mod switching
 4 darkplaces: make hqbsp save mip textures to bsp if tga textures are found
 4 darkplaces: rewrite sound system! (FrikaC, Static_Fiend, SeienAbunae)