/
floten3.php
executable file
·549 lines (482 loc) · 22.3 KB
/
floten3.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
<?php
/**
* floten3.php
*
* @version 1.0
* @copyright 2008 by Chlorel for XNova
*/
define('INSIDE' , true);
define('INSTALL' , false);
$ugamela_root_path = './';
include($ugamela_root_path . 'extension.inc');
include($ugamela_root_path . 'common.' . $phpEx);
$dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"];
includeLang('fleet');
$CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['current_planet'] ."'", 'planets', true);
$TargetPlanet = doquery("SELECT * FROM {{table}} WHERE `galaxy` = '". $_POST['galaxy'] ."' AND `system` = '". $_POST['system'] ."' AND `planet` = '". $_POST['planet'] ."' AND `planet_type` = '". $_POST['planettype'] ."';", 'planets', true);
$MyDBRec = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['id']."';", 'users', true);
$protection = $game_config['noobprotection'];//新手保护
$protectiontime = $game_config['noobprotectiontime'];//新手保护时间
$protectionmulti = $game_config['noobprotectionmulti'];//积分差距倍数
if ($protectiontime < 1) {
$protectiontime = 9999999999999999;
}
$fleetarray = unserialize(base64_decode(str_rot13($_POST["usedfleet"])));
if (!is_array($fleetarray)) {
message ("<font color=\"red\"><b>". $lang['fl_fleet_err'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
// On verifie s'il y a assez de vaisseaux sur la planete !
foreach ($fleetarray as $Ship => $Count) {
if ($Count > $CurrentPlanet[$resource[$Ship]]) {
message ("<font color=\"red\"><b>". $lang['fl_fleet_err'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
}
$error = 0;
$galaxy = intval($_POST['galaxy']);
$system = intval($_POST['system']);
$planet = intval($_POST['planet']);
$planettype = intval($_POST['planettype']);
$fleetmission = $_POST['mission'];
if ($planettype != 1 && $planettype != 2 && $planettype != 3) {
message ("<font color=\"red\"><b>". $lang['fl_fleet_err_pl'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
if ($fleetmission == 8) {
$YourPlanet = false;
$UsedPlanet = false;
$select = doquery("SELECT * FROM {{table}} WHERE galaxy = '". $galaxy ."' AND system = '". $system ."' AND planet = '". $planet ."'", "planets");
} else {
$YourPlanet = false;
$UsedPlanet = false;
$select = doquery("SELECT * FROM {{table}} WHERE galaxy = '". $galaxy ."' AND system = '". $system ."' AND planet = '". $planet ."' AND planet_type = '". $planettype ."'", "planets");
}
if ($CurrentPlanet['galaxy'] == $galaxy &&
$CurrentPlanet['system'] == $system &&
$CurrentPlanet['planet'] == $planet &&
$CurrentPlanet['planet_type'] == $planettype) {
message ("<font color=\"red\"><b>". $lang['fl_ownpl_err'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
// Test d'existance de l'enregistrement dans la gaalxie !
if ($_POST['mission'] != 15) {
if (mysql_num_rows($select) < 1 && $fleetmission != 7) {
message ("<font color=\"red\"><b>". $lang['fl_unknow_target'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
} elseif ($fleetmission == 9 && mysql_num_rows($select)) {
message ("<font color=\"red\"><b>". $lang['fl_used_target'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
} else {
$EnvoiMaxExpedition = $_POST['maxepedition'];
$Expedition = $_POST['curepedition'];
if ($EnvoiMaxExpedition == 0 ) {
message ("<font color=\"red\"><b>". $lang['fl_expe_notech'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
} elseif ($Expedition >= $EnvoiMaxExpedition ) {
message ("<font color=\"red\"><b>". $lang['fl_expe_max'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
}
$select = mysql_fetch_array($select);
if ($select['id_owner'] == $user['id']) {
$YourPlanet = true;
$UsedPlanet = true;
} elseif (!empty($select['id_owner'])) {
$YourPlanet = false;
$UsedPlanet = true;
} else {
$YourPlanet = false;
$UsedPlanet = false;
}
// Determinons les type de missions possibles par rapport a la planete cible
if ($fleetmission == 15) {
// Gestion des Exp�ditions
$missiontype = array(15 => $lang['type_mission'][15]);
} else {
if ($_POST['planettype'] == "2") {
if ($_POST['ship209'] >= 1) {
$missiontype = array(8 => $lang['type_mission'][8]);
} else {
$missiontype = array();
}
} elseif ($_POST['planettype'] == "1" || $_POST['planettype'] == "3") {
if ($_POST['ship208'] >= 1 && !$UsedPlanet) {
$missiontype = array(7 => $lang['type_mission'][7]);
} elseif ($_POST['ship210'] >= 1 && !$YourPlanet) {
$missiontype = array(6 => $lang['type_mission'][6]);
}
if ($_POST['ship202'] >= 1 ||
$_POST['ship203'] >= 1 ||
$_POST['ship204'] >= 1 ||
$_POST['ship205'] >= 1 ||
$_POST['ship206'] >= 1 ||
$_POST['ship207'] >= 1 ||
$_POST['ship210'] >= 1 ||
$_POST['ship211'] >= 1 ||
$_POST['ship213'] >= 1 ||
$_POST['ship214'] >= 1 ||
$_POST['ship215'] >= 1) {
if (!$YourPlanet) {
$missiontype[1] = $lang['type_mission'][1];
}
$missiontype[3] = $lang['type_mission'][3];
}
if ( ($_POST['ship202'] >= 1 ||
$_POST['ship203'] ) &&
!$YourPlanet &&
$UsedPlanet) {
$missiontype[5] = $lang['type_mission'][5];
}
} elseif ($_POST['ship209'] >= 1 || $_POST['ship208']) {
$missiontype[3] = $lang['type_mission'][3];
}
if ($YourPlanet)
$missiontype[4] = $lang['type_mission'][4];
if ( $_POST['planettype'] == 3 &&
($_POST['ship214'] ||
$_POST['ship213']) &&
!$YourPlanet &&
$UsedPlanet) {
$missiontype[2] = $lang['type_mission'][2];
}
}
if (empty($missiontype[$fleetmission])) {
message ("<font color=\"red\"><b>". $lang['fl_bad_mission'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
CheckPlanetUsedFields($CurrentPlanet);
if ($TargetPlanet['id_owner'] == '') {
$HeDBRec = $MyDBRec;
} elseif ($TargetPlanet['id_owner'] != '') {
$HeDBRec = doquery("SELECT * FROM {{table}} WHERE `id` = '". $TargetPlanet['id_owner'] ."';", 'users', true);
}
$UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $MyDBRec['id'] ."';", 'statpoints', true);
$User2Points = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $HeDBRec['id'] ."';", 'statpoints', true);
$MyGameLevel = $UserPoints['total_points'];
$HeGameLevel = $User2Points['total_points'];
$VacationMode = $HeDBRec['urlaubs_modus']; //假期模式
if($user['authlevel']<1)//新手保护,管理员除外
{
if ($MyGameLevel > ($HeGameLevel * $protectionmulti) AND
$TargetPlanet['id_owner'] != '' AND
$_POST['mission'] == 1 AND
$protection == 1 AND
$HeGameLevel < ($protectiontime * 500)) {
message("<font color=\"lime\"><b>1.".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . $phpEx, 2);
}
if ($MyGameLevel > ($HeGameLevel * $protectionmulti) AND
$TargetPlanet['id_owner'] != '' AND
$_POST['mission'] == 5 AND
$protection == 1 AND
$HeGameLevel < ($protectiontime *500)) {
message("<font color=\"lime\"><b>2.".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . $phpEx, 2);
}
if ($MyGameLevel > ($HeGameLevel * $protectionmulti) AND
$TargetPlanet['id_owner'] != '' AND
$_POST['mission'] == 6 AND
$protection == 1 AND
$HeGameLevel < ($protectiontime * 500)) {
message("<font color=\"lime\"><b>3.".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . $phpEx, 2);
}
if (($MyGameLevel * $protectionmulti) < $HeGameLevel AND
$TargetPlanet['id_owner'] != '' AND
$_POST['mission'] == 1 AND
$protection == 1 AND
$MyGameLevel < ($protectiontime * 500)) {
message("<font color=\"lime\"><b>4.".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . $phpEx, 2);
}
if (($MyGameLevel * $protectionmulti) < $HeGameLevel AND
$TargetPlanet['id_owner'] != '' AND
$_POST['mission'] == 5 AND
$protection == 1 AND
$MyGameLevel < ($protectiontime * 500)) {
message("<font color=\"lime\"><b>5.".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . $phpEx, 2);
}
if (($MyGameLevel * $protectionmulti) < $HeGameLevel AND
$TargetPlanet['id_owner'] != '' AND
$_POST['mission'] == 6 AND
$protection == 1 AND
$MyGameLevel < ($protectiontime * 500)) {
message("<font color=\"lime\"><b>6.".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . $phpEx, 2);
}
}
if ($VacationMode AND $_POST['mission'] != 8) {
message("<font color=\"lime\"><b>".$lang['fl_vacation_pla']."</b></font>", $lang['fl_vacation_ttl'], "fleet." . $phpEx, 2);
}
$FlyingFleets = mysql_fetch_assoc(doquery("SELECT COUNT(fleet_id) as Number FROM {{table}} WHERE `fleet_owner`='{$user['id']}'", 'fleets'));
$ActualFleets = $FlyingFleets["Number"];
if (($user[$resource[108]] + 1) <= $ActualFleets) {
message($lang['fl_expe_max'], "错误", "fleet." . $phpEx, 1);
}
if ($_POST['resource1'] + $_POST['resource2'] + $_POST['resource3'] < 1 AND $_POST['mission'] == 3) {
message("<font color=\"lime\"><b>".$lang['fl_noenoughtgoods']."</b></font>", $lang['type_mission'][3], "fleet." . $phpEx, 1);
}
if ($_POST['mission'] != 15) {
if ($TargetPlanet['id_owner'] == '' AND $_POST['mission'] < 7) {
message ("<font color=\"red\"><b>". $lang['fl_bad_planet01'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
if ($TargetPlanet['id_owner'] != '' AND $_POST['mission'] == 7) {
message ("<font color=\"red\"><b>". $lang['fl_bad_planet02'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
if ($HeDBRec['ally_id'] != $MyDBRec['ally_id'] AND $_POST['mission'] == 4) {
message ("<font color=\"red\"><b>". $lang['fl_dont_stay_here'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
if ($TargetPlanet['ally_deposit'] < 1 AND $HeDBRec != $MyDBRec AND $_POST['mission'] == 5) {
message ("<font color=\"red\"><b>". $lang['fl_no_allydeposit'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
if (($TargetPlanet["id_owner"] == $CurrentPlanet["id_owner"]) AND ($_POST["mission"] == 1)) {
message ("<font color=\"red\"><b>". $lang['fl_no_self_attack'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
if (($TargetPlanet["id_owner"] == $CurrentPlanet["id_owner"]) AND ($_POST["mission"] == 6)) {
message ("<font color=\"red\"><b>". $lang['fl_no_self_spy'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
if (($TargetPlanet["id_owner"] != $CurrentPlanet["id_owner"]) AND ($_POST["mission"] == 4)) {
message ("<font color=\"red\"><b>". $lang['fl_only_stay_at_home'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
}
$missiontype = array(
1 => $lang['type_mission'][1],
2 => $lang['type_mission'][2],
3 => $lang['type_mission'][3],
4 => $lang['type_mission'][4],
5 => $lang['type_mission'][5],
6 => $lang['type_mission'][6],
7 => $lang['type_mission'][7],
8 => $lang['type_mission'][8],
9 => $lang['type_mission'][9],
15 => $lang['type_mission'][15],
);
$speed_possible = array(10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
$AllFleetSpeed = GetFleetMaxSpeed ($fleetarray, 0, $user);
$GenFleetSpeed = $_POST['speed'];
$SpeedFactor = $_POST['speedfactor'];
$MaxFleetSpeed = min($AllFleetSpeed);
if (!in_array($GenFleetSpeed, $speed_possible)) {
message ("<font color=\"red\"><b>". $lang['fl_cheat_speed'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
$CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '".$user['current_planet']."';", 'planets', true);
if ($MaxFleetSpeed != $_POST['speedallsmin']) {
message ("<font color=\"red\"><b>". $lang['fl_cheat_speed'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
if (!$_POST['planettype']) {
message ("<font color=\"red\"><b>". $lang['fl_no_planet_type'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
// Test de coherance de la destination (voir si elle se trouve dans les limites de l'univers connu
$error = 0;
$errorlist = "";
if (!$_POST['galaxy'] || !is_numeric($_POST['galaxy']) || $_POST['galaxy'] > 9 || $_POST['galaxy'] < 1) {
$error++;
$errorlist .= $lang['fl_limit_galaxy'];
}
if (!$_POST['system'] || !is_numeric($_POST['system']) || $_POST['system'] > 499 || $_POST['system'] < 1) {
$error++;
$errorlist .= $lang['fl_limit_system'];
}
if (!$_POST['planet'] || !is_numeric($_POST['planet']) || $_POST['planet'] > 16 || $_POST['planet'] < 1) {
$error++;
$errorlist .= $lang['fl_limit_planet'];
}
if ($error > 0) {
message ("<font color=\"red\"><ul>" . $errorlist . "</ul></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
// La flotte part bien de la planete courrante ??
if ($_POST['thisgalaxy'] != $CurrentPlanet['galaxy'] |
$_POST['thissystem'] != $CurrentPlanet['system'] |
$_POST['thisplanet'] != $CurrentPlanet['planet'] |
$_POST['thisplanettype'] != $CurrentPlanet['planet_type']) {
message ("<font color=\"red\"><b>". $lang['fl_cheat_origine'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
if (!isset($fleetarray)) {
message ("<font color=\"red\"><b>". $lang['fl_no_fleetarray'] ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
$distance = GetTargetDistance ( $_POST['thisgalaxy'], $_POST['galaxy'], $_POST['thissystem'], $_POST['system'], $_POST['thisplanet'], $_POST['planet'] );
$duration = GetMissionDuration ( $GenFleetSpeed, $MaxFleetSpeed, $distance, $SpeedFactor );
$consumption = GetFleetConsumption ( $fleetarray, $SpeedFactor, $duration, $distance, $MaxFleetSpeed, $user );
$fleet['start_time'] = $duration + time();
//修改等待时间,原本为小时,现改成分钟
/*
if ($_POST['mission'] == 15) {
$StayDuration = $_POST['expeditiontime'] * 3600;
$StayTime = $fleet['start_time'] + $_POST['expeditiontime'] * 3600;
} elseif ($_POST['mission'] == 5) {
$StayDuration = $_POST['holdingtime'] * 3600;
$StayTime = $fleet['start_time'] + $_POST['holdingtime'] * 3600;
} else {
$StayDuration = 0;
$StayTime = 0;
}
*/
if ($_POST['mission'] == 15) {
$StayDuration = $_POST['expeditiontime'] * 60;
$StayTime = $fleet['start_time'] + $_POST['expeditiontime'] * 60;
} elseif ($_POST['mission'] == 5) {
$StayDuration = $_POST['holdingtime'] * 60;
$StayTime = $fleet['start_time'] + $_POST['holdingtime'] * 60;
} else {
$StayDuration = 0;
$StayTime = 0;
}
$fleet['end_time'] = $StayDuration + (2 * $duration) + time();
$FleetStorage = 0;
$FleetShipCount = 0;
$fleet_array = "";
$FleetSubQRY = "";
foreach ($fleetarray as $Ship => $Count) {
$FleetStorage += $pricelist[$Ship]["capacity"] * $Count;
$FleetShipCount += $Count;
$fleet_array .= $Ship .",". $Count .";";
$FleetSubQRY .= "`".$resource[$Ship] . "` = `" . $resource[$Ship] . "` - " . $Count . " , ";
}
$FleetStorage -= $consumption;
$StorageNeeded = 0;
if ($_POST['resource1'] < 1) {
$TransMetal = 0;
} else {
$TransMetal = $_POST['resource1'];
$StorageNeeded += $TransMetal;
}
if ($_POST['resource2'] < 1) {
$TransCrystal = 0;
} else {
$TransCrystal = $_POST['resource2'];
$StorageNeeded += $TransCrystal;
}
if ($_POST['resource3'] < 1) {
$TransDeuterium = 0;
} else {
$TransDeuterium = $_POST['resource3'];
$StorageNeeded += $TransDeuterium;
}
$StockMetal = $CurrentPlanet['metal'];
$StockCrystal = $CurrentPlanet['crystal'];
$StockDeuterium = $CurrentPlanet['deuterium'];
$StockDeuterium -= $consumption;
$StockOk = false;
if ($StockMetal >= $TransMetal) {
if ($StockCrystal >= $TransCrystal) {
if ($StockDeuterium >= $TransDeuterium) {
$StockOk = true;
}
}
}
if ( !$StockOk ) {
message ("<font color=\"red\"><b>". $lang['fl_noressources'] . pretty_number($consumption) ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
if ( $StorageNeeded > $FleetStorage) {
message ("<font color=\"red\"><b>". $lang['fl_nostoragespa'] . pretty_number($StorageNeeded - $FleetStorage) ."</b></font>", $lang['fl_error'], "fleet." . $phpEx, 2);
}
if ($TargetPlanet['id_level'] > $user['authlevel']) {
$Allowed = true;
switch ($_POST['mission']){
case 1:
case 2:
case 6:
case 9:
$Allowed = false;
break;
case 3:
case 4:
case 5:
case 7:
case 8:
case 15:
break;
default:
}
if ($Allowed == false) {
message ("<font color=\"red\"><b>". $lang['fl_adm_attak'] ."</b></font>", $lang['fl_warning'], "fleet." . $phpEx, 2);
}
}
// ecriture de l'enregistrement de flotte (a partir de l�, y a quelque chose qui vole et c'est toujours sur la planete d'origine)
$QryInsertFleet = "INSERT INTO {{table}} SET ";
$QryInsertFleet .= "`fleet_owner` = '". $user['id'] ."', ";
$QryInsertFleet .= "`fleet_mission` = '". $_POST['mission'] ."', ";
$QryInsertFleet .= "`fleet_amount` = '". $FleetShipCount ."', ";
$QryInsertFleet .= "`fleet_array` = '". $fleet_array ."', ";
$QryInsertFleet .= "`fleet_start_time` = '". $fleet['start_time'] ."', ";
$QryInsertFleet .= "`fleet_start_galaxy` = '". intval($_POST['thisgalaxy']) ."', ";
$QryInsertFleet .= "`fleet_start_system` = '". intval($_POST['thissystem']) ."', ";
$QryInsertFleet .= "`fleet_start_planet` = '". intval($_POST['thisplanet']) ."', ";
$QryInsertFleet .= "`fleet_start_type` = '". intval($_POST['thisplanettype']) ."', ";
$QryInsertFleet .= "`fleet_end_time` = '". $fleet['end_time'] ."', ";
$QryInsertFleet .= "`fleet_end_stay` = '". $StayTime ."', ";
$QryInsertFleet .= "`fleet_end_galaxy` = '". intval($_POST['galaxy']) ."', ";
$QryInsertFleet .= "`fleet_end_system` = '". intval($_POST['system']) ."', ";
$QryInsertFleet .= "`fleet_end_planet` = '". intval($_POST['planet']) ."', ";
$QryInsertFleet .= "`fleet_end_type` = '". intval($_POST['planettype']) ."', ";
$QryInsertFleet .= "`fleet_resource_metal` = '". $TransMetal ."', ";
$QryInsertFleet .= "`fleet_resource_crystal` = '". $TransCrystal ."', ";
$QryInsertFleet .= "`fleet_resource_deuterium` = '". $TransDeuterium ."', ";
$QryInsertFleet .= "`fleet_target_owner` = '". $TargetPlanet['id_owner'] ."', ";
$QryInsertFleet .= "`start_time` = '". time() ."';";
doquery( $QryInsertFleet, 'fleets');
$CurrentPlanet["metal"] = $CurrentPlanet["metal"] - $TransMetal;
$CurrentPlanet["crystal"] = $CurrentPlanet["crystal"] - $TransCrystal;
$CurrentPlanet["deuterium"] = $CurrentPlanet["deuterium"] - $TransDeuterium;
$CurrentPlanet["deuterium"] = $CurrentPlanet["deuterium"] - $consumption;
$QryUpdatePlanet = "UPDATE {{table}} SET ";
$QryUpdatePlanet .= $FleetSubQRY;
$QryUpdatePlanet .= "`metal` = '". $CurrentPlanet["metal"] ."', ";
$QryUpdatePlanet .= "`crystal` = '". $CurrentPlanet["crystal"] ."', ";
$QryUpdatePlanet .= "`deuterium` = '". $CurrentPlanet["deuterium"] ."' ";
$QryUpdatePlanet .= "WHERE ";
$QryUpdatePlanet .= "`id` = '". $CurrentPlanet['id'] ."'";
// Mise a jours de l'enregistrement de la planete de depart (a partir de là, y a quelque chose qui vole et ce n'est plus sur la planete de depart)
doquery("LOCK TABLE {{table}} WRITE", 'planets');
doquery ($QryUpdatePlanet, "planets");
doquery("UNLOCK TABLES", '');
// doquery("FLUSH TABLES", '');
// Un peu de blabla pour l'utilisateur, affichage d'un joli tableau de la flotte expedi�e
$page = "<br><div><center>";
$page .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"519\">";
$page .= "<tr height=\"20\">";
$page .= "<td class=\"c\" colspan=\"2\"><span class=\"success\">". $lang['fl_fleet_send'] ."</span></td>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_mission'] ."</th>";
$page .= "<th>". $missiontype[$_POST['mission']] ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_dist'] ."</th>";
$page .= "<th>". pretty_number($distance) ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_speed'] ."</th>";
$page .= "<th>". pretty_number($_POST['speedallsmin']) ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_deute_need'] ."</th>";
$page .= "<th>". pretty_number($consumption) ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_from'] ."</th>";
$page .= "<th>". $_POST['thisgalaxy'] .":". $_POST['thissystem']. ":". $_POST['thisplanet'] ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_dest'] ."</th>";
$page .= "<th>". $_POST['galaxy'] .":". $_POST['system'] .":". $_POST['planet'] ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_time_go'] ."</th>";
$page .= "<th>". date("Y-m-d H:i:s", $fleet['start_time']) ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_time_back'] ."</th>";
$page .= "<th>". date("Y-m-d H:i:s", $fleet['end_time']) ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<td class=\"c\" colspan=\"2\">". $lang['fl_title'] ."</td>";
$page .= '
<script type="text/javascript">
var dt = new Date();
var ende = dt.getTime();
ende = ende + 100;
function countdown()
{
var dt2 = new Date();
var curdt = dt2.getTime();
if(curdt >= ende) {window.location.href="fleet.php";}
}
setInterval(countdown, 3000);
</script>
';
foreach ($fleetarray as $Ship => $Count) {
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['tech'][$Ship] ."</th>";
$page .= "<th>". pretty_number($Count) ."</th>";
}
$page .= "</tr></table></div></center>";
// Provisoire
sleep (1);
$planetrow = doquery ("SELECT * FROM {{table}} WHERE `id` = '". $CurrentPlanet['id'] ."';", 'planets', true);
display($page, $lang['fl_title']);
// Updated by Chlorel. 16 Jan 2008 (String extraction, bug corrections, code uniformisation
// Updated by -= MoF =- for Deutsches Ugamela Forum
// 06.12.2007 - 08:39
// Open Source
// (c) by MoF
?>