Main
Resources

This patch comes to us from TheMentor again and it concerns being able to force multiple logins on iDirt. Basically, if you start two login sessions at once and keep them in sync so they enter the game at the same time, you can be in twice with the same char. Not good.

The patch goes into talker() which is in mud.c. I chose to place it between the two if blocks marked below:

  if ((k = the_world->w_lock) > plev (mynum)) {
    sprintf (msg, &qout;I'm sorry, the game is currently %slocked - 
        please try later.\n&qout;, lev2s (b, k));
    crapup (msg, NO_SAVE);
    return;
  } else if (k != 0) {
    bprintf (&qout;The game is currently %slocked.\n&qout;, lev2s (buff1, k));
  }
  if (the_world->w_peace) {
    bprintf (&qout;Everything is peaceful.\n&qout;);
  }

The piece of code we're going to insert causes a rather abrupt little disconnect for whichever login is lagging behind the others but this is OK -- the only folks who really can exploit this bug are the ones who know about it, a little rude awakening might be what the doctor ordered. Between the two if blocks, place the following piece of code:

  for (k = 0; k < max_players; k++) {
    if (EQ(pname(k),pname(mynum)) && (k != mynum)) {
      mudlog("CONN: Multiple entries for player %s",pname(mynum));
      p_crapup(k,"\t\tAlready connected, 
          no need to be on more than once.",CRAP_SAVE|CRAP_RETURN);
    }
  }

With this code in place, players will be unable to force the same character onto the mud on 2 or more sockets.