Freeciv-3.3
Loading...
Searching...
No Matches
hand_gen.c
Go to the documentation of this file.
1 /**************************************************************************
2 * THIS FILE WAS GENERATED *
3 * Script: common/generate_packets.py *
4 * Input: common/networking/packets.def *
5 * DO NOT CHANGE THIS FILE *
6 **************************************************************************/
7
8#ifdef HAVE_CONFIG_H
9#include <fc_config.h>
10#endif
11
12/* common */
13#include "packets.h"
14
15#include "hand_gen.h"
16
17bool server_handle_packet(enum packet_type type, const void *packet,
18 struct player *pplayer, struct connection *pconn)
19{
20 switch (type) {
23 ((const struct packet_nation_select_req *)packet)->player_no,
24 ((const struct packet_nation_select_req *)packet)->nation_no,
25 ((const struct packet_nation_select_req *)packet)->is_male,
26 ((const struct packet_nation_select_req *)packet)->name,
27 ((const struct packet_nation_select_req *)packet)->style);
28 return TRUE;
29
31 handle_player_ready(pplayer,
32 ((const struct packet_player_ready *)packet)->player_no,
33 ((const struct packet_player_ready *)packet)->is_ready);
34 return TRUE;
35
38 ((const struct packet_chat_msg_req *)packet)->message);
39 return TRUE;
40
42 handle_city_sell(pplayer,
43 ((const struct packet_city_sell *)packet)->city_id,
44 ((const struct packet_city_sell *)packet)->build_id);
45 return TRUE;
46
47 case PACKET_CITY_BUY:
48 handle_city_buy(pplayer,
49 ((const struct packet_city_buy *)packet)->city_id);
50 return TRUE;
51
53 handle_city_change(pplayer,
54 ((const struct packet_city_change *)packet)->city_id,
55 ((const struct packet_city_change *)packet)->production_kind,
56 ((const struct packet_city_change *)packet)->production_value);
57 return TRUE;
58
61 ((const struct packet_city_worklist *)packet)->city_id,
62 &((const struct packet_city_worklist *)packet)->worklist);
63 return TRUE;
64
67 ((const struct packet_city_make_specialist *)packet)->city_id,
68 ((const struct packet_city_make_specialist *)packet)->tile_id);
69 return TRUE;
70
73 ((const struct packet_city_make_worker *)packet)->city_id,
74 ((const struct packet_city_make_worker *)packet)->tile_id);
75 return TRUE;
76
79 ((const struct packet_city_change_specialist *)packet)->city_id,
80 ((const struct packet_city_change_specialist *)packet)->from,
81 ((const struct packet_city_change_specialist *)packet)->to);
82 return TRUE;
83
85 handle_city_rename(pplayer,
86 ((const struct packet_city_rename *)packet)->city_id,
87 ((const struct packet_city_rename *)packet)->name);
88 return TRUE;
89
92 ((const struct packet_city_options_req *)packet)->city_id,
93 ((const struct packet_city_options_req *)packet)->options);
94 return TRUE;
95
97 handle_city_refresh(pplayer,
98 ((const struct packet_city_refresh *)packet)->city_id);
99 return TRUE;
100
103 ((const struct packet_city_name_suggestion_req *)packet)->unit_id);
104 return TRUE;
105
107 handle_city_rally_point(pplayer, packet);
108 return TRUE;
109
111 handle_worker_task(pplayer, packet);
112 return TRUE;
113
116 ((const struct packet_player_phase_done *)packet)->turn);
117 return TRUE;
118
120 handle_player_rates(pplayer,
121 ((const struct packet_player_rates *)packet)->tax,
122 ((const struct packet_player_rates *)packet)->luxury,
123 ((const struct packet_player_rates *)packet)->science);
124 return TRUE;
125
128 ((const struct packet_player_change_government *)packet)->government);
129 return TRUE;
130
133 ((const struct packet_player_place_infra *)packet)->tile,
134 ((const struct packet_player_place_infra *)packet)->extra);
135 return TRUE;
136
139 return TRUE;
140
142 handle_player_attribute_chunk(pplayer, packet);
143 return TRUE;
144
147 ((const struct packet_player_multiplier *)packet)->count,
148 ((const struct packet_player_multiplier *)packet)->multipliers);
149 return TRUE;
150
153 ((const struct packet_player_research *)packet)->tech);
154 return TRUE;
155
158 ((const struct packet_player_tech_goal *)packet)->tech);
159 return TRUE;
160
162 handle_unit_sscs_set(pplayer,
163 ((const struct packet_unit_sscs_set *)packet)->unit_id,
164 ((const struct packet_unit_sscs_set *)packet)->type,
165 ((const struct packet_unit_sscs_set *)packet)->value);
166 return TRUE;
167
169 handle_unit_orders(pplayer, packet);
170 return TRUE;
171
174 ((const struct packet_unit_server_side_agent_set *)packet)->unit_id,
175 ((const struct packet_unit_server_side_agent_set *)packet)->agent);
176 return TRUE;
177
180 ((const struct packet_unit_action_query *)packet)->actor_id,
181 ((const struct packet_unit_action_query *)packet)->target_id,
182 ((const struct packet_unit_action_query *)packet)->action_type,
183 ((const struct packet_unit_action_query *)packet)->request_kind);
184 return TRUE;
185
188 ((const struct packet_unit_type_upgrade *)packet)->type);
189 return TRUE;
190
192 handle_unit_do_action(pplayer,
193 ((const struct packet_unit_do_action *)packet)->actor_id,
194 ((const struct packet_unit_do_action *)packet)->target_id,
195 ((const struct packet_unit_do_action *)packet)->sub_tgt_id,
196 ((const struct packet_unit_do_action *)packet)->name,
197 ((const struct packet_unit_do_action *)packet)->action_type);
198 return TRUE;
199
202 ((const struct packet_unit_get_actions *)packet)->actor_unit_id,
203 ((const struct packet_unit_get_actions *)packet)->target_unit_id,
204 ((const struct packet_unit_get_actions *)packet)->target_tile_id,
205 ((const struct packet_unit_get_actions *)packet)->target_extra_id,
206 ((const struct packet_unit_get_actions *)packet)->request_kind);
207 return TRUE;
208
211 ((const struct packet_unit_change_activity *)packet)->unit_id,
212 ((const struct packet_unit_change_activity *)packet)->activity,
213 ((const struct packet_unit_change_activity *)packet)->target);
214 return TRUE;
215
218 ((const struct packet_diplomacy_init_meeting_req *)packet)->counterpart);
219 return TRUE;
220
223 ((const struct packet_diplomacy_cancel_meeting_req *)packet)->counterpart);
224 return TRUE;
225
228 ((const struct packet_diplomacy_create_clause_req *)packet)->counterpart,
229 ((const struct packet_diplomacy_create_clause_req *)packet)->giver,
230 ((const struct packet_diplomacy_create_clause_req *)packet)->type,
231 ((const struct packet_diplomacy_create_clause_req *)packet)->value);
232 return TRUE;
233
236 ((const struct packet_diplomacy_remove_clause_req *)packet)->counterpart,
237 ((const struct packet_diplomacy_remove_clause_req *)packet)->giver,
238 ((const struct packet_diplomacy_remove_clause_req *)packet)->type,
239 ((const struct packet_diplomacy_remove_clause_req *)packet)->value);
240 return TRUE;
241
244 ((const struct packet_diplomacy_accept_treaty_req *)packet)->counterpart);
245 return TRUE;
246
249 ((const struct packet_diplomacy_cancel_pact *)packet)->other_player_id,
250 ((const struct packet_diplomacy_cancel_pact *)packet)->clause);
251 return TRUE;
252
255 ((const struct packet_report_req *)packet)->type);
256 return TRUE;
257
258 case PACKET_CONN_PONG:
260 return TRUE;
261
264 return TRUE;
265
268 ((const struct packet_client_info *)packet)->gui,
269 ((const struct packet_client_info *)packet)->emerg_version,
270 ((const struct packet_client_info *)packet)->distribution);
271 return TRUE;
272
275 return TRUE;
276
279 ((const struct packet_spaceship_place *)packet)->type,
280 ((const struct packet_spaceship_place *)packet)->num);
281 return TRUE;
282
285 return TRUE;
286
289 return TRUE;
290
293 ((const struct packet_save_scenario *)packet)->name);
294 return TRUE;
295
298 ((const struct packet_vote_submit *)packet)->vote_no,
299 ((const struct packet_vote_submit *)packet)->value);
300 return TRUE;
301
302 case PACKET_EDIT_MODE:
304 ((const struct packet_edit_mode *)packet)->state);
305 return TRUE;
306
309 return TRUE;
310
313 return TRUE;
314
317 ((const struct packet_edit_toggle_fogofwar *)packet)->player);
318 return TRUE;
319
322 ((const struct packet_edit_tile_terrain *)packet)->tile,
323 ((const struct packet_edit_tile_terrain *)packet)->terrain,
324 ((const struct packet_edit_tile_terrain *)packet)->size);
325 return TRUE;
326
329 ((const struct packet_edit_tile_extra *)packet)->tile,
330 ((const struct packet_edit_tile_extra *)packet)->extra_type_id,
331 ((const struct packet_edit_tile_extra *)packet)->removal,
332 ((const struct packet_edit_tile_extra *)packet)->eowner,
333 ((const struct packet_edit_tile_extra *)packet)->size);
334 return TRUE;
335
338 return TRUE;
339
342 return TRUE;
343
344 case PACKET_EDIT_TILE:
345 handle_edit_tile(pconn, packet);
346 return TRUE;
347
350 ((const struct packet_edit_unit_create *)packet)->owner,
351 ((const struct packet_edit_unit_create *)packet)->tile,
352 ((const struct packet_edit_unit_create *)packet)->type,
353 ((const struct packet_edit_unit_create *)packet)->count,
354 ((const struct packet_edit_unit_create *)packet)->tag);
355 return TRUE;
356
359 ((const struct packet_edit_unit_remove *)packet)->owner,
360 ((const struct packet_edit_unit_remove *)packet)->tile,
361 ((const struct packet_edit_unit_remove *)packet)->type,
362 ((const struct packet_edit_unit_remove *)packet)->count);
363 return TRUE;
364
367 ((const struct packet_edit_unit_remove_by_id *)packet)->id);
368 return TRUE;
369
370 case PACKET_EDIT_UNIT:
371 handle_edit_unit(pconn, packet);
372 return TRUE;
373
376 ((const struct packet_edit_city_create *)packet)->owner,
377 ((const struct packet_edit_city_create *)packet)->tile,
378 ((const struct packet_edit_city_create *)packet)->size,
379 ((const struct packet_edit_city_create *)packet)->tag);
380 return TRUE;
381
384 ((const struct packet_edit_city_remove *)packet)->id);
385 return TRUE;
386
387 case PACKET_EDIT_CITY:
388 handle_edit_city(pconn, packet);
389 return TRUE;
390
393 ((const struct packet_edit_player_create *)packet)->tag);
394 return TRUE;
395
398 ((const struct packet_edit_player_remove *)packet)->id);
399 return TRUE;
400
402 handle_edit_player(pconn, packet);
403 return TRUE;
404
407 ((const struct packet_edit_player_vision *)packet)->player,
408 ((const struct packet_edit_player_vision *)packet)->tile,
409 ((const struct packet_edit_player_vision *)packet)->known,
410 ((const struct packet_edit_player_vision *)packet)->size);
411 return TRUE;
412
413 case PACKET_EDIT_GAME:
414 handle_edit_game(pconn, packet);
415 return TRUE;
416
419 ((const struct packet_edit_scenario_desc *)packet)->scenario_desc);
420 return TRUE;
421
423 handle_web_cma_set(pplayer,
424 ((const struct packet_web_cma_set *)packet)->id,
425 &((const struct packet_web_cma_set *)packet)->cm_parameter);
426 return TRUE;
427
429 handle_web_cma_clear(pplayer,
430 ((const struct packet_web_cma_clear *)packet)->id);
431 return TRUE;
432
433 default:
434 return FALSE;
435 }
436}
void handle_city_change(struct player *pplayer, int city_id, int production_kind, int production_value)
Definition cityhand.c:434
void handle_city_options_req(struct player *pplayer, int city_id, bv_city_options options)
Definition cityhand.c:508
void handle_city_rally_point(struct player *pplayer, const struct packet_city_rally_point *packet)
Definition cityhand.c:525
void handle_city_name_suggestion_req(struct player *pplayer, int unit_id)
Definition cityhand.c:59
void handle_city_worklist(struct player *pplayer, int city_id, const struct worklist *worklist)
Definition cityhand.c:383
void handle_city_buy(struct player *pplayer, int city_id)
Definition cityhand.c:401
void handle_city_change_specialist(struct player *pplayer, int city_id, Specialist_type_id from, Specialist_type_id to)
Definition cityhand.c:91
void handle_web_cma_set(struct player *pplayer, int id, const struct cm_parameter *param)
Definition cityhand.c:539
void handle_city_sell(struct player *pplayer, int city_id, int build_id)
Definition cityhand.c:278
void handle_city_make_worker(struct player *pplayer, int city_id, int tile_id)
Definition cityhand.c:169
void handle_city_refresh(struct player *pplayer, int city_id)
Definition cityhand.c:415
void handle_city_make_specialist(struct player *pplayer, int city_id, int tile_id)
Definition cityhand.c:122
void handle_city_rename(struct player *pplayer, int city_id, const char *name)
Definition cityhand.c:483
void handle_web_cma_clear(struct player *pplayer, int id)
Definition cityhand.c:567
char * incite_cost
Definition comments.c:74
void handle_diplomacy_remove_clause_req(struct player *pplayer, int counterpart, int giver, enum clause_type type, int value)
Definition diplhand.c:720
void handle_diplomacy_create_clause_req(struct player *pplayer, int counterpart, int giver, enum clause_type type, int value)
Definition diplhand.c:753
void handle_diplomacy_init_meeting_req(struct player *pplayer, int counterpart)
Definition diplhand.c:845
void handle_diplomacy_cancel_meeting_req(struct player *pplayer, int counterpart)
Definition diplhand.c:830
void handle_diplomacy_accept_treaty_req(struct player *pplayer, int counterpart)
Definition diplhand.c:147
void handle_edit_unit_remove_by_id(struct connection *pc, Unit_type_id id)
Definition edithand.c:594
void handle_edit_tile(struct connection *pc, const struct packet_edit_tile *packet)
Definition edithand.c:375
void handle_edit_scenario_desc(struct connection *pc, const char *scenario_desc)
Definition edithand.c:1487
void handle_edit_check_tiles(struct connection *pc)
Definition edithand.c:1305
void handle_edit_mode(struct connection *pc, bool is_edit_mode)
Definition edithand.c:188
void handle_edit_tile_terrain(struct connection *pc, int tile, Terrain_type_id terrain, int size)
Definition edithand.c:298
void handle_edit_player(struct connection *pc, const struct packet_edit_player *packet)
Definition edithand.c:1006
void handle_edit_player_remove(struct connection *pc, int id)
Definition edithand.c:982
void handle_edit_city_remove(struct connection *pc, int id)
Definition edithand.c:1288
void handle_edit_player_vision(struct connection *pc, int plr_no, int tile, bool known, int size)
Definition edithand.c:1208
void handle_edit_city(struct connection *pc, const struct packet_edit_city *packet)
Definition edithand.c:743
void handle_edit_city_create(struct connection *pc, int owner, int tile, int size, int tag)
Definition edithand.c:687
void handle_edit_game(struct connection *pc, const struct packet_edit_game *packet)
Definition edithand.c:1424
void handle_edit_unit_remove(struct connection *pc, int owner, int tile, Unit_type_id utid, int count)
Definition edithand.c:539
void handle_edit_toggle_fogofwar(struct connection *pc, int plr_no)
Definition edithand.c:1315
void handle_edit_startpos_full(struct connection *pconn, const struct packet_edit_startpos_full *packet)
Definition edithand.c:1386
void handle_edit_player_create(struct connection *pc, int tag)
Definition edithand.c:903
void handle_edit_recalculate_borders(struct connection *pc)
Definition edithand.c:1280
void handle_save_scenario(struct connection *pc, const char *name)
Definition edithand.c:1499
void handle_edit_tile_extra(struct connection *pc, int tile, int id, bool removal, int eowner, int size)
Definition edithand.c:335
void handle_edit_unit_create(struct connection *pc, int owner, int tile, Unit_type_id utid, int count, int tag)
Definition edithand.c:433
void handle_edit_unit(struct connection *pc, const struct packet_edit_unit *packet)
Definition edithand.c:611
void handle_edit_startpos(struct connection *pconn, const struct packet_edit_startpos *packet)
Definition edithand.c:1348
void handle_single_want_hack_req(struct connection *pc, const struct packet_single_want_hack_req *packet)
Definition gamehand.c:1237
void handle_ruleset_select(struct connection *pc, const struct packet_ruleset_select *packet)
Definition gamehand.c:1186
static int actor_unit_id
static int target_extra_id
struct city * owner
Definition citydlg.c:226
GType type
Definition repodlgs.c:1313
bool server_handle_packet(enum packet_type type, const void *packet, struct player *pplayer, struct connection *pconn)
Definition hand_gen.c:17
void handle_player_phase_done(struct player *pplayer, int turn)
Definition plrhand.c:3183
void handle_player_multiplier(struct player *pplayer, int count, const int *multipliers)
Definition plrhand.c:3399
void handle_client_heartbeat(struct connection *pc)
Definition sernet.c:1461
void handle_nation_select_req(struct connection *pc, int player_no, Nation_type_id nation_no, bool is_male, const char *name, int style)
Definition srv_main.c:2369
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)
Definition unithand.c:2250
void handle_unit_type_upgrade(struct player *pplayer, Unit_type_id type)
Definition unithand.c:187
void handle_unit_orders(struct player *pplayer, const struct packet_unit_orders *packet)
Definition unithand.c:6763
void handle_report_req(struct connection *pc, enum report_type type)
Definition srv_main.c:1988
void handle_client_info(struct connection *pc, enum gui_type gui, int emerg_version, const char *distribution)
Definition srv_main.c:315
void handle_worker_task(struct player *pplayer, const struct packet_worker_task *packet)
Definition unithand.c:6872
void handle_player_tech_goal(struct player *pplayer, int tech)
Definition techtools.c:1361
void handle_unit_change_activity(struct player *pplayer, int unit_id, enum unit_activity activity, int target)
Definition unithand.c:4338
void handle_player_place_infra(struct player *pplayer, int tile, int extra)
Definition infrapts.c:29
void handle_player_attribute_block(struct player *pplayer)
Definition plrhand.c:3175
void handle_unit_action_query(struct connection *pc, int actor_id, int target_id, action_id action_type, int request_kind)
Definition unithand.c:3186
void handle_player_ready(struct player *pplayer, int player_no, bool is_ready)
Definition srv_main.c:2451
void handle_chat_msg_req(struct connection *pc, const char *message)
Definition handchat.c:320
void handle_player_research(struct player *pplayer, int tech)
Definition techtools.c:1338
void handle_unit_server_side_agent_set(struct player *pplayer, int unit_id, enum server_side_agent agent)
Definition unithand.c:6464
void handle_player_change_government(struct player *pplayer, Government_type_id government)
Definition plrhand.c:565
void handle_spaceship_place(struct player *pplayer, enum spaceship_place_type type, int num)
Definition spacerace.c:206
void handle_conn_pong(struct connection *pc)
Definition sernet.c:1441
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)
Definition unithand.c:3301
void handle_diplomacy_cancel_pact(struct player *pplayer, int other_player_id, enum clause_type clause)
Definition plrhand.c:880
void handle_player_attribute_chunk(struct player *pplayer, const struct packet_player_attribute_chunk *packet)
Definition plrhand.c:3165
void handle_spaceship_launch(struct player *pplayer)
Definition spacerace.c:167
void handle_player_rates(struct player *pplayer, int tax, int luxury, int science)
Definition plrhand.c:285
void handle_unit_sscs_set(struct player *pplayer, int unit_id, enum unit_ss_data_type type, int value)
Definition unithand.c:6357
void handle_vote_submit(struct connection *pc, int vote_no, int value)
Definition voting.c:775
const char * name
Definition inputfile.c:127
static mpgui * gui
Definition mpgui_qt.cpp:52
static struct multiplier multipliers[MAX_NUM_MULTIPLIERS]
Definition multipliers.c:23
packet_type
@ PACKET_PLAYER_MULTIPLIER
@ PACKET_PLAYER_CHANGE_GOVERNMENT
@ PACKET_SAVE_SCENARIO
@ PACKET_EDIT_TOGGLE_FOGOFWAR
@ PACKET_WEB_CMA_SET
@ PACKET_EDIT_MODE
@ PACKET_EDIT_PLAYER
@ PACKET_DIPLOMACY_CANCEL_MEETING_REQ
@ PACKET_CITY_MAKE_WORKER
@ PACKET_CITY_OPTIONS_REQ
@ PACKET_CITY_CHANGE
@ PACKET_UNIT_SSCS_SET
@ PACKET_UNIT_DO_ACTION
@ PACKET_EDIT_PLAYER_CREATE
@ PACKET_EDIT_GAME
@ PACKET_EDIT_TILE_EXTRA
@ PACKET_SPACESHIP_PLACE
@ PACKET_NATION_SELECT_REQ
@ PACKET_REPORT_REQ
@ PACKET_EDIT_CITY_CREATE
@ PACKET_DIPLOMACY_INIT_MEETING_REQ
@ PACKET_PLAYER_ATTRIBUTE_BLOCK
@ PACKET_CITY_SELL
@ PACKET_CITY_NAME_SUGGESTION_REQ
@ PACKET_CHAT_MSG_REQ
@ PACKET_CLIENT_HEARTBEAT
@ PACKET_DIPLOMACY_CREATE_CLAUSE_REQ
@ PACKET_CITY_BUY
@ PACKET_EDIT_CITY_REMOVE
@ PACKET_EDIT_STARTPOS
@ PACKET_PLAYER_RESEARCH
@ PACKET_PLAYER_PHASE_DONE
@ PACKET_RULESET_SELECT
@ PACKET_CLIENT_INFO
@ PACKET_CITY_WORKLIST
@ PACKET_UNIT_TYPE_UPGRADE
@ PACKET_UNIT_GET_ACTIONS
@ PACKET_PLAYER_ATTRIBUTE_CHUNK
@ PACKET_CITY_MAKE_SPECIALIST
@ PACKET_SINGLE_WANT_HACK_REQ
@ PACKET_PLAYER_PLACE_INFRA
@ PACKET_EDIT_PLAYER_REMOVE
@ PACKET_EDIT_TILE_TERRAIN
@ PACKET_UNIT_ACTION_QUERY
@ PACKET_EDIT_SCENARIO_DESC
@ PACKET_EDIT_UNIT_CREATE
@ PACKET_UNIT_CHANGE_ACTIVITY
@ PACKET_EDIT_UNIT_REMOVE
@ PACKET_VOTE_SUBMIT
@ PACKET_WEB_CMA_CLEAR
@ PACKET_EDIT_PLAYER_VISION
@ PACKET_EDIT_CHECK_TILES
@ PACKET_CITY_CHANGE_SPECIALIST
@ PACKET_CITY_REFRESH
@ PACKET_EDIT_TILE
@ PACKET_PLAYER_READY
@ PACKET_EDIT_UNIT
@ PACKET_CONN_PONG
@ PACKET_EDIT_RECALCULATE_BORDERS
@ PACKET_EDIT_CITY
@ PACKET_PLAYER_TECH_GOAL
@ PACKET_CITY_RALLY_POINT
@ PACKET_UNIT_SERVER_SIDE_AGENT_SET
@ PACKET_SPACESHIP_LAUNCH
@ PACKET_DIPLOMACY_REMOVE_CLAUSE_REQ
@ PACKET_DIPLOMACY_ACCEPT_TREATY_REQ
@ PACKET_UNIT_ORDERS
@ PACKET_EDIT_UNIT_REMOVE_BY_ID
@ PACKET_EDIT_STARTPOS_FULL
@ PACKET_DIPLOMACY_CANCEL_PACT
@ PACKET_PLAYER_RATES
@ PACKET_CITY_RENAME
@ PACKET_WORKER_TASK
size_t size
Definition specvec.h:72
Definition agents.h:40
Definition tile.h:50
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47