Crossfire Server, Trunk  R20608
c_new.c File Reference
#include "global.h"
#include <stdlib.h>
#include <string.h>
#include "commands.h"
#include "sproto.h"
+ Include dependency graph for c_new.c:

Go to the source code of this file.

Macros

#define tolower(C)   (((C) >= 'A' && (C) <= 'Z') ? (C)-'A'+'a' : (C))
 

Functions

void command_fire (object *op, const char *params)
 
void command_fire_stop (object *op, const char *params)
 
void command_run (object *op, const char *params)
 
void command_run_stop (object *op, const char *params)
 
static int compare_A (const void *a, const void *b)
 
void execute_newserver_command (object *pl, char *command)
 
static command_array_structfind_command_element (const char *cmd, command_array_struct *commarray, int commsize)
 

Detailed Description

This file deals with administrative commands from the client.

Definition in file c_new.c.

Macro Definition Documentation

#define tolower (   C)    (((C) >= 'A' && (C) <= 'Z') ? (C)-'A'+'a' : (C))

Simple macro to convert a letter to lowercase.

Definition at line 29 of file c_new.c.

Referenced by cast_consecrate(), do_map_index(), execute_newserver_command(), knowledge_god_face(), main(), re_match_token(), strcasecmp(), strcasestr(), strncasecmp(), and strtoint().

Function Documentation

void command_fire ( object op,
const char *  params 
)

Player wants to start furing.

Parameters
opplayer.
paramsadditional parameters.

Definition at line 187 of file c_new.c.

References obj::contr, draw_ext_info(), pl::fire_on, move_player(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.

+ Here is the call graph for this function:

void command_fire_stop ( object op,
const char *  params 
)

Player wants to stop firing.

Parameters
opplayer.
paramsignored.

Definition at line 208 of file c_new.c.

References obj::contr, and pl::fire_on.

void command_run ( object op,
const char *  params 
)

Player wants to start running.

Parameters
opplayer.
paramsadditional parameters.

Definition at line 152 of file c_new.c.

References obj::contr, draw_ext_info(), move_player(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and pl::run_on.

+ Here is the call graph for this function:

void command_run_stop ( object op,
const char *  params 
)

Player wants to stop running.

Parameters
opplayer.
paramsignored.
Returns
1.

Definition at line 175 of file c_new.c.

References obj::contr, and pl::run_on.

static int compare_A ( const void *  a,
const void *  b 
)
static

Compare function for commands.

Parameters
a
bcommands to compare.
Return values
-1a is less then b.
0a and b are equals.
1a is greater than b.

Definition at line 45 of file c_new.c.

Referenced by find_command_element().

+ Here is the caller graph for this function:

void execute_newserver_command ( object pl,
char *  command 
)

Player issued a command, let's handle it.

This function is called from the new client/server code.

Parameters
plplayer who is issuing the command
commandthe actual command with its arguments.

Definition at line 83 of file c_new.c.

References Commands, CommandsSize, CommunicationCommands, CommunicationCommandSize, obj::contr, draw_ext_info_format(), find_command_element(), find_plugin_command(), FLAG_WIZ, command_array_struct::func, pl::has_hit, llevDebug, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, QUERY_FLAG, obj::speed_left, command_array_struct::time, tolower, WizCommands, and WizCommandsSize.

Referenced by new_player_cmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static command_array_struct* find_command_element ( const char *  cmd,
command_array_struct commarray,
int  commsize 
)
static

Finds the specified command in the command array. Utility function.

Parameters
cmdcommand to find. Will be put to lowercase.
commarraycommands to search into.
commsizelength of commarray.
Returns
matching command, NULL for no match.

Definition at line 62 of file c_new.c.

References compare_A(), and command_array_struct::name.

Referenced by execute_newserver_command().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: