Freeciv-3.1: /fast/freeciv/nightly/S3_1/server/cityhand.c File Reference

Freeciv-3.1

Loading...
Searching...
No Matches
Functions
cityhand.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include "capability.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_id16, int unit_id32)
void | handle_city_change_specialist (struct player *pplayer, int city_id16, int city_id32, Specialist_type_id from, Specialist_type_id to)
void | handle_city_make_specialist (struct player *pplayer, int city_id16, int city_id32, int tile_id)
void | handle_city_make_worker (struct player *pplayer, int city_id16, int city_id32, 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_id16, int city_id32, int build_id)
void | really_handle_city_buy (struct player *pplayer, struct city *pcity)
void | handle_city_worklist (struct player *pplayer, int city_id16, int city_id32, const struct worklist *worklist)
void | handle_city_buy (struct player *pplayer, int city_id16, int city_id32)
void | handle_city_refresh (struct player *pplayer, int city_id16, int city_id32)
void | handle_city_change (struct player *pplayer, int city_id16, int city_id32, int production_kind, int production_value)
void | handle_city_rename (struct player *pplayer, int city_id16, int city_id32, const char *name)
void | handle_city_options_req (struct player *pplayer, int city_id16, int city_id32, bv_city_options options)
void | handle_city_rally_point (struct player *pplayer, const struct packet_city_rally_point *packet)

## Function Documentation

## ◆ handle_city_buy()

void handle_city_buy | ( | struct player * | pplayer,
|  | int | city_id16,
|  | int | city_id32
| ) |  |

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

Definition at line 435 of file cityhand.c.

Referenced by server_handle_packet().

## ◆ handle_city_change()

void handle_city_change | ( | struct player * | pplayer,
|  | int | city_id16,
|  | int | city_id32,
|  | int | production_kind,
|  | int | production_value
| ) |  |

Handle request to change current production.

Definition at line 478 of file cityhand.c.

Referenced by server_handle_packet().

## ◆ handle_city_change_specialist()

void handle_city_change_specialist | ( | struct player * | pplayer,
|  | int | city_id16,
|  | int | city_id32,
|  | Specialist_type_id | from,
|  | Specialist_type_id | to
| ) |  |

Handle request to change specialist type

Definition at line 100 of file cityhand.c.

Referenced by server_handle_packet().

## ◆ handle_city_make_specialist()

void handle_city_make_specialist | ( | struct player * | pplayer,
|  | int | city_id16,
|  | int | city_id32,
|  | int | tile_id
| ) |  |

Handle request to change city worker in to specialist.

Definition at line 138 of file cityhand.c.

Referenced by server_handle_packet().

## ◆ handle_city_make_worker()

void handle_city_make_worker | ( | struct player * | pplayer,
|  | int | city_id16,
|  | int | city_id32,
|  | 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 189 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_id16,
|  | int | unit_id32
| ) |  |

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 60 of file cityhand.c.

Referenced by server_handle_packet().

## ◆ handle_city_options_req()

void handle_city_options_req | ( | struct player * | pplayer,
|  | int | city_id16,
|  | int | city_id32,
|  | bv_city_options | options
| ) |  |

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

Definition at line 564 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 588 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_id16,
|  | int | city_id32
| ) |  |

Handle city refresh request

Definition at line 455 of file cityhand.c.

Referenced by server_handle_packet().

## ◆ handle_city_rename()

void handle_city_rename | ( | struct player * | pplayer,
|  | int | city_id16,
|  | int | city_id32,
|  | const char * | name
| ) |  |

Handle city rename request packet.

Definition at line 533 of file cityhand.c.

Referenced by server_handle_packet().

## ◆ handle_city_sell()

void handle_city_sell | ( | struct player * | pplayer,
|  | int | city_id16,
|  | int | city_id32,
|  | 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 298 of file cityhand.c.

Referenced by server_handle_packet().

## ◆ handle_city_worklist()

void handle_city_worklist | ( | struct player * | pplayer,
|  | int | city_id16,
|  | int | city_id32,
|  | const struct worklist * | worklist
| ) |  |

Handle city worklist update request

Definition at line 411 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 321 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 260 of file cityhand.c.

Referenced by handle_city_sell(), and try_to_sell_stuff().