FS2_Open
Open source remastering of the Freespace 2 engine
|
Go to the source code of this file.
Classes | |
struct | net_addr |
Macros | |
#define | NET_NONE 0 |
#define | NET_TCP 1 |
#define | NET_VMT 3 |
#define | MAX_PACKET_SIZE 512 |
#define | DEFAULT_GAME_PORT 7808 |
#define | INVALID_SOCKET (PSNET_SOCKET)(~0) |
#define | UDP_HEADER_SIZE 34 |
#define | TCP_HEADER_SIZE 40 |
#define | TCP_HEADER_SIZE_COMPRESSED 6 |
#define | NETWORK_ERROR_NONE 0 |
#define | NETWORK_ERROR_NO_TYPE -1 |
#define | NETWORK_ERROR_NO_WINSOCK -2 |
#define | NETWORK_ERROR_NO_PROTOCOL -3 |
#define | NETWORK_ERROR_RELIABLE -4 |
#define | NETWORK_ERROR_CONNECT_TO_ISP -5 |
#define | NETWORK_ERROR_LAN_AND_RAS -6 |
#define | PSNET_NUM_TYPES 5 |
#define | PSNET_TYPE_UNRELIABLE 0 |
#define | PSNET_TYPE_RELIABLE 1 |
#define | PSNET_TYPE_USER_TRACKER 2 |
#define | PSNET_TYPE_GAME_TRACKER 3 |
#define | PSNET_TYPE_VALIDATION 4 |
#define | NETWORK_CONNECTION_NONE 1 |
#define | NETWORK_CONNECTION_DIALUP 2 |
#define | NETWORK_CONNECTION_LAN 3 |
#define | RNF_UNUSED 0 |
#define | RNF_CONNECTED 1 |
#define | RNF_BROKEN 2 |
#define | RNF_DISCONNECTED 3 |
#define | RNF_CONNECTING 4 |
#define | RNF_LIMBO 5 |
Typedefs | |
typedef struct net_addr | net_addr |
typedef uint | PSNET_SOCKET |
typedef uint | PSNET_SOCKET_RELIABLE |
#define INVALID_SOCKET (PSNET_SOCKET)(~0) |
typedef uint PSNET_SOCKET |
typedef uint PSNET_SOCKET_RELIABLE |
char* psnet_addr_to_string | ( | char * | text, |
net_addr * | address | ||
) |
Convert a net_addr to a string
Definition at line 705 of file psnet2.cpp.
Broadcast data on unreliable socket
Definition at line 897 of file psnet2.cpp.
void psnet_close | ( | ) |
Shutdown psnet
Definition at line 563 of file psnet2.cpp.
void psnet_flush | ( | ) |
Flush all sockets
Definition at line 927 of file psnet2.cpp.
Get data from the unreliable socket
Definition at line 881 of file psnet2.cpp.
int psnet_get_network_status | ( | ) |
Get the status of the network
Definition at line 670 of file psnet2.cpp.
Initialize psnet to use the specified port
Definition at line 458 of file psnet2.cpp.
If the passed string is a valid IP string
Definition at line 938 of file psnet2.cpp.
void psnet_mark_received | ( | PSNET_SOCKET_RELIABLE | socket | ) |
Mark a socket as having received data
Definition at line 2174 of file psnet2.cpp.
int psnet_rel_check | ( | ) |
Definition at line 1067 of file psnet2.cpp.
Checks the Listen_socket for possibly incoming requests to be connected.
Definition at line 1555 of file psnet2.cpp.
void psnet_rel_close_socket | ( | PSNET_SOCKET_RELIABLE * | sockp | ) |
Function to shutdown and close the given socket.
It takes a couple of things into consideration when closing, such as possibly reiniting reliable sockets if they are closed here.
Definition at line 1008 of file psnet2.cpp.
void psnet_rel_connect_to_server | ( | PSNET_SOCKET * | socket, |
net_addr * | server_addr | ||
) |
Attempt to connect() to the server's tcp socket. socket parameter is simply assigned to the Reliable_socket socket created in psnet_init
Definition at line 1593 of file psnet2.cpp.
int psnet_rel_get | ( | PSNET_SOCKET_RELIABLE | socket, |
ubyte * | buffer, | ||
int | max_length | ||
) |
Definition at line 1152 of file psnet2.cpp.
int psnet_rel_get_status | ( | PSNET_SOCKET_RELIABLE | socketid | ) |
Get the status of a reliable socket, see RNF_* defines above
Definition at line 1542 of file psnet2.cpp.
int psnet_rel_send | ( | PSNET_SOCKET_RELIABLE | socketid, |
ubyte * | data, | ||
int | length, | ||
int | np_index | ||
) |
Send data reliably
Definition at line 1075 of file psnet2.cpp.
void psnet_rel_work | ( | ) |
Process all active reliable sockets
Definition at line 1187 of file psnet2.cpp.
Compare 2 addresses
Definition at line 785 of file psnet2.cpp.
Send data unreliably
Definition at line 793 of file psnet2.cpp.
Convert a string to a net addr
Definition at line 732 of file psnet2.cpp.
void PSNET_TOP_LAYER_PROCESS | ( | ) |
Call this once per frame to read everything off of our socket
Definition at line 360 of file psnet2.cpp.
Set the protocol to use
Definition at line 596 of file psnet2.cpp.
int RECVFROM | ( | uint | s, |
char * | buf, | ||
int | len, | ||
int | flags, | ||
sockaddr * | from, | ||
int * | fromlen, | ||
int | psnet_type | ||
) |
int SELECT | ( | int | nfds, |
fd_set * | readfds, | ||
fd_set * | writefds, | ||
fd_set * | exceptfds, | ||
const timeval * | timeout, | ||
int | psnet_type | ||
) |
int Network_status |
Definition at line 62 of file psnet2.cpp.
int Psnet_connection |
Definition at line 65 of file psnet2.cpp.
ushort Psnet_default_port |
Definition at line 67 of file psnet2.cpp.
net_addr Psnet_my_addr |
Definition at line 52 of file psnet2.cpp.
int Psnet_my_addr_valid |
Definition at line 51 of file psnet2.cpp.
uint Psnet_my_ip |
int Socket_type |
Definition at line 56 of file psnet2.cpp.
int Tcp_active |
Definition at line 60 of file psnet2.cpp.
int Tcp_failure_code |
Definition at line 63 of file psnet2.cpp.
SOCKET Unreliable_socket |
Definition at line 208 of file psnet2.cpp.