fix a couple of serious issues molgrum reported.

fix dedicated server to integrate inside fteqcc.
fix bug with jump being released.
fix fteqcc always using 32bit output.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5086 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2017-03-30 18:37:16 +00:00
parent 492feafd1d
commit c46f6a3a53
12 changed files with 158 additions and 73 deletions

View file

@ -905,8 +905,8 @@ char *Sys_ConsoleInput (void)
{
if (!GetMessage (&msg, NULL, 0, 0))
return NULL;
TranslateMessage (&msg);
DispatchMessage (&msg);
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return NULL;
}
@ -955,6 +955,55 @@ char *Sys_ConsoleInput (void)
}
#endif
if (isPlugin)
{
DWORD avail;
static char text[256], *nl;
static int textpos = 0;
HANDLE input = GetStdHandle(STD_INPUT_HANDLE);
if (!PeekNamedPipe(input, NULL, 0, NULL, &avail, NULL))
{
wantquit = true;
Cmd_ExecuteString("quit force", RESTRICT_LOCAL);
}
else if (avail)
{
if (avail > sizeof(text)-1-textpos)
avail = sizeof(text)-1-textpos;
if (ReadFile(input, text+textpos, avail, &avail, NULL))
{
textpos += avail;
if (textpos > sizeof(text)-1)
Sys_Error("No.");
}
}
while (textpos)
{
text[textpos] = 0;
nl = strchr(text, '\n');
if (nl)
{
*nl++ = 0;
if (coninput_len)
{
putch ('\r');
putch (']');
}
coninput_len = 0;
Q_strncpyz(coninput_text, text, sizeof(coninput_text));
memmove(text, nl, textpos - (nl - text));
textpos -= (nl - text);
return coninput_text;
}
else
break;
}
}
// read a line out
while (_kbhit())
{