server/c_wiz.c File Reference

#include <global.h>
#include <sproto.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)
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)
void remove_active_DM (object *op)
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)

Detailed Description

Functions used by DMs.

Definition in file c_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:
op The player object trying to become a DM
pl_passwd Password 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 1369 of file c_wiz.c.

int command_addexp ( object op,
char *  params 
)

Adds experience to a player.

Parameters:
op DM.
params Should be "\<who\> \<skill nr\> \<exp\>".
Returns:
1.

Definition at line 1042 of file c_wiz.c.

int command_arrest ( object op,
char *  params 
)

Wizard jails player.

Parameters:
op Wizard.
params Player to jail.
Returns:
1.

Definition at line 2341 of file c_wiz.c.

int command_ban ( object op,
char *  params 
)

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

Parameters:
op DM.
params Command parameters.
Returns:
Always returns 1.

Definition at line 1734 of file c_wiz.c.

int command_cmd_permission ( object op,
char *  params 
)

/cmd_permission command.

Parameters:
op Wizard.
params Parameters.
Returns:
1.

Definition at line 2380 of file c_wiz.c.

int command_create ( object op,
char *  params 
)

DM wants to create an object.

Parameters:
op DM.
params Object variables.
Returns:
1 unless op is NULL.

Definition at line 504 of file c_wiz.c.

int command_debug ( object op,
char *  params 
)

Set debug level.

Parameters:
op Object requesting this.
params Command parameters.
Returns:
1.

Definition at line 1779 of file c_wiz.c.

int command_dm ( object op,
char *  params 
)

Actual command to become a DM.

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

Definition at line 1410 of file c_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:
op Object requesting this.
params Unused.
Returns:
1.

Definition at line 1951 of file c_wiz.c.

int command_dm_password ( object op,
char *  params 
)

/dm_password command.

Parameters:
op DM.
params Command parameters.
Returns:
0.

Definition at line 1978 of file c_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:
op Object requesting this.
params Unused.
Returns:
1.

Definition at line 1924 of file c_wiz.c.

int command_dump ( object op,
char *  params 
)

Dumps the difference between an object and its archetype.

Parameters:
op DM.
params Object to dump.
Returns:
1.

Definition at line 910 of file c_wiz.c.

int command_dumpactivelist ( object op,
char *  params 
)

Dump active list.

Parameters:
op Object requesting this.
params Unused.
Returns:
1.

Definition at line 2054 of file c_wiz.c.

int command_dumpallarchetypes ( object op,
char *  params 
)

Dumps all archetypes.

Parameters:
op Unused.
params Unused.
Returns:
1.

Definition at line 1909 of file c_wiz.c.

int command_dumpallmaps ( object op,
char *  params 
)

Dump information about all maps.

Parameters:
op Object requesting this
params Command parameters
Returns:
Always returns 1

Definition at line 2157 of file c_wiz.c.

int command_dumpbelow ( object op,
char *  params 
)

Dump objects below the DM.

Parameters:
op Object requesting this.
params Unused.
Returns:
1.

Definition at line 1841 of file c_wiz.c.

int command_dumpbelowfull ( object op,
char *  params 
)

Full dump of objects below the DM.

Parameters:
op Object requesting this.
params Unused.
Returns:
1.

Definition at line 1799 of file c_wiz.c.

int command_dumpmap ( object op,
char *  params 
)

Dump map information.

Parameters:
op Object requesting this
params Command parameters
Returns:
Always returns 1

Definition at line 2140 of file c_wiz.c.

int command_follow ( object op,
char *  params 
)

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

Parameters:
op Wizard.
params Player to follow. If NULL, stop following player.
Returns:
0.

Definition at line 2268 of file c_wiz.c.

int command_forget_spell ( object op,
char *  params 
)

DM wishes to forget a spell.

Parameters:
op DM.
params Spell name to forget.
Returns:
0 if no spell was forgotten, 1 otherwise.

Definition at line 1517 of file c_wiz.c.

int command_freeze ( object op,
char *  params 
)

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

Parameters:
op DM freezing the player.
params Optional tick count, followed by player name.
Returns:
1.

Definition at line 351 of file c_wiz.c.

int command_goto ( object op,
char *  params 
)

DM teleports to a map.

Parameters:
op DM teleporting.
params Map to teleport to. Can be absolute or relative path.
Returns:
1 unless op is NULL.

Definition at line 313 of file c_wiz.c.

int command_insert_into ( object op,
char *  params 
)

Insert marked object into another, specified by params.

Parameters:
op Wizard.
params Object name or #ID to insert something into.
Returns:
0.

Definition at line 2302 of file c_wiz.c.

int command_inventory ( object op,
char *  params 
)

Shows the inventory of some object.

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

Definition at line 883 of file c_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:
ob DM kicking.
params Player to kick. Must be a full name match.
Returns:
1.

Definition at line 247 of file c_wiz.c.

int command_learn_special_prayer ( object op,
char *  params 
)

DM wants to learn a god-given spell.

Parameters:
op DM.
params Spell name.
Returns:
0 on failure, 1 on success.

Definition at line 1507 of file c_wiz.c.

int command_learn_spell ( object op,
char *  params 
)

DM wants to learn a regular spell.

Parameters:
op DM.
params Spell name.
Returns:
0 on failure, 1 on success.

Definition at line 1497 of file c_wiz.c.

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

DM wants to learn a spell.

Parameters:
op DM.
params Spell name to learn.
special_prayer If set, special (god-given) prayer.
Returns:
0 if the spell wasn't learned or was already learned, 1 otherwise.

Definition at line 1467 of file c_wiz.c.

int command_listplugins ( object op,
char *  params 
)

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

Parameters:
op DM.
params Unused.
Returns:
1.

Definition at line 1541 of file c_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:
op DM loading a plugin.
params Should be the plugin's name, eg plugin_python.so.
Returns:
1.

Definition at line 1556 of file c_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:
op Object requesting this.
params Command parameters.
Returns:
Always returns 1.

Definition at line 2176 of file c_wiz.c.

int command_maps ( object op,
char *  params 
)

Maps command.

Parameters:
op Object requesting this.
params Command parameters.
Returns:
Always returns 1.

Definition at line 2217 of file c_wiz.c.

int command_motd_set ( object op,
char *  params 
)

Set a custom Message of the Day in the file.

Parameters:
op DM.
params The new message of the day, if "original" revert to the original MotD.
Returns:
1 on success, 0 on failure.

Definition at line 1691 of file c_wiz.c.

int command_nowiz ( object op,
char *  params 
)

Steps down from DM mode.

Parameters:
op DM.
params Ignored.
Returns:
1.

Definition at line 1341 of file c_wiz.c.

int command_patch ( object op,
char *  params 
)

DM wants to alter an object.

Parameters:
op DM.
params Object and what to patch.
Returns:
1.

Definition at line 940 of file c_wiz.c.

int command_remove ( object op,
char *  params 
)

Remove an object from its position.

Parameters:
op DM.
params Object to remove.
Returns:
1.

Definition at line 998 of file c_wiz.c.

int command_resetmap ( object op,
char *  params 
)

Resets a map.

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

Definition at line 1186 of file c_wiz.c.

int command_setgod ( object op,
char *  params 
)

Sets the god for some objects.

Parameters:
op The DM.
params Should 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 191 of file c_wiz.c.

int command_setmaplight ( object op,
char *  params 
)

Set map light by DM.

Parameters:
op Object requesting this.
params Command parameters.
Returns:
1 on success, 0 on failure.

Definition at line 2119 of file c_wiz.c.

int command_shutdown ( object op,
char *  params 
)

Starts server shutdown timer.

Parameters:
op Object requesting this.
params Command parameters.
Returns:
1.

Definition at line 2078 of file c_wiz.c.

int command_shutdown_now ( object op,
char *  params 
)

Totally shuts down the server.

Parameters:
op DM shutting down the server.
params Ignored.
Returns:
1.

Definition at line 296 of file c_wiz.c.

int command_speed ( object op,
char *  params 
)

Changes the server speed.

Parameters:
op DM.
params New speed, or NULL to see the speed.
Returns:
1.

Definition at line 1126 of file c_wiz.c.

int command_ssdumptable ( object op,
char *  params 
)

Dump the strings table.

Parameters:
op Wizard.
params Parameters.
Returns:
1.

Definition at line 2254 of file c_wiz.c.

int command_stats ( object op,
char *  params 
)

Displays the statistics of a player.

Parameters:
op DM.
params Player's name.
Returns:
1.

Definition at line 1147 of file c_wiz.c.

int command_strings ( object op,
char *  params 
)

Strings command.

Parameters:
op Object requesting this.
params Command parameters.
Returns:
Always returns 1.

Definition at line 2230 of file c_wiz.c.

int command_summon ( object op,
char *  params 
)

Summons player near DM.

Parameters:
op DM.
params Player to summon.
Returns:
1 unless op is NULL.

Definition at line 402 of file c_wiz.c.

int command_teleport ( object op,
char *  params 
)

Teleport next to target player.

Parameters:
op DM teleporting.
params Player to teleport to.
Returns:
0 if couldn't teleport, 1 otherwise.

Definition at line 450 of file c_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:
op DM unloading a plugin.
params Should be the plugin's internal name, eg Python.
Returns:
1.

Definition at line 1579 of file c_wiz.c.

int command_wizpass ( object op,
char *  params 
)

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

Parameters:
op Object requesting this.
params Command parameters.
Returns:
1 on success, 0 on failure.

Definition at line 1872 of file c_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:
op The DM requesting this.
params Name or ID of object to find.
Returns:
The object if found, NULL otherwise.

Definition at line 116 of file c_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:
ob Object to start searching from.
name Name to search for. Must be a shared string. Can be NULL.
count ID of the object to search for. Can be 0.
Returns:
Found object, NULL if no matching object found.

Definition at line 86 of file c_wiz.c.

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

Search for player other than the searcher in game.

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

Definition at line 40 of file c_wiz.c.

void remove_active_DM ( object op  ) 

Remove DM from the list of DMs.

Parameters:
op The DM object to remove.

Definition at line 1321 of file c_wiz.c.

void shutdown_agent ( int  timer,
char *  reason 
)

Start the shutdown agent.

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

Definition at line 1597 of file c_wiz.c.


Generated by  doxygen 1.6.2