… | |
… | |
113 | } |
113 | } |
114 | |
114 | |
115 | void |
115 | void |
116 | client::tick () |
116 | client::tick () |
117 | { |
117 | { |
118 | if (!pl || destroyed ()) |
118 | if (destroyed ()) |
119 | return; |
119 | return; |
120 | |
120 | |
|
|
121 | if (pl) |
|
|
122 | { |
121 | pl->dirty = true; |
123 | pl->dirty = true; |
122 | |
124 | |
123 | /* Update the players stats once per tick. More efficient than |
125 | /* Update the players stats once per tick. More efficient than |
124 | * sending them whenever they change, and probably just as useful |
126 | * sending them whenever they change, and probably just as useful |
125 | */ |
127 | */ |
126 | pl->need_updated_stats (); |
128 | pl->need_updated_stats (); |
127 | esrv_update_stats (pl); |
129 | esrv_update_stats (pl); |
128 | |
130 | |
129 | if (pl->ns->update_spells) |
131 | if (pl->ns->update_spells) |
130 | esrv_update_spells (pl); |
132 | esrv_update_spells (pl); |
131 | |
133 | |
132 | sint32 weight = pl->ob->client_weight (); |
134 | sint32 weight = pl->ob->client_weight (); |
133 | |
135 | |
134 | if (last_weight != weight) |
136 | if (last_weight != weight) |
135 | { |
137 | { |
136 | pl->ob->update_stats (); |
138 | pl->ob->update_stats (); |
137 | esrv_update_item (UPD_WEIGHT, pl->ob, pl->ob); |
139 | esrv_update_item (UPD_WEIGHT, pl->ob, pl->ob); |
138 | } |
140 | } |
139 | |
141 | |
140 | draw_client_map (pl); |
142 | draw_client_map (pl); |
141 | |
143 | |
142 | if (update_look) |
144 | if (update_look) |
143 | esrv_draw_look (pl); |
145 | esrv_draw_look (pl); |
144 | |
146 | |
145 | mapinfo_queue_run (); |
147 | mapinfo_queue_run (); |
|
|
148 | } |
146 | |
149 | |
147 | #if HAVE_TCP_INFO |
150 | #if HAVE_TCP_INFO |
148 | // check time of last ack, and, if too old, kill connection |
151 | // check time of last ack, and, if too old, kill connection |
149 | socklen_t len = sizeof (tcpi); |
152 | socklen_t len = sizeof (tcpi); |
150 | |
153 | |