Vanilla Netrek Server Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[VANILLA-L:838] Vicious eject bug fix



I found out the problem with the new vicious eject code put in by Bob.
The problem is when freeslot() is called, it frees the slot, but
leaves the ntserv process running.  When a new player comes in to the
ejected slot you then have two ntserv process sharing the same slot.
The ejected player can actually give commands (like quit, shoot
torps!, etc) that the new player will be affected by.

To fix this, I just took the code from xsg that will free a live slot.

As squinn mentioned in the newsgroup, an ejection looks like a
ghostbust to the player being ejected, which I think is ugly.  I guess
it's good enough for now, though.

The following patch should be applied after applying Bob's patch.

References:
vanilla-l:715 - Original bug report.
vanilla-l:722 - Patch to fix bug report.
vanilla-l:832 - Bug in patch bug report.

-Jeff (specter)

*** old/Server/ntserv/ntscmds.c	Wed Apr 15 08:26:43 1998
--- Server/ntserv/ntscmds.c	Wed Apr 15 08:23:42 1998
***************
*** 224,232 ****
  					   when ejected by the team they log
  					   right back in. Freeing the slot
  					   should help a little. */
!     if (freeslot(j) < 0) {
!       ERROR(1,("do_player_eject: freeslot failed\n"));
!       return;
      }
      pmessage(0, MALL, addr_mess(who, MALL),
  	     "Freeing %2s slot. Continuum vicious code enabled", j->p_mapchars);
--- 224,233 ----
  					   when ejected by the team they log
  					   right back in. Freeing the slot
  					   should help a little. */
!     if (j->p_process != 0) {
!       if (kill(j->p_process, SIGTERM) < 0) freeslot(j);
!     } else {
!       freeslot(j);
      }
      pmessage(0, MALL, addr_mess(who, MALL),
  	     "Freeing %2s slot. Continuum vicious code enabled", j->p_mapchars);
+
++ Vanilla-l Mailing List ++
To unsubscribe: send "unsubscribe vanilla-l" to majordomo@real-time.com
For more information: http://archives.real-time.com