… | |
… | |
1153 | } |
1153 | } |
1154 | } |
1154 | } |
1155 | } |
1155 | } |
1156 | |
1156 | |
1157 | if (pl->socket.exp64) |
1157 | if (pl->socket.exp64) |
1158 | AddIfInt64 (pl->last_stats.exp, pl->ob->stats.exp, CS_STAT_EXP64); |
1158 | { AddIfInt64 (pl->last_stats.exp, pl->ob->stats.exp, CS_STAT_EXP64) } |
1159 | else |
1159 | else |
1160 | AddIfInt (pl->last_stats.exp, (int) pl->ob->stats.exp, CS_STAT_EXP); |
1160 | { AddIfInt (pl->last_stats.exp, (int) pl->ob->stats.exp, CS_STAT_EXP) } |
1161 | |
1161 | |
1162 | AddIfShort (pl->last_level, (char) pl->ob->level, CS_STAT_LEVEL); |
1162 | AddIfShort (pl->last_level, (char) pl->ob->level, CS_STAT_LEVEL); |
1163 | AddIfShort (pl->last_stats.wc, pl->ob->stats.wc, CS_STAT_WC); |
1163 | AddIfShort (pl->last_stats.wc, pl->ob->stats.wc, CS_STAT_WC); |
1164 | AddIfShort (pl->last_stats.ac, pl->ob->stats.ac, CS_STAT_AC); |
1164 | AddIfShort (pl->last_stats.ac, pl->ob->stats.ac, CS_STAT_AC); |
1165 | AddIfShort (pl->last_stats.dam, pl->ob->stats.dam, CS_STAT_DAM); |
1165 | AddIfShort (pl->last_stats.dam, pl->ob->stats.dam, CS_STAT_DAM); |
… | |
… | |
1176 | flags |= SF_RUNON; |
1176 | flags |= SF_RUNON; |
1177 | |
1177 | |
1178 | AddIfShort (pl->last_flags, flags, CS_STAT_FLAGS); |
1178 | AddIfShort (pl->last_flags, flags, CS_STAT_FLAGS); |
1179 | |
1179 | |
1180 | if (pl->socket.sc_version < 1025) |
1180 | if (pl->socket.sc_version < 1025) |
1181 | AddIfShort (pl->last_resist[ATNR_PHYSICAL], pl->ob->resist[ATNR_PHYSICAL], CS_STAT_ARMOUR); |
1181 | { AddIfShort (pl->last_resist[ATNR_PHYSICAL], pl->ob->resist[ATNR_PHYSICAL], CS_STAT_ARMOUR) } |
1182 | else |
1182 | else |
1183 | { |
1183 | { |
1184 | int i; |
1184 | int i; |
1185 | |
1185 | |
1186 | for (i = 0; i < NROFATTACKS; i++) |
1186 | for (i = 0; i < NROFATTACKS; i++) |
1187 | { |
1187 | { |
1188 | /* Skip ones we won't send */ |
1188 | /* Skip ones we won't send */ |
1189 | if (atnr_cs_stat[i] == -1) |
1189 | if (atnr_cs_stat[i] == -1) |
1190 | continue; |
1190 | continue; |
|
|
1191 | |
1191 | AddIfShort (pl->last_resist[i], pl->ob->resist[i], (char) atnr_cs_stat[i]); |
1192 | AddIfShort (pl->last_resist[i], pl->ob->resist[i], (char) atnr_cs_stat[i]); |
1192 | } |
1193 | } |
1193 | } |
1194 | } |
1194 | |
1195 | |
1195 | if (pl->socket.monitor_spells) |
1196 | if (pl->socket.monitor_spells) |
… | |
… | |
1210 | #ifdef ESRV_DEBUG |
1211 | #ifdef ESRV_DEBUG |
1211 | LOG (llevDebug, "Sending stats command, %d bytes long.\n", sl.len); |
1212 | LOG (llevDebug, "Sending stats command, %d bytes long.\n", sl.len); |
1212 | #endif |
1213 | #endif |
1213 | Send_With_Handling (&pl->socket, &sl); |
1214 | Send_With_Handling (&pl->socket, &sl); |
1214 | } |
1215 | } |
|
|
1216 | |
1215 | free (sl.buf); |
1217 | free (sl.buf); |
1216 | } |
1218 | } |
1217 | |
|
|
1218 | |
1219 | |
1219 | /** |
1220 | /** |
1220 | * Tells the client that here is a player it should start using. |
1221 | * Tells the client that here is a player it should start using. |
1221 | */ |
1222 | */ |
1222 | void |
1223 | void |
… | |
… | |
1240 | |
1241 | |
1241 | Send_With_Handling (&pl->socket, &sl); |
1242 | Send_With_Handling (&pl->socket, &sl); |
1242 | free (sl.buf); |
1243 | free (sl.buf); |
1243 | SET_FLAG (pl->ob, FLAG_CLIENT_SENT); |
1244 | SET_FLAG (pl->ob, FLAG_CLIENT_SENT); |
1244 | } |
1245 | } |
1245 | |
|
|
1246 | |
1246 | |
1247 | /** |
1247 | /** |
1248 | * Need to send an animation sequence to the client. |
1248 | * Need to send an animation sequence to the client. |
1249 | * We will send appropriate face commands to the client if we haven't |
1249 | * We will send appropriate face commands to the client if we haven't |
1250 | * sent them the face yet (this can become quite costly in terms of |
1250 | * sent them the face yet (this can become quite costly in terms of |