Clean up after removal of wait command:

(player_wakeup_all, player_wakeup): Remove.  Callers changed.
(player): Remove member waiting.
This commit is contained in:
Markus Armbruster 2007-01-31 06:08:39 +00:00
parent fcef921437
commit 3788676530
5 changed files with 2 additions and 29 deletions

View file

@ -65,7 +65,6 @@ struct player {
int god; int god;
int owner; int owner;
int nstat; int nstat;
int waiting;
int simulation; /* e.g. budget command */ int simulation; /* e.g. budget command */
double dolcost; double dolcost;
int broke; int broke;

View file

@ -400,8 +400,6 @@ extern struct player *player_delete(struct player *);
extern struct player *player_next(struct player *); extern struct player *player_next(struct player *);
extern struct player *player_prev(struct player *); extern struct player *player_prev(struct player *);
extern struct player *getplayer(natid); extern struct player *getplayer(natid);
extern void player_wakeup_all(natid);
extern void player_wakeup(struct player *);
extern void player_accept(void *); extern void player_accept(void *);
/* dispatch.c */ /* dispatch.c */
extern int dispatch(char *, char *); extern int dispatch(char *, char *);

View file

@ -159,7 +159,6 @@ sendmessage(struct natstr *us, struct natstr *to, char *message, int verbose)
else else
pr_flash(other, "%s (#%d): %s\n", pr_flash(other, "%s (#%d): %s\n",
us->nat_cnam, us->nat_cnum, message); us->nat_cnam, us->nat_cnum, message);
player_wakeup(other);
sent++; sent++;
} }
if (player->god) { if (player->god) {

View file

@ -163,22 +163,6 @@ getplayer(natid cnum)
return NULL; 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*/ /*ARGSUSED*/
void void
player_accept(void *unused) player_accept(void *unused)

View file

@ -129,7 +129,6 @@ typed_wu(natid from, natid to, char *message, int type)
#endif #endif
int fd; int fd;
char box[1024]; char box[1024];
int notify = 0;
int write_ok = 0; int write_ok = 0;
int new_tele = 0; int new_tele = 0;
struct player *other; struct player *other;
@ -181,16 +180,12 @@ typed_wu(natid from, natid to, char *message, int type)
continue; continue;
if (!player->god && (getrejects(from, np) & REJ_ANNO)) if (!player->god && (getrejects(from, np) & REJ_ANNO))
continue; continue;
notify = (np->nat_ann == 0);
np->nat_ann++; np->nat_ann++;
putnat(np); putnat(np);
if (notify)
player_wakeup_all(to);
} }
} else if (write_ok) { } else if (write_ok) {
notify = (np->nat_tgms == 0);
new_tele = telegram_is_new(to, &tel); new_tele = telegram_is_new(to, &tel);
np->nat_tgms += new_tele || notify; np->nat_tgms += new_tele || np->nat_tgms == 0;
putnat(np); putnat(np);
if (new_tele && np->nat_flags & NF_INFORM) { if (new_tele && np->nat_flags & NF_INFORM) {
@ -199,10 +194,8 @@ typed_wu(natid from, natid to, char *message, int type)
pr_inform(other, "[new tele]\n"); pr_inform(other, "[new tele]\n");
else else
pr_inform(other, "[%d new teles]\n", np->nat_tgms); pr_inform(other, "[%d new teles]\n", np->nat_tgms);
player_wakeup_all(to);
} }
} else if (notify) }
player_wakeup_all(to);
} }
return 0; return 0;