(player_wakeup_all, player_wakeup): Remove. Callers changed.
(player): Remove member waiting.
int god;
int owner;
int nstat;
- int waiting;
int simulation; /* e.g. budget command */
double dolcost;
int broke;
extern struct player *player_next(struct player *);
extern struct player *player_prev(struct player *);
extern struct player *getplayer(natid);
-extern void player_wakeup_all(natid);
-extern void player_wakeup(struct player *);
extern void player_accept(void *);
/* dispatch.c */
extern int dispatch(char *, char *);
else
pr_flash(other, "%s (#%d): %s\n",
us->nat_cnam, us->nat_cnum, message);
- player_wakeup(other);
sent++;
}
if (player->god) {
return NULL;
}
-void
-player_wakeup_all(natid cnum)
-{
- struct player *lp;
-
- if (NULL != (lp = getplayer(cnum)))
- player_wakeup(lp);
-}
-
-void
-player_wakeup(struct player *pl)
-{
- if (pl->waiting)
- empth_wakeup(pl->proc);
-}
-
/*ARGSUSED*/
void
player_accept(void *unused)
#endif
int fd;
char box[1024];
- int notify = 0;
int write_ok = 0;
int new_tele = 0;
struct player *other;
continue;
if (!player->god && (getrejects(from, np) & REJ_ANNO))
continue;
- notify = (np->nat_ann == 0);
np->nat_ann++;
putnat(np);
- if (notify)
- player_wakeup_all(to);
}
} else if (write_ok) {
- notify = (np->nat_tgms == 0);
new_tele = telegram_is_new(to, &tel);
- np->nat_tgms += new_tele || notify;
+ np->nat_tgms += new_tele || np->nat_tgms == 0;
putnat(np);
if (new_tele && np->nat_flags & NF_INFORM) {
pr_inform(other, "[new tele]\n");
else
pr_inform(other, "[%d new teles]\n", np->nat_tgms);
- player_wakeup_all(to);
}
- } else if (notify)
- player_wakeup_all(to);
+ }
}
return 0;