socket/init.c File Reference
#include <global.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
#include <sys/stat.h>
#include <stdio.h>
#include <newserver.h>
#include "zlib.h"
Go to the source code of this file.
Detailed Description
Socket initialization related code.
Definition in file init.c.
Function Documentation
| static void create_client_settings |
( |
|
) |
[static] |
Get the lib/settings default file and create the data/client_settings file from it.
Definition at line 416 of file init.c.
| void free_all_newserver |
( |
|
) |
|
Frees all the memory that ericserver allocates.
Definition at line 295 of file init.c.
Basically, all we need to do here is free all data structures that might be associated with the socket.
It is up to the called to update the list.
- Parameters:
-
Definition at line 309 of file init.c.
| 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.
Sends server version to the client.
- Parameters:
-
| ns | Client's socket. |
| from | Where the connection is coming from. |
- Todo:
- Remove version sending legacy support for older clients at some point.
Definition at line 67 of file init.c.
This sets up the socket and reads all the image information into memory.
Definition at line 151 of file init.c.
Load all the server files we can send to client.
client_bmaps is generated from the server at startup out of the Atrinik png file.
Definition at line 469 of file init.c.
| static void load_srv_file |
( |
char * |
fname, |
|
|
int |
id | |
|
) |
| | [static] |
Load server file.
- Parameters:
-
| fname | Filename of the server file. |
| id | ID of the server file. |
| cmd | The data command. |
Definition at line 353 of file init.c.
A connecting client has requested a server file.
Note that we don't know anything about the player at this point - we got an open socket, an IP, a matching version, and an usable setup string from the client.
- Parameters:
-
| ns | The client's socket. |
| id | ID of the server file. |
Definition at line 524 of file init.c.
Variable Documentation
Established connections for clients not yet playing.
Definition at line 56 of file init.c.
Socket information.
Definition at line 54 of file init.c.
All the server/client files.
Definition at line 51 of file init.c.