/* These are options specific to CobraMUSH.
*/
+/* Automatic keepalive for telnet-enabled connections */
+#define TELNET_KEEPALIVE /* */
+
+/* Keepalive timer interval (in seconds) */
+#define KEEPALIVE_INTERVAL 300
+
/* Colored WHO */
#define COLOREDWHO /* */
back, the client probably doesn't understand them */
if ((d->conn_flags & CONN_TELNET_QUERY) && idle_for > 60)
d->conn_flags &= ~CONN_TELNET_QUERY;
+
+#ifndef COMPILE_CONSOLE
+#ifdef TELNET_KEEPALIVE
+ if (idle_for && !(idle_for % KEEPALIVE_INTERVAL) &&
+ (d->conn_flags & CONN_TELNET)) {
+ tbuf[0] = IAC;
+ tbuf[1] = NOP;
+ tbuf[2] = '\0';
+ queue_newwrite(d, (unsigned char *) tbuf, 2);
+ }
+#endif /* TELNET_KEEPALIVE */
+#endif /* !COMPILE_CONSOLE */
+
if(d->connected && GoodObject(d->player) && ((a = atr_get(d->player, "IDLE_TIMEOUT"))!=NULL)) {
memset(tbuf, '\0', BUFFER_LEN);
strncpy(tbuf, atr_value(a), BUFFER_LEN-1);