Freeciv-3.2
|
Go to the source code of this file.
void handle_chat_msg_req | ( | struct connection * | pconn, |
const char * | message | ||
) |
Handle a chat message packet from client:
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 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().
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().
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 request to change city worker in to specialist.
Definition at line 123 of file cityhand.c.
Referenced by server_handle_packet().
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().
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().
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().
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 request
Definition at line 416 of file cityhand.c.
Referenced by server_handle_packet().
Handle city rename request packet.
Definition at line 485 of file cityhand.c.
Referenced by server_handle_packet().
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().
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().
void handle_client_heartbeat | ( | struct connection * | pconn | ) |
Handle client's regular hearbeat
Definition at line 1465 of file sernet.c.
Referenced by server_handle_packet().
void handle_client_info | ( | struct connection * | pc, |
enum gui_type | gui, | ||
int | emerg_version, | ||
const char * | distribution | ||
) |
Handle client info packet
Definition at line 310 of file srv_main.c.
Referenced by server_handle_packet().
void handle_conn_pong | ( | struct connection * | pconn | ) |
Handle response to ping.
Definition at line 1445 of file sernet.c.
Referenced by server_handle_packet(), and server_packet_input().
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 150 of file diplhand.c.
Referenced by dai_treaty_evaluate(), and server_handle_packet().
Handle meeting cancelling request.
Definition at line 833 of file diplhand.c.
Referenced by server_handle_packet().
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.
pplayer | player cancelling the pact |
other_player_id | id of player we want to cancel a pact with |
clause | value 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 dai_declare_war(), dai_diplomacy_actions(), handle_diplomacy_cancel_pact(), server_handle_packet(), and update_diplomatics().
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 756 of file diplhand.c.
Referenced by dai_diplomacy_suggest(), and server_handle_packet().
Handle meeting opening request.
Definition at line 848 of file diplhand.c.
Referenced by dai_diplomacy_suggest(), and server_handle_packet().
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 723 of file diplhand.c.
Referenced by server_handle_packet().
void handle_edit_check_tiles | ( | struct connection * | pc | ) |
Run any pending tile checks.
Definition at line 1322 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 746 of file edithand.c.
Referenced by server_handle_packet().
Allows the editing client to create a city at the given position and of size 'size'.
Definition at line 690 of file edithand.c.
Referenced by server_handle_packet().
void handle_edit_city_remove | ( | struct connection * | pc, |
int | id | ||
) |
Remove any city at the given location.
Definition at line 1305 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 1441 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 193 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 1009 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 906 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 985 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 1225 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 1297 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 1504 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 1365 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 1403 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 380 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 340 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 303 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 1332 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 613 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 438 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 541 of file edithand.c.
Referenced by server_handle_packet().
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 596 of file edithand.c.
Referenced by server_handle_packet().
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 2329 of file srv_main.c.
Referenced by server_handle_packet().
The client request an attribute block.
Definition at line 3169 of file plrhand.c.
Referenced by server_handle_packet().
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 3159 of file plrhand.c.
Referenced by client_handle_packet(), and server_handle_packet().
void handle_player_change_government | ( | struct player * | pplayer, |
Government_type_id | government | ||
) |
Called by the client or AI to change government.
Definition at line 566 of file plrhand.c.
Referenced by dai_go_to_war(), dai_government_change(), research_tech_lost(), server_handle_packet(), and update_city_activity().
Sets player's multipliers.
Definition at line 3390 of file plrhand.c.
Referenced by server_handle_packet().
(Hmm, how should "turn done" work for multi-connected non-observer players?)
Definition at line 3177 of file plrhand.c.
Referenced by server_handle_packet().
Handle player_place_infra packet
Definition at line 29 of file infrapts.c.
Referenced by server_handle_packet().
Handle a client or AI request to change the tax/luxury/science rates. This function does full sanity checking.
Definition at line 286 of file plrhand.c.
Referenced by server_handle_packet().
Handle a player-ready packet.
Definition at line 2411 of file srv_main.c.
Referenced by server_handle_packet(), and start_command().
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 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().
void handle_report_req | ( | struct connection * | pconn, |
enum report_type | type | ||
) |
Handle request asking report to be sent to client.
Definition at line 1947 of file srv_main.c.
Referenced by server_handle_packet().
void handle_ruleset_select | ( | struct connection * | pc, |
const struct packet_ruleset_select * | packet | ||
) |
Change ruleset based on modpack.
Definition at line 1183 of file gamehand.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 1516 of file edithand.c.
Referenced by server_handle_packet().
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 1234 of file gamehand.c.
Referenced by server_handle_packet().
Handle spaceship launch request.
Definition at line 167 of file spacerace.c.
Referenced by dai_manage_spaceship(), and server_handle_packet().
Handle spaceship part placement request
Definition at line 206 of file spacerace.c.
Referenced by server_handle_packet().
void handle_sync_serial | ( | struct connection * | conn, |
int | serial | ||
) |
Handle client's request to sync via packet serial number.
Definition at line 1016 of file connecthand.c.
Referenced by server_handle_packet().
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 3163 of file unithand.c.
Referenced by server_handle_packet().
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 4312 of file unithand.c.
Referenced by server_handle_packet().
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 3277 of file unithand.c.
Referenced by server_handle_packet().
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 2228 of file unithand.c.
Referenced by server_handle_packet().
Receives route packages.
Definition at line 6612 of file unithand.c.
Referenced by server_handle_packet().
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 6321 of file unithand.c.
Referenced by server_handle_packet().
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 6214 of file unithand.c.
Referenced by server_handle_packet().
void handle_unit_type_upgrade | ( | struct player * | pplayer, |
Unit_type_id | uti | ||
) |
Upgrade all units of a given type.
Definition at line 185 of file unithand.c.
Referenced by server_handle_packet().
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().
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().
Handles a request to change city CMA settings.
Definition at line 543 of file cityhand.c.
Referenced by server_handle_packet().
Handle worker task assigned to the city
Definition at line 6721 of file unithand.c.
Referenced by client_handle_packet(), and 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().