Freeciv-3.2: /fast/freeciv/nightly/S3_2/server/scripting/script_server.h File Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Functions
script_server.h File Reference
`#include "support.h"`
`#include "luascript_types.h"`

Go to the source code of this file.

## Functions

void | script_server_remove_exported_object (void *object)
bool | script_server_init (void)
void | script_server_free (void)
bool | script_server_do_string (struct connection *caller, const char *str)
bool | script_server_do_file (struct connection *caller, const char *filename)
bool | script_server_load_file (const char *filename, char **buf)
bool | script_server_unsafe_do_string (struct connection *caller, const char *str)
bool | script_server_unsafe_do_file (struct connection *caller, const char *filename)
void | script_server_state_load (struct section_file *file)
void | script_server_state_save (struct section_file *file)
void | script_server_signal_emit (const char *signal_name,...)
bool | script_server_call (const char *func_name,...)

## Function Documentation

## ◆ script_server_call()

bool script_server_call | ( | const char * | func_name,
|  |  | ...
| ) |  |

Call a lua function.

Definition at line 595 of file script_server.c.

## ◆ script_server_do_file()

bool script_server_do_file | ( | struct connection * | caller,
|  | const char * | filename
| ) |  |

Parse and execute the script at filename in the same instance as the ruleset.

Definition at line 188 of file script_server.c.

Referenced by lua_command(), and openload_script_file().

## ◆ script_server_do_string()

bool script_server_do_string | ( | struct connection * | caller,
|  | const char * | str
| ) |  |

Parse and execute the script in str in the same instance as the ruleset

Definition at line 112 of file script_server.c.

Referenced by lua_command().

## ◆ script_server_free()

void script_server_free | ( | void |  | ) |

Free the scripting data.

Definition at line 366 of file script_server.c.

Referenced by load_rulesetdir(), and rulesets_deinit().

## ◆ script_server_init()

bool script_server_init | ( | void |  | ) |

Initialize the scripting state.

Definition at line 292 of file script_server.c.

Referenced by load_rulesetdir().

## ◆ script_server_load_file()

bool script_server_load_file | ( | const char * | filename,
|  | char ** | buf
| ) |  |

Load script to a buffer

Definition at line 129 of file script_server.c.

Referenced by openload_script_file().

## ◆ script_server_remove_exported_object()

void script_server_remove_exported_object | ( | void * | object | ) |

Mark any, if exported, full userdata representing 'object' in the current script state as 'Nonexistent'. This changes the type of the lua variable.

Definition at line 207 of file script_server.c.

Referenced by remove_city(), server_remove_player(), and server_remove_unit_full().

## ◆ script_server_signal_emit()

void script_server_signal_emit | ( | const char * | signal_name,
|  |  | ...
| ) |  |

Invoke all the callback functions attached to a given signal.

Definition at line 408 of file script_server.c.

Referenced by apply_disaster(), begin_phase(), begin_turn(), building_removed(), city_add_unit(), city_build_building(), city_build_unit(), city_change_size(), city_create_unit(), city_increase_size(), city_populate(), city_reduce_size(), civil_war(), create_city(), diplomat_incite(), disband_city(), do_city_migration(), do_nuclear_explosion(), do_tech_parasite_effects(), end_phase(), end_turn(), handle_diplomacy_accept_treaty_req(), kill_player(), script_tech_learned(), server_remove_unit_full(), server_sniff_all_input(), srv_ready(), unit_conquer_city(), unit_do_destroy_city(), unit_enter_hut(), unit_move(), worklist_change_build_target(), and worklist_item_postpone_req_vec().

## ◆ script_server_state_load()

void script_server_state_load | ( | struct section_file * | file | ) |

Load the scripting state from file.

Definition at line 387 of file script_server.c.

Referenced by sg_load_script(), and sg_load_script().

## ◆ script_server_state_save()

void script_server_state_save | ( | struct section_file * | file | ) |

Save the scripting state to file.

Definition at line 399 of file script_server.c.

Referenced by sg_save_script().

## ◆ script_server_unsafe_do_file()

bool script_server_unsafe_do_file | ( | struct connection * | caller,
|  | const char * | filename
| ) |  |

Parse and execute the script at filename in an unsafe instance.

Definition at line 196 of file script_server.c.

Referenced by lua_command().

## ◆ script_server_unsafe_do_string()

bool script_server_unsafe_do_string | ( | struct connection * | caller,
|  | const char * | str
| ) |  |

Parse and execute the script in str in an unsafe instance

Definition at line 120 of file script_server.c.

Referenced by lua_command().