Freeciv-3.3
Loading...
Searching...
No Matches
Functions
cityhand.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "rand.h"
#include "support.h"
#include "city.h"
#include "events.h"
#include "game.h"
#include "idex.h"
#include "map.h"
#include "player.h"
#include "specialist.h"
#include "unit.h"
#include "worklist.h"
#include "cm.h"
#include "citytools.h"
#include "cityturn.h"
#include "notify.h"
#include "plrhand.h"
#include "sanitycheck.h"
#include "unithand.h"
#include "unittools.h"
#include "cityhand.h"

Go to the source code of this file.

Functions

void handle_city_name_suggestion_req (struct player *pplayer, int unit_id)
 
void handle_city_change_specialist (struct player *pplayer, int city_id, Specialist_type_id from, Specialist_type_id to)
 
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 really_handle_city_sell (struct player *pplayer, struct city *pcity, struct impr_type *pimprove)
 
void handle_city_sell (struct player *pplayer, int city_id, int build_id)
 
void really_handle_city_buy (struct player *pplayer, struct city *pcity)
 
void handle_city_worklist (struct player *pplayer, int city_id, const struct worklist *worklist)
 
void handle_city_buy (struct player *pplayer, int city_id)
 
void handle_city_refresh (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_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 wlcb)
 
void handle_city_rally_point (struct player *pplayer, const struct packet_city_rally_point *packet)
 
void handle_web_cma_set (struct player *pplayer, int id, const struct cm_parameter *param)
 
void handle_web_cma_clear (struct player *pplayer, int id)
 

Function Documentation

◆ 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_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().

◆ really_handle_city_buy()

void really_handle_city_buy ( struct player pplayer,
struct city pcity 
)

Handle buying request. Caller is responsible to validate input before passing to this function if it comes from untrusted source.

Definition at line 294 of file cityhand.c.

Referenced by dai_spend_gold(), and handle_city_buy().

◆ really_handle_city_sell()

void really_handle_city_sell ( struct player pplayer,
struct city pcity,
struct impr_type pimprove 
)

Handle improvement selling request. Caller is responsible to validate input before passing to this function if it comes from untrusted source.

Definition at line 241 of file cityhand.c.

Referenced by handle_city_sell(), and try_to_sell_stuff().