~ubuntu-branches/debian/sid/freeciv/sid

« back to all changes in this revision

Viewing changes to server/hand_gen.c

  • Committer: Package Import Robot
  • Author(s): Clint Adams, Karl Goetz, Clint Adams
  • Date: 2011-08-28 22:40:00 UTC
  • mfrom: (1.2.19 upstream)
  • Revision ID: package-import@ubuntu.com-20110828224000-j2r1erewlem25dox
Tags: 2.3.0-1
[ Karl Goetz ]
* New upstream version.
* Fix themes_sdl_use_system_fonts.diff to apply cleanly on 2.3.0
* Massage work_around_unity_induced_breakage.diff to get it
  applying to the new codebase (The patch assumes commits made
  after 2.3.0 was tagged upstream).

[ Clint Adams ]
* Fudge build system to think there is no libtool mismatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#include <config.h>
13
13
#endif
14
14
 
 
15
/* common */
15
16
#include "packets.h"
16
17
 
17
18
#include "hand_gen.h"
18
19
    
19
 
bool server_handle_packet(enum packet_type type, void *packet,
20
 
                          struct player *pplayer, struct connection *pconn)
 
20
bool server_handle_packet(enum packet_type type, const void *packet,
 
21
                          struct player *pplayer, struct connection *pconn)
21
22
{
22
23
  switch(type) {
23
24
  case PACKET_NATION_SELECT_REQ:
24
25
    handle_nation_select_req(pconn,
25
 
      ((struct packet_nation_select_req *)packet)->player_no,
26
 
      ((struct packet_nation_select_req *)packet)->nation_no,
27
 
      ((struct packet_nation_select_req *)packet)->is_male,
28
 
      ((struct packet_nation_select_req *)packet)->name,
29
 
      ((struct packet_nation_select_req *)packet)->city_style);
 
26
      ((const struct packet_nation_select_req *)packet)->player_no,
 
27
      ((const struct packet_nation_select_req *)packet)->nation_no,
 
28
      ((const struct packet_nation_select_req *)packet)->is_male,
 
29
      ((const struct packet_nation_select_req *)packet)->name,
 
30
      ((const struct packet_nation_select_req *)packet)->city_style);
30
31
    return TRUE;
31
32
 
32
33
  case PACKET_PLAYER_READY:
33
34
    handle_player_ready(pplayer,
34
 
      ((struct packet_player_ready *)packet)->player_no,
35
 
      ((struct packet_player_ready *)packet)->is_ready);
 
35
      ((const struct packet_player_ready *)packet)->player_no,
 
36
      ((const struct packet_player_ready *)packet)->is_ready);
36
37
    return TRUE;
37
38
 
38
39
  case PACKET_CHAT_MSG_REQ:
39
40
    handle_chat_msg_req(pconn,
40
 
      ((struct packet_chat_msg_req *)packet)->message);
 
41
      ((const struct packet_chat_msg_req *)packet)->message);
41
42
    return TRUE;
42
43
 
43
44
  case PACKET_CITY_SELL:
44
45
    handle_city_sell(pplayer,
45
 
      ((struct packet_city_sell *)packet)->city_id,
46
 
      ((struct packet_city_sell *)packet)->build_id);
 
46
      ((const struct packet_city_sell *)packet)->city_id,
 
47
      ((const struct packet_city_sell *)packet)->build_id);
47
48
    return TRUE;
48
49
 
49
50
  case PACKET_CITY_BUY:
50
51
    handle_city_buy(pplayer,
51
 
      ((struct packet_city_buy *)packet)->city_id);
 
52
      ((const struct packet_city_buy *)packet)->city_id);
52
53
    return TRUE;
53
54
 
54
55
  case PACKET_CITY_CHANGE:
55
56
    handle_city_change(pplayer,
56
 
      ((struct packet_city_change *)packet)->city_id,
57
 
      ((struct packet_city_change *)packet)->production_kind,
58
 
      ((struct packet_city_change *)packet)->production_value);
 
57
      ((const struct packet_city_change *)packet)->city_id,
 
58
      ((const struct packet_city_change *)packet)->production_kind,
 
59
      ((const struct packet_city_change *)packet)->production_value);
59
60
    return TRUE;
60
61
 
61
62
  case PACKET_CITY_WORKLIST:
62
63
    handle_city_worklist(pplayer,
63
 
      ((struct packet_city_worklist *)packet)->city_id,
64
 
      &((struct packet_city_worklist *)packet)->worklist);
 
64
      ((const struct packet_city_worklist *)packet)->city_id,
 
65
      &((const struct packet_city_worklist *)packet)->worklist);
65
66
    return TRUE;
66
67
 
67
68
  case PACKET_CITY_MAKE_SPECIALIST:
68
69
    handle_city_make_specialist(pplayer,
69
 
      ((struct packet_city_make_specialist *)packet)->city_id,
70
 
      ((struct packet_city_make_specialist *)packet)->worker_x,
71
 
      ((struct packet_city_make_specialist *)packet)->worker_y);
 
70
      ((const struct packet_city_make_specialist *)packet)->city_id,
 
71
      ((const struct packet_city_make_specialist *)packet)->worker_x,
 
72
      ((const struct packet_city_make_specialist *)packet)->worker_y);
72
73
    return TRUE;
73
74
 
74
75
  case PACKET_CITY_MAKE_WORKER:
75
76
    handle_city_make_worker(pplayer,
76
 
      ((struct packet_city_make_worker *)packet)->city_id,
77
 
      ((struct packet_city_make_worker *)packet)->worker_x,
78
 
      ((struct packet_city_make_worker *)packet)->worker_y);
 
77
      ((const struct packet_city_make_worker *)packet)->city_id,
 
78
      ((const struct packet_city_make_worker *)packet)->worker_x,
 
79
      ((const struct packet_city_make_worker *)packet)->worker_y);
79
80
    return TRUE;
80
81
 
81
82
  case PACKET_CITY_CHANGE_SPECIALIST:
82
83
    handle_city_change_specialist(pplayer,
83
 
      ((struct packet_city_change_specialist *)packet)->city_id,
84
 
      ((struct packet_city_change_specialist *)packet)->from,
85
 
      ((struct packet_city_change_specialist *)packet)->to);
 
84
      ((const struct packet_city_change_specialist *)packet)->city_id,
 
85
      ((const struct packet_city_change_specialist *)packet)->from,
 
86
      ((const struct packet_city_change_specialist *)packet)->to);
86
87
    return TRUE;
87
88
 
88
89
  case PACKET_CITY_RENAME:
89
90
    handle_city_rename(pplayer,
90
 
      ((struct packet_city_rename *)packet)->city_id,
91
 
      ((struct packet_city_rename *)packet)->name);
 
91
      ((const struct packet_city_rename *)packet)->city_id,
 
92
      ((const struct packet_city_rename *)packet)->name);
92
93
    return TRUE;
93
94
 
94
95
  case PACKET_CITY_OPTIONS_REQ:
95
96
    handle_city_options_req(pplayer,
96
 
      ((struct packet_city_options_req *)packet)->city_id,
97
 
      ((struct packet_city_options_req *)packet)->options);
 
97
      ((const struct packet_city_options_req *)packet)->city_id,
 
98
      ((const struct packet_city_options_req *)packet)->options);
98
99
    return TRUE;
99
100
 
100
101
  case PACKET_CITY_REFRESH:
101
102
    handle_city_refresh(pplayer,
102
 
      ((struct packet_city_refresh *)packet)->city_id);
 
103
      ((const struct packet_city_refresh *)packet)->city_id);
103
104
    return TRUE;
104
105
 
105
106
  case PACKET_CITY_NAME_SUGGESTION_REQ:
106
107
    handle_city_name_suggestion_req(pplayer,
107
 
      ((struct packet_city_name_suggestion_req *)packet)->unit_id);
 
108
      ((const struct packet_city_name_suggestion_req *)packet)->unit_id);
108
109
    return TRUE;
109
110
 
110
111
  case PACKET_PLAYER_PHASE_DONE:
111
112
    handle_player_phase_done(pplayer,
112
 
      ((struct packet_player_phase_done *)packet)->turn);
 
113
      ((const struct packet_player_phase_done *)packet)->turn);
113
114
    return TRUE;
114
115
 
115
116
  case PACKET_PLAYER_RATES:
116
117
    handle_player_rates(pplayer,
117
 
      ((struct packet_player_rates *)packet)->tax,
118
 
      ((struct packet_player_rates *)packet)->luxury,
119
 
      ((struct packet_player_rates *)packet)->science);
 
118
      ((const struct packet_player_rates *)packet)->tax,
 
119
      ((const struct packet_player_rates *)packet)->luxury,
 
120
      ((const struct packet_player_rates *)packet)->science);
120
121
    return TRUE;
121
122
 
122
123
  case PACKET_PLAYER_CHANGE_GOVERNMENT:
123
124
    handle_player_change_government(pplayer,
124
 
      ((struct packet_player_change_government *)packet)->government);
 
125
      ((const struct packet_player_change_government *)packet)->government);
125
126
    return TRUE;
126
127
 
127
128
  case PACKET_PLAYER_RESEARCH:
128
129
    handle_player_research(pplayer,
129
 
      ((struct packet_player_research *)packet)->tech);
 
130
      ((const struct packet_player_research *)packet)->tech);
130
131
    return TRUE;
131
132
 
132
133
  case PACKET_PLAYER_TECH_GOAL:
133
134
    handle_player_tech_goal(pplayer,
134
 
      ((struct packet_player_tech_goal *)packet)->tech);
 
135
      ((const struct packet_player_tech_goal *)packet)->tech);
135
136
    return TRUE;
136
137
 
137
138
  case PACKET_PLAYER_ATTRIBUTE_BLOCK:
144
145
 
145
146
  case PACKET_UNIT_MOVE:
146
147
    handle_unit_move(pplayer,
147
 
      ((struct packet_unit_move *)packet)->unit_id,
148
 
      ((struct packet_unit_move *)packet)->x,
149
 
      ((struct packet_unit_move *)packet)->y);
 
148
      ((const struct packet_unit_move *)packet)->unit_id,
 
149
      ((const struct packet_unit_move *)packet)->tile);
150
150
    return TRUE;
151
151
 
152
152
  case PACKET_UNIT_BUILD_CITY:
153
153
    handle_unit_build_city(pplayer,
154
 
      ((struct packet_unit_build_city *)packet)->unit_id,
155
 
      ((struct packet_unit_build_city *)packet)->name);
 
154
      ((const struct packet_unit_build_city *)packet)->unit_id,
 
155
      ((const struct packet_unit_build_city *)packet)->name);
156
156
    return TRUE;
157
157
 
158
158
  case PACKET_UNIT_DISBAND:
159
159
    handle_unit_disband(pplayer,
160
 
      ((struct packet_unit_disband *)packet)->unit_id);
 
160
      ((const struct packet_unit_disband *)packet)->unit_id);
161
161
    return TRUE;
162
162
 
163
163
  case PACKET_UNIT_CHANGE_HOMECITY:
164
164
    handle_unit_change_homecity(pplayer,
165
 
      ((struct packet_unit_change_homecity *)packet)->unit_id,
166
 
      ((struct packet_unit_change_homecity *)packet)->city_id);
 
165
      ((const struct packet_unit_change_homecity *)packet)->unit_id,
 
166
      ((const struct packet_unit_change_homecity *)packet)->city_id);
167
167
    return TRUE;
168
168
 
169
169
  case PACKET_UNIT_ESTABLISH_TRADE:
170
170
    handle_unit_establish_trade(pplayer,
171
 
      ((struct packet_unit_establish_trade *)packet)->unit_id);
 
171
      ((const struct packet_unit_establish_trade *)packet)->unit_id);
172
172
    return TRUE;
173
173
 
174
174
  case PACKET_UNIT_BATTLEGROUP:
175
175
    handle_unit_battlegroup(pplayer,
176
 
      ((struct packet_unit_battlegroup *)packet)->unit_id,
177
 
      ((struct packet_unit_battlegroup *)packet)->battlegroup);
 
176
      ((const struct packet_unit_battlegroup *)packet)->unit_id,
 
177
      ((const struct packet_unit_battlegroup *)packet)->battlegroup);
178
178
    return TRUE;
179
179
 
180
180
  case PACKET_UNIT_HELP_BUILD_WONDER:
181
181
    handle_unit_help_build_wonder(pplayer,
182
 
      ((struct packet_unit_help_build_wonder *)packet)->unit_id);
 
182
      ((const struct packet_unit_help_build_wonder *)packet)->unit_id);
183
183
    return TRUE;
184
184
 
185
185
  case PACKET_UNIT_ORDERS:
188
188
 
189
189
  case PACKET_UNIT_AUTOSETTLERS:
190
190
    handle_unit_autosettlers(pplayer,
191
 
      ((struct packet_unit_autosettlers *)packet)->unit_id);
 
191
      ((const struct packet_unit_autosettlers *)packet)->unit_id);
192
192
    return TRUE;
193
193
 
194
194
  case PACKET_UNIT_LOAD:
195
195
    handle_unit_load(pplayer,
196
 
      ((struct packet_unit_load *)packet)->cargo_id,
197
 
      ((struct packet_unit_load *)packet)->transporter_id);
 
196
      ((const struct packet_unit_load *)packet)->cargo_id,
 
197
      ((const struct packet_unit_load *)packet)->transporter_id);
198
198
    return TRUE;
199
199
 
200
200
  case PACKET_UNIT_UNLOAD:
201
201
    handle_unit_unload(pplayer,
202
 
      ((struct packet_unit_unload *)packet)->cargo_id,
203
 
      ((struct packet_unit_unload *)packet)->transporter_id);
 
202
      ((const struct packet_unit_unload *)packet)->cargo_id,
 
203
      ((const struct packet_unit_unload *)packet)->transporter_id);
204
204
    return TRUE;
205
205
 
206
206
  case PACKET_UNIT_UPGRADE:
207
207
    handle_unit_upgrade(pplayer,
208
 
      ((struct packet_unit_upgrade *)packet)->unit_id);
 
208
      ((const struct packet_unit_upgrade *)packet)->unit_id);
 
209
    return TRUE;
 
210
 
 
211
  case PACKET_UNIT_CONVERT:
 
212
    handle_unit_convert(pplayer,
 
213
      ((const struct packet_unit_convert *)packet)->unit_id);
209
214
    return TRUE;
210
215
 
211
216
  case PACKET_UNIT_NUKE:
212
217
    handle_unit_nuke(pplayer,
213
 
      ((struct packet_unit_nuke *)packet)->unit_id);
 
218
      ((const struct packet_unit_nuke *)packet)->unit_id);
214
219
    return TRUE;
215
220
 
216
221
  case PACKET_UNIT_PARADROP_TO:
217
222
    handle_unit_paradrop_to(pplayer,
218
 
      ((struct packet_unit_paradrop_to *)packet)->unit_id,
219
 
      ((struct packet_unit_paradrop_to *)packet)->x,
220
 
      ((struct packet_unit_paradrop_to *)packet)->y);
 
223
      ((const struct packet_unit_paradrop_to *)packet)->unit_id,
 
224
      ((const struct packet_unit_paradrop_to *)packet)->tile);
221
225
    return TRUE;
222
226
 
223
227
  case PACKET_UNIT_AIRLIFT:
224
228
    handle_unit_airlift(pplayer,
225
 
      ((struct packet_unit_airlift *)packet)->unit_id,
226
 
      ((struct packet_unit_airlift *)packet)->city_id);
 
229
      ((const struct packet_unit_airlift *)packet)->unit_id,
 
230
      ((const struct packet_unit_airlift *)packet)->city_id);
227
231
    return TRUE;
228
232
 
229
233
  case PACKET_UNIT_DIPLOMAT_QUERY:
230
234
    handle_unit_diplomat_query(pconn,
231
 
      ((struct packet_unit_diplomat_query *)packet)->diplomat_id,
232
 
      ((struct packet_unit_diplomat_query *)packet)->target_id,
233
 
      ((struct packet_unit_diplomat_query *)packet)->value,
234
 
      ((struct packet_unit_diplomat_query *)packet)->action_type);
 
235
      ((const struct packet_unit_diplomat_query *)packet)->diplomat_id,
 
236
      ((const struct packet_unit_diplomat_query *)packet)->target_id,
 
237
      ((const struct packet_unit_diplomat_query *)packet)->value,
 
238
      ((const struct packet_unit_diplomat_query *)packet)->action_type);
235
239
    return TRUE;
236
240
 
237
241
  case PACKET_UNIT_TYPE_UPGRADE:
238
242
    handle_unit_type_upgrade(pplayer,
239
 
      ((struct packet_unit_type_upgrade *)packet)->type);
 
243
      ((const struct packet_unit_type_upgrade *)packet)->type);
240
244
    return TRUE;
241
245
 
242
246
  case PACKET_UNIT_DIPLOMAT_ACTION:
243
247
    handle_unit_diplomat_action(pplayer,
244
 
      ((struct packet_unit_diplomat_action *)packet)->diplomat_id,
245
 
      ((struct packet_unit_diplomat_action *)packet)->target_id,
246
 
      ((struct packet_unit_diplomat_action *)packet)->value,
247
 
      ((struct packet_unit_diplomat_action *)packet)->action_type);
 
248
      ((const struct packet_unit_diplomat_action *)packet)->diplomat_id,
 
249
      ((const struct packet_unit_diplomat_action *)packet)->target_id,
 
250
      ((const struct packet_unit_diplomat_action *)packet)->value,
 
251
      ((const struct packet_unit_diplomat_action *)packet)->action_type);
248
252
    return TRUE;
249
253
 
250
254
  case PACKET_UNIT_CHANGE_ACTIVITY:
251
255
    handle_unit_change_activity(pplayer,
252
 
      ((struct packet_unit_change_activity *)packet)->unit_id,
253
 
      ((struct packet_unit_change_activity *)packet)->activity,
254
 
      ((struct packet_unit_change_activity *)packet)->activity_target,
255
 
      ((struct packet_unit_change_activity *)packet)->activity_base);
 
256
      ((const struct packet_unit_change_activity *)packet)->unit_id,
 
257
      ((const struct packet_unit_change_activity *)packet)->activity,
 
258
      ((const struct packet_unit_change_activity *)packet)->activity_target,
 
259
      ((const struct packet_unit_change_activity *)packet)->activity_base);
256
260
    return TRUE;
257
261
 
258
262
  case PACKET_DIPLOMACY_INIT_MEETING_REQ:
259
263
    handle_diplomacy_init_meeting_req(pplayer,
260
 
      ((struct packet_diplomacy_init_meeting_req *)packet)->counterpart);
 
264
      ((const struct packet_diplomacy_init_meeting_req *)packet)->counterpart);
261
265
    return TRUE;
262
266
 
263
267
  case PACKET_DIPLOMACY_CANCEL_MEETING_REQ:
264
268
    handle_diplomacy_cancel_meeting_req(pplayer,
265
 
      ((struct packet_diplomacy_cancel_meeting_req *)packet)->counterpart);
 
269
      ((const struct packet_diplomacy_cancel_meeting_req *)packet)->counterpart);
266
270
    return TRUE;
267
271
 
268
272
  case PACKET_DIPLOMACY_CREATE_CLAUSE_REQ:
269
273
    handle_diplomacy_create_clause_req(pplayer,
270
 
      ((struct packet_diplomacy_create_clause_req *)packet)->counterpart,
271
 
      ((struct packet_diplomacy_create_clause_req *)packet)->giver,
272
 
      ((struct packet_diplomacy_create_clause_req *)packet)->type,
273
 
      ((struct packet_diplomacy_create_clause_req *)packet)->value);
 
274
      ((const struct packet_diplomacy_create_clause_req *)packet)->counterpart,
 
275
      ((const struct packet_diplomacy_create_clause_req *)packet)->giver,
 
276
      ((const struct packet_diplomacy_create_clause_req *)packet)->type,
 
277
      ((const struct packet_diplomacy_create_clause_req *)packet)->value);
274
278
    return TRUE;
275
279
 
276
280
  case PACKET_DIPLOMACY_REMOVE_CLAUSE_REQ:
277
281
    handle_diplomacy_remove_clause_req(pplayer,
278
 
      ((struct packet_diplomacy_remove_clause_req *)packet)->counterpart,
279
 
      ((struct packet_diplomacy_remove_clause_req *)packet)->giver,
280
 
      ((struct packet_diplomacy_remove_clause_req *)packet)->type,
281
 
      ((struct packet_diplomacy_remove_clause_req *)packet)->value);
 
282
      ((const struct packet_diplomacy_remove_clause_req *)packet)->counterpart,
 
283
      ((const struct packet_diplomacy_remove_clause_req *)packet)->giver,
 
284
      ((const struct packet_diplomacy_remove_clause_req *)packet)->type,
 
285
      ((const struct packet_diplomacy_remove_clause_req *)packet)->value);
282
286
    return TRUE;
283
287
 
284
288
  case PACKET_DIPLOMACY_ACCEPT_TREATY_REQ:
285
289
    handle_diplomacy_accept_treaty_req(pplayer,
286
 
      ((struct packet_diplomacy_accept_treaty_req *)packet)->counterpart);
 
290
      ((const struct packet_diplomacy_accept_treaty_req *)packet)->counterpart);
287
291
    return TRUE;
288
292
 
289
293
  case PACKET_DIPLOMACY_CANCEL_PACT:
290
294
    handle_diplomacy_cancel_pact(pplayer,
291
 
      ((struct packet_diplomacy_cancel_pact *)packet)->other_player_id,
292
 
      ((struct packet_diplomacy_cancel_pact *)packet)->clause);
 
295
      ((const struct packet_diplomacy_cancel_pact *)packet)->other_player_id,
 
296
      ((const struct packet_diplomacy_cancel_pact *)packet)->clause);
293
297
    return TRUE;
294
298
 
295
299
  case PACKET_REPORT_REQ:
296
300
    handle_report_req(pconn,
297
 
      ((struct packet_report_req *)packet)->type);
 
301
      ((const struct packet_report_req *)packet)->type);
298
302
    return TRUE;
299
303
 
300
304
  case PACKET_CONN_PONG:
303
307
 
304
308
  case PACKET_CLIENT_INFO:
305
309
    handle_client_info(pconn,
306
 
      ((struct packet_client_info *)packet)->gui);
 
310
      ((const struct packet_client_info *)packet)->gui);
307
311
    return TRUE;
308
312
 
309
313
  case PACKET_SPACESHIP_LAUNCH:
312
316
 
313
317
  case PACKET_SPACESHIP_PLACE:
314
318
    handle_spaceship_place(pplayer,
315
 
      ((struct packet_spaceship_place *)packet)->type,
316
 
      ((struct packet_spaceship_place *)packet)->num);
 
319
      ((const struct packet_spaceship_place *)packet)->type,
 
320
      ((const struct packet_spaceship_place *)packet)->num);
317
321
    return TRUE;
318
322
 
319
323
  case PACKET_SINGLE_WANT_HACK_REQ:
326
330
 
327
331
  case PACKET_SAVE_SCENARIO:
328
332
    handle_save_scenario(pconn,
329
 
      ((struct packet_save_scenario *)packet)->name);
 
333
      ((const struct packet_save_scenario *)packet)->name);
330
334
    return TRUE;
331
335
 
332
336
  case PACKET_VOTE_SUBMIT:
333
337
    handle_vote_submit(pconn,
334
 
      ((struct packet_vote_submit *)packet)->vote_no,
335
 
      ((struct packet_vote_submit *)packet)->value);
 
338
      ((const struct packet_vote_submit *)packet)->vote_no,
 
339
      ((const struct packet_vote_submit *)packet)->value);
336
340
    return TRUE;
337
341
 
338
342
  case PACKET_EDIT_MODE:
339
343
    handle_edit_mode(pconn,
340
 
      ((struct packet_edit_mode *)packet)->state);
 
344
      ((const struct packet_edit_mode *)packet)->state);
341
345
    return TRUE;
342
346
 
343
347
  case PACKET_EDIT_RECALCULATE_BORDERS:
350
354
 
351
355
  case PACKET_EDIT_TOGGLE_FOGOFWAR:
352
356
    handle_edit_toggle_fogofwar(pconn,
353
 
      ((struct packet_edit_toggle_fogofwar *)packet)->player);
 
357
      ((const struct packet_edit_toggle_fogofwar *)packet)->player);
354
358
    return TRUE;
355
359
 
356
360
  case PACKET_EDIT_TILE_TERRAIN:
357
361
    handle_edit_tile_terrain(pconn,
358
 
      ((struct packet_edit_tile_terrain *)packet)->x,
359
 
      ((struct packet_edit_tile_terrain *)packet)->y,
360
 
      ((struct packet_edit_tile_terrain *)packet)->terrain,
361
 
      ((struct packet_edit_tile_terrain *)packet)->size);
 
362
      ((const struct packet_edit_tile_terrain *)packet)->tile,
 
363
      ((const struct packet_edit_tile_terrain *)packet)->terrain,
 
364
      ((const struct packet_edit_tile_terrain *)packet)->size);
362
365
    return TRUE;
363
366
 
364
367
  case PACKET_EDIT_TILE_RESOURCE:
365
368
    handle_edit_tile_resource(pconn,
366
 
      ((struct packet_edit_tile_resource *)packet)->x,
367
 
      ((struct packet_edit_tile_resource *)packet)->y,
368
 
      ((struct packet_edit_tile_resource *)packet)->resource,
369
 
      ((struct packet_edit_tile_resource *)packet)->size);
 
369
      ((const struct packet_edit_tile_resource *)packet)->tile,
 
370
      ((const struct packet_edit_tile_resource *)packet)->resource,
 
371
      ((const struct packet_edit_tile_resource *)packet)->size);
370
372
    return TRUE;
371
373
 
372
374
  case PACKET_EDIT_TILE_SPECIAL:
373
375
    handle_edit_tile_special(pconn,
374
 
      ((struct packet_edit_tile_special *)packet)->x,
375
 
      ((struct packet_edit_tile_special *)packet)->y,
376
 
      ((struct packet_edit_tile_special *)packet)->special,
377
 
      ((struct packet_edit_tile_special *)packet)->remove,
378
 
      ((struct packet_edit_tile_special *)packet)->size);
 
376
      ((const struct packet_edit_tile_special *)packet)->tile,
 
377
      ((const struct packet_edit_tile_special *)packet)->special,
 
378
      ((const struct packet_edit_tile_special *)packet)->remove,
 
379
      ((const struct packet_edit_tile_special *)packet)->size);
379
380
    return TRUE;
380
381
 
381
382
  case PACKET_EDIT_TILE_BASE:
382
383
    handle_edit_tile_base(pconn,
383
 
      ((struct packet_edit_tile_base *)packet)->x,
384
 
      ((struct packet_edit_tile_base *)packet)->y,
385
 
      ((struct packet_edit_tile_base *)packet)->base_type_id,
386
 
      ((struct packet_edit_tile_base *)packet)->remove,
387
 
      ((struct packet_edit_tile_base *)packet)->size);
 
384
      ((const struct packet_edit_tile_base *)packet)->tile,
 
385
      ((const struct packet_edit_tile_base *)packet)->base_type_id,
 
386
      ((const struct packet_edit_tile_base *)packet)->remove,
 
387
      ((const struct packet_edit_tile_base *)packet)->size);
388
388
    return TRUE;
389
389
 
390
390
  case PACKET_EDIT_STARTPOS:
391
 
    handle_edit_startpos(pconn,
392
 
      ((struct packet_edit_startpos *)packet)->x,
393
 
      ((struct packet_edit_startpos *)packet)->y,
394
 
      ((struct packet_edit_startpos *)packet)->nation);
 
391
    handle_edit_startpos(pconn, packet);
 
392
    return TRUE;
 
393
 
 
394
  case PACKET_EDIT_STARTPOS_FULL:
 
395
    handle_edit_startpos_full(pconn, packet);
395
396
    return TRUE;
396
397
 
397
398
  case PACKET_EDIT_TILE:
399
400
    return TRUE;
400
401
 
401
402
  case PACKET_EDIT_UNIT_CREATE:
402
 
    handle_edit_unit_create(pconn, packet);
 
403
    handle_edit_unit_create(pconn,
 
404
      ((const struct packet_edit_unit_create *)packet)->owner,
 
405
      ((const struct packet_edit_unit_create *)packet)->tile,
 
406
      ((const struct packet_edit_unit_create *)packet)->type,
 
407
      ((const struct packet_edit_unit_create *)packet)->count,
 
408
      ((const struct packet_edit_unit_create *)packet)->tag);
403
409
    return TRUE;
404
410
 
405
411
  case PACKET_EDIT_UNIT_REMOVE:
406
412
    handle_edit_unit_remove(pconn,
407
 
      ((struct packet_edit_unit_remove *)packet)->owner,
408
 
      ((struct packet_edit_unit_remove *)packet)->x,
409
 
      ((struct packet_edit_unit_remove *)packet)->y,
410
 
      ((struct packet_edit_unit_remove *)packet)->type,
411
 
      ((struct packet_edit_unit_remove *)packet)->count);
 
413
      ((const struct packet_edit_unit_remove *)packet)->owner,
 
414
      ((const struct packet_edit_unit_remove *)packet)->tile,
 
415
      ((const struct packet_edit_unit_remove *)packet)->type,
 
416
      ((const struct packet_edit_unit_remove *)packet)->count);
412
417
    return TRUE;
413
418
 
414
419
  case PACKET_EDIT_UNIT_REMOVE_BY_ID:
415
420
    handle_edit_unit_remove_by_id(pconn,
416
 
      ((struct packet_edit_unit_remove_by_id *)packet)->id);
 
421
      ((const struct packet_edit_unit_remove_by_id *)packet)->id);
417
422
    return TRUE;
418
423
 
419
424
  case PACKET_EDIT_UNIT:
422
427
 
423
428
  case PACKET_EDIT_CITY_CREATE:
424
429
    handle_edit_city_create(pconn,
425
 
      ((struct packet_edit_city_create *)packet)->owner,
426
 
      ((struct packet_edit_city_create *)packet)->x,
427
 
      ((struct packet_edit_city_create *)packet)->y,
428
 
      ((struct packet_edit_city_create *)packet)->size,
429
 
      ((struct packet_edit_city_create *)packet)->tag);
 
430
      ((const struct packet_edit_city_create *)packet)->owner,
 
431
      ((const struct packet_edit_city_create *)packet)->tile,
 
432
      ((const struct packet_edit_city_create *)packet)->size,
 
433
      ((const struct packet_edit_city_create *)packet)->tag);
430
434
    return TRUE;
431
435
 
432
436
  case PACKET_EDIT_CITY_REMOVE:
433
437
    handle_edit_city_remove(pconn,
434
 
      ((struct packet_edit_city_remove *)packet)->id);
 
438
      ((const struct packet_edit_city_remove *)packet)->id);
435
439
    return TRUE;
436
440
 
437
441
  case PACKET_EDIT_CITY:
440
444
 
441
445
  case PACKET_EDIT_PLAYER_CREATE:
442
446
    handle_edit_player_create(pconn,
443
 
      ((struct packet_edit_player_create *)packet)->tag);
 
447
      ((const struct packet_edit_player_create *)packet)->tag);
444
448
    return TRUE;
445
449
 
446
450
  case PACKET_EDIT_PLAYER_REMOVE:
447
451
    handle_edit_player_remove(pconn,
448
 
      ((struct packet_edit_player_remove *)packet)->id);
 
452
      ((const struct packet_edit_player_remove *)packet)->id);
449
453
    return TRUE;
450
454
 
451
455
  case PACKET_EDIT_PLAYER:
454
458
 
455
459
  case PACKET_EDIT_PLAYER_VISION:
456
460
    handle_edit_player_vision(pconn,
457
 
      ((struct packet_edit_player_vision *)packet)->player,
458
 
      ((struct packet_edit_player_vision *)packet)->x,
459
 
      ((struct packet_edit_player_vision *)packet)->y,
460
 
      ((struct packet_edit_player_vision *)packet)->known,
461
 
      ((struct packet_edit_player_vision *)packet)->size);
 
461
      ((const struct packet_edit_player_vision *)packet)->player,
 
462
      ((const struct packet_edit_player_vision *)packet)->tile,
 
463
      ((const struct packet_edit_player_vision *)packet)->known,
 
464
      ((const struct packet_edit_player_vision *)packet)->size);
462
465
    return TRUE;
463
466
 
464
467
  case PACKET_EDIT_GAME: