--- deliantra/server/socket/lowlevel.C 2006/12/20 01:19:11 1.27 +++ deliantra/server/socket/lowlevel.C 2006/12/21 23:37:06 1.29 @@ -53,6 +53,9 @@ void client::flush () { + if (destroyed ()) + return; + #ifdef __linux__ // check time of last ack, and, if too old, kill connection struct tcp_info tcpi; @@ -189,7 +192,6 @@ {"examine", PC(ExamineCmd) PF_PLAYING }, {"apply", PC(ApplyCmd) PF_PLAYING }, - {"reply", PC(ReplyCmd) 0 }, {"lookat", PC(LookAt) PF_PLAYING }, {"lock", PC(LockItem) PF_PLAYING }, {"mark", PC(MarkItem) PF_PLAYING }, @@ -198,6 +200,7 @@ {"mapredraw", PC(MapRedrawCmd) 0 }, /* Added: phil */ {"mapinfo", PC(MapInfoCmd) 0 }, /* CF+ */ + {"reply", SC(ReplyCmd) 0 }, {"exti", SC(ExtiCmd) 0 }, /* CF+ */ {"addme", SC(AddMeCmd) 0 }, {"askface", SC(SendFaceCmd) 0 }, /* Added: phil */ @@ -215,7 +218,7 @@ client::may_execute (const packet_type *pkt) const { return (!(pkt->flags & PF_PLAYER) || pl) - && (!(pkt->flags & PF_PLAYING) || (pl && pl->state == ST_PLAYING)); + && (!(pkt->flags & PF_PLAYING) || state == ST_PLAYING); } void @@ -296,7 +299,7 @@ client::socket_cb (iow &w, int got) { //TODO remove when we have better socket cleanup logic - if (status == Ns_Dead) + if (destroyed ()) { socket_ev.poll (0); return; @@ -382,7 +385,7 @@ char *pos = buf; int amt = 0; - if (status == Ns_Dead || !buf) + if (destroyed () || !buf) return; if ((len + outputbuffer.len) > SOCKETBUFSIZE) @@ -423,7 +426,7 @@ void client::send_packet (packet &sl) { - if (status == Ns_Dead) + if (destroyed ()) return; if (sl.length () >= MAXSOCKBUF)