![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <QStandardPaths>#include "sol/sol.hpp"#include "lua.h"#include "log.h"#include "luascript.h"#include "luascript_types.h"#include "tolua_common_a_gen.h"#include "tolua_game_gen.h"#include "auth.h"#include "console.h"#include "stdinhand.h"#include "script_fcdb.h"
Include dependency graph for script_fcdb.cpp:Go to the source code of this file.
Macros | |
| #define | SCRIPT_FCDB_LUA_FILE "freeciv21/database.lua" |
Functions | |
| static bool | script_fcdb_functions_check (const char *fcdb_luafile) |
| fcdb callback functions that must be defined in the lua script 'database.lua': More... | |
| static bool | script_fcdb_database_init () |
| test and initialise the database. More... | |
| static bool | script_fcdb_database_free () |
| free the database. More... | |
| static void | script_fcdb_cmd_reply (struct fc_lua *lfcl, QtMsgType level, const char *format,...) |
| Send the message via cmd_reply(). More... | |
| static void | script_fcdb_register_functions () |
| Registers FCDB-related functions in the Lua state. More... | |
| bool | script_fcdb_init (const QString &fcdb_luafile) |
| Initialize the scripting state. More... | |
| void | script_fcdb_free () |
| Free the scripting data. More... | |
| bool | script_fcdb_do_string (struct connection *caller, const char *str) |
| Parse and execute the script in str in the lua instance for the freeciv database. More... | |
| bool | script_fcdb_user_delegate_to (connection *pconn, player *pplayer, const char *delegate, bool &success) |
| returns Bool, whether pconn is allowed to delegate player to delegate. More... | |
| bool | script_fcdb_user_exists (connection *pconn, bool &exists) |
| Check if the user exists. More... | |
| bool | script_fcdb_user_save (connection *pconn, const char *password) |
| Save a new user. More... | |
| bool | script_fcdb_user_take (connection *requester, connection *taker, player *player, bool will_observe, bool &success) |
| returns Bool, whether requester is allowed to attach taker to pplayer. More... | |
| bool | script_fcdb_user_verify (connection *pconn, const char *username, bool &success) |
| Check the credentials of the user. More... | |
Variables | |
| static void static sol::state * | fcl = nullptr |
| Lua virtual machine state. More... | |
| static fc_lua | fcl_compat = fc_lua() |
| Tolua compatibility. More... | |
| #define SCRIPT_FCDB_LUA_FILE "freeciv21/database.lua" |
Definition at line 36 of file script_fcdb.cpp.
|
static |
Send the message via cmd_reply().
Definition at line 115 of file script_fcdb.cpp.
Referenced by script_fcdb_do_string().
|
static |
free the database.
Definition at line 294 of file script_fcdb.cpp.
Referenced by script_fcdb_free().
|
static |
test and initialise the database.
Definition at line 279 of file script_fcdb.cpp.
Referenced by script_fcdb_init().
| bool script_fcdb_do_string | ( | struct connection * | caller, |
| const char * | str | ||
| ) |
Parse and execute the script in str in the lua instance for the freeciv database.
Definition at line 258 of file script_fcdb.cpp.
Referenced by fcdb_command().
| void script_fcdb_free | ( | ) |
Free the scripting data.
Definition at line 241 of file script_fcdb.cpp.
Referenced by fcdb_command(), fcdb_free(), and script_fcdb_init().
|
static |
fcdb callback functions that must be defined in the lua script 'database.lua':
database_init:
user_exists(Connection pconn):
Definition at line 78 of file script_fcdb.cpp.
Referenced by script_fcdb_init().
| bool script_fcdb_init | ( | const QString & | fcdb_luafile | ) |
Initialize the scripting state.
Returns the status of the freeciv database lua state.
Definition at line 178 of file script_fcdb.cpp.
Referenced by fcdb_command(), and fcdb_init().
|
static |
Registers FCDB-related functions in the Lua state.
Definition at line 149 of file script_fcdb.cpp.
Referenced by script_fcdb_init().
| bool script_fcdb_user_delegate_to | ( | connection * | pconn, |
| player * | pplayer, | ||
| const char * | delegate, | ||
| bool & | success | ||
| ) |
returns Bool, whether pconn is allowed to delegate player to delegate.
Definition at line 309 of file script_fcdb.cpp.
Referenced by delegate_command().
| bool script_fcdb_user_exists | ( | connection * | pconn, |
| bool & | exists | ||
| ) |
Check if the user exists.
Definition at line 327 of file script_fcdb.cpp.
Referenced by auth_user().
| bool script_fcdb_user_save | ( | connection * | pconn, |
| const char * | password | ||
| ) |
| bool script_fcdb_user_take | ( | connection * | requester, |
| connection * | taker, | ||
| player * | player, | ||
| bool | will_observe, | ||
| bool & | success | ||
| ) |
returns Bool, whether requester is allowed to attach taker to pplayer.
Definition at line 358 of file script_fcdb.cpp.
Referenced by is_allowed_to_take().
| bool script_fcdb_user_verify | ( | connection * | pconn, |
| const char * | username, | ||
| bool & | success | ||
| ) |
Check the credentials of the user.
Definition at line 375 of file script_fcdb.cpp.
Referenced by auth_handle_reply().
|
static |
Lua virtual machine state.
Definition at line 48 of file script_fcdb.cpp.
Referenced by api_edit_create_player(), api_edit_create_unit_full(), api_signal_by_index(), api_signal_callback_by_index(), api_signal_connect(), api_signal_defined(), api_signal_remove(), api_utilities_log_base(), map_view::hide_all_fcwidgets(), luascript_call(), luascript_callback_invoke(), luascript_check_function(), luascript_destroy(), luascript_do_file(), luascript_do_string(), luascript_func_add(), luascript_func_add_valist(), luascript_func_call(), luascript_func_call_valist(), luascript_func_check(), luascript_func_free(), luascript_func_init(), luascript_func_is_required(), luascript_get_fcl(), luascript_init(), luascript_log(), luascript_log_vargs(), luascript_new(), luascript_pop_returns(), luascript_push_args(), luascript_remove_exported_object(), luascript_report(), luascript_signal_by_index(), luascript_signal_callback(), luascript_signal_callback_by_index(), luascript_signal_callback_defined(), luascript_signal_create(), luascript_signal_create_valist(), luascript_signal_emit(), luascript_signal_emit_valist(), luascript_signal_free(), luascript_signal_init(), luascript_vars_load(), luascript_vars_save(), script_client_output(), script_fcdb_do_string(), script_fcdb_free(), script_fcdb_functions_check(), script_fcdb_init(), script_fcdb_register_functions(), script_server_cmd_reply(), script_server_do_file_shared(), and script_server_do_string_shared().
Tolua compatibility.
Definition at line 51 of file script_fcdb.cpp.
Referenced by script_fcdb_do_string(), and script_fcdb_init().