|
Atrinik Server 2.5
|
#include <global.h>Go to the source code of this file.
Data Structures | |
| struct | client_cmd_mapping |
| struct | player_cmd_mapping |
Defines | |
| #define | FREE_SOCKET(i) |
Typedefs | |
| typedef void(* | func_uint8_int_ns )(char *, int, socket_struct *) |
| typedef void(* | func_uint8_int_pl )(char *, int, player *) |
Functions | |
| static int | check_client_command (socket_struct *ns) |
| static void | fill_command_buffer (socket_struct *ns) |
| static int | check_command (socket_struct *ns, player *pl) |
| void | handle_client (socket_struct *ns, player *pl) |
| void | watchdog () |
| void | remove_ns_dead_player (player *pl) |
| static int | is_fd_valid (int fd) |
| void | doeric_server () |
| void | doeric_server_write () |
Variables | |
| static fd_set | tmp_read |
| static fd_set | tmp_exceptions |
| static fd_set | tmp_write |
| static struct player_cmd_mapping | player_commands [] |
| static struct client_cmd_mapping | client_commands [] |
Mainly deals with initialization and higher level socket maintenance (checking for lost connections and if data has arrived).
Definition in file loop.c.
| #define FREE_SOCKET | ( | i | ) |
free_newsocket(&init_sockets[(i)]); \ init_sockets[(i)].status = Ns_Avail; \ socket_info.nconns--;
Common way to free a socket. Frees the socket from init_sockets, sets its status to Ns_Avail and decrements number of connections.
| typedef void(* func_uint8_int_ns)(char *, int, socket_struct *) |
| typedef void(* func_uint8_int_pl)(char *, int, player *) |
| static int check_client_command | ( | socket_struct * | ns | ) | [static] |
Used to check whether read data is a client command in fill_command_buffer().
| ns | Socket. |
| static int check_command | ( | socket_struct * | ns, |
| player * | pl | ||
| ) | [static] |
Used to check whether parsed data is valid client or player command in handle_client().
| ns | Socket. |
| pl | Player. Can be NULL, in which case player commands are not considered. |
| void doeric_server | ( | ) |
| static void fill_command_buffer | ( | socket_struct * | ns | ) | [static] |
| void handle_client | ( | socket_struct * | ns, |
| player * | pl | ||
| ) |
| static int is_fd_valid | ( | int | fd | ) | [static] |
| void remove_ns_dead_player | ( | player * | pl | ) |
| void watchdog | ( | ) |
struct client_cmd_mapping client_commands[] [static] |
{
{"addme", AddMeCmd},
{"askface", SendFaceCmd},
{"setup", SetUp},
{"version", VersionCmd},
{"rf", RequestFileCmd},
{"clr", command_clear_cmds},
{"setsound", SetSound},
{"upf", cmd_request_update},
{"ka", cmd_keepalive},
{NULL, NULL}
}
Commands sent directly by the client, when connecting or needed.
struct player_cmd_mapping player_commands[] [static] |
{
{"ex", ExamineCmd, 0},
{"ap", ApplyCmd, 0},
{"mv", MoveCmd, 0},
{"reply", ReplyCmd, 0},
{"cm", PlayerCmd, 0},
{"lock", (func_uint8_int_pl) LockItem, 0},
{"mark", (func_uint8_int_pl) MarkItem, 0},
{"/fire", command_fire_old, 0},
{"fire", (func_uint8_int_pl) command_fire, 0},
{"nc", command_new_char, 0},
{"qs", (func_uint8_int_pl) QuickSlotCmd, 0},
{"shop", ShopCmd, 0},
{"qlist", QuestListCmd, 0},
{"mp", (func_uint8_int_pl) command_move_path, 0},
{"rd", (func_uint8_int_pl) cmd_ready, 0},
{"pc", (func_uint8_int_pl) cmd_password_change, 0},
{NULL, NULL, 0}
}
Commands sent by the client, based on player's actions.
1.7.4