Freeciv21
Develop your civilization from humble roots to a global empire
script_server.h File Reference
#include "support.h"
#include "luascript_types.h"
+ Include dependency graph for script_server.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void script_server_remove_exported_object (void *object)
 Mark any, if exported, full userdata representing 'object' in the current script state as 'Nonexistent'. More...
 
bool script_server_init ()
 Initialize the scripting state. More...
 
void script_server_free ()
 Free the scripting data. More...
 
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. More...
 
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. More...
 
bool script_server_load_file (const char *filename, char **buf)
 Load script to a buffer. More...
 
bool script_server_unsafe_do_string (struct connection *caller, const char *str)
 Parse and execute the script in str in an unsafe instance. More...
 
bool script_server_unsafe_do_file (struct connection *caller, const char *filename)
 Parse and execute the script at filename in an unsafe instance. More...
 
void script_server_state_load (struct section_file *file)
 Load the scripting state from file. More...
 
void script_server_state_save (struct section_file *file)
 Save the scripting state to file. More...
 
void script_server_signal_emit (const char *signal_name,...)
 Invoke all the callback functions attached to a given signal. More...
 
bool script_server_call (const char *func_name,...)
 Call a lua function. More...
 

Function Documentation

◆ script_server_call()

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

Call a lua function.

Definition at line 525 of file script_server.cpp.

◆ 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 178 of file script_server.cpp.

Referenced by lua_command().

◆ 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 101 of file script_server.cpp.

Referenced by lua_command().

◆ script_server_free()

void script_server_free ( )

Free the scripting data.

Definition at line 337 of file script_server.cpp.

Referenced by load_rulesetdir(), and rulesets_deinit().

◆ script_server_init()

bool script_server_init ( )

Initialize the scripting state.

Definition at line 277 of file script_server.cpp.

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 118 of file script_server.cpp.

◆ 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 197 of file script_server.cpp.

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

◆ script_server_signal_emit()

◆ script_server_state_load()

void script_server_state_load ( struct section_file file)

Load the scripting state from file.

Definition at line 358 of file script_server.cpp.

Referenced by 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 370 of file script_server.cpp.

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 186 of file script_server.cpp.

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 109 of file script_server.cpp.

Referenced by lua_command().