Atrinik Server 2.5
Functions
commands/wiz.c File Reference
#include <global.h>
#include <shstr.h>

Go to the source code of this file.

Functions

static playerget_other_player_from_name (object *op, char *name)
static objectfind_object_rec (object *ob, const char *name, tag_t count)
static objectfind_object_both (object *op, char *params)
static int dm_map_remove_players (mapstruct *m)
static void dm_map_reinsert_players (mapstruct *m, object *op)
int command_setgod (object *op, char *params)
int command_kick (object *ob, char *params)
int command_shutdown_now (object *op, char *params)
int command_goto (object *op, char *params)
int command_freeze (object *op, char *params)
int command_summon (object *op, char *params)
int command_teleport (object *op, char *params)
int command_create (object *op, char *params)
int command_inventory (object *op, char *params)
int command_dump (object *op, char *params)
int command_patch (object *op, char *params)
int command_remove (object *op, char *params)
int command_addexp (object *op, char *params)
int command_speed (object *op, char *params)
int command_stats (object *op, char *params)
int command_resetmap (object *op, char *params)
int command_nowiz (object *op, char *params)
static int checkdm (object *op, char *pl_passwd)
int command_dm (object *op, char *params)
static int command_learn_spell_or_prayer (object *op, char *params, int special_prayer)
int command_learn_spell (object *op, char *params)
int command_learn_special_prayer (object *op, char *params)
int command_forget_spell (object *op, char *params)
int command_listplugins (object *op, char *params)
int command_loadplugin (object *op, char *params)
int command_unloadplugin (object *op, char *params)
void shutdown_agent (int timer, char *reason)
int command_motd_set (object *op, char *params)
int command_ban (object *op, char *params)
int command_debug (object *op, char *params)
int command_dumpbelowfull (object *op, char *params)
int command_dumpbelow (object *op, char *params)
int command_wizpass (object *op, char *params)
int command_dumpallarchetypes (object *op, char *params)
int command_dm_stealth (object *op, char *params)
int command_dm_light (object *op, char *params)
int command_dm_password (object *op, char *params)
int command_dumpactivelist (object *op, char *params)
int command_shutdown (object *op, char *params)
int command_setmaplight (object *op, char *params)
int command_dumpmap (object *op, char *params)
int command_dumpallmaps (object *op, char *params)
int command_malloc (object *op, char *params)
int command_maps (object *op, char *params)
int command_strings (object *op, char *params)
int command_ssdumptable (object *op, char *params)
int command_follow (object *op, char *params)
int command_insert_into (object *op, char *params)
int command_arrest (object *op, char *params)
int command_cmd_permission (object *op, char *params)
int command_map_save (object *op, char *params)
int command_map_reset (object *op, char *params)
int command_map_patch (object *op, char *params)
int command_no_shout (object *op, char *params)
int command_dmtake (object *op, char *params)
int command_server_shout (object *op, char *params)
int command_mod_shout (object *op, char *params)

Detailed Description

Functions used by DMs.

Definition in file wiz.c.


Function Documentation

static int checkdm ( object op,
char *  pl_passwd 
) [static]

Check to see if player is allowed to become a DM.

Parameters:
opThe player object trying to become a DM
pl_passwdPassword can be used to become a DM if it matches one of passwords in the file.
Returns:
1 if the object can become a DM, 0 otherwise.
Todo:
Should be rewritten to use objectlinks, similar to ban.c.

Definition at line 1314 of file wiz.c.

int command_addexp ( object op,
char *  params 
)

Adds experience to a player.

Parameters:
opDM.
paramsShould be "\<who\> \<skill nr\> \<exp\>".
Returns:
1.

Definition at line 1081 of file wiz.c.

int command_arrest ( object op,
char *  params 
)

Wizard jails player.

Parameters:
opWizard.
paramsPlayer to jail.
Returns:
1.

Definition at line 2281 of file wiz.c.

int command_ban ( object op,
char *  params 
)

Ban command, used to ban IP or player from the game.

Parameters:
opDM.
paramsCommand parameters.
Returns:
Always returns 1.

Definition at line 1674 of file wiz.c.

int command_cmd_permission ( object op,
char *  params 
)

/cmd_permission command.

Parameters:
opWizard.
paramsParameters.
Returns:
1.

Definition at line 2319 of file wiz.c.

int command_create ( object op,
char *  params 
)

DM wants to create an object.

Parameters:
opDM.
paramsObject variables.
Returns:
1.

Definition at line 560 of file wiz.c.

int command_debug ( object op,
char *  params 
)

Set debug level.

Parameters:
opObject requesting this.
paramsCommand parameters.
Returns:
1.

Definition at line 1719 of file wiz.c.

int command_dm ( object op,
char *  params 
)

Actual command to become a DM.

Parameters:
opThe player object.
paramsParams may include password needed to become a DM.
Returns:
1 on success, 0 on failure (caller not a player, etc).

Definition at line 1355 of file wiz.c.

int command_dm_light ( object op,
char *  params 
)

Toggle DM light on/off. DM light will light up all maps for the DM.

Parameters:
opObject requesting this.
paramsUnused.
Returns:
1.

Definition at line 1891 of file wiz.c.

int command_dm_password ( object op,
char *  params 
)

/dm_password command.

Parameters:
opDM.
paramsCommand parameters.
Returns:
0.

Definition at line 1918 of file wiz.c.

int command_dm_stealth ( object op,
char *  params 
)

DM stealth command. Used by DMs to make the DM hidden from all other players. It also works when DM logs in without DM flag set or leaves the DM mode.

Parameters:
opObject requesting this.
paramsUnused.
Returns:
1.

Definition at line 1864 of file wiz.c.

int command_dmtake ( object op,
char *  params 
)

Take an object and put it in DM's inventory.

Parameters:
opDM.
paramsObject to take.
Returns:
1.

Definition at line 2580 of file wiz.c.

int command_dump ( object op,
char *  params 
)

Dumps the difference between an object and its archetype.

Parameters:
opDM.
paramsObject to dump.
Returns:
1.

Definition at line 917 of file wiz.c.

int command_dumpactivelist ( object op,
char *  params 
)

Dump active list.

Parameters:
opObject requesting this.
paramsUnused.
Returns:
1.

Definition at line 1994 of file wiz.c.

int command_dumpallarchetypes ( object op,
char *  params 
)

Dumps all archetypes.

Parameters:
opUnused.
paramsUnused.
Returns:
1.

Definition at line 1849 of file wiz.c.

int command_dumpallmaps ( object op,
char *  params 
)

Dump information about all maps.

Parameters:
opObject requesting this
paramsCommand parameters
Returns:
Always returns 1

Definition at line 2097 of file wiz.c.

int command_dumpbelow ( object op,
char *  params 
)

Dump objects below the DM.

Parameters:
opObject requesting this.
paramsUnused.
Returns:
1.

Definition at line 1781 of file wiz.c.

int command_dumpbelowfull ( object op,
char *  params 
)

Full dump of objects below the DM.

Parameters:
opObject requesting this.
paramsUnused.
Returns:
1.

Definition at line 1739 of file wiz.c.

int command_dumpmap ( object op,
char *  params 
)

Dump map information.

Parameters:
opObject requesting this
paramsCommand parameters
Returns:
Always returns 1

Definition at line 2080 of file wiz.c.

int command_follow ( object op,
char *  params 
)

DM wants to follow a player, or stop following a player.

Parameters:
opWizard.
paramsPlayer to follow. If NULL, stop following player.
Returns:
0.

Definition at line 2208 of file wiz.c.

int command_forget_spell ( object op,
char *  params 
)

DM wishes to forget a spell.

Parameters:
opDM.
paramsSpell name to forget.
Returns:
0 if no spell was forgotten, 1 otherwise.

Definition at line 1456 of file wiz.c.

int command_freeze ( object op,
char *  params 
)

Freezes a player for a specified tick count, 100 by default.

Parameters:
opDM freezing the player.
paramsOptional tick count, followed by player name.
Returns:
1.

Definition at line 413 of file wiz.c.

int command_goto ( object op,
char *  params 
)

DM teleports to a map.

Parameters:
opDM teleporting.
paramsMap to teleport to. Can be absolute or relative path.
Returns:
1 unless op is NULL.

Definition at line 375 of file wiz.c.

int command_insert_into ( object op,
char *  params 
)

Insert marked object into another, specified by params.

Parameters:
opWizard.
paramsObject name or #ID to insert something into.
Returns:
0.

Definition at line 2242 of file wiz.c.

int command_inventory ( object op,
char *  params 
)

Shows the inventory of some object.

Parameters:
opPlayer.
paramsObject count to get the inventory of. If NULL then defaults to op.
Returns:
1 unless params is NULL.

Definition at line 868 of file wiz.c.

int command_kick ( object ob,
char *  params 
)

Kicks a player from the server.

If both parameters are NULL, will kick all players.

Parameters:
obDM kicking.
paramsPlayer to kick. Must be a full name match.
Returns:
1.

Definition at line 304 of file wiz.c.

int command_learn_special_prayer ( object op,
char *  params 
)

DM wants to learn a god-given spell.

Parameters:
opDM.
paramsSpell name.
Returns:
0 on failure, 1 on success.

Definition at line 1446 of file wiz.c.

int command_learn_spell ( object op,
char *  params 
)

DM wants to learn a regular spell.

Parameters:
opDM.
paramsSpell name.
Returns:
0 on failure, 1 on success.

Definition at line 1436 of file wiz.c.

static int command_learn_spell_or_prayer ( object op,
char *  params,
int  special_prayer 
) [static]

DM wants to learn a spell.

Parameters:
opDM.
paramsSpell name to learn.
special_prayerIf set, special (god-given) prayer.
Returns:
0 if the spell wasn't learned or was already learned, 1 otherwise.

Definition at line 1406 of file wiz.c.

int command_listplugins ( object op,
char *  params 
)

Lists all plugins currently loaded with their IDs and full names.

Parameters:
opDM.
paramsUnused.
Returns:
1.

Definition at line 1480 of file wiz.c.

int command_loadplugin ( object op,
char *  params 
)

Loads the given plugin. The DM specifies the name of the library to load (no pathname is needed). Do not ever attempt to load the same plugin more than once at a time, or undefined behavior could happen.

Parameters:
opDM loading a plugin.
paramsShould be the plugin's name, eg plugin_python.so.
Returns:
1.

Definition at line 1495 of file wiz.c.

int command_malloc ( object op,
char *  params 
)

Malloc info command.

If MEMPOOL_TRACKING is defined, parameters are used to free (and force freeing) empty puddles. Otherwise, malloc_info() is used to display information about memory usage.

Parameters:
opObject requesting this.
paramsCommand parameters.
Returns:
Always returns 1.

Definition at line 2116 of file wiz.c.

int command_map_patch ( object op,
char *  params 
)

Patch map header variables of a map.

Parameters:
opPlayer.
paramsParameters.
Returns:
1.

Definition at line 2518 of file wiz.c.

int command_map_reset ( object op,
char *  params 
)

Resets DM's current map to the original version.

Parameters:
opPlayer.
paramsParameters.
Returns:
1.

Definition at line 2486 of file wiz.c.

int command_map_save ( object op,
char *  params 
)

Saves the DM's current map to the original map file.

Parameters:
opPlayer.
paramsParameters.
Returns:
1.

Definition at line 2420 of file wiz.c.

int command_maps ( object op,
char *  params 
)

Maps command.

Parameters:
opObject requesting this.
paramsCommand parameters.
Returns:
Always returns 1.

Definition at line 2157 of file wiz.c.

int command_mod_shout ( object op,
char *  params 
)

/mod_shout command. Shouts a message in red and prefixes it with [Moderator]. For those with this command permission will also see who used the command in the message, but not anyone else.

Parameters:
opDM.
paramsMessage to shout.
Returns:
1 on success, 0 on failure.

Definition at line 2649 of file wiz.c.

int command_motd_set ( object op,
char *  params 
)

Set a custom Message of the Day in the file.

Parameters:
opDM.
paramsThe new message of the day, if "original" revert to the original MotD.
Returns:
1 on success, 0 on failure.

Definition at line 1631 of file wiz.c.

int command_no_shout ( object op,
char *  params 
)

The /no_shout command.

Parameters:
opWizard.
paramsParameters.
Returns:
1.

Definition at line 2543 of file wiz.c.

int command_nowiz ( object op,
char *  params 
)

Steps down from DM mode.

Parameters:
opDM.
paramsIgnored.
Returns:
1.

Definition at line 1290 of file wiz.c.

int command_patch ( object op,
char *  params 
)

DM wants to alter an object.

Parameters:
opDM.
paramsObject and what to patch.
Returns:
1.

Definition at line 947 of file wiz.c.

int command_remove ( object op,
char *  params 
)

Remove an object from its position.

Parameters:
opDM.
paramsObject to remove.
Returns:
1.

Definition at line 1037 of file wiz.c.

int command_resetmap ( object op,
char *  params 
)

Resets a map.

Parameters:
opDM.
paramsMap to reset. Can be NULL for current op's map, or a map path.
Returns:
1.

Definition at line 1226 of file wiz.c.

int command_server_shout ( object op,
char *  params 
)

/server_shout command. Shouts a message in green and prefixes it with [Server]. For those with this command permission will also see who used the command in the message, but not anyone else.

Parameters:
opDM.
paramsMessage to shout.
Returns:
1 on success, 0 on failure.

Definition at line 2614 of file wiz.c.

int command_setgod ( object op,
char *  params 
)

Sets the god for some objects.

Parameters:
opThe DM.
paramsShould contain two values - first the object to change, followed by the god to change it to.
Returns:
0 on syntax error, 1 otherwise.

Definition at line 248 of file wiz.c.

int command_setmaplight ( object op,
char *  params 
)

Set map light by DM.

Parameters:
opObject requesting this.
paramsCommand parameters.
Returns:
1 on success, 0 on failure.

Definition at line 2059 of file wiz.c.

int command_shutdown ( object op,
char *  params 
)

Starts server shutdown timer.

Parameters:
opObject requesting this.
paramsCommand parameters.
Returns:
1.

Definition at line 2018 of file wiz.c.

int command_shutdown_now ( object op,
char *  params 
)

Totally shuts down the server.

Parameters:
opDM shutting down the server.
paramsIgnored.
Returns:
1.

Definition at line 357 of file wiz.c.

int command_speed ( object op,
char *  params 
)

Changes the server speed.

Parameters:
opDM.
paramsNew speed, or NULL to see the speed.
Returns:
1.

Definition at line 1166 of file wiz.c.

int command_ssdumptable ( object op,
char *  params 
)

Dump the strings table.

Parameters:
opWizard.
paramsParameters.
Returns:
1.

Definition at line 2194 of file wiz.c.

int command_stats ( object op,
char *  params 
)

Displays the statistics of a player.

Parameters:
opDM.
paramsPlayer's name.
Returns:
1.

Definition at line 1187 of file wiz.c.

int command_strings ( object op,
char *  params 
)

Strings command.

Parameters:
opObject requesting this.
paramsCommand parameters.
Returns:
Always returns 1.

Definition at line 2170 of file wiz.c.

int command_summon ( object op,
char *  params 
)

Summons player near DM.

Parameters:
opDM.
paramsPlayer to summon.
Returns:
1 unless op is NULL.

Definition at line 464 of file wiz.c.

int command_teleport ( object op,
char *  params 
)

Teleport next to target player.

Parameters:
opDM teleporting.
paramsPlayer to teleport to.
Returns:
0 if couldn't teleport, 1 otherwise.

Definition at line 509 of file wiz.c.

int command_unloadplugin ( object op,
char *  params 
)

Unloads the given plugin. The DM specified the ID of the library to unload. Note that some things may behave strangely if the correct plugins are not loaded.

Parameters:
opDM unloading a plugin.
paramsShould be the plugin's internal name, eg Python.
Returns:
1.

Definition at line 1518 of file wiz.c.

int command_wizpass ( object op,
char *  params 
)

Wizpass command. Used by DMs to toggle walking through walls on/off.

Parameters:
opObject requesting this.
paramsCommand parameters.
Returns:
1 on success, 0 on failure.

Definition at line 1812 of file wiz.c.

static void dm_map_reinsert_players ( mapstruct m,
object op 
) [static]

Re-insert players from previous reset of a map.

Parameters:
mMap to place the players to.
opPlayer object doing the reset.

Definition at line 212 of file wiz.c.

static int dm_map_remove_players ( mapstruct m) [static]

Remove all players from the specified map, marking them with player::dm_removed_from_map so we can re-insert them later.

Parameters:
mMap to remove players from.
Returns:
How many players were removed.

Definition at line 189 of file wiz.c.

static object* find_object_both ( object op,
char *  params 
) [static]

This finds and returns the object which matches the name or object number (specified via num #whatever).

Parameters:
opThe DM requesting this.
paramsName or ID of object to find.
Returns:
The object if found, NULL otherwise.

Definition at line 115 of file wiz.c.

static object* find_object_rec ( object ob,
const char *  name,
tag_t  count 
) [static]

Recursively find an object by its name or ID.

Parameters:
obObject to start searching from.
nameName to search for. Must be a shared string. Can be NULL.
countID of the object to search for. Can be 0.
Returns:
Found object, NULL if no matching object found.

Definition at line 85 of file wiz.c.

static player* get_other_player_from_name ( object op,
char *  name 
) [static]

Search for player other than the searcher in game.

Parameters:
opPlayer searching someone.
nameName to search for.
Returns:
Player, or NULL if player can't be found.

Definition at line 39 of file wiz.c.

void shutdown_agent ( int  timer,
char *  reason 
)

Start the shutdown agent.

Parameters:
timerIf -1 count the shutdown timer, reset the shutdown value otherwise.
reasonThe reason for a shutdown.

Definition at line 1536 of file wiz.c.