… | |
… | |
1147 | } |
1147 | } |
1148 | |
1148 | |
1149 | int |
1149 | int |
1150 | command_real_quit (object *op, char *params) |
1150 | command_real_quit (object *op, char *params) |
1151 | { |
1151 | { |
1152 | send_query (&op->contr->socket, CS_QUERY_SINGLECHAR, "Quitting will delete your character.\nAre you sure you want to quit (y/n):"); |
1152 | send_query (op->contr->socket, CS_QUERY_SINGLECHAR, "Quitting will delete your character.\nAre you sure you want to quit (y/n):"); |
1153 | |
1153 | |
1154 | op->contr->state = ST_CONFIRM_QUIT; |
1154 | op->contr->state = ST_CONFIRM_QUIT; |
1155 | return 1; |
1155 | return 1; |
1156 | } |
1156 | } |
1157 | |
1157 | |
… | |
… | |
1183 | } |
1183 | } |
1184 | |
1184 | |
1185 | int |
1185 | int |
1186 | command_sound (object *op, char *params) |
1186 | command_sound (object *op, char *params) |
1187 | { |
1187 | { |
1188 | if (op->contr->socket.sound) |
1188 | if (op->contr->socket->sound) |
1189 | { |
1189 | { |
1190 | op->contr->socket.sound = 0; |
1190 | op->contr->socket->sound = 0; |
1191 | new_draw_info (NDI_UNIQUE, 0, op, "Silence is golden..."); |
1191 | new_draw_info (NDI_UNIQUE, 0, op, "Silence is golden..."); |
1192 | } |
1192 | } |
1193 | else |
1193 | else |
1194 | { |
1194 | { |
1195 | op->contr->socket.sound = 1; |
1195 | op->contr->socket->sound = 1; |
1196 | new_draw_info (NDI_UNIQUE, 0, op, "The sounds are enabled."); |
1196 | new_draw_info (NDI_UNIQUE, 0, op, "The sounds are enabled."); |
1197 | } |
1197 | } |
|
|
1198 | |
1198 | return 1; |
1199 | return 1; |
1199 | } |
1200 | } |
1200 | |
1201 | |
1201 | /* Perhaps these should be in player.c, but that file is |
1202 | /* Perhaps these should be in player.c, but that file is |
1202 | * already a bit big. |
1203 | * already a bit big. |
… | |
… | |
1229 | get_name (op); |
1230 | get_name (op); |
1230 | return; |
1231 | return; |
1231 | } |
1232 | } |
1232 | new_draw_info (NDI_UNIQUE, 0, op, " "); /* To hide the password better */ |
1233 | new_draw_info (NDI_UNIQUE, 0, op, " "); /* To hide the password better */ |
1233 | |
1234 | |
1234 | if (checkbanned (op->name, op->contr->socket.host)) |
1235 | if (checkbanned (op->name, op->contr->socket->host)) |
1235 | { |
1236 | { |
1236 | LOG (llevInfo, "Banned player tried to add: [%s@%s]\n", &op->name, op->contr->socket.host); |
1237 | LOG (llevInfo, "Banned player tried to add: [%s@%s]\n", &op->name, op->contr->socket->host); |
1237 | new_draw_info (NDI_UNIQUE | NDI_RED, 0, op, "You are not allowed to play."); |
1238 | new_draw_info (NDI_UNIQUE | NDI_RED, 0, op, "You are not allowed to play."); |
1238 | get_name (op); |
1239 | get_name (op); |
1239 | return; |
1240 | return; |
1240 | } |
1241 | } |
1241 | |
1242 | |