Freeciv-3.2
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 ((const struct packet_city_options_req *)packet)->wl_cb);
95 return TRUE;
96
98 handle_city_refresh(pplayer,
99 ((const struct packet_city_refresh *)packet)->city_id);
100 return TRUE;
101
104 ((const struct packet_city_name_suggestion_req *)packet)->unit_id);
105 return TRUE;
106
108 handle_city_rally_point(pplayer, packet);
109 return TRUE;
110
112 handle_worker_task(pplayer, packet);
113 return TRUE;
114
117 ((const struct packet_player_phase_done *)packet)->turn);
118 return TRUE;
119
121 handle_player_rates(pplayer,
122 ((const struct packet_player_rates *)packet)->tax,
123 ((const struct packet_player_rates *)packet)->luxury,
124 ((const struct packet_player_rates *)packet)->science);
125 return TRUE;
126
129 ((const struct packet_player_change_government *)packet)->government);
130 return TRUE;
131
134 ((const struct packet_player_place_infra *)packet)->tile,
135 ((const struct packet_player_place_infra *)packet)->extra);
136 return TRUE;
137
140 return TRUE;
141
143 handle_player_attribute_chunk(pplayer, packet);
144 return TRUE;
145
148 ((const struct packet_player_multiplier *)packet)->count,
149 ((const struct packet_player_multiplier *)packet)->multipliers);
150 return TRUE;
151
154 ((const struct packet_player_research *)packet)->tech);
155 return TRUE;
156
159 ((const struct packet_player_tech_goal *)packet)->tech);
160 return TRUE;
161
163 handle_unit_sscs_set(pplayer,
164 ((const struct packet_unit_sscs_set *)packet)->unit_id,
165 ((const struct packet_unit_sscs_set *)packet)->type,
166 ((const struct packet_unit_sscs_set *)packet)->value);
167 return TRUE;
168
170 handle_unit_orders(pplayer, packet);
171 return TRUE;
172
175 ((const struct packet_unit_server_side_agent_set *)packet)->unit_id,
176 ((const struct packet_unit_server_side_agent_set *)packet)->agent);
177 return TRUE;
178
181 ((const struct packet_unit_action_query *)packet)->actor_id,
182 ((const struct packet_unit_action_query *)packet)->target_id,
183 ((const struct packet_unit_action_query *)packet)->action_type,
184 ((const struct packet_unit_action_query *)packet)->request_kind);
185 return TRUE;
186
189 ((const struct packet_unit_type_upgrade *)packet)->type);
190 return TRUE;
191
193 handle_unit_do_action(pplayer,
194 ((const struct packet_unit_do_action *)packet)->actor_id,
195 ((const struct packet_unit_do_action *)packet)->target_id,
196 ((const struct packet_unit_do_action *)packet)->sub_tgt_id,
197 ((const struct packet_unit_do_action *)packet)->name,
198 ((const struct packet_unit_do_action *)packet)->action_type);
199 return TRUE;
200
203 ((const struct packet_unit_get_actions *)packet)->actor_unit_id,
204 ((const struct packet_unit_get_actions *)packet)->target_unit_id,
205 ((const struct packet_unit_get_actions *)packet)->target_tile_id,
206 ((const struct packet_unit_get_actions *)packet)->target_extra_id,
207 ((const struct packet_unit_get_actions *)packet)->request_kind);
208 return TRUE;
209
212 ((const struct packet_unit_change_activity *)packet)->unit_id,
213 ((const struct packet_unit_change_activity *)packet)->activity,
214 ((const struct packet_unit_change_activity *)packet)->target);
215 return TRUE;
216
219 ((const struct packet_diplomacy_init_meeting_req *)packet)->counterpart);
220 return TRUE;
221
224 ((const struct packet_diplomacy_cancel_meeting_req *)packet)->counterpart);
225 return TRUE;
226
229 ((const struct packet_diplomacy_create_clause_req *)packet)->counterpart,
230 ((const struct packet_diplomacy_create_clause_req *)packet)->giver,
231 ((const struct packet_diplomacy_create_clause_req *)packet)->type,
232 ((const struct packet_diplomacy_create_clause_req *)packet)->value);
233 return TRUE;
234
237 ((const struct packet_diplomacy_remove_clause_req *)packet)->counterpart,
238 ((const struct packet_diplomacy_remove_clause_req *)packet)->giver,
239 ((const struct packet_diplomacy_remove_clause_req *)packet)->type,
240 ((const struct packet_diplomacy_remove_clause_req *)packet)->value);
241 return TRUE;
242
245 ((const struct packet_diplomacy_accept_treaty_req *)packet)->counterpart);
246 return TRUE;
247
250 ((const struct packet_diplomacy_cancel_pact *)packet)->other_player_id,
251 ((const struct packet_diplomacy_cancel_pact *)packet)->clause);
252 return TRUE;
253
256 ((const struct packet_report_req *)packet)->type);
257 return TRUE;
258
259 case PACKET_CONN_PONG:
261 return TRUE;
262
265 return TRUE;
266
269 ((const struct packet_client_info *)packet)->gui,
270 ((const struct packet_client_info *)packet)->emerg_version,
271 ((const struct packet_client_info *)packet)->distribution);
272 return TRUE;
273
276 return TRUE;
277
280 ((const struct packet_spaceship_place *)packet)->type,
281 ((const struct packet_spaceship_place *)packet)->num);
282 return TRUE;
283
286 return TRUE;
287
290 return TRUE;
291
294 ((const struct packet_save_scenario *)packet)->name);
295 return TRUE;
296
299 ((const struct packet_vote_submit *)packet)->vote_no,
300 ((const struct packet_vote_submit *)packet)->value);
301 return TRUE;
302
303 case PACKET_EDIT_MODE:
305 ((const struct packet_edit_mode *)packet)->state);
306 return TRUE;
307
310 return TRUE;
311
314 return TRUE;
315
318 ((const struct packet_edit_toggle_fogofwar *)packet)->player);
319 return TRUE;
320
323 ((const struct packet_edit_tile_terrain *)packet)->tile,
324 ((const struct packet_edit_tile_terrain *)packet)->terrain,
325 ((const struct packet_edit_tile_terrain *)packet)->size);
326 return TRUE;
327
330 ((const struct packet_edit_tile_extra *)packet)->tile,
331 ((const struct packet_edit_tile_extra *)packet)->extra_type_id,
332 ((const struct packet_edit_tile_extra *)packet)->removal,
333 ((const struct packet_edit_tile_extra *)packet)->eowner,
334 ((const struct packet_edit_tile_extra *)packet)->size);
335 return TRUE;
336
339 return TRUE;
340
343 return TRUE;
344
345 case PACKET_EDIT_TILE:
346 handle_edit_tile(pconn, packet);
347 return TRUE;
348
351 ((const struct packet_edit_unit_create *)packet)->owner,
352 ((const struct packet_edit_unit_create *)packet)->tile,
353 ((const struct packet_edit_unit_create *)packet)->type,
354 ((const struct packet_edit_unit_create *)packet)->count,
355 ((const struct packet_edit_unit_create *)packet)->tag);
356 return TRUE;
357
360 ((const struct packet_edit_unit_remove *)packet)->owner,
361 ((const struct packet_edit_unit_remove *)packet)->tile,
362 ((const struct packet_edit_unit_remove *)packet)->type,
363 ((const struct packet_edit_unit_remove *)packet)->count);
364 return TRUE;
365
368 ((const struct packet_edit_unit_remove_by_id *)packet)->id);
369 return TRUE;
370
371 case PACKET_EDIT_UNIT:
372 handle_edit_unit(pconn, packet);
373 return TRUE;
374
377 ((const struct packet_edit_city_create *)packet)->owner,
378 ((const struct packet_edit_city_create *)packet)->tile,
379 ((const struct packet_edit_city_create *)packet)->size,
380 ((const struct packet_edit_city_create *)packet)->tag);
381 return TRUE;
382
385 ((const struct packet_edit_city_remove *)packet)->id);
386 return TRUE;
387
388 case PACKET_EDIT_CITY:
389 handle_edit_city(pconn, packet);
390 return TRUE;
391
394 ((const struct packet_edit_player_create *)packet)->tag);
395 return TRUE;
396
399 ((const struct packet_edit_player_remove *)packet)->id);
400 return TRUE;
401
403 handle_edit_player(pconn, packet);
404 return TRUE;
405
408 ((const struct packet_edit_player_vision *)packet)->player,
409 ((const struct packet_edit_player_vision *)packet)->tile,
410 ((const struct packet_edit_player_vision *)packet)->known,
411 ((const struct packet_edit_player_vision *)packet)->size);
412 return TRUE;
413
414 case PACKET_EDIT_GAME:
415 handle_edit_game(pconn, packet);
416 return TRUE;
417
420 ((const struct packet_edit_scenario_desc *)packet)->scenario_desc);
421 return TRUE;
422
425 ((const struct packet_sync_serial *)packet)->serial);
426 return TRUE;
427
429 handle_web_cma_set(pplayer,
430 ((const struct packet_web_cma_set *)packet)->id,
431 &((const struct packet_web_cma_set *)packet)->cm_parameter);
432 return TRUE;
433
435 handle_web_cma_clear(pplayer,
436 ((const struct packet_web_cma_clear *)packet)->id);
437 return TRUE;
438
439 default:
440 return FALSE;
441 }
442}
void handle_city_change(struct player *pplayer, int city_id, int production_kind, int production_value)
Definition cityhand.c:435
void handle_city_rally_point(struct player *pplayer, const struct packet_city_rally_point *packet)
Definition cityhand.c:529
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:384
void handle_city_buy(struct player *pplayer, int city_id)
Definition cityhand.c:402
void handle_city_change_specialist(struct player *pplayer, int city_id, Specialist_type_id from, Specialist_type_id to)
Definition cityhand.c:92
void handle_web_cma_set(struct player *pplayer, int id, const struct cm_parameter *param)
Definition cityhand.c:543
void handle_city_sell(struct player *pplayer, int city_id, int build_id)
Definition cityhand.c:279
void handle_city_make_worker(struct player *pplayer, int city_id, int tile_id)
Definition cityhand.c:170
void handle_city_options_req(struct player *pplayer, int city_id, bv_city_options options, enum city_wl_cancel_behavior wlcb)
Definition cityhand.c:510
void handle_city_refresh(struct player *pplayer, int city_id)
Definition cityhand.c:416
void handle_city_make_specialist(struct player *pplayer, int city_id, int tile_id)
Definition cityhand.c:123
void handle_city_rename(struct player *pplayer, int city_id, const char *name)
Definition cityhand.c:485
void handle_web_cma_clear(struct player *pplayer, int id)
Definition cityhand.c:571
char * incite_cost
Definition comments.c:75
void handle_sync_serial(struct connection *conn, int serial)
void handle_diplomacy_remove_clause_req(struct player *pplayer, int counterpart, int giver, enum clause_type type, int value)
Definition diplhand.c:723
void handle_diplomacy_create_clause_req(struct player *pplayer, int counterpart, int giver, enum clause_type type, int value)
Definition diplhand.c:756
void handle_diplomacy_init_meeting_req(struct player *pplayer, int counterpart)
Definition diplhand.c:848
void handle_diplomacy_cancel_meeting_req(struct player *pplayer, int counterpart)
Definition diplhand.c:833
void handle_diplomacy_accept_treaty_req(struct player *pplayer, int counterpart)
Definition diplhand.c:150
void handle_edit_unit_remove_by_id(struct connection *pc, Unit_type_id id)
Definition edithand.c:596
void handle_edit_tile(struct connection *pc, const struct packet_edit_tile *packet)
Definition edithand.c:380
void handle_edit_scenario_desc(struct connection *pc, const char *scenario_desc)
Definition edithand.c:1504
void handle_edit_check_tiles(struct connection *pc)
Definition edithand.c:1322
void handle_edit_mode(struct connection *pc, bool is_edit_mode)
Definition edithand.c:193
void handle_edit_tile_terrain(struct connection *pc, int tile, Terrain_type_id terrain, int size)
Definition edithand.c:303
void handle_edit_player(struct connection *pc, const struct packet_edit_player *packet)
Definition edithand.c:1009
void handle_edit_player_remove(struct connection *pc, int id)
Definition edithand.c:985
void handle_edit_city_remove(struct connection *pc, int id)
Definition edithand.c:1305
void handle_edit_player_vision(struct connection *pc, int plr_no, int tile, bool known, int size)
Definition edithand.c:1225
void handle_edit_city(struct connection *pc, const struct packet_edit_city *packet)
Definition edithand.c:746
void handle_edit_city_create(struct connection *pc, int owner, int tile, int size, int tag)
Definition edithand.c:690
void handle_edit_game(struct connection *pc, const struct packet_edit_game *packet)
Definition edithand.c:1441
void handle_edit_unit_remove(struct connection *pc, int owner, int tile, Unit_type_id utid, int count)
Definition edithand.c:541
void handle_edit_toggle_fogofwar(struct connection *pc, int plr_no)
Definition edithand.c:1332
void handle_edit_startpos_full(struct connection *pconn, const struct packet_edit_startpos_full *packet)
Definition edithand.c:1403
void handle_edit_player_create(struct connection *pc, int tag)
Definition edithand.c:906
void handle_edit_recalculate_borders(struct connection *pc)
Definition edithand.c:1297
void handle_save_scenario(struct connection *pc, const char *name)
Definition edithand.c:1516
void handle_edit_tile_extra(struct connection *pc, int tile, int id, bool removal, int eowner, int size)
Definition edithand.c:340
void handle_edit_unit_create(struct connection *pc, int owner, int tile, Unit_type_id utid, int count, int tag)
Definition edithand.c:438
void handle_edit_unit(struct connection *pc, const struct packet_edit_unit *packet)
Definition edithand.c:613
void handle_edit_startpos(struct connection *pconn, const struct packet_edit_startpos *packet)
Definition edithand.c:1365
void handle_single_want_hack_req(struct connection *pc, const struct packet_single_want_hack_req *packet)
Definition gamehand.c:1234
void handle_ruleset_select(struct connection *pc, const struct packet_ruleset_select *packet)
Definition gamehand.c:1183
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:3177
void handle_player_multiplier(struct player *pplayer, int count, const int *multipliers)
Definition plrhand.c:3390
void handle_client_heartbeat(struct connection *pc)
Definition sernet.c:1465
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:2329
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:2228
void handle_unit_type_upgrade(struct player *pplayer, Unit_type_id type)
Definition unithand.c:185
void handle_unit_orders(struct player *pplayer, const struct packet_unit_orders *packet)
Definition unithand.c:6612
void handle_report_req(struct connection *pc, enum report_type type)
Definition srv_main.c:1947
void handle_client_info(struct connection *pc, enum gui_type gui, int emerg_version, const char *distribution)
Definition srv_main.c:310
void handle_worker_task(struct player *pplayer, const struct packet_worker_task *packet)
Definition unithand.c:6721
void handle_player_tech_goal(struct player *pplayer, int tech)
Definition techtools.c:1362
void handle_unit_change_activity(struct player *pplayer, int unit_id, enum unit_activity activity, int target)
Definition unithand.c:4312
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:3169
void handle_unit_action_query(struct connection *pc, int actor_id, int target_id, action_id action_type, int request_kind)
Definition unithand.c:3163
void handle_player_ready(struct player *pplayer, int player_no, bool is_ready)
Definition srv_main.c:2411
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:1339
void handle_unit_server_side_agent_set(struct player *pplayer, int unit_id, enum server_side_agent agent)
Definition unithand.c:6321
void handle_player_change_government(struct player *pplayer, Government_type_id government)
Definition plrhand.c:566
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:1445
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:3277
void handle_diplomacy_cancel_pact(struct player *pplayer, int other_player_id, enum clause_type clause)
Definition plrhand.c:882
void handle_player_attribute_chunk(struct player *pplayer, const struct packet_player_attribute_chunk *packet)
Definition plrhand.c:3159
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:286
void handle_unit_sscs_set(struct player *pplayer, int unit_id, enum unit_ss_data_type type, int value)
Definition unithand.c:6214
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_SYNC_SERIAL
@ 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