Freeciv21
Develop your civilization from humble roots to a global empire
script_fcdb.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  part of Freeciv21. Freeciv21 is free software: you can redistribute it
4  and/or modify it under the terms of the GNU General Public License as
5  published by the Free Software Foundation, either version 3 of the
6  License, or (at your option) any later version. You should have received
7  a copy of the GNU General Public License along with Freeciv21. If not,
8  see https://www.gnu.org/licenses/.
9 **************************************************************************/
10 
11 #pragma once
12 
13 // utility
14 #include "support.h" // fc__attribute()
15 
16 // server
17 #include "fcdb.h"
18 
19 // Forward declarations
20 class QString;
21 
22 struct connection;
23 struct player;
24 
25 // fcdb script functions.
26 bool script_fcdb_init(const QString &fcdb_luafile);
27 void script_fcdb_free();
28 
29 bool script_fcdb_do_string(struct connection *caller, const char *str);
30 
31 // Call Lua functions
32 bool script_fcdb_user_delegate_to(connection *pconn, player *pplayer,
33  const char *delegate, bool &success);
34 bool script_fcdb_user_exists(connection *pconn, bool &exists);
35 bool script_fcdb_user_save(connection *pconn, const char *password);
36 bool script_fcdb_user_take(connection *requester, connection *taker,
37  player *player, bool will_observe, bool &success);
38 bool script_fcdb_user_verify(connection *pconn, const char *username,
39  bool &success);
bool script_fcdb_user_save(connection *pconn, const char *password)
Save a new user.
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.
bool script_fcdb_user_exists(connection *pconn, bool &exists)
Check if the user exists.
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.
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.
bool script_fcdb_init(const QString &fcdb_luafile)
Initialize the scripting state.
void script_fcdb_free()
Free the scripting data.
bool script_fcdb_user_verify(connection *pconn, const char *username, bool &success)
Check the credentials of the user.
Definition: player.h:231
char username[MAX_LEN_NAME]
Definition: player.h:234