int idle_time; /** Time for the system to consider player 'idle' used in conjuntion with @AUNIDLE */
int unconnected_idle_timeout; /**< Maximum idle time for connections without dbrefs, in minutes */
int keepalive_timeout; /**< Number of seconds between TCP keepalive pings */
+ int telnet_keepalive_interval; /**< Number of seconds between telnet NOP transmissions */
int dump_interval; /**< Interval between database dumps, in seconds */
char dump_message[256]; /**< Message shown at start of nonforking dump */
char dump_complete[256]; /**< Message shown at end of nonforking dump */
#define PURGE_INTERVAL (options.purge_interval)
#define DBCK_INTERVAL (options.dbck_interval)
+#define TELNET_KEEPALIVE_INTERVAL (options.telnet_keepalive_interval)
#define MAX_PARENTS (options.max_parents)
#define MAX_DEPTH (options.max_depth)
#define MAX_PENNIES (options.max_pennies)
#define Halted(x) (has_flag_by_name(x, "HALT", NOTYPE))
#define Haven(x) (has_flag_by_name(x, "HAVEN", NOTYPE))
#define Inherit(x) (has_flag_by_name(x, "INHERIT", TYPE_THING|TYPE_EXIT|TYPE_ROOM))
+#define Keepalive(x) (has_flag_by_name(x, "KEEPALIVE", TYPE_PLAYER))
#define Light(x) (has_flag_by_name(x, "LIGHT", NOTYPE))
#define LinkOk(x) (has_flag_by_name(x, "LINK_OK", NOTYPE))
#define Loud(x) (has_flag_by_name(x, "LOUD", NOTYPE))
/* 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 /* */
d->conn_flags &= ~CONN_TELNET_QUERY;
#ifndef COMPILE_CONSOLE
-#ifdef TELNET_KEEPALIVE
- if (idle_for && !(idle_for % KEEPALIVE_INTERVAL) &&
- (d->conn_flags & CONN_TELNET)) {
+ if (TELNET_KEEPALIVE_INTERVAL && idle_for &&
+ !(idle_for % TELNET_KEEPALIVE_INTERVAL) &&
+ (d->conn_flags & CONN_TELNET) &&
+ Keepalive(d->player)) {
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)) {
,
{"keepalive_timeout", cf_time, &options.keepalive_timeout, 10000, 0, "limits"}
,
+ {"telnet_keepalive_interval", cf_time, &options.telnet_keepalive_interval, 10000, 0, "limits"}
+ ,
{"whisper_loudness", cf_int, &options.whisper_loudness, 100, 0, "limits"}
,
{"starting_quota", cf_int, &options.starting_quota, 10000, 0, "limits"}
options.idle_time = 0;
options.unconnected_idle_timeout = 300;
options.keepalive_timeout = 300;
+ options.telnet_keepalive_interval = 300;
options.dump_interval = 3601;
strcpy(options.dump_message,
T("GAME: Dumping database. Game may freeze for a minute"));
add_flag("PARALYZED", '\0', TYPE_PLAYER, F_PRIVILEGE, F_PRIVILEGE);
add_flag("RPAPPROVED", '\0', TYPE_THING, F_PRIVILEGE, F_PRIVILEGE);
#endif
+ add_flag("KEEPALIVE", '\0', TYPE_PLAYER, F_ANY, F_ANY);
if ((f = match_flag("TERSE")))
f->type |= TYPE_THING;
if ((f = match_flag("PUPPET")))