Crossfire Server, Branches 1.12
R18729
|
#include <global.h>
#include <sproto.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <newserver.h>
#include <loader.h>
Go to the source code of this file.
Functions | |
void | final_free_player (player *pl) |
void | free_all_newserver (void) |
void | free_newsocket (socket_struct *ns) |
void | init_connection (socket_struct *ns, const char *from_ip) |
void | init_server (void) |
Variables | |
socket_struct * | init_sockets |
Socket_Info | socket_info |
Socket general functions
Mainly deals with initialization and higher level socket maintenance (checking for lost connections and if data has arrived.) The reading of data is handled in ericserver.c
Definition in file init.c.
void final_free_player | ( | player * | pl | ) |
Sends the 'goodbye' command to the player, and closes connection.
Definition at line 328 of file init.c.
References free_newsocket(), free_player(), Send_With_Handling(), pl::socket, SockList_AddString(), SockList_Init(), and SockList_Term().
Referenced by check_login(), and do_server().
void free_all_newserver | ( | void | ) |
void free_newsocket | ( | socket_struct * | ns | ) |
Frees a socket. Basically, all we need to do here is free all data structures that might be associated with the socket. It is up to the caller to update the list
Definition at line 305 of file init.c.
References socket_struct::fd, FREE_AND_CLEAR, socket_struct::host, socket_struct::inbuf, llevDebug, LOG(), statsinfo::range, SockList_Term(), socket_struct::stats, and statsinfo::title.
Referenced by do_server(), and final_free_player().
void init_connection | ( | socket_struct * | ns, |
const char * | from_ip | ||
) |
Initializes a connection. Really, it just sets up the data structure, socket setup is handled elsewhere. We do send a version to the client.
Definition at line 75 of file init.c.
References socket_struct::anims_sent, SockList::buf, socket_struct::can_write, cst_lst, cst_tot, socket_struct::darkness, DEFAULT_NUM_LOOK_OBJECTS, socket_struct::facecache, socket_struct::faces_sent, socket_struct::faces_sent_len, socket_struct::faceset, socket_struct::fd, socket_struct::has_readable_type, socket_struct::host, socket_struct::inbuf, socket_struct::is_bot, socket_struct::lastmap, buffer_struct::len, llevDebug, llevError, LOG(), socket_struct::look_position, socket_struct::map_scroll_x, socket_struct::map_scroll_y, socket_struct::mapx, socket_struct::mapy, CS_Stats::max_conn, socket_struct::monitor_spells, Socket_Info::nconns, socket_struct::newmapcmd, nrofpixmaps, Ns_Add, NS_FACESENT_FACE, socket_struct::num_look_objects, socket_struct::outputbuffer, socket_struct::password_fails, Send_With_Handling(), socklen_t, SockList_AddPrintf(), SockList_Init(), SockList_ResetRead(), SockList_Term(), socket_struct::sound, buffer_struct::start, socket_struct::stats, socket_struct::status, strdup_local(), socket_struct::supported_readables, socket_struct::tick, socket_struct::update_look, VERSION_CS, VERSION_INFO, VERSION_SC, and socket_struct::want_pickup.
Referenced by do_server().
void init_server | ( | void | ) |
This sets up the socket and reads all the image information into memory.
Definition at line 173 of file init.c.
References Socket_Info::allocated_sockets, Settings::csport, cst_lst, cst_tot, socket_struct::faces_sent, socket_struct::fd, llevDebug, llevError, LOG(), MAX_BUF, Socket_Info::max_filedescriptor, Socket_Info::nconns, Ns_Add, read_client_images(), settings, socket_struct::status, strerror_local(), CS_Stats::time_start, and Socket_Info::timeout.
Referenced by init().
socket_struct* init_sockets |
Established connections for clients not yet playing. See the page on the login process for a description of its use.
Definition at line 68 of file init.c.
Referenced by block_until_new_connection(), and do_server().
Socket_Info socket_info |
Socket information.
Definition at line 63 of file init.c.
Referenced by add_me_cmd(), block_until_new_connection(), and do_server().