--- deliantra/server/socket/loop.C 2008/01/13 12:39:29 1.71 +++ deliantra/server/socket/loop.C 2008/05/06 16:55:26 1.77 @@ -1,7 +1,7 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team * Copyright (©) 2002-2003,2007 Mark Wedel & The Crossfire Development Team * Copyright (©) 1992,2007 Frank Tore Johansen * @@ -52,7 +52,7 @@ #define MAX_QUEUE_BACKLOG 3. // disconnect a socket after this many seconds without an ack -#define SOCKET_TIMEOUT 8. +#define SOCKET_TIMEOUT 16. void client::reset_state () @@ -117,17 +117,19 @@ if (!pl || destroyed ()) return; + pl->dirty = true; + /* Update the players stats once per tick. More efficient than * sending them whenever they change, and probably just as useful */ esrv_update_stats (pl); - if (last_weight != -1 && last_weight != WEIGHT (pl->ob)) + sint32 weight = pl->ob->client_weight (); + + if (last_weight != weight) { + pl->ob->update_stats (); esrv_update_item (UPD_WEIGHT, pl->ob, pl->ob); - if (last_weight != WEIGHT (pl->ob)) - LOG (llevError, "esrv_update_item(UPD_WEIGHT) did not set player weight: is %lu, should be %lu\n", - (unsigned long) last_weight, WEIGHT (pl->ob)); } draw_client_map (pl);