… | |
… | |
966 | |
966 | |
967 | #ifdef AUTOSAVE |
967 | #ifdef AUTOSAVE |
968 | /* check for ST_PLAYING state so that we don't try to save off when |
968 | /* check for ST_PLAYING state so that we don't try to save off when |
969 | * the player is logging in. |
969 | * the player is logging in. |
970 | */ |
970 | */ |
971 | if ((pl->last_save_tick + AUTOSAVE) < (uint32) pticks && pl->state == ST_PLAYING) |
971 | if ((pl->last_save_tick + AUTOSAVE) < (uint32) pticks && pl->ns->state == ST_PLAYING) |
972 | { |
972 | { |
973 | save_player (pl->ob, 1); |
973 | save_player (pl->ob, 1); |
974 | pl->last_save_tick = pticks; |
974 | pl->last_save_tick = pticks; |
975 | } |
975 | } |
976 | #endif |
976 | #endif |
… | |
… | |
1225 | { |
1225 | { |
1226 | /* We do this so that the socket handling routine can do the final |
1226 | /* We do this so that the socket handling routine can do the final |
1227 | * cleanup. We also leave that loop to actually handle the freeing |
1227 | * cleanup. We also leave that loop to actually handle the freeing |
1228 | * of the data. |
1228 | * of the data. |
1229 | */ |
1229 | */ |
1230 | if (pl->socket) |
1230 | if (pl->ns) |
1231 | pl->socket->destroy (); |
1231 | pl->ns->destroy (); |
1232 | |
1232 | |
1233 | if (pl->ob->type != DEAD_OBJECT) |
1233 | if (pl->ob->type != DEAD_OBJECT) |
1234 | { |
1234 | { |
1235 | /* If a hidden dm dropped connection do not create |
1235 | /* If a hidden dm dropped connection do not create |
1236 | * inconsistencies by showing that they have left the game |
1236 | * inconsistencies by showing that they have left the game |
1237 | */ |
1237 | */ |
1238 | if (!(QUERY_FLAG (pl->ob, FLAG_WIZ) && pl->ob->contr->hidden) |
1238 | if (!(QUERY_FLAG (pl->ob, FLAG_WIZ) && pl->ob->contr->hidden) |
1239 | && draw_exit && (pl->state != ST_GET_NAME && pl->state != ST_GET_PASSWORD && pl->state != ST_CONFIRM_PASSWORD)) |
1239 | && draw_exit && (pl->ns->state != ST_GET_NAME && pl->ns->state != ST_GET_PASSWORD && pl->ns->state != ST_CONFIRM_PASSWORD)) |
1240 | { |
1240 | { |
1241 | if (pl->ob->map) |
1241 | if (pl->ob->map) |
1242 | { |
1242 | { |
1243 | INVOKE_PLAYER (LOGOUT, pl); |
1243 | INVOKE_PLAYER (LOGOUT, pl); |
1244 | LOG (llevInfo, "LOGOUT: Player named %s from ip %s\n", &pl->ob->name, pl->socket->host); |
1244 | LOG (llevInfo, "LOGOUT: Player named %s from ip %s\n", &pl->ob->name, pl->ns->host); |
1245 | } |
1245 | } |
1246 | |
1246 | |
1247 | char buf[MAX_BUF]; |
1247 | char buf[MAX_BUF]; |
1248 | |
1248 | |
1249 | sprintf (buf, "%s left the game.", &pl->ob->name); |
1249 | sprintf (buf, "%s left the game.", &pl->ob->name); |