Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit f226f1c5 authored by rswindell's avatar rswindell

Reversed the ungetkey() overhaul of Sept-2-2005 (included in v3.13a), this new

method would insert keys at end of the input ring buffer. This was fine if
there weren't already chars in the buffer. But if there were already chars in
the input buffer, ansi_getxy() would then move keys to the end of the input
buffer until it found the <ESC>[y;xR response it was looking for. This garbled
the user's input in split-screen chat as reported by JasHud and others.
If there was a RingBufInsert() routine, we could use that instead, but this
separate "ungetkey" buf will do for now.
parent 254be857
......@@ -538,5 +538,11 @@ void sbbs_t::pause()
/****************************************************************************/
void sbbs_t::ungetkey(char ch)
{
#if 0 /* this way breaks ansi_getxy() */
RingBufWrite(&inbuf,(uchar*)&ch,sizeof(uchar));
#else
keybuf[keybuftop++]=ch;
if(keybuftop==KEY_BUFSIZE)
keybuftop=0;
#endif
}
......@@ -49,7 +49,13 @@ char sbbs_t::inkey(long mode, unsigned long timeout)
{
uchar ch=0;
ch=incom(timeout);
if(keybuftop!=keybufbot) {
ch=keybuf[keybufbot++];
if(keybufbot==KEY_BUFSIZE)
keybufbot=0;
} else
ch=incom(timeout);
if(ch==0) {
// moved here from getkey() on AUG-29-2001
if(sys_status&SS_SYSPAGE)
......
......@@ -2340,6 +2340,7 @@ sbbs_t::sbbs_t(ushort node_num, DWORD addr, char* name, SOCKET sd,
timeleft = 60*10; /* just incase this is being used for calling gettimeleft() */
uselect_total = 0;
lbuflen = 0;
keybufbot=keybuftop=0; /* initialize [unget]keybuf pointers */
connection="Telnet";
ZERO_VAR(telnet_local_option);
......@@ -2349,7 +2350,7 @@ sbbs_t::sbbs_t(ushort node_num, DWORD addr, char* name, SOCKET sd,
telnet_mode=0;
telnet_last_rxch=0;
sys_status=lncntr=tos=criterrs=lbuflen=slcnt=0L;
sys_status=lncntr=tos=criterrs=slcnt=0L;
curatr=LIGHTGRAY;
attr_sp=0; /* attribute stack pointer */
errorlevel=0;
......@@ -3215,6 +3216,7 @@ void sbbs_t::reset_logon_vars(void)
slcnt=0;
altul=0;
timeleft_warn=0;
keybufbot=keybuftop=0;
logon_uls=logon_ulb=logon_dls=logon_dlb=0;
logon_posts=logon_emails=logon_fbacks=0;
batdn_total=batup_total=0;
......
......@@ -255,6 +255,8 @@ public:
char *text[TOTAL_TEXT]; /* Text from ctrl\text.dat */
char *text_sav[TOTAL_TEXT]; /* Text from ctrl\text.dat */
char dszlog[127]; /* DSZLOG enviornment variable */
int keybuftop,keybufbot; /* Keyboard input buffer pointers (for ungetkey) */
char keybuf[KEY_BUFSIZE]; /* Keyboard input buffer */
char * connection; /* Connection Description */
ulong cur_rate; /* Current Connection (DCE) Rate */
ulong cur_cps; /* Current Average Transfer CPS */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment