]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/pr.c
Fix journalling of output ids
[empserver] / src / lib / subs / pr.c
index 876c819e347e30c2430f6e60ece6ea0062e7bb11..358bdc1f25c28b3b8d71d6bee63196f122b1a62f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -31,7 +31,7 @@
  *     Dave Pare, 1986, 1989
  *     Steve McClure, 1998-2000
  *     Ron Koenderink, 2005
- *     Markus Armbruster, 2005-2008
+ *     Markus Armbruster, 2005-2009
  */
 
 /*
@@ -56,6 +56,7 @@
 #include "com.h"
 #include "empio.h"
 #include "file.h"
+#include "journal.h"
 #include "misc.h"
 #include "nat.h"
 #include "player.h"
@@ -124,6 +125,7 @@ pr_id(struct player *p, int id, char *format, ...)
 
     if (p->curid >= 0) {
        io_puts(p->iop, "\n");
+       journal_output(p, p->curid, "\n");
        p->curid = -1;
     }
     va_start(ap, format);
@@ -242,6 +244,8 @@ pr_player(struct player *pl, int id, char *buf)
        }
     }
 
+    journal_output(pl, id, buf);
+
     if (player == pl) {
        while (io_output_if_queue_long(pl->iop,
                        pl->may_sleep == PLAYER_SLEEP_FREELY) > 0)
@@ -298,6 +302,8 @@ upr_player(struct player *pl, int id, char *buf)
        }
     }
 
+    journal_output(pl, id, buf);
+
     if (player == pl) {
        while (io_output_if_queue_long(pl->iop,
                        pl->may_sleep == PLAYER_SLEEP_FREELY) > 0)