Freeciv-3.3
|
#include "dataio.h"
#include "fcintl.h"
#include "genhash.h"
#include "log.h"
#include "mem.h"
#include "packets.h"
#include "client_main.h"
#include "attribute.h"
#include "spechash.h"
Go to the source code of this file.
Data Structures | |
struct | attr_key |
Enumerations | |
enum | attribute_serial { A_SERIAL_FAIL , A_SERIAL_OK , A_SERIAL_OLD } |
Variables | |
static struct attribute_hash * | attribute_hash = NULL |
#define attribute_hash_iterate | ( | hash, | |
pkey, | |||
pvalue | |||
) | TYPED_HASH_ITERATE(const struct attr_key *, void *, hash, pkey, pvalue) |
Definition at line 64 of file attribute.c.
#define attribute_hash_iterate_end HASH_ITERATE_END |
Definition at line 66 of file attribute.c.
#define attribute_hash_values_iterate | ( | hash, | |
pvalue | |||
) | TYPED_HASH_DATA_ITERATE(void *, hash, pvalue) |
Definition at line 61 of file attribute.c.
#define attribute_hash_values_iterate_end HASH_DATA_ITERATE_END |
Definition at line 63 of file attribute.c.
Definition at line 33 of file attribute.c.
Definition at line 59 of file attribute.c.
Definition at line 54 of file attribute.c.
#define SPECHASH_IKEY_COMP attr_key_comp |
Definition at line 56 of file attribute.c.
#define SPECHASH_IKEY_COPY attr_key_dup |
Definition at line 57 of file attribute.c.
#define SPECHASH_IKEY_FREE attr_key_destroy |
Definition at line 58 of file attribute.c.
Definition at line 53 of file attribute.c.
#define SPECHASH_IKEY_VAL attr_key_val |
Definition at line 55 of file attribute.c.
Definition at line 52 of file attribute.c.
Enumerator | |
---|---|
A_SERIAL_FAIL | |
A_SERIAL_OK | |
A_SERIAL_OLD |
Definition at line 35 of file attribute.c.
Get city related attribute
Definition at line 498 of file attribute.c.
Referenced by attr_city_get_int(), and cma_get_parameter().
Get city related integer attribute
Definition at line 515 of file attribute.c.
Set city related attribute
Definition at line 489 of file attribute.c.
Referenced by attr_city_set_int(), city_remove(), cma_set_parameter(), and release_city().
Set city related integer attribute
Definition at line 507 of file attribute.c.
Compare-function for the keys in the hash table.
Definition at line 82 of file attribute.c.
Free an attribute key.
Definition at line 105 of file attribute.c.
Duplicate an attribute key.
Definition at line 94 of file attribute.c.
|
static |
Hash function for attribute_hash.
Definition at line 74 of file attribute.c.
size_t attr_player_get | ( | enum attr_player | what, |
int | player_id, | ||
size_t | max_data_length, | ||
void * | data | ||
) |
Get player related attribute
Definition at line 532 of file attribute.c.
void attr_player_set | ( | enum attr_player | what, |
int | player_id, | ||
size_t | data_length, | ||
const void *const | data | ||
) |
Set player related attribute
Definition at line 523 of file attribute.c.
Get tile related attribute
Definition at line 550 of file attribute.c.
void attr_tile_set | ( | enum attr_tile | what, |
int | x, | ||
int | y, | ||
size_t | data_length, | ||
const void *const | data | ||
) |
Set tile related attribute
Definition at line 541 of file attribute.c.
Get unit related attribute
Definition at line 464 of file attribute.c.
Referenced by attr_unit_get_int().
Get unit related integer attribute
Definition at line 481 of file attribute.c.
Set unit related attribute
Definition at line 455 of file attribute.c.
Referenced by attr_unit_set_int().
Set unit related integer attribute
Definition at line 473 of file attribute.c.
Send current state to the server. Note that the current implementation will send all attributes to the server.
Definition at line 333 of file attribute.c.
Referenced by client_exit(), disconnect_from_server(), send_save_game(), and send_turn_done().
Frees the attribute module.
Definition at line 123 of file attribute.c.
Referenced by client_game_free(), and client_game_reset().
Low-level function to get an attribute. If data hasn't enough space to hold the attribute data isn't set to the attribute. Returns the actual size of the attribute. Can be zero if the attribute is unset. To get the size of an attribute use size = attribute_get(key, id, x, y, 0, NULL)
Definition at line 422 of file attribute.c.
Referenced by attr_city_get(), attr_player_get(), attr_tile_get(), and attr_unit_get().
Initializes the attribute module.
Definition at line 114 of file attribute.c.
Referenced by client_game_init(), and client_game_reset().
Recreate the attribute set from the player's attribute_block. Shouldn't be used by normal code.
Definition at line 361 of file attribute.c.
Referenced by handle_player_attribute_chunk().
Low-level function to set an attribute. If data_length is zero the attribute is removed.
Definition at line 390 of file attribute.c.
Referenced by attr_city_set(), attr_player_set(), attr_tile_set(), and attr_unit_set().
|
static |
Serialize an attribute hash for network/storage.
Definition at line 134 of file attribute.c.
Referenced by attribute_flush().
|
static |
This data was serialized (above), sent as an opaque data packet to the server, stored in a savegame, retrieved from the savegame, sent as an opaque data packet back to the client, and now is ready to be restored. Check everything!
Definition at line 236 of file attribute.c.
Referenced by attribute_restore().
Definition at line 69 of file attribute.c.
Referenced by attribute_flush(), attribute_free(), attribute_get(), attribute_init(), attribute_restore(), and attribute_set().