Freeciv-3.2
|
#include "fc_prehdrs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include "capability.h"
#include "fc_cmdline.h"
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "support.h"
#include "dataio.h"
#include "game.h"
#include "events.h"
#include "map.h"
#include "packets.h"
#include "spechash.h"
Go to the source code of this file.
Variables | |
const char *const | packet_functional_capability |
static struct packet_handler_hash * | packet_handlers = NULL |
#define SPECHASH_IDATA_FREE (packet_handler_hash_data_free_fn_t) free |
#define SPECHASH_IDATA_TYPE struct packet_handlers * |
#define SPECHASH_TAG packet_handler |
bool conn_compression_thaw | ( | struct connection * | pconn | ) |
Thaw the connection. Then maybe compress the data waiting to send them to the connection. Returns TRUE on success. See also conn_compression_freeze().
Definition at line 194 of file packets.c.
Referenced by conn_list_compression_thaw(), connection_attach_real(), establish_new_connection(), and finish_processing_request().
void generic_handle_player_attribute_chunk | ( | struct player * | pplayer, |
const struct packet_player_attribute_chunk * | chunk | ||
) |
Updates pplayer->attribute_block according to the given packet.
Definition at line 690 of file packets.c.
Referenced by handle_player_attribute_chunk(), and handle_player_attribute_chunk().
void * get_packet_from_connection_raw | ( | struct connection * | pc, |
enum packet_type * | ptype | ||
) |
bool packet_check | ( | struct data_in * | din, |
struct connection * | pc | ||
) |
Destroy the packet handler hash table.
Definition at line 812 of file packets.c.
Referenced by packets_deinit().
const struct packet_handlers * packet_handlers_get | ( | const char * | capability | ) |
Returns the packet handlers variant for 'capability'.
Definition at line 840 of file packets.c.
Referenced by conn_set_capability().
const struct packet_handlers * packet_handlers_initial | ( | void | ) |
Returns the packet handlers variant with no special capability.
Definition at line 823 of file packets.c.
Referenced by init_packet_hashes(), and packet_handlers_get().
void packet_header_init | ( | struct packet_header * | packet_header | ) |
Set the packet header field lengths used for the login protocol, before the capability of the connection could be checked.
NB: These values cannot be changed for backward compatibility reasons.
Definition at line 617 of file packets.c.
Referenced by connection_common_init().
|
inlinestatic |
Set the packet header field lengths used after the login protocol, after the capability of the connection could be checked.
Definition at line 627 of file packets.c.
Referenced by post_receive_packet_server_join_reply(), and post_send_packet_server_join_reply().
Call when there is no longer a requirement for protocol processing. All connections must have been closed.
Definition at line 900 of file packets.c.
Referenced by at_exit(), and close_connections_and_socket().
void post_receive_packet_server_join_reply | ( | struct connection * | pconn, |
const struct packet_server_join_reply * | packet | ||
) |
Modify if needed the packet header field lengths.
Definition at line 652 of file packets.c.
Referenced by receive_packet_server_join_reply_100().
void post_send_packet_server_join_reply | ( | struct connection * | pconn, |
const struct packet_server_join_reply * | packet | ||
) |
Modify if needed the packet header field lengths.
Definition at line 640 of file packets.c.
Referenced by send_packet_server_join_reply_100().
void pre_send_packet_player_attribute_chunk | ( | struct connection * | pc, |
struct packet_player_attribute_chunk * | packet | ||
) |
Test and log for sending player attribute_block
Definition at line 793 of file packets.c.
Referenced by send_packet_player_attribute_chunk_100().
void remove_packet_from_buffer | ( | struct socket_packet_buffer * | buffer | ) |
Split the attribute block into chunks and send them over pconn.
Definition at line 746 of file packets.c.
Referenced by attribute_flush(), handle_player_attribute_block(), and send_all_info().
int send_packet_data | ( | struct connection * | pc, |
unsigned char * | data, | ||
int | len, | ||
enum packet_type packet_type packet_type | |||
) |
It returns the request id of the outgoing packet (or 0 if is_server()).
Definition at line 30 of file packets_gen.c.
Referenced by packet_handlers_get().
|
static |