]> git.pond.sub.org Git - empserver/blobdiff - src/server/idle.c
Update copyright notice
[empserver] / src / server / idle.c
index d80ddc53058003a2efe1a1e438390f71fc9f6b1b..5ca5c16d62cc009449c01bf0a42958c7c9586ba2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -51,29 +51,19 @@ player_kill_idle(void *unused)
     while (1) {
        empth_sleep(now + 60);
        time(&now);
-       /*if (update_pending) */
-       /*continue; */
        for (p = player_next(0); p != 0; p = player_next(p)) {
            if (p->state == PS_SHUTDOWN) {
-               /* no more mr. nice guy */
-               p->state = PS_KILL;
-               p->aborted++;
-               empth_terminate(p->proc);
-               p = player_delete(p);
+               /*
+                * Player thread hung or just aborted by update or
+                * shutdown, we can't tell.
+                */
                continue;
            }
            if (p->curup + max_idle * 60 < now) {
                p->state = PS_SHUTDOWN;
-               /* giving control to another thread while
-                * in the middle of walking player list is
-                * not a good idea at all. Sasha */
                p->aborted++;
                pr_flash(p, "idle connection terminated\n");
                empth_wakeup(p->proc);
-               /* go to sleep because player thread
-                  could vandalize a player list */
-
-               break;
            }
        }
     }