Crossfire Client, Branches  R11627
script.c File Reference
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <ctype.h>
#include <client.h>
#include <external.h>
#include <script.h>
#include <p_cmd.h>
#include "mapdata.h"
+ Include dependency graph for script.c:

Go to the source code of this file.

Data Structures

struct  script
 

Functions

static int script_by_name (const char *name)
 
static void script_dead (int i)
 
void script_fdset (int *maxfd, fd_set *set)
 
void script_init (const char *cparams)
 
void script_kill (const char *params)
 
void script_list (void)
 
void script_monitor (const char *command, int repeat, int must_send)
 
void script_monitor_str (const char *command)
 
void script_process (fd_set *set)
 
static void script_process_cmd (int i)
 
static void script_send_item (int i, const char *head, const item *it)
 
void script_sync (int commdiff)
 
void script_tell (const char *params)
 
void script_watch (const char *cmd, const uint8 *data, const int data_len, const enum CmdFormat format)
 
static void send_map (int i, int x, int y)
 

Variables

static int num_scripts = 0
 
const char *const rcsid_common_script_c
 
static struct scriptscripts = NULL
 

Function Documentation

static int script_by_name ( const char *  name)
static

Definition at line 908 of file script.c.

References num_scripts.

Referenced by script_kill(), and script_tell().

+ Here is the caller graph for this function:

static void script_dead ( int  i)
static

Definition at line 936 of file script.c.

References script::in_fd, name, num_scripts, script::num_watch, script::out_fd, params, and script::watch.

Referenced by script_kill(), and script_process().

+ Here is the caller graph for this function:

void script_fdset ( int *  maxfd,
fd_set *  set 
)

Definition at line 559 of file script.c.

References script::in_fd, and num_scripts.

Referenced by do_network(), and event_loop().

+ Here is the caller graph for this function:

void script_init ( const char *  cparams)
void script_kill ( const char *  params)

Definition at line 528 of file script.c.

References draw_info(), NDI_BLACK, NDI_RED, num_scripts, script::pid, script_by_name(), and script_dead().

+ Here is the call graph for this function:

void script_list ( void  )

Definition at line 504 of file script.c.

References draw_info(), name, NDI_BLACK, num_scripts, and params.

Referenced by do_script_list().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void script_monitor ( const char *  command,
int  repeat,
int  must_send 
)

Definition at line 854 of file script.c.

References script::monitor, num_scripts, and script::out_fd.

Referenced by send_command().

+ Here is the caller graph for this function:

void script_monitor_str ( const char *  command)

Definition at line 872 of file script.c.

References script::monitor, num_scripts, and script::out_fd.

Referenced by cs_print_string(), inscribe_magical_scroll(), send_mark_obj(), and toggle_locked().

+ Here is the caller graph for this function:

void script_process ( fd_set *  set)

Definition at line 572 of file script.c.

References script::cmd, script::cmd_count, script::in_fd, num_scripts, script_dead(), and script_process_cmd().

Referenced by do_network(), and event_loop().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void script_process_cmd ( int  i)
static

Definition at line 992 of file script.c.

References Stat_struct::ac, item_struct::applied, Stat_struct::attuned, Player_Struct::below, Stat_struct::Cha, script::cmd, script::cmd_count, ClientSocket::command_received, ClientSocket::command_sent, Stat_struct::Con, CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, Player_Struct::container, cpl, CS_NUM_SKILLS, cs_print_string(), CS_STAT_SKILLINFO, csocket, Stat_struct::dam, Spell_struct::dam, Stat_struct::denied, Stat_struct::Dex, draw_info(), Stat_struct::exp, ClientSocket::fd, Player_Struct::fire_on, Stat_struct::flags, Stat_struct::food, Stat_struct::grace, Spell_struct::grace, handle_local_command(), Stat_struct::hp, Stat_struct::Int, item_struct::inv, Stat_struct::level, Spell_struct::level, MAX_BUF, MAX_SKILL, Stat_struct::maxgrace, Stat_struct::maxhp, Stat_struct::maxsp, script::monitor, name, Spell_struct::name, NDI_RED, item_struct::next, Spell_struct::next, Player_Struct::no_echo, script::num_watch, Player_Struct::ob, script::out_fd, Spell_struct::path, pl_pos, Stat_struct::Pow, Player_Struct::range, Stat_struct::repelled, Stat_struct::resists, Player_Struct::run_on, script_send_item(), script_sync(), send_command(), send_map(), Stat_struct::skill_exp, Stat_struct::skill_level, skill_names, Spell_struct::skill_number, SockList_AddChar(), SockList_AddInt(), SockList_AddString(), SockList_Init(), SockList_Send(), Stat_struct::sp, Spell_struct::sp, Stat_struct::speed, Player_Struct::spelldata, Player_Struct::stats, Stat_struct::Str, script::sync_watch, item_struct::tag, Spell_struct::tag, the_map, Spell_struct::time, Player_Struct::title, use_config, script::watch, Stat_struct::wc, Stat_struct::weapon_sp, item_struct::weight, Stat_struct::weight_limit, Stat_struct::Wis, Map::x, PlayerPosition::x, Map::y, and PlayerPosition::y.

Referenced by script_process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void script_send_item ( int  i,
const char *  head,
const item it 
)
static
void script_sync ( int  commdiff)

Definition at line 488 of file script.c.

References num_scripts, script::out_fd, and script::sync_watch.

Referenced by CompleteCmd(), and script_process_cmd().

+ Here is the caller graph for this function:

void script_tell ( const char *  params)

Definition at line 890 of file script.c.

References draw_info(), NDI_BLACK, script::out_fd, and script_by_name().

+ Here is the call graph for this function:

static void send_map ( int  i,
int  x,
int  y 
)
static

Variable Documentation

const char* const rcsid_common_script_c
Initial value:
=
"$Id: script.c 9364 2008-06-22 21:53:03Z quinet $"

Definition at line 1 of file script.c.

struct script* scripts = NULL
static

Definition at line 161 of file script.c.