ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/loop.C
(Generate patch)

Comparing deliantra/server/socket/loop.C (file contents):
Revision 1.29 by root, Tue Dec 19 04:58:05 2006 UTC vs.
Revision 1.30 by root, Thu Dec 21 06:12:37 2006 UTC

116 116
117void 117void
118flush_sockets (void) 118flush_sockets (void)
119{ 119{
120 for (sockvec::iterator i = clients.begin (); i != clients.end (); ++i) 120 for (sockvec::iterator i = clients.begin (); i != clients.end (); ++i)
121 if ((*i)->status != Ns_Dead) 121 if (!(*i)->destroyed)
122 (*i)->flush (); 122 (*i)->flush ();
123} 123}
124 124
125/** 125/**
126 * This checks the sockets for input, does the right thing. 126 * This checks the sockets for input, does the right thing.
144 for (player *pl = first_player; pl; ) 144 for (player *pl = first_player; pl; )
145 { 145 {
146 player *npl = pl->next; 146 player *npl = pl->next;
147 147
148 //TODO: must be handled cleanly elsewhere 148 //TODO: must be handled cleanly elsewhere
149 if (!pl->socket || pl->socket->status == Ns_Dead) 149 if (!pl->socket || pl->socket->destroyed)
150 { 150 {
151 save_player (pl->ob, 0); 151 save_player (pl->ob, 0);
152 152
153 if (!QUERY_FLAG (pl->ob, FLAG_REMOVED)) 153 if (!QUERY_FLAG (pl->ob, FLAG_REMOVED))
154 { 154 {
165 165
166 for (sockvec::iterator i = clients.begin (); i != clients.end (); ) 166 for (sockvec::iterator i = clients.begin (); i != clients.end (); )
167 { 167 {
168 client *s = *i; 168 client *s = *i;
169 169
170 if (s->status == Ns_Dead) 170 if (s->destroyed)
171 { 171 {
172 clients.erase (i); 172 clients.erase (i);
173 delete s; 173 delete s;
174 } 174 }
175 else 175 else
183 { 183 {
184 client *s = *i; 184 client *s = *i;
185 player *pl = s->pl; 185 player *pl = s->pl;
186 186
187 //TODO: should not be done here, either 187 //TODO: should not be done here, either
188 if (s->status != Ns_Dead && pl) 188 if (!s->destroyed && pl)
189 { 189 {
190 /* Update the players stats once per tick. More efficient than 190 /* Update the players stats once per tick. More efficient than
191 * sending them whenever they change, and probably just as useful 191 * sending them whenever they change, and probably just as useful
192 */ 192 */
193 esrv_update_stats (pl); 193 esrv_update_stats (pl);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines