Freeciv-3.1
|
#include "chat.h"
#include "connection.h"
#include "fc_types.h"
#include "commands.h"
#include "console.h"
Go to the source code of this file.
Functions | |
void | stdinhand_init (void) |
void | stdinhand_turn (void) |
void | stdinhand_free (void) |
void | cmd_reply (enum command_id cmd, struct connection *caller, enum rfc_status rfc_status, const char *format,...) fc__attribute((__format__(__printf__ |
void bool | handle_stdin_input (struct connection *caller, char *str) |
bool | handle_stdin_input_free (struct connection *caller, char *str) |
void | set_ai_level_direct (struct player *pplayer, enum ai_level level) |
bool | read_init_script (struct connection *caller, char *script_filename, bool from_cmdline, bool check) |
struct strvec * | get_init_script_choices (void) |
void | show_players (struct connection *caller) |
enum rfc_status | create_command_newcomer (const char *name, const char *ai, bool check, struct nation_type *pnation, struct player **newplayer, char *buf, size_t buflen) |
enum rfc_status | create_command_pregame (const char *name, const char *ai, bool check, struct player **newplayer, char *buf, size_t buflen) |
bool | load_command (struct connection *caller, const char *filename, bool check, bool cmdline_load) |
bool | start_command (struct connection *caller, bool check, bool notify) |
void | toggle_ai_player_direct (struct connection *caller, struct player *pplayer) |
enum cmdlevel | access_level_for_next_connection (void) |
void | notify_if_first_access_level_is_available (void) |
bool | conn_is_kicked (struct connection *pconn, int *time_remaining) |
void | set_running_game_access_level (void) |
enum cmdlevel access_level_for_next_connection | ( | void | ) |
Return access level for next connection
Definition at line 1435 of file stdinhand.c.
Referenced by server_make_connection().
void cmd_reply | ( | enum command_id | cmd, |
struct connection * | caller, | ||
enum rfc_status | rfc_status, | ||
const char * | format, | ||
... | |||
) |
bool conn_is_kicked | ( | struct connection * | pconn, |
int * | time_remaining | ||
) |
Returns FALSE if the connection isn't kicked and can connect the server normally.
Definition at line 6210 of file stdinhand.c.
Referenced by handle_login_request().
enum rfc_status create_command_newcomer | ( | const char * | name, |
const char * | ai, | ||
bool | check, | ||
struct nation_type * | pnation, | ||
struct player ** | newplayer, | ||
char * | buf, | ||
size_t | buflen | ||
) |
Try to add a player to a running game in the following order:
If 'pnation' is defined this nation is used for the new player.
Definition at line 810 of file stdinhand.c.
Referenced by api_edit_create_player(), and create_command().
enum rfc_status create_command_pregame | ( | const char * | name, |
const char * | ai, | ||
bool | check, | ||
struct player ** | newplayer, | ||
char * | buf, | ||
size_t | buflen | ||
) |
Create player in pregame.
Definition at line 994 of file stdinhand.c.
Referenced by api_edit_create_player(), and create_command().
struct strvec * get_init_script_choices | ( | void | ) |
Return a list of init scripts found on the data path. Caller should free. These are conventionally scripts that load rulesets (generally containing just a 'rulesetdir' command).
Definition at line 1268 of file stdinhand.c.
Referenced by send_ruleset_choices(), and show_rulesets().
void bool handle_stdin_input | ( | struct connection * | caller, |
char * | str | ||
) |
Main entry point for "command input". Version to be used with statically allocated 'str'
Definition at line 4362 of file stdinhand.c.
Referenced by check_vote(), and handle_chat_msg_req().
bool handle_stdin_input_free | ( | struct connection * | caller, |
char * | str | ||
) |
Entry point for "command input". Version that frees 'str' in the end.
Definition at line 4370 of file stdinhand.c.
Referenced by server_sniff_all_input().
bool load_command | ( | struct connection * | caller, |
const char * | filename, | ||
bool | check, | ||
bool | cmdline_load | ||
) |
Loads a file, complete with access checks and error messages sent back to the caller on failure.
caller is the connection requesting the load, or NULL for a command-line load. Error messages are sent back to the caller and an access check is done to make sure they are allowed to load.
filename is simply the name of the file to be loaded. This may be approximate; the function will look for appropriate suffixes and will check in the various directories to see if the file is found.
if check is set then only a test run is done and no actual loading is attempted.
The return value is true if the load succeeds, or would succeed; false if there's an error in the file or file name. Some errors in loading however could be unrecoverable (if the save game is legitimate but has inconsistencies) and would lead to a broken server afterwards.
Definition at line 3733 of file stdinhand.c.
Referenced by handle_stdin_input_real(), and srv_prepare().
void notify_if_first_access_level_is_available | ( | void | ) |
Check if first access level is available and if it is, notify connections about it.
Definition at line 1449 of file stdinhand.c.
Referenced by lost_connection_to_client().
bool read_init_script | ( | struct connection * | caller, |
char * | script_filename, | ||
bool | from_cmdline, | ||
bool | check | ||
) |
Main entry point for reading an init script.
Definition at line 1167 of file stdinhand.c.
Referenced by srv_main().
void set_ai_level_direct | ( | struct player * | pplayer, |
enum ai_level | level | ||
) |
Set an AI level from the server prompt.
Definition at line 2003 of file stdinhand.c.
Referenced by split_player(), and srv_ready().
void set_running_game_access_level | ( | void | ) |
Adjust default command level on game start.
Definition at line 1633 of file stdinhand.c.
Referenced by start_game().
void show_players | ( | struct connection * | caller | ) |
Show the list of the players of the game.
Definition at line 6682 of file stdinhand.c.
Referenced by show_list().
bool start_command | ( | struct connection * | caller, |
bool | check, | ||
bool | notify | ||
) |
Handle start command. Notify all players about errors if notify set.
Definition at line 6044 of file stdinhand.c.
Referenced by handle_observer_ready(), handle_player_ready(), and handle_stdin_input_real().
void stdinhand_free | ( | void | ) |
Deinitialize stuff related to this code module.
Definition at line 262 of file stdinhand.c.
Referenced by server_quit().
void stdinhand_init | ( | void | ) |
Initialize stuff related to this code module.
Definition at line 241 of file stdinhand.c.
Referenced by srv_prepare().
void stdinhand_turn | ( | void | ) |
Update stuff every turn that is related to this code module. Run this on turn end.
Definition at line 254 of file stdinhand.c.
Referenced by end_turn().
void toggle_ai_player_direct | ( | struct connection * | caller, |
struct player * | pplayer | ||
) |
Handle ai player ai toggling.
Definition at line 704 of file stdinhand.c.
Referenced by autotoggle_action(), connection_attach_real(), connection_detach(), srv_ready(), and toggle_ai_command().