Freeciv-3.3
Loading...
Searching...
No Matches
Functions
hand_gen.h File Reference
#include "shared.h"
#include "fc_types.h"
#include "packets.h"

Go to the source code of this file.

Functions

bool server_handle_packet (enum packet_type type, const void *packet, struct player *pplayer, struct connection *pconn)
 
void handle_nation_select_req (struct connection *pc, int player_no, Nation_type_id nation_no, bool is_male, const char *name, int style)
 
void handle_player_ready (struct player *pplayer, int player_no, bool is_ready)
 
void handle_chat_msg_req (struct connection *pc, const char *message)
 
void handle_city_sell (struct player *pplayer, int city_id, int build_id)
 
void handle_city_buy (struct player *pplayer, int city_id)
 
void handle_city_change (struct player *pplayer, int city_id, int production_kind, int production_value)
 
void handle_city_worklist (struct player *pplayer, int city_id, const struct worklist *worklist)
 
void handle_city_make_specialist (struct player *pplayer, int city_id, int tile_id)
 
void handle_city_make_worker (struct player *pplayer, int city_id, int tile_id)
 
void handle_city_change_specialist (struct player *pplayer, int city_id, Specialist_type_id from, Specialist_type_id to)
 
void handle_city_rename (struct player *pplayer, int city_id, const char *name)
 
void handle_city_options_req (struct player *pplayer, int city_id, bv_city_options options, enum city_wl_cancel_behavior wl_cb)
 
void handle_city_refresh (struct player *pplayer, int city_id)
 
void handle_city_name_suggestion_req (struct player *pplayer, int unit_id)
 
void handle_city_rally_point (struct player *pplayer, const struct packet_city_rally_point *packet)
 
void handle_worker_task (struct player *pplayer, const struct packet_worker_task *packet)
 
void handle_player_phase_done (struct player *pplayer, int turn)
 
void handle_player_rates (struct player *pplayer, int tax, int luxury, int science)
 
void handle_player_change_government (struct player *pplayer, Government_type_id government)
 
void handle_player_place_infra (struct player *pplayer, int tile, int extra)
 
void handle_player_attribute_block (struct player *pplayer)
 
void handle_player_attribute_chunk (struct player *pplayer, const struct packet_player_attribute_chunk *packet)
 
void handle_player_multiplier (struct player *pplayer, int count, const int *multipliers)
 
void handle_player_research (struct player *pplayer, int tech)
 
void handle_player_tech_goal (struct player *pplayer, int tech)
 
void handle_unit_sscs_set (struct player *pplayer, int unit_id, enum unit_ss_data_type type, int value)
 
void handle_unit_orders (struct player *pplayer, const struct packet_unit_orders *packet)
 
void handle_unit_server_side_agent_set (struct player *pplayer, int unit_id, enum server_side_agent agent)
 
void handle_unit_action_query (struct connection *pc, int actor_id, int target_id, action_id action_type, int request_kind)
 
void handle_unit_type_upgrade (struct player *pplayer, Unit_type_id type)
 
void handle_unit_do_action (struct player *pplayer, int actor_id, int target_id, int sub_tgt_id, const char *name, action_id action_type)
 
void handle_unit_get_actions (struct connection *pc, int actor_unit_id, int target_unit_id, int target_tile_id, int target_extra_id, int request_kind)
 
void handle_unit_change_activity (struct player *pplayer, int unit_id, enum unit_activity activity, int target)
 
void handle_diplomacy_init_meeting_req (struct player *pplayer, int counterpart)
 
void handle_diplomacy_cancel_meeting_req (struct player *pplayer, int counterpart)
 
void handle_diplomacy_create_clause_req (struct player *pplayer, int counterpart, int giver, enum clause_type type, int value)
 
void handle_diplomacy_remove_clause_req (struct player *pplayer, int counterpart, int giver, enum clause_type type, int value)
 
void handle_diplomacy_accept_treaty_req (struct player *pplayer, int counterpart)
 
void handle_diplomacy_cancel_pact (struct player *pplayer, int other_player_id, enum clause_type clause)
 
void handle_report_req (struct connection *pc, enum report_type type)
 
void handle_conn_pong (struct connection *pc)
 
void handle_client_heartbeat (struct connection *pc)
 
void handle_client_info (struct connection *pc, enum gui_type gui, int emerg_version, const char *distribution)
 
void handle_spaceship_launch (struct player *pplayer)
 
void handle_spaceship_place (struct player *pplayer, enum spaceship_place_type type, int num)
 
void handle_single_want_hack_req (struct connection *pc, const struct packet_single_want_hack_req *packet)
 
void handle_ruleset_select (struct connection *pc, const struct packet_ruleset_select *packet)
 
void handle_save_scenario (struct connection *pc, const char *name)
 
void handle_vote_submit (struct connection *pc, int vote_no, int value)
 
void handle_edit_mode (struct connection *pc, bool state)
 
void handle_edit_recalculate_borders (struct connection *pc)
 
void handle_edit_check_tiles (struct connection *pc)
 
void handle_edit_toggle_fogofwar (struct connection *pc, int player)
 
void handle_edit_tile_terrain (struct connection *pc, int tile, Terrain_type_id terrain, int size)
 
void handle_edit_tile_extra (struct connection *pc, int tile, int extra_type_id, bool removal, int eowner, int size)
 
void handle_edit_startpos (struct connection *pc, const struct packet_edit_startpos *packet)
 
void handle_edit_startpos_full (struct connection *pc, const struct packet_edit_startpos_full *packet)
 
void handle_edit_tile (struct connection *pc, const struct packet_edit_tile *packet)
 
void handle_edit_unit_create (struct connection *pc, int owner, int tile, Unit_type_id type, int count, int tag)
 
void handle_edit_unit_remove (struct connection *pc, int owner, int tile, Unit_type_id type, int count)
 
void handle_edit_unit_remove_by_id (struct connection *pc, int id)
 
void handle_edit_unit (struct connection *pc, const struct packet_edit_unit *packet)
 
void handle_edit_city_create (struct connection *pc, int owner, int tile, int size, int tag)
 
void handle_edit_city_remove (struct connection *pc, int id)
 
void handle_edit_city (struct connection *pc, const struct packet_edit_city *packet)
 
void handle_edit_player_create (struct connection *pc, int tag)
 
void handle_edit_player_remove (struct connection *pc, int id)
 
void handle_edit_player (struct connection *pc, const struct packet_edit_player *packet)
 
void handle_edit_player_vision (struct connection *pc, int player, int tile, bool known, int size)
 
void handle_edit_game (struct connection *pc, const struct packet_edit_game *packet)
 
void handle_edit_scenario_desc (struct connection *pc, const char *scenario_desc)
 
void handle_sync_serial (struct connection *pc, int serial)
 
void handle_web_cma_set (struct player *pplayer, int id, const struct cm_parameter *cm_parameter)
 
void handle_web_cma_clear (struct player *pplayer, int id)
 

Function Documentation

◆ handle_chat_msg_req()

void handle_chat_msg_req ( struct connection pconn,
const char message 
)

Handle a chat message packet from client:

  1. Work out whether it is a server command and if so run it;
  2. Otherwise work out whether it is directed to a single player, or to a single connection, and send there. (For a player, send to all clients connected as that player, in multi-connect case);
  3. Or it may be intended for all allied players.
  4. Else send to all connections (game.est_connections).

In case 2, there can sometimes be ambiguity between player and connection names. By default this tries to match player name first, and only if that fails tries to match connection name. User can override this and specify connection only by using two colons ("::") after the destination name/prefix, instead of one.

The message sent will name the sender, and via format differences also indicates whether the recipient is either all connections, a single connection, or multiple connections to a single player.

Message is also echoed back to sender (with different format), avoiding sending both original and echo if sender is in destination set.

Definition at line 320 of file handchat.c.

Referenced by server_handle_packet().

◆ handle_city_buy()

void handle_city_buy ( struct player pplayer,
int  city_id 
)

Handle buying request. This function does properly check its input as it may come from untrusted source over the network.

Definition at line 402 of file cityhand.c.

Referenced by server_handle_packet().

◆ handle_city_change()

void handle_city_change ( struct player pplayer,
int  city_id,
int  production_kind,
int  production_value 
)

Handle request to change current production.

Definition at line 435 of file cityhand.c.

Referenced by server_handle_packet().

◆ handle_city_change_specialist()

void handle_city_change_specialist ( struct player pplayer,
int  city_id,
Specialist_type_id  from,
Specialist_type_id  to 
)

Handle request to change specialist type

Definition at line 92 of file cityhand.c.

Referenced by server_handle_packet().

◆ handle_city_make_specialist()

void handle_city_make_specialist ( struct player pplayer,
int  city_id,
int  tile_id 
)

Handle request to change city worker in to specialist.

Definition at line 123 of file cityhand.c.

Referenced by server_handle_packet().

◆ handle_city_make_worker()

void handle_city_make_worker ( struct player pplayer,
int  city_id,
int  tile_id 
)

Handle request to turn specialist in to city worker. Client cannot tell which kind of specialist is to be taken, but this just makes worker from first available specialist.

Definition at line 170 of file cityhand.c.

Referenced by server_handle_packet().

◆ handle_city_name_suggestion_req()

void handle_city_name_suggestion_req ( struct player pplayer,
int  unit_id 
)

Send city_name_suggestion packet back to requesting conn, with suggested name and with same id which was passed in (either unit id for city builder or existing city id for rename, we don't care here).

Definition at line 59 of file cityhand.c.

Referenced by server_handle_packet().

◆ handle_city_options_req()

void handle_city_options_req ( struct player pplayer,
int  city_id,
bv_city_options  options,
enum city_wl_cancel_behavior  wlcb 
)

Handles a packet from the client that requests the city options for the given city be changed.

Definition at line 510 of file cityhand.c.

Referenced by server_handle_packet().

◆ handle_city_rally_point()

void handle_city_rally_point ( struct player pplayer,
const struct packet_city_rally_point packet 
)

Handles a request to set city rally point for new units.

Definition at line 529 of file cityhand.c.

Referenced by client_handle_packet(), and server_handle_packet().

◆ handle_city_refresh()

void handle_city_refresh ( struct player pplayer,
int  city_id 
)

Handle city refresh request

Definition at line 416 of file cityhand.c.

Referenced by server_handle_packet().

◆ handle_city_rename()

void handle_city_rename ( struct player pplayer,
int  city_id,
const char name 
)

Handle city rename request packet.

Definition at line 485 of file cityhand.c.

Referenced by server_handle_packet().

◆ handle_city_sell()

void handle_city_sell ( struct player pplayer,
int  city_id,
int  build_id 
)

Handle improvement selling request. This function does check its parameters as they may come from untrusted source over the network.

Definition at line 279 of file cityhand.c.

Referenced by server_handle_packet().

◆ handle_city_worklist()

void handle_city_worklist ( struct player pplayer,
int  city_id,
const struct worklist worklist 
)

Handle city worklist update request

Definition at line 384 of file cityhand.c.

Referenced by server_handle_packet().

◆ handle_client_heartbeat()

void handle_client_heartbeat ( struct connection pconn)

Handle client's regular hearbeat

Definition at line 1461 of file sernet.c.

Referenced by server_handle_packet().

◆ handle_client_info()

void handle_client_info ( struct connection pc,
enum gui_type  gui,
int  emerg_version,
const char distribution 
)

Handle client info packet

Definition at line 315 of file srv_main.c.

Referenced by server_handle_packet().

◆ handle_conn_pong()

void handle_conn_pong ( struct connection pconn)

Handle response to ping.

Definition at line 1441 of file sernet.c.

Referenced by server_handle_packet(), and server_packet_input().

◆ handle_diplomacy_accept_treaty_req()

void handle_diplomacy_accept_treaty_req ( struct player pplayer,
int  counterpart 
)

pplayer clicked the accept button. If they accepted the treaty we check the clauses. If both players have now accepted the treaty we execute the agreed clauses.

Definition at line 147 of file diplhand.c.

Referenced by dai_treaty_evaluate(), and server_handle_packet().

◆ handle_diplomacy_cancel_meeting_req()

void handle_diplomacy_cancel_meeting_req ( struct player pplayer,
int  counterpart 
)

Handle meeting cancelling request.

Definition at line 830 of file diplhand.c.

Referenced by server_handle_packet().

◆ handle_diplomacy_cancel_pact()

void handle_diplomacy_cancel_pact ( struct player pplayer,
int  other_player_id,
enum clause_type  clause 
)

Handles a player cancelling a "pact" with another player.

Parameters
pplayerplayer cancelling the pact
other_player_idid of player we want to cancel a pact with
clausevalue indicating what kind of treaty we want to break. If this is CLAUSE_VISION, we break shared vision. If it is CLAUSE_SHARED_TILES, we break shared tiles pact. Otherwise we break one pact level.

Definition at line 882 of file plrhand.c.

Referenced by api_methods_cancel_pact(), dai_declare_war(), dai_diplomacy_actions(), handle_diplomacy_cancel_pact(), server_handle_packet(), and update_diplomatics().

◆ handle_diplomacy_create_clause_req()

void handle_diplomacy_create_clause_req ( struct player pplayer,
int  counterpart,
int  giver,
enum clause_type  type,
int  value 
)

Handle request to add clause to treaty between two players.

Definition at line 753 of file diplhand.c.

Referenced by dai_diplomacy_suggest(), and server_handle_packet().

◆ handle_diplomacy_init_meeting_req()

void handle_diplomacy_init_meeting_req ( struct player pplayer,
int  counterpart 
)

Handle meeting opening request.

Definition at line 845 of file diplhand.c.

Referenced by dai_diplomacy_suggest(), and server_handle_packet().

◆ handle_diplomacy_remove_clause_req()

void handle_diplomacy_remove_clause_req ( struct player pplayer,
int  counterpart,
int  giver,
enum clause_type  type,
int  value 
)

Handle request to remove clause from treaty.

Definition at line 720 of file diplhand.c.

Referenced by server_handle_packet().

◆ handle_edit_check_tiles()

void handle_edit_check_tiles ( struct connection pc)

Run any pending tile checks.

Definition at line 1325 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_city()

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 749 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_city_create()

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 693 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_city_remove()

void handle_edit_city_remove ( struct connection pc,
int  id 
)

Remove any city at the given location.

Definition at line 1308 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_game()

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 1444 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_mode()

void handle_edit_mode ( struct connection pc,
bool  is_edit_mode 
)

Handles a request by the client to enter edit mode.

Definition at line 193 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_player()

void handle_edit_player ( struct connection pc,
const struct packet_edit_player packet 
)

Handle editing of any or all player properties.

Definition at line 1012 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_player_create()

void handle_edit_player_create ( struct connection pc,
int  tag 
)

Handle a request to create a new player.

Definition at line 909 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_player_remove()

void handle_edit_player_remove ( struct connection pc,
int  id 
)

Handle a request to remove a player.

Definition at line 988 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_player_vision()

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 1228 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_recalculate_borders()

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 1300 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_scenario_desc()

void handle_edit_scenario_desc ( struct connection pc,
const char scenario_desc 
)

Handle edit requests to scenario description

Definition at line 1507 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_startpos()

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 1368 of file edithand.c.

Referenced by client_handle_packet(), and server_handle_packet().

◆ handle_edit_startpos_full()

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 1406 of file edithand.c.

Referenced by client_handle_packet(), and server_handle_packet().

◆ handle_edit_tile()

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 380 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_tile_extra()

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 340 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_tile_terrain()

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 303 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_toggle_fogofwar()

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 1335 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_unit()

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 616 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_unit_create()

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 438 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_unit_remove()

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 544 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_edit_unit_remove_by_id()

void handle_edit_unit_remove_by_id ( struct connection pc,
Unit_type_id  id 
)

Handle a request to remove a unit given by its id.

Definition at line 599 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_nation_select_req()

void handle_nation_select_req ( struct connection pc,
int  player_no,
Nation_type_id  nation_no,
bool  is_male,
const char name,
int  style 
)

Handles a pick-nation packet from the client. These packets are handled by connection because ctrl users may edit anyone's nation in pregame, and editing is possible during a running game.

Definition at line 2370 of file srv_main.c.

Referenced by server_handle_packet().

◆ handle_player_attribute_block()

void handle_player_attribute_block ( struct player pplayer)

The client request an attribute block.

Definition at line 3173 of file plrhand.c.

Referenced by server_handle_packet().

◆ handle_player_attribute_chunk()

void handle_player_attribute_chunk ( struct player pplayer,
const struct packet_player_attribute_chunk chunk 
)

The client has send as a chunk of the attribute block.

Definition at line 3163 of file plrhand.c.

Referenced by client_handle_packet(), and server_handle_packet().

◆ handle_player_change_government()

void handle_player_change_government ( struct player pplayer,
Government_type_id  government 
)

Called by the client or AI to change government.

Definition at line 565 of file plrhand.c.

Referenced by dai_go_to_war(), dai_government_change(), research_tech_lost(), server_handle_packet(), and update_city_activity().

◆ handle_player_multiplier()

void handle_player_multiplier ( struct player pplayer,
int  count,
const int multipliers 
)

Sets player's multipliers.

Definition at line 3397 of file plrhand.c.

Referenced by server_handle_packet().

◆ handle_player_phase_done()

void handle_player_phase_done ( struct player pplayer,
int  turn 
)

(Hmm, how should "turn done" work for multi-connected non-observer players?)

Definition at line 3181 of file plrhand.c.

Referenced by server_handle_packet().

◆ handle_player_place_infra()

void handle_player_place_infra ( struct player pplayer,
int  tile,
int  extra 
)

Handle player_place_infra packet

Definition at line 29 of file infrapts.c.

Referenced by server_handle_packet().

◆ handle_player_rates()

void handle_player_rates ( struct player pplayer,
int  tax,
int  luxury,
int  science 
)

Handle a client or AI request to change the tax/luxury/science rates. This function does full sanity checking.

Definition at line 285 of file plrhand.c.

Referenced by server_handle_packet().

◆ handle_player_ready()

void handle_player_ready ( struct player requestor,
int  player_no,
bool  is_ready 
)

Handle a player-ready packet.

Definition at line 2452 of file srv_main.c.

Referenced by server_handle_packet(), and start_command().

◆ handle_player_research()

void handle_player_research ( struct player pplayer,
int  tech 
)

Handle incoming research packet. Need to check correctness Set the player to be researching the given tech.

If there are enough accumulated research points, the tech may be acquired immediately.

Definition at line 1339 of file techtools.c.

Referenced by server_handle_packet().

◆ handle_player_tech_goal()

void handle_player_tech_goal ( struct player pplayer,
int  tech_goal 
)

Handle incoming player_tech_goal packet Called from the network or AI code to set the player's tech goal.

Definition at line 1362 of file techtools.c.

Referenced by server_handle_packet().

◆ handle_report_req()

void handle_report_req ( struct connection pconn,
enum report_type  type 
)

Handle request asking report to be sent to client.

Definition at line 1988 of file srv_main.c.

Referenced by server_handle_packet().

◆ handle_ruleset_select()

void handle_ruleset_select ( struct connection pc,
const struct packet_ruleset_select packet 
)

Change ruleset based on modpack.

Definition at line 1186 of file gamehand.c.

Referenced by server_handle_packet().

◆ handle_save_scenario()

void handle_save_scenario ( struct connection pc,
const char name 
)

Make scenario file out of current game.

Definition at line 1519 of file edithand.c.

Referenced by server_handle_packet().

◆ handle_single_want_hack_req()

void handle_single_want_hack_req ( struct connection pc,
const struct packet_single_want_hack_req packet 
)

Opens a file specified by the packet and compares the packet values with the file values. Sends an answer to the client once it's done.

Definition at line 1237 of file gamehand.c.

Referenced by server_handle_packet().

◆ handle_spaceship_launch()

void handle_spaceship_launch ( struct player pplayer)

Handle spaceship launch request.

Definition at line 167 of file spacerace.c.

Referenced by dai_manage_spaceship(), and server_handle_packet().

◆ handle_spaceship_place()

void handle_spaceship_place ( struct player pplayer,
enum spaceship_place_type  type,
int  num 
)

Handle spaceship part placement request

Definition at line 206 of file spacerace.c.

Referenced by server_handle_packet().

◆ handle_sync_serial()

void handle_sync_serial ( struct connection conn,
int  serial 
)

Handle client's request to sync via packet serial number.

Definition at line 1017 of file connecthand.c.

Referenced by server_handle_packet().

◆ handle_unit_action_query()

void handle_unit_action_query ( struct connection pc,
const int  actor_id,
const int  target_id,
const action_id  action_type,
int  request_kind 
)

Tell the client the cost of bribing a unit, inciting a revolt, or any other parameters needed for action.

Only send result back to the requesting connection, not all connections for that player.

Definition at line 3189 of file unithand.c.

Referenced by server_handle_packet().

◆ handle_unit_change_activity()

void handle_unit_change_activity ( struct player pplayer,
int  unit_id,
enum unit_activity  activity,
int  target_id 
)

Handle change in unit activity.

Definition at line 4374 of file unithand.c.

Referenced by server_handle_packet().

◆ handle_unit_do_action()

void handle_unit_do_action ( struct player pplayer,
const int  actor_id,
const int  target_id,
const int  sub_tgt_id,
const char name,
const action_id  action_type 
)

Handle a request to do an action.

action_type must be a valid action.

Definition at line 3322 of file unithand.c.

Referenced by server_handle_packet().

◆ handle_unit_get_actions()

void handle_unit_get_actions ( struct connection pc,
const int  actor_unit_id,
const int  target_unit_id_client,
const int  target_tile_id,
const int  target_extra_id_client,
const int  request_kind 
)

Handle a query for what actions a unit may do.

MUST always send a reply so the client can move on in the queue. This includes when the client give invalid input. That the acting unit died before the server received a request for what actions it could do should not stop the client from processing the next unit in the queue.

Definition at line 2251 of file unithand.c.

Referenced by server_handle_packet().

◆ handle_unit_orders()

void handle_unit_orders ( struct player pplayer,
const struct packet_unit_orders packet 
)

Receives route packages.

Definition at line 6813 of file unithand.c.

Referenced by server_handle_packet().

◆ handle_unit_server_side_agent_set()

void handle_unit_server_side_agent_set ( struct player pplayer,
int  unit_id,
enum server_side_agent  agent 
)

Handle request to change controlling server side agent.

Definition at line 6513 of file unithand.c.

Referenced by server_handle_packet().

◆ handle_unit_sscs_set()

void handle_unit_sscs_set ( struct player pplayer,
int  unit_id,
enum unit_ss_data_type  type,
int  value 
)

Change various unit server side client state.

The server keeps various unit state that is owned by the client. The only consequence this state has for the game is how the client reacts to it. The state may be server side because the server writes to it or simply to have it end up in the save game.

Definition at line 6406 of file unithand.c.

Referenced by server_handle_packet().

◆ handle_unit_type_upgrade()

void handle_unit_type_upgrade ( struct player pplayer,
Unit_type_id  uti 
)

Upgrade all units of a given type.

Definition at line 187 of file unithand.c.

Referenced by server_handle_packet().

◆ handle_vote_submit()

void handle_vote_submit ( struct connection pconn,
int  vote_no,
int  value 
)

Handle a vote submit packet sent from a client. This is basically just a Wrapper around connection_vote().

Definition at line 775 of file voting.c.

Referenced by server_handle_packet().

◆ handle_web_cma_clear()

void handle_web_cma_clear ( struct player pplayer,
int  id 
)

Handles a request to clear city CMA settings.

Definition at line 571 of file cityhand.c.

Referenced by handle_city_make_specialist(), handle_city_make_worker(), and server_handle_packet().

◆ handle_web_cma_set()

void handle_web_cma_set ( struct player pplayer,
int  id,
const struct cm_parameter param 
)

Handles a request to change city CMA settings.

Definition at line 543 of file cityhand.c.

Referenced by server_handle_packet().

◆ handle_worker_task()

void handle_worker_task ( struct player pplayer,
const struct packet_worker_task packet 
)

Handle worker task assigned to the city

Definition at line 6922 of file unithand.c.

Referenced by client_handle_packet(), and server_handle_packet().

◆ server_handle_packet()

bool server_handle_packet ( enum packet_type  type,
const void packet,
struct player pplayer,
struct connection pconn 
)

Definition at line 17 of file hand_gen.c.

Referenced by server_packet_input().