1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002-2003,2007 Mark Wedel & The Crossfire Development Team |
5 | * Copyright (©) 2002-2003,2007 Mark Wedel & The Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify |
8 | * Deliantra is free software: you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
… | |
… | |
50 | |
50 | |
51 | #define MAX_QUEUE_DEPTH 50 |
51 | #define MAX_QUEUE_DEPTH 50 |
52 | #define MAX_QUEUE_BACKLOG 3. |
52 | #define MAX_QUEUE_BACKLOG 3. |
53 | |
53 | |
54 | // disconnect a socket after this many seconds without an ack |
54 | // disconnect a socket after this many seconds without an ack |
55 | #define SOCKET_TIMEOUT 8. |
55 | #define SOCKET_TIMEOUT 16. |
56 | |
56 | |
57 | void |
57 | void |
58 | client::reset_state () |
58 | client::reset_state () |
59 | { |
59 | { |
60 | if (!pl) |
60 | if (!pl) |
… | |
… | |
115 | client::tick () |
115 | client::tick () |
116 | { |
116 | { |
117 | if (!pl || destroyed ()) |
117 | if (!pl || destroyed ()) |
118 | return; |
118 | return; |
119 | |
119 | |
|
|
120 | pl->dirty = true; |
|
|
121 | |
120 | /* Update the players stats once per tick. More efficient than |
122 | /* Update the players stats once per tick. More efficient than |
121 | * sending them whenever they change, and probably just as useful |
123 | * sending them whenever they change, and probably just as useful |
122 | */ |
124 | */ |
123 | esrv_update_stats (pl); |
125 | esrv_update_stats (pl); |
124 | |
126 | |
125 | if (last_weight != -1 && last_weight != WEIGHT (pl->ob)) |
127 | sint32 weight = pl->ob->client_weight (); |
|
|
128 | |
|
|
129 | if (last_weight != weight) |
126 | { |
130 | { |
|
|
131 | pl->ob->update_stats (); |
127 | esrv_update_item (UPD_WEIGHT, pl->ob, pl->ob); |
132 | esrv_update_item (UPD_WEIGHT, pl->ob, pl->ob); |
128 | if (last_weight != WEIGHT (pl->ob)) |
|
|
129 | LOG (llevError, "esrv_update_item(UPD_WEIGHT) did not set player weight: is %lu, should be %lu\n", |
|
|
130 | (unsigned long) last_weight, WEIGHT (pl->ob)); |
|
|
131 | } |
133 | } |
132 | |
134 | |
133 | draw_client_map (pl); |
135 | draw_client_map (pl); |
134 | |
136 | |
135 | if (update_look) |
137 | if (update_look) |