Freeciv-3.3
|
#include <stdarg.h>
#include <stdlib.h>
#include <time.h>
#include "lua.h"
#include "lualib.h"
#include "tolua.h"
#include "astring.h"
#include "log.h"
#include "mem.h"
#include "registry.h"
#include "api_game_specenum.h"
#include "luascript.h"
#include "luascript_signal.h"
#include "luascript_func.h"
#include "tolua_common_a_gen.h"
#include "tolua_common_z_gen.h"
#include "tolua_game_gen.h"
#include "tolua_signal_gen.h"
#include "console.h"
#include "stdinhand.h"
#include <tolua_server_gen.h>
#include "script_server.h"
Go to the source code of this file.
Variables | |
static struct fc_lua * | fcl_main = NULL |
static struct fc_lua * | fcl_unsafe = NULL |
static char * | script_server_code = NULL |
Call a lua function.
Definition at line 610 of file script_server.c.
|
static |
Send the message via cmd_reply().
Definition at line 625 of file script_server.c.
Referenced by script_server_do_file_shared(), and script_server_do_string_shared().
Free the optional game script code (useful for scenarios).
Definition at line 256 of file script_server.c.
Referenced by script_server_free().
Initialize the optional game script code (useful for scenarios).
Definition at line 248 of file script_server.c.
Referenced by script_server_init().
|
static |
Load the optional game script code from file (useful for scenarios).
Definition at line 267 of file script_server.c.
Referenced by script_server_state_load().
|
static |
Save the optional game script code to file (useful for scenarios).
Definition at line 282 of file script_server.c.
Referenced by script_server_state_save().
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().
|
static |
Parse and execute the script at filename in the context of the specified instance.
Definition at line 160 of file script_server.c.
Referenced by script_server_do_file(), and script_server_unsafe_do_file().
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().
|
static |
Parse and execute the script in str in the context of the specified instance.
Definition at line 85 of file script_server.c.
Referenced by script_server_do_string(), and script_server_unsafe_do_string().
Free the scripting data.
Definition at line 366 of file script_server.c.
Referenced by load_rulesetdir(), and rulesets_deinit().
Add server callback functions; these must be defined in the lua script '[rulesetdir]/script.lua':
respawn_callback (optional):
Definition at line 601 of file script_server.c.
Referenced by script_server_init().
Initialize the scripting state.
Definition at line 292 of file script_server.c.
Referenced by load_rulesetdir().
Load script to a buffer
Definition at line 129 of file script_server.c.
Referenced by openload_script_file().
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().
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_change_homecity_handling(), unit_conquer_city(), unit_do_destroy_city(), unit_enter_hut(), unit_move(), worklist_change_build_target(), and worklist_item_postpone_req_vec().
Declare any new signal types you need here.
Definition at line 420 of file script_server.c.
Referenced by script_server_init().
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().
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().
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().
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().
Free the game script variables.
Definition at line 224 of file script_server.c.
Referenced by script_server_free().
Initialize the game script variables.
Definition at line 216 of file script_server.c.
Referenced by script_server_init().
|
static |
Load the game script variables in file.
Definition at line 232 of file script_server.c.
Referenced by script_server_state_load().
|
static |
Save the game script variables to file.
Definition at line 240 of file script_server.c.
Referenced by script_server_state_save().
Lua virtual machine states.
Definition at line 57 of file script_server.c.
Referenced by script_server_call(), script_server_code_load(), script_server_do_file(), script_server_do_string(), script_server_free(), script_server_functions_define(), script_server_init(), script_server_remove_exported_object(), script_server_signal_emit(), script_server_signals_create(), script_server_vars_load(), and script_server_vars_save().
Definition at line 58 of file script_server.c.
Referenced by script_server_free(), script_server_init(), script_server_remove_exported_object(), script_server_unsafe_do_file(), and script_server_unsafe_do_string().
Optional game script code (useful for scenarios).
Definition at line 63 of file script_server.c.
Referenced by script_server_code_free(), script_server_code_init(), script_server_code_load(), and script_server_code_save().