… | |
… | |
1272 | do_forget_spell (op, spell->name); |
1272 | do_forget_spell (op, spell->name); |
1273 | return 1; |
1273 | return 1; |
1274 | } |
1274 | } |
1275 | |
1275 | |
1276 | /** |
1276 | /** |
1277 | * Lists all plugins currently loaded with their IDs and full names. |
|
|
1278 | */ |
|
|
1279 | int |
|
|
1280 | command_listplugins (object *op, char *params) |
|
|
1281 | { |
|
|
1282 | plugins_display_list (op); |
|
|
1283 | return 1; |
|
|
1284 | } |
|
|
1285 | |
|
|
1286 | /** |
|
|
1287 | * Loads the given plugin. The DM specifies the name of the library to load (no |
|
|
1288 | * pathname is needed). Do not ever attempt to load the same plugin more than |
|
|
1289 | * once at a time, or bad things could happen. |
|
|
1290 | */ |
|
|
1291 | int |
|
|
1292 | command_loadplugin (object *op, char *params) |
|
|
1293 | { |
|
|
1294 | char buf[MAX_BUF]; |
|
|
1295 | |
|
|
1296 | if (params == NULL) |
|
|
1297 | { |
|
|
1298 | new_draw_info (NDI_UNIQUE, 0, op, "Load which plugin?"); |
|
|
1299 | return 1; |
|
|
1300 | } |
|
|
1301 | |
|
|
1302 | strcpy (buf, LIBDIR); |
|
|
1303 | strcat (buf, "/plugins/"); |
|
|
1304 | strcat (buf, params); |
|
|
1305 | LOG (llevDebug, "Requested plugin file is %s\n", buf); |
|
|
1306 | if (plugins_init_plugin (buf) == 0) |
|
|
1307 | new_draw_info (NDI_UNIQUE, 0, op, "Plugin successfully loaded."); |
|
|
1308 | else |
|
|
1309 | new_draw_info (NDI_UNIQUE, 0, op, "Could not load plugin."); |
|
|
1310 | return 1; |
|
|
1311 | } |
|
|
1312 | |
|
|
1313 | /** |
|
|
1314 | * Unloads the given plugin. The DM specified the ID of the library to unload. |
|
|
1315 | * Note that some things may behave strangely if the correct plugins are not |
|
|
1316 | * loaded. |
|
|
1317 | */ |
|
|
1318 | int |
|
|
1319 | command_unloadplugin (object *op, char *params) |
|
|
1320 | { |
|
|
1321 | if (params == NULL) |
|
|
1322 | { |
|
|
1323 | new_draw_info (NDI_UNIQUE, 0, op, "Remove which plugin?"); |
|
|
1324 | return 1; |
|
|
1325 | } |
|
|
1326 | |
|
|
1327 | if (plugins_remove_plugin (params) == 0) |
|
|
1328 | new_draw_info (NDI_UNIQUE, 0, op, "Plugin successfully removed."); |
|
|
1329 | else |
|
|
1330 | new_draw_info (NDI_UNIQUE, 0, op, "Could not remove plugin."); |
|
|
1331 | return 1; |
|
|
1332 | } |
|
|
1333 | |
|
|
1334 | /** |
|
|
1335 | * A players wants to become DM and hide. |
1277 | * A players wants to become DM and hide. |
1336 | * Let's see if that's authorized. |
1278 | * Let's see if that's authorized. |
1337 | * Make sure to not tell anything to anyone. |
1279 | * Make sure to not tell anything to anyone. |
1338 | */ |
1280 | */ |
1339 | int |
1281 | int |