mirror of
https://github.com/paxed/dgamelaunch.git
synced 2025-07-31 01:24:43 +02:00
Remove support for uuencoded ttyrec output.
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@554 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
ce1dd29060
commit
6581664456
76
ttyrec.c
76
ttyrec.c
@ -83,7 +83,6 @@ int master;
|
|||||||
|
|
||||||
struct termios tt;
|
struct termios tt;
|
||||||
struct winsize win;
|
struct winsize win;
|
||||||
int uflg;
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ttyrec_id(int game, char *username, char *ttyrec_filename)
|
ttyrec_id(int game, char *username, char *ttyrec_filename)
|
||||||
@ -252,79 +251,6 @@ finish (int sig)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct linebuf
|
|
||||||
{
|
|
||||||
char str[BUFSIZ + 1]; /* + 1 for an additional NULL character. */
|
|
||||||
int len;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
check_line (const char *line)
|
|
||||||
{
|
|
||||||
static int uuencode_mode = 0;
|
|
||||||
static FILE *uudecode;
|
|
||||||
|
|
||||||
if (uuencode_mode == 1)
|
|
||||||
{
|
|
||||||
fprintf (uudecode, "%s", line);
|
|
||||||
if (strcmp (line, "end\n") == 0)
|
|
||||||
{
|
|
||||||
pclose (uudecode);
|
|
||||||
uuencode_mode = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int dummy;
|
|
||||||
char dummy2[BUFSIZ];
|
|
||||||
if (sscanf (line, "begin %o %s", &dummy, dummy2) == 2)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* uuencode line found!
|
|
||||||
*/
|
|
||||||
uudecode = popen ("uudecode", "w");
|
|
||||||
fprintf (uudecode, "%s", line);
|
|
||||||
uuencode_mode = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
check_output (const char *str, int len)
|
|
||||||
{
|
|
||||||
static struct linebuf lbuf = { "", 0 };
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < len; i++)
|
|
||||||
{
|
|
||||||
if (lbuf.len < BUFSIZ)
|
|
||||||
{
|
|
||||||
lbuf.str[lbuf.len] = str[i];
|
|
||||||
if (lbuf.str[lbuf.len] == '\r')
|
|
||||||
{
|
|
||||||
lbuf.str[lbuf.len] = '\n';
|
|
||||||
}
|
|
||||||
lbuf.len++;
|
|
||||||
if (lbuf.str[lbuf.len - 1] == '\n')
|
|
||||||
{
|
|
||||||
if (lbuf.len > 1)
|
|
||||||
{ /* skip a blank line. */
|
|
||||||
lbuf.str[lbuf.len] = '\0';
|
|
||||||
check_line (lbuf.str);
|
|
||||||
}
|
|
||||||
lbuf.len = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ /* buffer overflow */
|
|
||||||
lbuf.len = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
game_idle_kill(int signal)
|
game_idle_kill(int signal)
|
||||||
{
|
{
|
||||||
@ -355,8 +281,6 @@ dooutput (int max_idle_time)
|
|||||||
if (max_idle_time)
|
if (max_idle_time)
|
||||||
alarm(max_idle_time);
|
alarm(max_idle_time);
|
||||||
|
|
||||||
if (uflg)
|
|
||||||
check_output (obuf, cc);
|
|
||||||
h.len = cc;
|
h.len = cc;
|
||||||
gettimeofday (&h.tv, NULL);
|
gettimeofday (&h.tv, NULL);
|
||||||
(void) write (1, obuf, cc);
|
(void) write (1, obuf, cc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user