Freeciv-3.1
|
#include <limits.h>
#include "bitvector.h"
#include "capability.h"
#include "fcintl.h"
#include "log.h"
#include "shared.h"
#include "support.h"
#include "events.h"
#include "game.h"
#include "government.h"
#include "map.h"
#include "movement.h"
#include "nation.h"
#include "terrain.h"
#include "research.h"
#include "unitlist.h"
#include "aiiface.h"
#include "citytools.h"
#include "cityturn.h"
#include "connecthand.h"
#include "gamehand.h"
#include <hand_gen.h>
#include "maphand.h"
#include "plrhand.h"
#include "notify.h"
#include "sanitycheck.h"
#include "stdinhand.h"
#include "techtools.h"
#include "unittools.h"
#include "mapgen_utils.h"
#include "savemain.h"
#include "edithand.h"
Go to the source code of this file.
Variables | |
static bool | need_continents_reassigned = FALSE |
static struct tile_hash * | modified_tile_table = NULL |
static bool * | unfogged_players |
|
static |
Do the potentially slow checks required after one or several tiles' terrain has change.
Definition at line 143 of file edithand.c.
Referenced by check_leaving_edit_mode(), and handle_edit_check_tiles().
|
static |
Do any necessary checks after leaving edit mode to ensure that the game is in a consistent state.
Definition at line 165 of file edithand.c.
Referenced by handle_edit_mode().
|
static |
Base function to edit the extras property of a tile. Returns TRUE if the extra state has changed.
Definition at line 254 of file edithand.c.
Referenced by handle_edit_tile(), and handle_edit_tile_extra().
|
static |
Base function to edit the terrain property of a tile. Returns TRUE if the terrain has changed.
Definition at line 222 of file edithand.c.
Referenced by handle_edit_tile_terrain().
void edithand_free | ( | void | ) |
Free all memory used by data structures required for edit mode.
Definition at line 97 of file edithand.c.
Referenced by server_quit().
void edithand_init | ( | void | ) |
Initialize data structures required for edit mode.
Definition at line 79 of file edithand.c.
Referenced by srv_prepare().
void edithand_send_initial_packets | ( | struct conn_list * | dest | ) |
Send the needed packets for connections entering in the editing mode.
Definition at line 113 of file edithand.c.
Referenced by connection_attach_real(), and handle_edit_mode().
void handle_edit_check_tiles | ( | struct connection * | pc | ) |
Run any pending tile checks.
Definition at line 1319 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_city | ( | struct connection * | pc, |
const struct packet_edit_city * | packet | ||
) |
Handle a request to change the internal state of a city.
Definition at line 752 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_city_create | ( | struct connection * | pc, |
int | owner, | ||
int | tile, | ||
int | size, | ||
int | tag | ||
) |
Allows the editing client to create a city at the given position and of size 'size'.
Definition at line 696 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_city_remove | ( | struct connection * | pc, |
int | id16, | ||
int | id32 | ||
) |
Remove any city at the given location.
Definition at line 1298 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_game | ( | struct connection * | pc, |
const struct packet_edit_game * | packet | ||
) |
Handle edit requests to the main game data structure.
Definition at line 1438 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_mode | ( | struct connection * | pc, |
bool | is_edit_mode | ||
) |
Handles a request by the client to enter edit mode.
Definition at line 189 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_player | ( | struct connection * | pc, |
const struct packet_edit_player * | packet | ||
) |
Handle editing of any or all player properties.
Definition at line 1022 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_player_create | ( | struct connection * | pc, |
int | tag | ||
) |
Handle a request to create a new player.
Definition at line 919 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_player_remove | ( | struct connection * | pc, |
int | id | ||
) |
Handle a request to remove a player.
Definition at line 998 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_player_vision | ( | struct connection * | pc, |
int | plr_no, | ||
int | tile, | ||
bool | known, | ||
int | size | ||
) |
Handles vision editing requests from client.
Definition at line 1218 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_recalculate_borders | ( | struct connection * | pc | ) |
Client editor requests us to recalculate borders. Note that this does not necessarily extend borders to their maximum due to the way the borders code is written. This may be considered a feature or limitation.
Definition at line 1290 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_scenario_desc | ( | struct connection * | pc, |
const char * | scenario_desc | ||
) |
Handle edit requests to scenario description
Definition at line 1501 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_startpos | ( | struct connection * | pconn, |
const struct packet_edit_startpos * | packet | ||
) |
Create or remove a start position at a tile.
Definition at line 1362 of file edithand.c.
Referenced by client_handle_packet(), and server_handle_packet().
void handle_edit_startpos_full | ( | struct connection * | pconn, |
const struct packet_edit_startpos_full * | packet | ||
) |
Setup which nations can start at a start position.
Definition at line 1400 of file edithand.c.
Referenced by client_handle_packet(), and server_handle_packet().
void handle_edit_tile | ( | struct connection * | pc, |
const struct packet_edit_tile * | packet | ||
) |
Handles tile information from the client, to make edits to tiles.
Definition at line 376 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_tile_extra | ( | struct connection * | pc, |
int | tile, | ||
int | id, | ||
bool | removal, | ||
int | eowner, | ||
int | size | ||
) |
Handle a request to change one or more tiles' extras. The 'remove' argument controls whether to remove or add the given extra from the tile.
Definition at line 336 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_tile_terrain | ( | struct connection * | pc, |
int | tile, | ||
Terrain_type_id | terrain, | ||
int | size | ||
) |
Handles a client request to change the terrain of the tile at the given x, y coordinates. The 'size' parameter indicates that all tiles in a square of "radius" 'size' should be affected. So size=1 corresponds to the single tile case.
Definition at line 299 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_toggle_fogofwar | ( | struct connection * | pc, |
int | plr_no | ||
) |
Temporarily remove fog-of-war for the player with player number 'plr_no'. This will only stay in effect while the server is in edit mode and the connection is editing. Has no effect if fog-of-war is disabled globally.
Definition at line 1329 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_unit | ( | struct connection * | pc, |
const struct packet_edit_unit * | packet | ||
) |
Handles unit information from the client, to make edits to units.
Definition at line 614 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_unit_create | ( | struct connection * | pc, |
int | owner, | ||
int | tile, | ||
Unit_type_id | utid, | ||
int | count, | ||
int | tag | ||
) |
Handle a request to create 'count' units of type 'utid' at the tile given by the x, y coordinates and owned by player with number 'owner'.
Definition at line 434 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_unit_remove | ( | struct connection * | pc, |
int | owner, | ||
int | tile, | ||
Unit_type_id | utid, | ||
int | count | ||
) |
Remove 'count' units of type 'utid' owned by player number 'owner' at tile (x, y).
Definition at line 537 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_unit_remove_by_id | ( | struct connection * | pc, |
Unit_type_id | id16, | ||
Unit_type_id | id32 | ||
) |
Handle a request to remove a unit given by its id.
Definition at line 592 of file edithand.c.
Referenced by server_handle_packet().
void handle_save_scenario | ( | struct connection * | pc, |
const char * | name | ||
) |
Make scenario file out of current game.
Definition at line 1513 of file edithand.c.
Referenced by server_handle_packet().
|
static |
Definition at line 69 of file edithand.c.
Referenced by check_edited_tile_terrains(), edit_tile_terrain_handling(), edithand_free(), and edithand_init().
Definition at line 65 of file edithand.c.
Referenced by check_edited_tile_terrains(), edit_tile_terrain_handling(), and edithand_init().
|
static |
Definition at line 74 of file edithand.c.
Referenced by check_leaving_edit_mode(), edithand_free(), edithand_init(), and handle_edit_toggle_fogofwar().