Freeciv21
Develop your civilization from humble roots to a global empire
cityhand.cpp File Reference
#include "fcintl.h"
#include "log.h"
#include "rand.h"
#include "support.h"
#include "city.h"
#include "events.h"
#include "game.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"
+ Include dependency graph for cityhand.cpp:

Go to the source code of this file.

Functions

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). More...
 
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. More...
 
void handle_city_make_specialist (struct player *pplayer, int city_id, int tile_id)
 Handle request to change city worker in to specialist. More...
 
void handle_city_make_worker (struct player *pplayer, int city_id, int tile_id)
 Handle request to turn specialist in to city worker. More...
 
void really_handle_city_sell (struct player *pplayer, struct city *pcity, struct impr_type *pimprove)
 Handle improvement selling request. More...
 
void handle_city_sell (struct player *pplayer, int city_id, int build_id)
 Handle improvement selling request. More...
 
void really_handle_city_buy (struct player *pplayer, struct city *pcity)
 Handle buying request. More...
 
void handle_city_worklist (struct player *pplayer, int city_id, const struct worklist *worklist)
 Handle city worklist update request. More...
 
void handle_city_buy (struct player *pplayer, int city_id)
 Handle buying request. More...
 
void handle_city_refresh (struct player *pplayer, int city_id)
 Handle city refresh request. More...
 
void handle_city_change (struct player *pplayer, int city_id, int production_kind, int production_value)
 Handle request to change current production. More...
 
void handle_city_rename (struct player *pplayer, int city_id, const char *name)
 'struct packet_city_rename' handler. More...
 
void handle_city_options_req (struct player *pplayer, int city_id, bv_city_options options)
 Handles a packet from the client that requests the city options for the given city be changed. More...
 
void handle_city_rally_point (struct player *pplayer, int city_id, int length, bool persistent, bool vigilant, const struct unit_order *orders)
 Handles a request to set city rally point for new units. More...
 
void handle_city_manager (struct player *pplayer, int city_id, bool enabled, struct cm_parameter parameter)
 Handles a request to set city manager parameter. More...
 

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 390 of file cityhand.cpp.

◆ 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 423 of file cityhand.cpp.

◆ 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 82 of file cityhand.cpp.

◆ 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 112 of file cityhand.cpp.

◆ 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 157 of file cityhand.cpp.

◆ handle_city_manager()

void handle_city_manager ( struct player pplayer,
int  city_id,
bool  enabled,
struct cm_parameter  parameter 
)

Handles a request to set city manager parameter.

Definition at line 562 of file cityhand.cpp.

◆ 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 49 of file cityhand.cpp.

◆ handle_city_options_req()

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

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

Definition at line 497 of file cityhand.cpp.

◆ handle_city_rally_point()

void handle_city_rally_point ( struct player pplayer,
int  city_id,
int  length,
bool  persistent,
bool  vigilant,
const struct unit_order orders 
)

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

Definition at line 514 of file cityhand.cpp.

◆ handle_city_refresh()

void handle_city_refresh ( struct player pplayer,
int  city_id 
)

Handle city refresh request.

Definition at line 404 of file cityhand.cpp.

◆ handle_city_rename()

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

'struct packet_city_rename' handler.

Definition at line 472 of file cityhand.cpp.

◆ 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 263 of file cityhand.cpp.

◆ 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 372 of file cityhand.cpp.

◆ 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 278 of file cityhand.cpp.

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 225 of file cityhand.cpp.

Referenced by handle_city_sell(), and try_to_sell_stuff().