11 Apr, 2009, triskaledia wrote in the 1st comment:
Votes: 0
I am currently running QuickMUD (ROM 2.4), and I was wondering if there
is any snippet, or code piece, out there that would make the linkdead
system work/run more timely and effeciently. With my connection, I am
getting booted offline from time to time, but when I come to return, I
find that my character is still online. Any help (actual, psuedo, or look
in this file) is greatly appreciated.

–Silence Tyire of Reanimation
11 Apr, 2009, David Haley wrote in the 2nd comment:
Votes: 0
I don't think it's meant to boot off the characters, just the connection. I think the idea is that going link-dead shouldn't be usable as a safety measure. Of course, I guess that wouldn't be as much of a problem if the character was taken offline after a timeout greater than a few minutes or something like that.
12 Apr, 2009, Skol wrote in the 3rd comment:
Votes: 0
Regular players will auto-boot in QuickMUD but Imms won't.

This part makes players quit.
if (ch->timer > 30)
ch_quit = ch;


// This part makes imms NOT quit or their timer increment.
/* comment OUT to make imms quit when idle */
if (IS_IMMORTAL (ch))
ch->timer = 0;// By moving that asterisk slash above to replace this comment.

if (++ch->timer >= 12 && !IS_IMMORTAL (ch))// Added an IMM check
{
if (ch->was_in_room == NULL && ch->in_room != NULL)
{
ch->was_in_room = ch->in_room;
if (ch->fighting != NULL)
stop_fighting (ch, TRUE);
act ("$n disappears into the void.",
ch, NULL, NULL, TO_ROOM);
send_to_char ("You disappear into the void.\n\r", ch);
if (ch->level > 1)
save_char_obj (ch);
char_from_room (ch);
char_to_room (ch, get_room_index (ROOM_VNUM_LIMBO));
}
}
if (ch->timer > 30 && !IS_IMMORTAL (ch))// Added an IMM check
ch_quit = ch;

// Added this below for a separate IMM timer.
if (ch->timer > 60) // For the imms, change to however long you want.
ch_quit = ch;
12 Apr, 2009, Skol wrote in the 4th comment:
Votes: 0
You could also add a descriptor check if you wanted, so that _only_ LD people are booted, but I used to have imms that would go on the road and leave their chars connected for a week idle heh.
12 Apr, 2009, triskaledia wrote in the 5th comment:
Votes: 0
I am thinking now that perhaps I worded what I was looking for inaccurately.
My internet provider likes to randomly drop link on me - either while chatting
with my few players, or in the middle of coding, but for some strange reason
( I do have the
if (!IS_NPC(victim) && !victim->desc) strcat( buf, "{r({RLinkdead{r){x " );
running on my code), the code/mud, doesn't want to read my descriptor as
nonexistant. Therefore, leaving me displayed as playing while I fight to get
my connection back up. Does this still work around that code bit for the
ch->timer found in update.c ?
–Silence Tyire
12 Apr, 2009, Skol wrote in the 6th comment:
Votes: 0
Ahhh yeah I hear you. I haven't found a way around that issue.
The character is still connected to the ISP and game, just not to you. I've had that with Comcast where I'll have it reconnect, when I reconnect to the game my char THEN goes LD/reconnect.
It's not something that you can address in the game itself.
12 Apr, 2009, Zeno wrote in the 7th comment:
Votes: 0
Closing the window will instantly show you as Linkdead.

Your Internet being lost will not. This seems to be the case for everything (probably because no signal is sent to the MUD regarding losing link). It'll take a while before the MUD notices your link is gone.

I think.
12 Apr, 2009, elanthis wrote in the 8th comment:
Votes: 0
See http://www.tldp.org/HOWTO/TCP-Keepalive-..., section 4 in particular.

That is pretty much the only way to detect link-dead clients, and even then it's not immediate. Problem is that if the link dies, all the MUD server knows is that it's not receiving anything from the client anymore, which may just mean that the player isn't typing anything. Unlike some other protocols, TELNET has no built-in keep-alive mechanism (there's the AYT command, but that doesn't do quite what you'd want) and doesn't require the client to acknowledge server output (except for certain TELNET commands that have other unwanted side effects), so you need to work at the TCP level as described in that document.

Keep-alive still may not solve the problem adequately for you, and it may create more problems. Keep-alive can't let the application instantly know that the link has been cut, and in order to avoid false-positives (disconnecting players who are just having a bit of bad but temporary lag) you need to configure keep-alive to only disconnect clients that have been silent for a sizable amount of time (not sure what a good default is, but 15 seconds is probably an absolute extreme minimum), so the amount of time it takes for the server to recognize the broken link may still be too long for you. On top of that, it's a more traffic and more processing time (absolutely negligable in most cases, but there's a reason it's not on by default).

You could possibly add keep-alive support but only enable it for specific users/accounts who complain about frequent connection loss problems, since you configure keep-alive on a per-socket basis.

So far as MUD policy/behavior with linkdead characters, you could do any of several things. For staff it may be best to immediately disconnect so regular players don't think the staff is just rude and ignoring help requests. For regular players, though, you really do want to make the character stay active for at least 30 seconds or so – about twice the amount of time it would take to die in combat with an opponent of equal skill. That prevents cheezy players who are getting their ass kicked from trying to save themselves by pulling the Ethernet cord or hitting the Cable model sleep button or pressing the Wireless switch on their laptop or whatever.
0.0/8