Exemplo n.º 1
0
             if ($anz_fertig != 0) {
                 $starttime = $row['starttime'] + $anz_fertig * $sol_time;
                 $db->query("UPDATE cc" . $n . "_countries SET " . $sol_tabless . "=" . $sol_tabless . "+'{$anz_fertig}' WHERE islandid='{$userdata['activeid']}'");
                 $db->query("UPDATE cc" . $n . "_create_sol SET anz= anz - '{$anz_fertig}' WHERE create_sol_id='{$row['create_sol_id']}'");
             } else {
                 $starttime = $row['starttime'];
             }
             if (fmod($requesttime, $sol_time)) {
                 $time_for_one = fmod($requesttime, $sol_time);
                 //rechnet den rest der zeit f�r aktuelle Einheit aus
             } else {
                 $time_for_one = $sol_time;
             }
             $endtime = $row['endtime'] - ($requesttime - $time_for_one);
             $backurl = "build_deff.php";
             $time_one = make_timebanner($starttime, $endtime, $z, $backurl);
         } else {
             $time_one = $builddeff12;
         }
         $message = "<br><a href=\"{$cancelURL}\">{$builddeff11}</a>";
         $z++;
         $new_found_inhalt_loop = array($z, $name, $numOfMans, $time_one, $time_ready, $message);
         array_push($new_found_loop, $new_found_inhalt_loop);
     }
 }
 if ($z != 0) {
     $tpl->assign('loop', $new_found_loop);
 }
 $result = $db->query("SELECT * FROM cc" . $n . "_soldiers where race = " . $userdata['rassenid'] . " AND sol_type = 1 ORDER BY sid");
 while ($row = $db->fetch_array($result)) {
     if ($userdata[$row['required']] >= $row['required_level']) {
Exemplo n.º 2
0
 $new_found_inhalt_2 = array();
 $new_found_2 = array();
 if ($userdata['size'] > $op_max_c_size) {
     $msize = $op_max_c_size;
 }
 if (isset($msize) and $msize < $op_max_c_size) {
     $msize = $op_max_c_size;
 }
 $new_found_inhalt_2 = array($userdata['sol_kolo'], $userdata['size'], $op_max_c_size);
 array_push($new_found_2, $new_found_inhalt_2);
 $result = $db->query("SELECT * FROM cc" . $n . "_new_land WHERE islandid='{$userdata['islandid']}' AND userid='{$userdata['userid']}' order by endtime");
 while ($row = $db->fetch_array($result)) {
     $requesttime = $row['endtime'] - time();
     if ($requesttime > 0) {
         timebanner_init(200, 1);
         $timebanner = make_timebanner($row['starttime'], $row['endtime'], $row['koloid'], "new_land.php");
         $sol_name = get_soldiers_name("sol_kolo", $userdata['rassenid']);
     } else {
         $result3 = $db->query("SELECT * FROM cc" . $n . "_crand WHERE x='{$row['x']}' AND y='{$row['y']}' AND used='0'");
         $map = $db->fetch_array($result3);
         if ($map) {
             $rand = rand(1, 15);
             trace_msg("landgr�ndung zufall: {$rand} win : 3,7,9,12", 113);
             if ($rand == 3 || $rand == 7 || $rand == 9 || $rand == 12) {
                 $db->query("INSERT INTO cc" . $n . "_countries (race,res1,res2,res3,res4,userid,lastressources,picid,x,y,size) VALUES ('{$userdata['rassenid']}','{$op_reg_res1}','{$op_reg_res2}','{$op_reg_res3}','{$op_reg_res4}','{$userdata['userid']}','" . time() . "','" . rand(1, 4) . "','{$map['x']}','{$map['y']}','" . rand($op_min_c_size, $op_max_c_size) . "')");
                 $db->query("UPDATE cc" . $n . "_crand SET used='1' WHERE x='{$map['x']}' AND y='{$map['y']}'");
                 make_ingamemail(0, $userdata['userid'], $newland11, $newland12);
             } else {
                 $die = rand(1, 10);
                 //set the die value $die=rand(1,xx);
                 trace_msg("landgr�ndung {$die} 1 <> 1  come back", 113);
Exemplo n.º 3
0
     }
     header("LOCATION: buildings.php");
     exit;
 }
 $new_found_inhalt = array();
 $new_found = array();
 $result_buildings = $db->query("SELECT * FROM cc" . $n . "_buildings where race = " . $userdata['rassenid'] . " and (tabless !='' and tabless !='0' ) and( require1 <= '" . $userdata['build_town'] . "' and require2 <= '" . $userdata['build_explore'] . "')ORDER BY p ASC");
 while ($row_buildings = $db->fetch_array($result_buildings)) {
     $in_bau = $userdata['bid'];
     $build_bid = $row_buildings['bid'];
     $es_wird_gebaut = 0;
     if (isset($show_bau) and $show_bau == 1) {
         if ($in_bau == $build_bid) {
             $es_wird_gebaut = 1;
             $cancelURL = "buildings.php?bid={$in_bau}&action=del";
             $message = make_timebanner($userdata['startbuildtime'], $userdata['endbuildtime'], $build_bid, "buildings.php") . "<br><a href=\"{$cancelURL}\">" . $buildingabort . "</a>";
         } else {
             $es_wird_gebaut = 1;
             $message = $building1;
         }
     } else {
         $res1 = $row_buildings['res1'] * ($userdata[$row_buildings['tabless']] + 1);
         $res2 = $row_buildings['res2'] * ($userdata[$row_buildings['tabless']] + 1);
         $res3 = $row_buildings['res3'] * ($userdata[$row_buildings['tabless']] + 1);
         $res4 = $row_buildings['res4'] * ($userdata[$row_buildings['tabless']] + 1);
         if ($userdata['res1'] >= $res1 && $userdata['res2'] >= $res2 && $userdata['res3'] >= $res3 && $userdata['res4'] >= $res4) {
             $message = "<a href='" . $file . "?bid={$row_buildings['bid']}&action=build&cxid={$sid}'>{$building9}</a>";
         } else {
             $message = $building11;
             $tofew_res1 = $res1 - $userdata['res1'];
             if ($tofew_res1 > 0) {
Exemplo n.º 4
0
         $buildtime = sec2time($row_explores['time'] * $size_new);
         $res1 = $row_explores['res1'] * ($size + 1);
         $res2 = $row_explores['res2'] * ($size + 1);
         $res3 = $row_explores['res3'] * ($size + 1);
         $res4 = $row_explores['res4'] * ($size + 1);
         $anzeige_res1 = $op_set_n_res1 . ": " . $res1;
         $anzeige_res2 = $op_set_n_res2 . ": " . $res2;
         $anzeige_res3 = $op_set_n_res3 . ": " . $res3;
         $anzeige_res4 = $op_set_n_res4 . ": " . $res4;
         if (isset($show_bau) and $show_bau == 1) {
             $time_2_go = sec2time($requesttime);
             if ($userdata['eid'] == $row_explores['eid']) {
                 $es_wird_gebaut = 1;
                 $timer = time();
                 $cancelURL = "exploring.php?eid={$userdata['eid']}&action=del";
                 $message = make_timebanner($userdata['startexploretime'], $userdata['endexploretime'], $row_explores['eid'], "") . "<br><a href=\"{$cancelURL}\">" . $exploreabort . "</a>";
             } else {
                 $es_wird_gebaut = 1;
                 $message = 'Es wird bereits geforscht! ';
             }
         } else {
             $message = "<a href=\"exploring.php?action=explore&eid={$row_explores['eid']}\">{$explore}</a>";
         }
         $image = "\"" . $row_explores['explorePic'] . "\"";
         $new_found_inhalt = array($image, $row_explores['name'], $size, $row_explores['description'], $anzeige_res1, $anzeige_res2, $anzeige_res3, $anzeige_res4, $buildtime, $message);
         array_push($new_found, $new_found_inhalt);
     }
 }
 $tpl->assign('daten', $new_found);
 template_out('exploring.html', $modul_name);
 exit;
Exemplo n.º 5
0
         $request_counter = make_timebanner($row['starttime'], $row['traveltime'], $z, "battle.php", "progressBar_red");
     } else {
         $request_counter = "Vor Ort";
     }
 } else {
     $request_counter = "Vor Ort";
 }
 $requesttime_battle = $row['traveltime'];
 $requesttime_battle_end = $row['traveltime'] + $op_battle_countdown_time;
 $requesttime_battle_total_end = $requesttime_battle_end - $time;
 if ($requesttime_battle_total_end > $op_battle_countdown_time) {
     $request_battle_counter = "auf den weg zum Ziel";
 } else {
     if ($requesttime_battle_total_end > 0) {
         $z++;
         $request_battle_counter = make_timebanner($row['traveltime'], $requesttime_battle_end, $z, "battle.php", "progressBar_red");
     } else {
         $request_battle_counter = "Beendet";
     }
 }
 $result_angreifer = $db->query("SELECT * FROM cc" . $n . "_countries WHERE islandid='{$row['islandid']}'");
 $row_angreifer = $db->fetch_array($result_angreifer);
 $angreifer_land = $row_angreifer['name'] . " (" . $row_angreifer['x'] . ":" . $row_angreifer['y'] . ")";
 $angreifer_user_id = $row_angreifer['userid'];
 $result_angreifer = $db->query("SELECT * FROM cc" . $n . "_users WHERE userid='{$angreifer_user_id}'");
 $row_angreifer = $db->fetch_array($result_angreifer);
 $angreifer_name = $row_angreifer['username'];
 $count++;
 $battle_def[$battle_def_count]['angreifer_name'] = $angreifer_name;
 $battle_def[$battle_def_count]['angreifer_land'] = $angreifer_land;
 $battle_def[$battle_def_count]['group_name'] = $group_name;
Exemplo n.º 6
0
 $spio_name = get_soldiers_name("sol_spio", $userdata['rassenid']);
 $spio_count = intval($userdata['sol_spio']);
 $new_found_inhalt = array();
 $new_found_spion = array();
 $spionage_bit = "";
 $sql = "SELECT * FROM cc" . $n . "_spions WHERE userid='{$userdata['userid']}' AND islandid='{$userdata['islandid']}'";
 $result = $db->query($sql);
 while ($row = $db->fetch_array($result)) {
     $endtime = $row['endtime'];
     $requesttime = $endtime - time();
     $starttime = $row['starttime'];
     $landname = get_island($row['toislandid']);
     $anzahl_spions = $row['spions'];
     $spion_id = $row['spionid'];
     if ($requesttime > 0) {
         $spionage_bit = make_timebanner($starttime, $endtime, $spion_id, "spion.php");
         $new_found_inhalt = array($landname, $anzahl_spions, $spionage_bit);
         array_push($new_found_spion, $new_found_inhalt);
     } else {
         $spio_ok = 0;
         $result_1 = $db->query("SELECT * FROM cc" . $n . "_countries WHERE islandid='{$row['toislandid']}'");
         $row2 = $db->fetch_array($result_1);
         $max_gegner = $row2['sol_spio'];
         $spioland = $row2['name'] . " (" . $row2['x'] . ":" . $row2['y'] . ")";
         $target_race = get_race_id_from_user($row2['userid']);
         trace_msg("Spionage Gegner anzahl :" . $max_gegner, 114);
         if ($max_gegner == 0) {
             $spio_ok = 1;
         } else {
             $change = rand(0, $max_gegner);
             $change = $change + $anzahl_spions;