Compare commits

...
Author SHA1 Message Date
Grégory PLANCHAT
2fde7653cf Merge pull request #6 from Noxgame/patch-1
Update src/application/code/core/Legacies/Empire/install/mysql5/install-...
2013-02-26 00:40:39 -08:00
Grégory PLANCHAT
7dcc790e65 Merge pull request #7 from loic-talon/master
Fix different error
2013-02-26 00:39:42 -08:00
Loïc TALON
5797328adc Fix date of messages and undefined var 2013-02-24 20:45:07 +01:00
Loïc TALON
6f1e5e4467 Fix Marchand
Fix undefined value in options.php
2013-02-24 19:01:04 +01:00
Loïc TALON
8ebc4cd91f Fix undefined dpath (options.php) 2013-02-24 18:11:09 +01:00
Loïc TALON
4b92511bae Fix second parameter of function date (options.php) 2013-02-24 17:58:42 +01:00
Mandalorien
74c4f31f7f Update src/application/code/core/Legacies/Empire/install/mysql5/install-1.5.0.php
correction
2013-01-22 17:21:24 +01:00
Gregory PLANCHAT
50538bd332 Updated profiler default visibility
Updated comments blocks

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-06-03 22:25:54 +02:00
Gregory PLANCHAT
9e3c1e68bf Added application handler
Fixed fleet bugs
Fixed colonization bug
Updated mail handler support
Fixed galaxy bugs
Updated license block

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-05-28 23:18:54 +02:00
Gregory PLANCHAT
4b2167c133 Fixed minor bugs
Updated redesign

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-05-02 23:06:18 +02:00
Gregory PLANCHAT
fa9fa5d3a5 Started interface redesign
Minor bug fixes

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-04-29 22:36:00 +02:00
Gregory PLANCHAT
b09c4e6c62 Bug fixes
Removed some dowuery calls in deprecated code.
Updated labels
Updated requirements & types for ore miner

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-04-09 20:01:45 +02:00
Gregory PLANCHAT
422f2c1295 Fixed minor bugs
Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-25 18:35:28 +02:00
Gregory PLANCHAT
a531d61639 Updated home page
Fixed buildings consruction time

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-24 15:51:26 +01:00
Gregory PLANCHAT
347952319a Fixed DML queries errors
Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-23 21:50:44 +01:00
Gregory PLANCHAT
70145967d0 Updated front controller
Fixed DML queries errors (partly implemented)
Fixed minor bugs

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-21 01:41:56 +01:00
Gregory PLANCHAT
3dde300c80 Added building/research-lab/shipyard/defenses MVC controllers
Refactored View & Model base classes
Added database adapter error messages and status utility methods
Fixed login error
Fixed HTTP 404 error on home page
Fixed minor bugs

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-20 21:31:33 +01:00
Gregory PLANCHAT
802be5f8c3 Updated Database component
Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-10 08:17:38 +01:00
Gregory PLANCHAT
7e7924e97e Updated Database component
Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-08 19:11:30 +01:00
Gregory PLANCHAT
03efb85c0b Refactored Controller
Refactored Database adapters

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-01 18:20:05 +01:00
Gregory PLANCHAT
690a7f60f3 Updated data access layer
Renamed classes, methods & variables from "User" to "Player"
Fixed dependencies requirements in the research lab queue
Updated overview
Added MVC's controller
Added build files
Updated directory structure

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-02-28 22:43:37 +01:00
Gregory PLANCHAT
d40313279a Updated layout file format to XML
Fixed config & install inconstinstencies
Fixed form management updates

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-01-24 22:27:32 +01:00
Gregory PLANCHAT
66805034a6 Configuration & Layout architecture updates
Fixed production bug
Fixed styles
Updated Action Controller

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-01-13 23:36:03 +01:00
Gregory PLANCHAT
dfa3dfb086 Finished install script
Updated configuration data loading
Added Website and Game models

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2011-12-27 19:37:28 +01:00
Gregory PLANCHAT
5393be4daf Updated installer
Added Website and Game models
Updted config loading

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2011-12-15 22:10:35 +01:00
Gregory PLANCHAT
fcd1f5b740 Updated config management
Updated install

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2011-12-14 23:45:09 +01:00
Gregory PLANCHAT
4bb4693d2e Updated install script
Fixed CSS issues

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2011-12-05 18:52:05 +01:00
Gregory PLANCHAT
5acde87794 Updated install
Added Form manager
Added session messages display

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2011-11-18 08:05:42 +01:00
Gregory PLANCHAT
9636b4bb00 Updated install and fixed bugs
Added session messages display
Fixed field and validator loading.
Updated form validation
Updated root config management
Muted error reporting in file evaluation
Added menu updates
Fixed galaxy data access error
Fixed config bug
Added HTTP request method checks
Added Form manager
Fixed core bugs

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2011-11-08 08:56:53 +01:00
Grégory PLANCHAT
c38e53706e Merge pull request #2 from warlof/patch-1
correction des caractères spéciaux et fermeture des chaîne de caractè
2011-10-26 01:10:05 -07:00
warlof
fc311855b4 correction des caractères spéciaux et fermeture des chaîne de caractère 60 et 65 2011-10-23 17:51:27 +03:00
1567 changed files with 24950 additions and 15453 deletions

3
.gitignore vendored
View file

@ -2,4 +2,7 @@ config.php
.buildpath
.project
.settings/
.idea/
coverage/
src/application/cache/*
src/application/configs/local.php

View file

@ -1,2 +0,0 @@
SetEnv DEBUG On
SetEnv DEPRECATION Off

View file

@ -1,68 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
includeLang('admin');
$mode = $_POST['mode'];
$PageTpl = gettemplate("add_declare");
$parse = $lang;
if ($mode == 'addit') {
$declarator = $user['id'];
$declarator_name = addslashes(htmlspecialchars($user['username']));
$decl1 = addslashes(htmlspecialchars($_POST['dec1']));
$decl2 = addslashes(htmlspecialchars($_POST['dec2']));
$decl3 = addslashes(htmlspecialchars($_POST['dec3']));
$reason1 = addslashes(htmlspecialchars($_POST['reason']));
$QryDeclare = "INSERT INTO {{table}} SET ";
$QryDeclare .= "`declarator` = '". $declarator ."', ";
$QryDeclare .= "`declarator_name` = '". $declarator_name ."', "; $QryDeclare .= "`declared_1` = '". $decl1 ."', ";
$QryDeclare .= "`declared_2` = '". $decl2 ."', ";
$QryDeclare .= "`declared_3` = '". $decl3 ."', ";
$QryDeclare .= "`reason` = '". $reason1 ."' ";
doquery( $QryDeclare, "declared");
doquery("UPDATE {{table}} SET multi_validated ='1' WHERE username='{$user['username']}'","users");
AdminMessage ( "Merci, votre demande a ete prise en compte. Les autres joueurs que vous avez implique doivent egalement et imperativement suivre cette procedure aussi.", "Ajout" );
}
$Page = parsetemplate($PageTpl, $parse);
display ($Page, "Declaration d\'IP partagee", false, '', true);
?>

View file

@ -1,66 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
includeLang('admin');
$parse = $lang;
$parse['dpath'] = $dpath;
$parse['mf'] = $mf;
$PageTPL = gettemplate('admin/activeplanet_body');
$AllActivPlanet = doquery("SELECT * FROM {{table}} WHERE `last_update` >= '". (time()-15 * 60) ."' ORDER BY `id` ASC", 'planets');
$Count = 0;
while ($ActivPlanet = $AllActivPlanet->fetch(PDO::FETCH_BOTH)) {
$parse['online_list'] .= "<tr>";
$parse['online_list'] .= "<td class=b><center><b>". $ActivPlanet['name'] ."</b></center></td>";
$parse['online_list'] .= "<td class=b><center><b>[". $ActivPlanet['galaxy'] .":". $ActivPlanet['system'] .":". $ActivPlanet['planet'] ."]</b></center></td>";
$parse['online_list'] .= "<td class=m><center><b>". pretty_number($ActivPlanet['points'] / 1000) ."</b></center></td>";
$parse['online_list'] .= "<td class=b><center><b>". pretty_time(time() - $ActivPlanet['last_update']) . "</b></center></td>";
$parse['online_list'] .= "</tr>";
$Count++;
}
$parse['online_list'] .= "<tr>";
$parse['online_list'] .= "<th class=\"b\" colspan=\"4\">". $lang['adm_pl_they'] ." ". $Count ." ". $lang['adm_pl_apla'] ."</th>";
$parse['online_list'] .= "</tr>";
$page = parsetemplate( $PageTPL , $parse );
display( $page, $lang['adm_pl_title'], false, '', true );
} else {
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
}
?>

View file

@ -1,101 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
if ($user['authlevel'] >= 1) {
includeLang('admin/add_fleet');
$mode = $_GET['mode'];
if($mode != 'add') {
$parse['ID'] = $lang['Id'];
$parse['Cle'] = $lang['cle'];
$parse['Clourd'] = $lang['clourd'];
$parse['Pt'] = $lang['pt'];
$parse['Gt'] = $lang['gt'];
$parse['Cruise'] = $lang['cruise'];
$parse['Vb'] = $lang['vb'];
$parse['Colo'] = $lang['colo'];
$parse['Rc'] = $lang['rc'];
$parse['Spy'] = $lang['spy'];
$parse['Bomb'] = $lang['bomb'];
$parse['Solar'] = $lang['solar'];
$parse['Des'] = $lang['des'];
$parse['Rip'] = $lang['rip'];
$parse['Traq'] = $lang['traq'];
} elseif($mode == 'add') {
$id = $_POST['id'];
$cle = $_POST['cle'];
$clourd = $_POST['clourd'];
$pt = $_POST['pt'];
$gt = $_POST['gt'];
$cruise = $_POST['cruise'];
$vb = $_POST['vb'];
$colo = $_POST['colo'];
$rc = $_POST['rc'];
$spy = $_POST['spy'];
$bomb = $_POST['bomb'];
$solar = $_POST['solar'];
$des = $_POST['des'];
$rip = $_POST['rip'];
$traq = $_POST['traq'];
$SqlAdd = "UPDATE {{table}} SET";
$SqlAdd .= "`light_hunter` = '".$cle."+light_hunter', ";
$SqlAdd .= "`heavy_hunter` = '".$clourd."+heavy_hunter', ";
$SqlAdd .= "`small_ship_cargo` = '".$pt."+small_ship_cargo', ";
$SqlAdd .= "`big_ship_cargo` = '".$gt."+big_ship_cargo', ";
$SqlAdd .= "`crusher` = '".$cruise."+crusher', ";
$SqlAdd .= "`battle_ship` = '".$vb."+battle_ship', ";
$SqlAdd .= "`colonizer` = '".$colo."+colonizer', ";
$SqlAdd .= "`recycler` = '".$rc."+recycler', ";
$SqlAdd .= "`spy_sonde`= '".$spy."+spy_sonde', ";
$SqlAdd .= "`bomber_ship` = '".$bomb."+bomber_ship', ";
$SqlAdd .= "`solar_satelit` = '".$solar."+solar_satelit', ";
$SqlAdd .= "`destructor` = '".$des."+destructor', ";
$SqlAdd .= "`dearth_star` = '".$rip."+dearth_star', ";
$SqlAdd .= "`battleship` = '".$traq."+battleship', ";
$SqlAdd .= " WHERE `id` = '".$id."' LIMIT 1";
doquery($SqlAdd, "planets");
message('Ajout OK');
}
$page = parsetemplate(gettemplate('admin/add_fleet'), $parse);
display( $page);
} else {
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
}
?>

View file

@ -1,66 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
function mass_message_run($parent){
if($_POST["mode"] == "change"){
if(isset($_POST["tresc"])&& $_POST["tresc"] != ''){
$gameConfig['tresc'] = $parent->safe_get_post_var("tresc");
}
if(isset($_POST["temat"])&& $_POST["temat"] != ''){
$gameConfig['temat'] = $parent->safe_get_post_var("temat");
}
$kolor = 'red';
if($gameConfig['tresc'] !='' and $gameConfig['temat']){
$sq = $parent->db->query("SELECT `id` FROM {{table}}","users");
while($u = $parent->db->fetch_assoc($sq)){
doquery("INSERT INTO {{table}} SET
`message_owner`='{$u['id']}',
`message_sender`='1' ,
`message_time`='".time()."',
`message_type`='0',
`message_from`='<font color=\"$kolor\">Administracja</font>',
`message_subject`='<font color=\"$kolor\">{$gameConfig['temat']}</font>',
`message_text`='<font color=\"$kolor\"><b>{$gameConfig['tresc']}</b></font>'
","messages");
$parent->db->query("UPDATE {{table}} SET new_message=new_message+1 WHERE id='{$u['id']}'",'users');
}
$parent->smarty->assign("message","<font color=\"lime\">Wys<79>a<EFBFBD>e<EFBFBD> wiadomo<6D><6F> do wszystkich graczy</font>");
}
}
$parent->smarty->display("mass_message.tpl");
}
function mass_message_info(){
return array("name" => "Send MassMessages","description"=>"Sends messagess to all players","default_weight"=>"0");
}

View file

@ -1,75 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
if ($_POST && $mode == "change") {
if (isset($_POST["tresc"]) && $_POST["tresc"] != '') {
$gameConfig['tresc'] = $_POST['tresc'];
}
if (isset($_POST["temat"]) && $_POST["temat"] != '') {
$gameConfig['temat'] = $_POST['temat'];
}
if ($user['authlevel'] == LEVEL_ADMIN) {
$kolor = 'red';
$ranga = 'Administrator';
} elseif ($user['authlevel'] == LEVEL_OPERATOR) {
$kolor = 'skyblue';
$ranga = 'Operator';
} elseif ($user['authlevel'] == LEVEL_MODERATOR) {
$kolor = 'yellow';
$ranga = 'Moderator';
}
if ($gameConfig['tresc'] != '' and $gameConfig['temat']) {
$sq = doquery("SELECT `id` FROM {{table}}", "users");
$Time = time();
$From = "<font color=\"". $kolor ."\">". $ranga ." ".$user['username']."</font>";
$Subject = "<font color=\"". $kolor ."\">". $gameConfig['temat'] ."</font>";
$Message = "<font color=\"". $kolor ."\"><b>". $gameConfig['tresc'] ."</b></font>";
while ($u = $sq->fetch(PDO::FETCH_BOTH)) {
SendSimpleMessage ( $u['id'], $user['id'], $Time, 97, $From, $Subject, $Message);
}
message("<font color=\"lime\">Wys<79>a<EFBFBD>e<EFBFBD> wiadomo<6D><6F> do wszystkich graczy</font>", "Complete", "../overview." . PHPEXT, 3);
}
} else {
$parse = $gameConfig;
$parse['dpath'] = $dpath;
$parse['debug'] = ($gameConfig['debug'] == 1) ? " checked='checked'/":'';
$page .= parsetemplate(gettemplate('admin/messall_body'), $parse);
display($page, '', false,'', true);
}
} else {
message($lang['sys_noalloaw'], $lang['sys_noaccess']);
}
?>

View file

@ -1,116 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
includeLang('admin');
if ($_GET['cmd'] == 'sort') {
$TypeSort = $_GET['type'];
} else {
$TypeSort = "id";
}
$PageTPL = gettemplate('admin/overview_body');
$RowsTPL = gettemplate('admin/overview_rows');
$parse = $lang;
$parse['dpath'] = $dpath;
$parse['mf'] = $mf;
$parse['adm_ov_data_yourv'] = colorRed(VERSION);
$Last15Mins = doquery("SELECT * FROM {{table}} WHERE `onlinetime` >= '". (time() - 15 * 60) ."' ORDER BY `". $TypeSort ."` ASC;", 'users');
$Count = 0;
$Color = "lime";
while ($TheUser = $Last15Mins->fetch(PDO::FETCH_ASSOC) ) {
if ($PrevIP != "") {
if ($PrevIP == $TheUser['user_lastip']) {
$Color = "red";
} else {
$Color = "lime";
}
}
$UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $TheUser['id'] . "';", 'statpoints', true);
$Bloc['dpath'] = $dpath;
$Bloc['adm_ov_altpm'] = $lang['adm_ov_altpm'];
$Bloc['adm_ov_wrtpm'] = $lang['adm_ov_wrtpm'];
$Bloc['adm_ov_data_id'] = $TheUser['id'];
$Bloc['adm_ov_data_name'] = $TheUser['username'];
$Bloc['adm_ov_data_agen'] = $TheUser['user_agent'];
$Bloc['current_page'] = $TheUser['current_page'];
$Bloc['usr_s_id'] = $TheUser['id'];
$Bloc['adm_ov_data_clip'] = $Color;
$Bloc['adm_ov_data_adip'] = $TheUser['user_lastip'];
$Bloc['adm_ov_data_ally'] = $TheUser['ally_name'];
$Bloc['adm_ov_data_point'] = pretty_number ( $UserPoints['total_points'] );
$Bloc['adm_ov_data_activ'] = pretty_time ( time() - $TheUser['onlinetime'] );
$Bloc['adm_ov_data_pict'] = "m.gif";
$PrevIP = $TheUser['user_lastip'];
//Tweaks vue g<>n<EFBFBD>rale
$Bloc['usr_email'] = $TheUser['email'];
$Bloc['usr_xp_raid'] = $TheUser['xpraid'];
$Bloc['usr_xp_min'] = $TheUser['xpminier'];
if ($TheUser['urlaubs_modus'] == 1) {
$Bloc['state_vacancy'] = "<img src=\"../images/true.png\" >";
} else {
$Bloc['state_vacancy'] = "<img src=\"../images/false.png\">";
}
if ($TheUser['bana'] == 1) {
$Bloc['is_banned'] = "<img src=\"../images/banned.png\" >";
} else {
$Bloc['is_banned'] = $lang['is_banned_lang'];
}
$Bloc['usr_planet_gal'] = $TheUser['galaxy'];
$Bloc['usr_planet_sys'] = $TheUser['system'];
$Bloc['usr_planet_pos'] = $TheUser['planet'];
$parse['adm_ov_data_table'] .= parsetemplate( $RowsTPL, $Bloc );
$Count++;
}
$parse['adm_ov_data_count'] = $Count;
$Page = parsetemplate($PageTPL, $parse);
display ( $Page, $lang['sys_overview'], false, '', true);
} else {
AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
}
?>

View file

@ -1,253 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
function DisplayGameSettingsPage ( $CurrentUser ) {
global $lang, $gameConfig;
includeLang('admin/settings');
if (in_array((int) $CurrentUser['authlevel'], array(LEVEL_ADMIN))) {
if (isset($_POST['opt_save']) && $_POST['opt_save'] == "1") {
// Jeu Ouvert ou Ferm<72> !
if (isset($_POST['closed']) && $_POST['closed'] == 'on') {
$gameConfig['game_disable'] = "1";
$gameConfig['close_reason'] = addslashes( $_POST['close_reason'] );
} else {
$gameConfig['game_disable'] = "0";
$gameConfig['close_reason'] = "";
}
// Y a un News Frame ? !
if (isset($_POST['newsframe']) && $_POST['newsframe'] == 'on') {
$gameConfig['OverviewNewsFrame'] = "1";
$gameConfig['OverviewNewsText'] = addslashes( $_POST['NewsText'] );
} else {
$gameConfig['OverviewNewsFrame'] = "0";
$gameConfig['OverviewNewsText'] = "";
}
// Y a un TCHAT externe ??
if (isset($_POST['chatframe']) && $_POST['chatframe'] == 'on') {
$gameConfig['OverviewExternChat'] = "1";
$gameConfig['OverviewExternChatCmd'] = addslashes( $_POST['ExternChat'] );
} else {
$gameConfig['OverviewExternChat'] = "0";
$gameConfig['OverviewExternChatCmd'] = "";
}
if (isset($_POST['googlead']) && $_POST['googlead'] == 'on') {
$gameConfig['OverviewBanner'] = "1";
$gameConfig['OverviewClickBanner'] = addslashes( $_POST['GoogleAds'] );
} else {
$gameConfig['OverviewBanner'] = "0";
$gameConfig['OverviewClickBanner'] = "";
}
// Y a un BANNER Frame ?
if (isset($_POST['bannerframe']) && $_POST['bannerframe'] == 'on') {
$gameConfig['ForumBannerFrame'] = "1";
} else {
$gameConfig['ForumBannerFrame'] = "0";
}
// Mode Debug ou pas !
if (isset($_POST['debug']) && $_POST['debug'] == 'on') {
$gameConfig['debug'] = "1";
} else {
$gameConfig['debug'] = "0";
}
// Nom du Jeu
if (isset($_POST['game_name']) && $_POST['game_name'] != '') {
$gameConfig['game_name'] = $_POST['game_name'];
}
// Adresse du Forum
if (isset($_POST['forum_url']) && $_POST['forum_url'] != '') {
$gameConfig['forum_url'] = $_POST['forum_url'];
}
// Vitesse du Jeu
if (isset($_POST['game_speed']) && is_numeric($_POST['game_speed'])) {
$gameConfig['game_speed'] = $_POST['game_speed'];
}
// Vitesse des Flottes
if (isset($_POST['fleet_speed']) && is_numeric($_POST['fleet_speed'])) {
$gameConfig['fleet_speed'] = $_POST['fleet_speed'];
}
// Multiplicateur de Production
if (isset($_POST['resource_multiplier']) && is_numeric($_POST['resource_multiplier'])) {
$gameConfig['resource_multiplier'] = $_POST['resource_multiplier'];
}
// Taille de la planete mère
if (isset($_POST['initial_fields']) && is_numeric($_POST['initial_fields'])) {
$gameConfig['initial_fields'] = $_POST['initial_fields'];
}
// Revenu de base Metal
if (isset($_POST['metal_basic_income']) && is_numeric($_POST['metal_basic_income'])) {
$gameConfig['metal_basic_income'] = $_POST['metal_basic_income'];
}
// Revenu de base Cristal
if (isset($_POST['crystal_basic_income']) && is_numeric($_POST['crystal_basic_income'])) {
$gameConfig['crystal_basic_income'] = $_POST['crystal_basic_income'];
}
// Revenu de base Deuterium
if (isset($_POST['deuterium_basic_income']) && is_numeric($_POST['deuterium_basic_income'])) {
$gameConfig['deuterium_basic_income'] = $_POST['deuterium_basic_income'];
}
// Revenu de base Energie
if (isset($_POST['energy_basic_income']) && is_numeric($_POST['energy_basic_income'])) {
$gameConfig['energy_basic_income'] = $_POST['energy_basic_income'];
}
// Lien supplémentaire dans le menu
if (isset($_POST['enable_link_']) && is_numeric($_POST['enable_link_'])) {
$gameConfig['link_enable'] = $_POST['enable_link_'];
}
// Texte de ce lien...
$gameConfig['link_name'] = addslashes( $_POST['name_link_']);
// URL de ce lien...
$gameConfig['link_url'] = $_POST['url_link_'];
// Image de la bannière
$gameConfig['banner_source_post'] = $_POST['banner_source_post'];
// 1 point = ??? Ressources ?
if (isset($_POST['stat_settings']) && is_numeric($_POST['stat_settings'])) {
$gameConfig['stat_settings'] = $_POST['stat_settings'];
}
// Activation -ou non- des annonces
if (isset($_POST['enable_announces_']) && is_numeric($_POST['enable_announces_'])) {
$gameConfig['enable_announces'] = $_POST['enable_announces_'];
}
// Activation -ou non- du marchand
if (isset($_POST['enable_marchand_']) && is_numeric($_POST['enable_marchand_'])) {
$gameConfig['enable_marchand'] = $_POST['enable_marchand_'];
}
// Activation -ou non- des notes
if (isset($_POST['enable_notes_']) && is_numeric($_POST['enable_notes_'])) {
$gameConfig['enable_notes'] = $_POST['enable_notes_'];
}
// Nom du bot antimulti
$gameConfig['bot_name'] = addslashes( $_POST['name_bot']);
// email du bot antimulti
$gameConfig['bot_adress'] = addslashes( $_POST['adress_bot']);
// Activation -ou non- des notes
if (isset($_POST['duration_ban']) && is_numeric($_POST['duration_ban'])) {
$gameConfig['ban_duration'] = $_POST['duration_ban'];
}
// Activation -ou non- du bot
if (isset($_POST['bot_enable']) && is_numeric($_POST['bot_enable'])) {
$gameConfig['enable_bot'] = $_POST['bot_enable'];
}
// BBCode ou pas ?
if (isset($_POST['bbcode_field']) && is_numeric($_POST['bbcode_field'])) {
$gameConfig['enable_bbcode'] = $_POST['bbcode_field'];
}
$gameConfig->save();
AdminMessage ('Options changees avec succes !', 'Succes', '?');
} else {
$parse = $lang;
$parse['game_name'] = $gameConfig['game_name'];
$parse['game_speed'] = $gameConfig['game_speed'];
$parse['fleet_speed'] = $gameConfig['fleet_speed'];
$parse['resource_multiplier'] = $gameConfig['resource_multiplier'];
$parse['forum_url'] = $gameConfig['forum_url'];
$parse['initial_fields'] = $gameConfig['initial_fields'];
$parse['metal_basic_income'] = $gameConfig['metal_basic_income'];
$parse['crystal_basic_income'] = $gameConfig['crystal_basic_income'];
$parse['deuterium_basic_income'] = $gameConfig['deuterium_basic_income'];
$parse['energy_basic_income'] = $gameConfig['energy_basic_income'];
$parse['enable_link'] = $gameConfig['link_enable'];
$parse['name_link'] = $gameConfig['link_name'];
$parse['url_link'] = $gameConfig['link_url'];
$parse['enable_announces'] = $gameConfig['enable_announces'];
$parse['enable_marchand'] = $gameConfig['enable_marchand'];
$parse['enable_notes'] = $gameConfig['enable_notes'];
$parse['bot_name'] = stripslashes($gameConfig['bot_name']);
$parse['bot_adress'] = stripslashes($gameConfig['bot_adress']);
$parse['ban_duration'] = stripslashes($gameConfig['ban_duration']);
$parse['enable_bot'] = stripslashes($gameConfig['enable_bot']);
$parse['enable_bbcode'] = stripslashes($gameConfig['enable_bbcode']);
$parse['banner_source_post'] = $gameConfig['banner_source_post'];
$parse['stat_settings'] = stripslashes($gameConfig['stat_settings']);
$parse['closed'] = ($gameConfig['game_disable'] == 1) ? " checked = 'checked' ":"";
$parse['close_reason'] = stripslashes( $gameConfig['close_reason'] );
$parse['newsframe'] = ($gameConfig['OverviewNewsFrame'] == 1) ? " checked = 'checked' ":"";
$parse['NewsTextVal'] = stripslashes( $gameConfig['OverviewNewsText'] );
$parse['chatframe'] = ($gameConfig['OverviewExternChat'] == 1) ? " checked = 'checked' ":"";
$parse['ExtTchatVal'] = stripslashes( $gameConfig['OverviewExternChatCmd'] );
$parse['googlead'] = ($gameConfig['OverviewBanner'] == 1) ? " checked = 'checked' ":"";
$parse['GoogleAdVal'] = stripslashes( $gameConfig['OverviewClickBanner'] );
$parse['debug'] = ($gameConfig['debug'] == 1) ? " checked = 'checked' ":"";
$parse['bannerframe'] = ($gameConfig['ForumBannerFrame'] == 1) ? " checked = 'checked' ":"";
$PageTPL = gettemplate('admin/options_body');
$Page = parsetemplate( $PageTPL, $parse );
display ( $Page, $lang['adm_opt_title'], false, '', true );
}
} else {
AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
}
return $Page;
}
$Page = DisplayGameSettingsPage($user);

View file

@ -1,70 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
$dpath = (!$userrow["dpath"]) ? DEFAULT_SKINPATH : $userrow["dpath"];
if(!is_numeric($_GET["a"]) || !$_GET["a"] ){ message("Ung&uuml;ltige Allianz-ID","Fehler");}
$allyrow = doquery("SELECT ally_name,ally_tag,ally_description,ally_web,ally_image FROM {{table}} WHERE id=".$_GET["a"],"alliance",true);
if(!$allyrow){ message("Alliance non trouv&eacute;e","Erreur");}
$count = doquery("SELECT COUNT(DISTINCT(id)) FROM {{table}} WHERE ally_id=".$_GET["a"].";","users",true);
$ally_member_scount = $count[0];
$page .="<table width=519><tr><td class=c colspan=2>Informations sur l'alliance</td></tr>";
if($allyrow["ally_image"] != ""){
$page .= "<tr><th colspan=2><img src=\"".$allyrow["ally_image"]."\"></td></tr>";
}
$page .= "<tr><th>Tag</th><th>".$allyrow["ally_tag"]."</th></tr><tr><th>Nom</th><th>".$allyrow["ally_name"]."</th></tr><tr><th>Membres</th><th>$ally_member_scount</th></tr>";
if($allyrow["ally_description"] != ""){
$page .= "<tr><th colspan=2 height=100>".$allyrow["ally_description"]."</th></tr>";
}
if($allyrow["ally_web"] != ""){
$page .="<tr>
<th>Site internet</th>
<th><a href=\"".$allyrow["ally_web"]."\">".$allyrow["ally_web"]."</a></th>
</tr>";
}
$page .= "</table>";
display($page,"Information sur l'alliance [".$allyrow["ally_name"]."]",false);
?>

View file

@ -1,252 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/agpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
*
* Enter description here ...
* @author Greg
*
*/
class Legacies_Empire_Model_Planet_Building_ResearchLab_Builder
extends Wootook_Empire_Model_BuilderAbstract
{
/**
* @var int
*/
protected $_maxLength = 0;
public function init()
{
$this->_unserializeQueue($this->_currentUser->getData('b_laboratory_id'));
}
/**
* @param int $buildingId
* @param int $level
* @param int $time
*/
protected function _initItem(Array $params)
{
if (!isset($params['technology_id']) || !isset($params['level'])) {
return null;
}
$technologyId = $params['technology_id'];
$level = $params['level'];
if (!isset($params['created_at'])) {
$createdAt = time();
} else {
$createdAt = $params['created_at'];
}
if (!isset($params['updated_at'])) {
$updatedAt = $createdAt;
} else {
$updatedAt = $params['updated_at'];
}
return new Legacies_Empire_Model_Planet_Building_ResearchLab_Item(array(
'technology_id' => $technologyId,
'level' => $level,
'created_at' => $createdAt,
'updated_at' => $updatedAt
));
}
/**
* Check if a technology type is actually buildable on the current
* planet, depending on the technology and buildings requirements.
*
* @param int $technologyId
* @return bool
*/
public function checkAvailability($technologyId)
{
$types = Wootook_Empire_Model_Game_Types::getSingleton();
if (!$types->is($technologyId, Legacies_Empire::TYPE_RESEARCH)) {
return false;
}
parent::checkAvailability($technologyId);
return true;
}
/**
* Returns the time needed to build $level of $technologyId
*
* @param int $technologyId
* @param int $level
*/
public function getBuildingTime($technologyId, $level)
{
$prices = Wootook_Empire_Model_Game_Prices::getSingleton();
$types = Wootook_Empire_Model_Game_Types::getSingleton();
$gameConfig = Wootook_Core_Model_Config::getSingleton();
Math::setPrecision(50);
// FIXME: Resource dependency
$totalCost = Math::mul(Math::add($prices[$technologyId][Legacies_Empire::RESOURCE_METAL], $prices[$technologyId][Legacies_Empire::RESOURCE_CRISTAL]), $level);
$speedFactor = $gameConfig->getData('game_speed');
// FIXME: Building & Technology dependency
$extraLaboratoriesLevels = 0;
$researchNetworkLevel = $this->_currentUser->getElement(Legacies_Empire::ID_RESEARCH_INTERGALACTIC_RESEARCH_NETWORK);
if ($researchNetworkLevel > 0) {
$laboratoriesLevels = array();
foreach ($this->_currentUser->getPlanetCollection() as $planet) {
if ($this->_currentPlanet->getId() == $planet->getId()) {
continue;
}
$level = $planet->getElement(Legacies_Empire::ID_BUILDING_RESEARCH_LAB);
if ($level > 0) {
$laboratoriesLevels[] = (int) $level;
}
}
sort($laboratoriesLevels, SORT_NUMERIC);
$extraLaboratoriesLevels = array_sum(array_slice(array_reverse($laboratoriesLevels), 0, $researchNetworkLevel));
}
$laboratorySpeedup = Math::div($totalCost, ($this->_currentPlanet->getElement(Legacies_Empire::ID_BUILDING_RESEARCH_LAB) + 1 + $extraLaboratoriesLevels));
Math::setPrecision();
$baseTime = ($totalCost / $speedFactor) * $laboratorySpeedup;
return (int) Math::floor($baseTime * 3600);
}
/**
* (non-PHPdoc)
* @see Legacies_Empire_Model_BuilderAbstract::getResourcesNeeded()
*/
public function getResourcesNeeded($technologyId, $level)
{
$prices = Wootook_Empire_Model_Game_Prices::getSingleton();
$resources = Wootook_Empire_Model_Game_Resources::getSingleton();
if (!isset($prices[$technologyId])) {
return array();
}
$resourcesNeeded = array();
foreach ($resources as $resourceId => $resourceConfig) {
if (!isset($prices[$technologyId][$resourceId])) {
continue;
}
if (Math::isPositive($prices[$technologyId][$resourceId])) {
$firstLevelCost = $prices[$technologyId][$resourceId];
$partialLevelCost = Math::mul($firstLevelCost, Math::pow($prices[$technologyId][Legacies_Empire::RESOURCE_MULTIPLIER], $level));
$resourcesNeeded[$resourceId] = Math::sub($partialLevelCost, $firstLevelCost);
}
}
return $resourcesNeeded;
}
/**
* Update the contruction queue.
*
* @return Legacies_Empire_Model_Planet_Building_ResearchLab
*/
public function updateQueue($time)
{
$fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton();
$elapsedTime = $time - $this->_currentUser->getData('b_laboratory');
foreach ($this->getQueue() as $element) {
$technologyId = $element->getData('research_id');
$level = $element->getData('level');
$buildTime = $this->getBuildingTime($technologyId, $level);
if ($elapsedTime >= $buildTime) {
$this->_currentUser[$fields[$technologyId]] = Math::add($this->_currentUser[$fields[$technologyId]], $level);
$elapsedTime -= $buildTime;
$this->dequeue($element);
continue;
}
$timeRatio = $elapsedTime / $buildTime;
$itemsBuilt = Math::mul($timeRatio, $level);
$element->setData('updated_at', $time);
$element->setData('level', Math::sub($level, $itemsBuilt));
$this->_currentUser->setData($fields[$technologyId], Math::add($this->_currentUser->getData($fields[$technologyId]), $itemsBuilt));
break;
}
$this->_currentUser->setData('b_laboratory_id', $this->serialize());
$this->_currentUser->setData('b_laboratory', $time);
return $this;
}
/**
* Append items to build to the construction list
*
* @param int $technologyId
* @param int|string $level
* @return Legacies_Empire_Model_Planet_Building_ResearchLab
*/
public function appendQueue($technologyId, $level, $time)
{
if ($this->_maxLength > 0 && $this->count() >= $this->_maxLength) {
return $this;
}
if (!Math::isPositive($level)) {
return $this;
}
$types = Wootook_Empire_Model_Game_Types::getSingleton();
if (!$types->is($technologyId, Legacies_Empire::TYPE_RESEARCH)) {
return $this;
}
if (!$this->checkAvailability($technologyId)) {
return $this;
}
$resourcesNeeded = $this->getResourcesNeeded($technologyId, $level);
$remainingAmounts = $this->_calculateResourceRemainingAmounts($resourcesNeeded);
if ($remainingAmounts === false) {
return $this;
}
$this->enqueue($technologyId, $level, $time);
$this->_currentUser->setData('b_laboratory_id', $this->serialize());
foreach ($remainingAmounts as $resourceId => $resourceAmount) {
$this->_currentPlanet[$resourceId] = $resourceAmount;
}
return $this;
}
};

View file

@ -1,70 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/agpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
*
* Enter description here ...
* @author Greg
*
*/
class Legacies_Officers_Model_Observer
{
public static function planetUpdateListener($eventData)
{
if (isset($eventData['planet'])) {
$planet = $eventData['planet'];
$user = $planet->getUser();
$level = floor(sqrt($user->getData('xpminier') / 500));
if ($user->getData('lvl_minier') < $level) {
$difference = $level - $user->getData('lvl_minier');
if ($difference == 1) {
Wootook::getSession(Wootook_Empire_Model_User::SESSION_KEY)
->addInfo('You gained 1 miner level.');
} else {
Wootook::getSession(Wootook_Empire_Model_User::SESSION_KEY)
->addInfo('You gained %1$d miner level.', (int) $difference);
}
}
$level = floor(sqrt($user->getData('xpraid')));
if ($user->getData('lvl_raid') < $level) {
$difference = $level - $user->getData('lvl_raid');
if ($difference == 1) {
Wootook::getSession(Wootook_Empire_Model_User::SESSION_KEY)
->addInfo('You gained 1 raider level.');
} else {
Wootook::getSession(Wootook_Empire_Model_User::SESSION_KEY)
->addInfo('You gained %1$d raider level.', (int) $difference);
}
}
}
}
}

View file

@ -1,342 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/agpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
* Bootstrap class, used to access main and global functionalities
*
* @package Wootook
* @category core
*/
class Wootook
{
/**
* Static list of application event listeners
*
* @var array
*/
private static $_listeners = array();
/**
* Static list of all locale translators
*
* @var array
*/
private static $_translators = array();
/**
* HTTP request management object
*
* @var Legacies_Core_Controller_Request_Http
*/
protected static $_request = null;
/**
* HTTP response management object
*
* @var Legacies_Core_Controller_Response
*/
protected static $_response = null;
/**
* The current timestamp
*
* @var int
*/
protected static $_now = null;
/**
* Default locale identifier
*
* @var string
*/
protected static $_defaultLocale = 'fr_FR';
/**
*
* Enter description here ...
* @var array
*/
protected static $_config = null;
/**
* Registers an event listener to be called later in the application.
*
* @param string $event The event identifier
* @param callback $listener The event callback to be called
*/
public static function registerListener($event, $listener)
{
if (!isset(self::$_listeners[$event])) {
self::$_listeners[$event] = array();
}
self::$_listeners[$event][] = $listener;
}
/**
* Clear all event listeners
*/
public static function clearAllListeners()
{
self::$_listeners = array();
}
/**
* Clear a specific event's listeners
*
* @param unknown_type $event
*/
public static function clearEventListeners($event)
{
if (isset(self::$_listeners[$event])) {
self::$_listeners[$event] = array();
}
}
/**
* Dispatches an event, calls all callbacks that were previously registered
*
* @param string $event The event identifier
* @param array $params The event params
*/
public static function dispatchEvent($event, $params)
{
$eventObject = new Wootook_Core_Event($params);
if (!isset(self::$_listeners[$event])) {
return $eventObject;
}
foreach (self::$_listeners[$event] as $listener) {
call_user_func($listener, $eventObject);
}
return $eventObject;
}
/**
*
* Enter description here ...
* @param unknown_type $namespace
* @return Legacies_Core_Model_Session
*/
public static function getSession($namespace)
{
return Wootook_Core_Model_Session::factory($namespace);
}
public static function getTranslator($locale = null)
{
if ($locale === null) {
$locale = self::getLocale();
}
if (!isset($translator[$locale])) {
$path = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'locale';
$translator[$locale] = new Wootook_Core_Model_Translator($path, $locale);
}
return $translator[$locale];
}
public static function translate($locale, $message, Array $args)
{
return self::getTranslator($locale)->translateArgs($message, $args);
}
public static function __($message, $_ = null)
{
$args = func_get_args();
array_shift($args);
return self::getTranslator(self::getLocale())->translateArgs($message, $args);
}
public static function getLocale()
{
$availableLocales = self::getConfig('global/locales');
return self::getPreferredLocale($availableLocales);
}
public static function setDefaultLocale($locale)
{
$oldLocale = self::$_defaultLocale;
self::$_defaultLocale = $locale;
return $oldLocale;
}
public static function getDefaultLocale()
{
return self::$_defaultLocale;
}
public function getPreferredLocale($availableLocales = array())
{
if (empty($availableLocales)) {
return self::getDefaultLocale();
}
$userLocale = self::getSession('user')->getData('locale');
if ($userLocale !== null) {
return $userLocale;
}
$locales = array();
if (($accept = self::getRequest()->getServer('HTTP_ACCEPT_LANGUAGE')) !== null) {
// break up string into pieces (languages and q factors)
preg_match_all('/([a-z]{1,8}(?:-([a-z]{1,8}))?)\s*(?:;\s*q\s*=\s*(1|0\.[0-9]+))?/i', $accept, $matches);
$length = count($matches[1]);
for ($i = 0; $i < $length; $i++) {
$locale = $lang_parse[1];
if (!empty($lang_parse[2])) {
$locale .= '_' . strtoupper($lang_parse[2]);
}
$locales[$locale] = !empty($lang_parse[3]) ? min(max(floatval($lang_parse[3]), 0), 1) : 1;
}
arsort($locales, SORT_NUMERIC);
}
if (empty($locales)) {
return self::getDefaultLocale();
}
$preferredLocale = key($locales);
$preferredPriority = current($locales);
foreach ($locales as $locale => $piority) {
if (!in_array($locale, $availableLocales)) {
continue;
}
if ($preferredPriority < $piority) {
$preferredPriority = $piority;
$preferredLocale = $locale;
}
}
self::getSession('user')->setData('locale', $preferredLocale);
return $preferredLocale;
}
public static function now()
{
if (self::$_now === null) {
self::$_now = time();
}
return self::$_now;
}
public static function getRequest()
{
if (self::$_request === null) {
self::$_request = new Wootook_Core_Controller_Request_Http();
}
return self::$_request;
}
public static function setRequest($request)
{
self::$_request = $request;
}
public static function getResponse()
{
if (self::$_response === null) {
self::$_response = new Wootook_Core_Controller_Response_Http();
}
return self::$_response;
}
public static function setResponse($response)
{
self::$_response = $response;
}
public static function getConfig($path = null)
{
if (self::$_config === null) {
self::$_config = include ROOT_PATH . DIRECTORY_SEPARATOR . 'config.php';
}
if ($path === null || !is_string($path)) {
return self::$_config;
}
$config = self::$_config;
foreach (explode('/', $path) as $chunk) {
if (!isset($config[$chunk])) {
return null;
}
$config = $config[$chunk];
}
return $config;
}
public static function getBaseUrl()
{
return self::getConfig('global/web/base_url');
}
public static function getSkinUrl($package, $theme, $uri, Array $params = array())
{
return self::getUrl("skin/{$package}/{$theme}/{$uri}", $params);
}
public static function getUrl($uri, Array $params = array())
{
$baseUrl = self::getBaseUrl();
$serializedParams = array();
foreach ($params as $paramKey => $paramValue) {
if ($paramValue) {
$serializedParams[] = "{$paramKey}={$paramValue}";
}
}
if (count($serializedParams) > 0) {
return $baseUrl . $uri . '?' . implode('&', $serializedParams);
}
return $baseUrl . $uri;
}
public static function fileExists($path)
{
if ($path === null || empty($path)) {
return false;
}
if (($fp = @fopen($path, 'r', true)) === false) {
return false;
}
fclose($fp);
return true;
}
}

View file

@ -1,366 +0,0 @@
<?php
class Wootook_Core_Collection
extends Wootook_Core_Model
implements Iterator, Countable
{
protected $_tableName = null;
protected $_tableAlias = null;
protected $_entityClassName = 'Wootook_Object';
protected $_columns = array();
protected $_where = array();
protected $_join = array();
protected $_order = array();
protected $_union = array();
protected $_limit = null;
protected $_offset = null;
protected $_group = array();
protected $_items = array();
public function __construct($tableName = null, $entityClassName = null)
{
if ($tableName !== null) {
$this->setTableName($tableName);
}
if ($entityClassName != null) {
$this->setEntityClassName($entityClassName);
}
}
protected function _init()
{
return $this;
}
public function setTableName($tableName)
{
if (!is_array($tableName)) {
$this->_tableName = $tableName;
} else {
$this->_tableName = current($tableName);
$this->_tableAlias = key($tableName);
}
return $this;
}
public function getTableName()
{
return $this->_tableName;
}
public function setEntityClassName($entityClassName)
{
$this->_entityClassName = $entityClassName;
return $this;
}
public function getEntityClassName()
{
return $this->_entityClassName;
}
public function quote($data)
{
static $database = null;
if ($database === null) {
$database = Wootook_Database::getSingleton();
}
return $database->quote($data);
}
public function column($column = '*', $alias = null)
{
if (is_array($column)) {
foreach ($column as $alias => $field) {
if (is_int($alias)) {
$this->_columns[] = array($field);
} else {
$this->_columns[] = array($alias => $field);
}
}
} else if ($alias === null || is_int($alias)) {
$this->_columns[] = array($column);
} else {
$this->_columns[] = array($alias => $column);
}
return $this;
}
public function where($condition)
{
$this->_where[] = $condition;
return $this;
}
public function join($table, $condition, $fields = array('*'), $mode = 'INNER')
{
static $database = null;
if ($database === null) {
$database = Wootook_Database::getSingleton();
}
if (is_array($table)) {
$alias = key($table);
$table = current($table);
foreach ($fields as $fieldAlias => $fieldName) {
$this->column("{$alias}.{$field}", $fieldAlias);
}
$this->_join[] = "{$mode} JOIN {$database->getTable($table)} AS {$alias} ON {$condition}";
} else {
foreach ($fields as $field) {
$this->column("{$field}");
}
$this->_join[] = "{$mode} JOIN {$database->getTable($table)} ON {$condition}";
}
return $this;
}
public function order($field, $direction = 'ASC')
{
$this->_order[] = "{$field} {$direction}";
return $this;
}
public function union($collection)
{
$this->_union[] = $collection;
return $this;
}
public function limit($limit, $offset = null)
{
$this->_limit = intval($limit);
$this->_offset = $offset;
return $this;
}
public function group($groupField)
{
$this->_group[] = $groupField;
return $this;
}
protected function _prepareSql()
{
if (empty($this->_union)) {
$database = Wootook_Database::getSingleton();
$fields = array();
foreach ($this->_columns as $field) {
$fieldName = current($field);
$fieldAlias = key($field);
if (is_string($fieldAlias)) {
$fields[] = "{$fieldName} AS {$fieldAlias}";
} else {
$fields[] = $fieldName;
}
}
if (!empty($fields)) {
$fields = implode(", ", $fields);
} else {
$fields = '*';
}
if (!empty($this->_where)) {
$where = 'WHERE (' . implode(") AND (", $this->_where) . ')';
} else {
$where = '';
}
$joinedTables = implode("\n ", $this->_join);
$order = '';
if (!empty($this->_order)) {
$order = 'ORDER BY ' . implode(", ", $this->_order);
}
$alias = '';
if ($this->_tableAlias !== null) {
$alias = " AS {$this->_tableAlias}";
}
$limit = '';
if ($this->_limit) {
if ($this->_offset) {
$limit = "LIMIT {$this->_limit}, {$this->_offset}";
} else {
$limit = "LIMIT {$this->_limit}";
}
}
$group = '';
if (!empty($this->_group)) {
$group = 'GROUP BY ' . implode(', ', $this->_group);
}
return <<<SQL_EOF
SELECT {$fields}
FROM {$database->getTable($this->getTableName())}{$alias}
{$joinedTables}
{$where}
{$group}
{$order}
{$limit}
SQL_EOF;
} else {
$statements = array();
foreach ($this->_union as $statement) {
$statements[] = $statement->_prepareSql();
}
$statements = '(' . implode(') UNION (', $statements) . ')';
if (!empty($where)) {
$where = 'WHERE ' . implode(" AND ", $this->_where);
} else {
$where = '';
}
$where = implode(" AND ", $this->_where);
$limit = '';
if ($this->_limit) {
if ($this->_offset) {
$limit = "LIMIT {$this->_limit}, {$this->_offset}";
} else {
$limit = "LIMIT {$this->_limit}";
}
}
return <<<SQL_EOF
$statements
{$where}
{$limit}
SQL_EOF;
}
}
public function __toString()
{
return $this->_prepareSql();
}
protected function _load()
{
$sql = $this->_prepareSql();
$database = Wootook_Database::getSingleton();
$statement = $database->prepare($sql);
$args = func_get_args();
$statement->execute(array_shift($args));
$this->_items = array();
if (func_num_args() > 1) {
$reflection = new ReflectionClass(array_shift($args));
} else {
$reflection = new ReflectionClass($this->getEntityClassName());
}
while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
$params = array_merge(array($row), $args);
$this->_items[] = $reflection->newInstanceArgs($params);
}
return $this;
}
protected function _save()
{
foreach ($this->_items as $child) {
$child->save();
}
return $this;
}
protected function _delete()
{
foreach ($this->_items as $child) {
$child->delete();
}
return $this;
}
public function getSize()
{
$clone = clone $this;
$clone->_fields = array();
$clone->column('1');
$sql = $clone->_prepareSql();
$database = Wootook_Database::getSingleton();
$statement = $database->prepare($sql);
$args = func_get_args();
$statement->execute(array_shift($args));
$count = $statement->rowCount();
$statement->closeCursor();
return $count;
}
public function count()
{
return count($this->_items);
}
public function current()
{
return current($this->_items);
}
public function next()
{
next($this->_items);
return $this;
}
public function rewind()
{
reset($this->_items);
return $this;
}
public function key()
{
return key($this->_items);
}
public function valid()
{
return current($this->_items) !== false;
}
public function getFirstItem()
{
if (!$this->_)
if (count($this->_items) > 0) {
return $this->_items[0];
}
return null;
}
public function getLastItem()
{
$size = count($this->_items);
if ($size > 0) {
return $this->_items[$size - 1];
}
return null;
}
}

View file

@ -1,50 +0,0 @@
<?php
class Wootook_Core_Controller_Action
{
private $_request = null;
private $_response = null;
public function init()
{
}
public function preDispatch()
{
}
public function postDispatch()
{
}
public function getRequest()
{
return $this->_request;
}
public function getResponse()
{
return $this->_response;
}
protected function _forward($action, $controller = null, $module = null)
{
$request = $this->getRequest();
$request->setAction($action);
if ($controller !== null) {
$request->setController($controller);
if ($module != null) {
$request->setModule($module);
}
}
$request->setIsDispatched(false);
}
protected function _redirect($url)
{
$this->getResponse()->setRedirect($url);
return $this;
}
}

View file

@ -1,102 +0,0 @@
<?php
class Wootook_Core_Controller_Request_Http
extends Wootook_Object
{
public function __construct()
{
parent::__construct(array());
}
public function setParam($key, $value)
{
return $this->setData($key, $value);
}
public function getParam($key, $default = null)
{
if ($this->hasData($key)) {
return $this->getData($key);
}
if (isset($_POST[$key])) {
return $_POST[$key];
}
if (isset($_GET[$key])) {
return $_GET[$key];
}
if (isset($_FILES[$key])) {
return $_FILES[$key];
}
if (isset($_COOKIE[$key])) {
return $_COOKIE[$key];
}
if (isset($_SERVER[$key])) {
return $_SERVER[$key];
}
return $default;
}
public function getQuery($key, $default = null)
{
if (!isset($_GET[$key])) {
return $default;
}
return $_GET[$key];
}
public function getFile($key, $default = null)
{
if (!isset($_FILES[$key])) {
return $default;
}
return $_FILES[$key];
}
public function getCookie($key, $default = null)
{
if (!isset($_COOKIE[$key])) {
return $default;
}
return unserialize(stripslashes($_COOKIE[$key]));
}
public function getRawCookie($key, $default = null)
{
if (!isset($_COOKIE[$key])) {
return $default;
}
return $_COOKIE[$key];
}
public function getPost($key, $default = null)
{
if (!isset($_POST[$key])) {
return $default;
}
return $_POST[$key];
}
public function getServer($key, $default = null)
{
if (!isset($_SERVER[$key])) {
return $default;
}
return $_SERVER[$key];
}
public function isPost()
{
if (strtoupper($this->getServer('REQUEST_METHOD')) == 'POST') {
return true;
}
return false;
}
public function isGet()
{
if (strtoupper($this->getServer('REQUEST_METHOD')) == 'GET') {
return true;
}
return false;
}
}

View file

@ -1,32 +0,0 @@
<?php
class Wootook_Core_Email
{
protected static $_defaultHeadrs = array(
);
protected $_headers = array();
public function send($to, $from, $subject, $body, Array $headers = array())
{
$this->_prepareHeaders($headers);
}
public function setHeader($name, $value)
{
$this->_headers[$name] = $value;
}
protected function _prepareHeaders($headers)
{
foreach ($headers as $name => $value) {
$this->setHeader($name, $value);
}
$this->addHeader('X-Mailer', 'PHP/' . PHP_VERSION . ' Wootook/' . VERSION);
$this->addHeader('Content-Transfer-Encoding', '7bit');
$this->addHeader('Content-Type', 'text/plain; charset=utf-8');
return $this;
}
}

View file

@ -1,153 +0,0 @@
<?php
abstract class Wootook_Core_Entity
extends Wootook_Core_Model
implements Wootook_Core_EntityInterface
{
protected $_idFieldName = null;
protected $_tableName = null;
public function setIdFieldName($fieldName)
{
$this->_idFieldName = $fieldName;
return $this;
}
public function getIdFieldName()
{
return $this->_idFieldName;
}
public function setTableName($tableName)
{
$this->_tableName = $tableName;
return $this;
}
public function getTableName()
{
return $this->_tableName;
}
public function setId($id)
{
$this->setData($this->getIdFieldName(), $id);
return $this;
}
public function getId()
{
return $this->getData($this->getIdFieldName());
}
protected function _load()
{
$id = func_get_arg(0);
$idFieldName = self::getIdFieldName();
$database = Wootook_Database::getSingleton();
$sql =<<<SQL_EOF
SELECT * FROM {$database->getTable(self::getTableName())}
WHERE {$idFieldName}=:id
LIMIT 1
SQL_EOF;
$statement = $database->prepare($sql);
$statement->execute(array(
'id' => $id
));
$datas = $statement->fetch(PDO::FETCH_ASSOC);
if (!is_array($datas) || empty($datas)) {
throw new Wootook_Core_Exception_DataAccessException('Could not load data: this id could not be found.');
}
unset($datas[self::getIdFieldName()]);
$this->_data = $datas;
$this->setId($id);
return $this;
}
protected function _save()
{
if ($this->getId() !== null) {
$fields = array();
$values = array();
foreach ($this->getAllDatas() as $field => $value) {
if ($field == self::getIdFieldName()) {
continue;
}
$fields[] = "{$field}=:{$field}";
$values[$field] = $value;
}
$fieldsImploded = implode(', ', $fields);
$idFieldName = self::getIdFieldName();
$values[$idFieldName] = $this->getId();
$database = Wootook_Database::getSingleton();
$sql =<<<SQL_EOF
UPDATE {$database->getTable(self::getTableName())}
SET {$fieldsImploded}
WHERE {$idFieldName}=:{$idFieldName}
SQL_EOF;
$statement = $database->prepare($sql);
$statement->execute($values);
} else {
$datas = $this->getAllDatas();
$fieldsImploded = implode(', ', array_keys($datas));
$tokens = array();
$values = array();
foreach ($datas as $field => $value) {
if ($field == self::getIdFieldName()) {
continue;
}
$tokens[] = ":{$field}";
$values[$field] = $value;
}
$tokensImploded = implode(', ', $tokens);
$database = Wootook_Database::getSingleton();
$sql =<<<SQL_EOF
INSERT INTO {$database->getTable(self::getTableName())} ($fieldsImploded)
VALUES ({$tokensImploded})
SQL_EOF;
$statement = $database->prepare($sql);
$statement->execute($values);
$this->setId($database->lastInsertId());
}
return $this;
}
protected function _delete()
{
$fields = array();
foreach ($this->getAllDatas() as $field => $value) {
if ($field == self::getIdFieldName()) {
continue;
}
$fields[] = "{$field}=:{$field}";
}
$fieldsImploded = implod(', ', $fields);
$idFieldName = self::getIdFieldName();
$database = Wootook_Database::getSingleton();
$sql =<<<SQL_EOF
DELETE {$database->getTable(self::getTableName())}
WHERE {$idFieldName}=:{$idFieldName}
SQL_EOF;
$statement->execute($this->getAllDatas());
return $this;
}
}

View file

@ -1,13 +0,0 @@
<?php
interface Wootook_Core_EntityInterface
{
public function getId();
public function setId($id);
public function getIdFieldName();
public function setIdFieldName($fieldName);
public function getTableName();
public function setTableName($tableName);
}

View file

@ -1,202 +0,0 @@
<?php
class Wootook_Core_ErrorProfiler
{
private static $_singleton = null;
protected $_errors = array();
protected $_warnings = array();
protected $_notices = array();
protected $_otherErrors = array();
protected $_exceptions = array();
private static $_isTraceRegistered = false;
private static $_listen = true;
public static function getSingleton()
{
if (self::$_singleton === null) {
self::$_singleton = new self;
}
return self::$_singleton;
}
public function errorManager($errno, $errstr, $errfile = null, $errline = null, Array $errcontext = array())
{
if (!self::$_listen) {
return;
}
switch ($errno) {
case E_USER_ERROR:
case E_ERROR:
$this->_errors[] = array(
'time' => explode(' ', microtime()),
'code' => $errno,
'message' => $errstr,
'file' => $errfile,
'line' => $errline,
'context' => $errcontext
);
break;
case E_USER_WARNING:
case E_WARNING:
$this->_warnings[] = array(
'time' => explode(' ', microtime()),
'code' => $errno,
'message' => $errstr,
'file' => $errfile,
'line' => $errline,
'context' => $errcontext
);
break;
case E_USER_NOTICE:
case E_NOTICE:
$this->_notices[] = array(
'time' => explode(' ', microtime()),
'code' => $errno,
'message' => $errstr,
'file' => $errfile,
'line' => $errline,
'context' => $errcontext
);
break;
default:
if (!isset($this->_otherErrors[$errno])) {
$this->_otherErrors[$errno] = array();
}
$this->_otherErrors[$errno][] = array(
'time' => explode(' ', microtime()),
'code' => $errno,
'message' => $errstr,
'file' => $errfile,
'line' => $errline,
'context' => $errcontext
);
break;
}
return true;
}
public function exceptionManager($exception)
{
if (!self::$_listen) {
return;
}
$this->_exceptions[] = $exception;
}
protected function _renderError($id, $error)
{
$types = array(
0x0001 => 'E_ERROR',
0x0002 => 'E_WARNING',
0x0004 => 'E_PARSE',
0x0008 => 'E_NOTICE',
0x0010 => 'E_CORE_ERROR',
0x0020 => 'E_CORE_WARNING',
0x0040 => 'E_COMPILE_ERROR',
0x0080 => 'E_COMPILE_WARNING',
0x0100 => 'E_USER_ERROR',
0x0200 => 'E_USER_WARNING',
0x0400 => 'E_USER_NOTICE',
0x0800 => 'E_STRICT',
0x1000 => 'E_RECOVERABLE_ERROR',
0x2000 => 'E_DEPRECATED',
0x4000 => 'E_USER_DEPRECATED',
);
if (isset($error['code']) && isset($types[$error['code']])) {
$code = $types[$error['code']];
} else {
$code = "Unknown ({$error['code']})";
}
$date = date('Y-m-d H:i:s', (int) $error['time'][1]);
$microsec = (int) ($error['time'][0] * 1000000);
return <<<ERROR_EOF
Message #{$id}
On: {$date} +{$microsec}µs
Type: {$code}
Message: {$error['message']}
File: {$error['file']}
Line: {$error['line']}
\n
ERROR_EOF;
}
public function shutdownManager()
{
$index = 0;
echo '<div style="background:#FFF;border:1px solid #F00;color:#000;padding:10px;margin:20px;text-align:left;">';
echo '<h1>Debug profiler</h1>';
if (count($this->_errors) <= 0 && count($this->_warnings) <= 0 &&
count($this->_notices) <= 0 && count($this->_otherErrors) <= 0 &&
count($this->_exceptions) <= 0) {
echo '<p>Profiler was empty.</p>';
} else {
echo '<pre>';
foreach ($this->_errors as $error) {
echo $this->_renderError(++$index, $error);
}
foreach ($this->_warnings as $error) {
echo $this->_renderError(++$index, $error);
}
foreach ($this->_notices as $error) {
echo $this->_renderError(++$index, $error);
}
foreach ($this->_otherErrors as $errorList) {
foreach ($errorList as $error) {
echo $this->_renderError(++$index, $error);
}
}
foreach ($this->_exceptions as $exception) {
$index++;
echo "Message #{$index}". PHP_EOL;
echo $exception->getMessage() . PHP_EOL;
echo $exception->getTraceAsString();
}
echo '</pre>';
}
echo '</div>';
}
public static function register()
{
set_error_handler(array(self::getSingleton(), 'errorManager'));
set_exception_handler(array(self::getSingleton(), 'exceptionManager'));
if (self::$_isTraceRegistered === false && defined('DEBUG')) {
self::$_isTraceRegistered = true;
register_shutdown_function(array(self::getSingleton(), 'shutdownManager'));
}
}
public static function unregister($force = false)
{
restore_error_handler();
restore_exception_handler();
if ((self::$_isTraceRegistered && defined('DEBUG')) || $force) {
self::$_isTraceRegistered = false;
register_shutdown_function(array(self::getSingleton(), 'shutdownManager'));
}
}
public static function sleep()
{
self::$_listen = false;
}
public static function wakeup()
{
self::$_listen = true;
}
}

View file

@ -1,6 +0,0 @@
<?php
class Wootook_Core_Event
extends Wootook_Object
{
}

View file

@ -1,3 +0,0 @@
<?php
interface Wootook_Core_Exception extends Wootook_Exception {}

View file

@ -1,7 +0,0 @@
<?php
class Wootook_Core_Exception_Exception
extends Exception
implements Wootook_Core_Exception
{
}

View file

@ -1,7 +0,0 @@
<?php
class Wootook_Core_Exception_RuntimeException
extends RuntimeException
implements Wootook_Core_Exception
{
}

View file

@ -1,88 +0,0 @@
<?php
/**
*
* Enter description here ...
*
* @uses Wootook_Object
* @uses Legacies_Empire
*/
class Wootook_Core_Model_Config
extends Wootook_Core_Model
implements Wootook_Core_Singleton
{
private static $_singleton = null;
protected $_eventPrefix = 'core.config';
protected $_eventObject = 'config';
public static function getSingleton()
{
if (self::$_singleton === null) {
self::$_singleton = new self();
}
return self::$_singleton;
}
protected function _init()
{
$this->load();
}
protected function _load()
{
$database = Wootook_Database::getSingleton();
$sql =<<<SQL_EOF
SELECT config_name AS attribute, config_value AS value
FROM {$database->getTable('config')} AS config
SQL_EOF;
$attributeName = null;
$attributeValue = null;
$statement = $database->prepare($sql);
$statement->execute();
$statement->bindColumn('attribute', $attributeName, PDO::PARAM_STR);
$statement->bindColumn('value', $attributeValue, PDO::PARAM_STR);
while ($statement->fetch(PDO::FETCH_BOUND)) {
$this->setData($attributeName, $attributeValue);
}
return $this;
}
protected function _save()
{
$database = Wootook_Database::getSingleton();
$fields = array();
$sql =<<<SQL_EOF
UPDATE {{table}}
SET config_value=:value
WHERE config_name=:name
SQL_EOF;
$statement = $database->prepare($sql);
foreach ($this->getAllDatas() as $attributeName => $attributeValue) {
$statement->execute(array(
'name' => $attributeName,
'value' => $attributeValue
));
}
return $this;
}
protected function _delete()
{
// NOP
return $this;
}
public function isEnabled()
{
return (bool) $this->getData('game_disable');
}
}

View file

@ -1,145 +0,0 @@
<?php
/**
*
* Enter description here ...
*
* @uses Wootook_Object
* @uses Legacies_Empire
*/
class Wootook_Core_Model_Session
extends Wootook_Object
{
const CRIT = 0x80;
const ERROR = 0x40;
const WARN = 0x20;
const INFO = 0x10;
const DEBUG = 0x01;
const SUCCESS = 0;
protected static $_instances = null;
protected static $_levels = null;
public static function factory($namespace)
{
$namespace = (string) $namespace;
if (!isset(self::$_instances[$namespace])) {
if (self::$_levels === null) {
$reflection = new ReflectionClass(__CLASS__);
self::$_levels = array_flip($reflection->getConstants());
}
self::$_instances[$namespace] = new self($namespace);
}
return self::$_instances[$namespace];
}
public static function destroy()
{
session_destroy();
}
public function __construct($namespace)
{
if (session_id() == '') {
session_start();
}
if (!isset($_SESSION[$namespace])) {
$_SESSION[$namespace] = array();
}
$this->_data = &$_SESSION[$namespace];
$this->_data['messages'] = array();
}
public function getMessages($clear = true)
{
$messages = $this->_data['messages'];
if ($clear == true) {
$this->_data['messages'] = array();
}
return $messages;
}
public function addMessage($message, $type = self::DEBUG)
{
if (!isset(self::$_levels[$type])) {
$type = self::DEBUG;
}
if (!isset($this->_data['messages'])) {
$this->_data['messages'] = array();
}
if (!isset($this->_data['messages'][self::$_levels[$type]])) {
$this->_data['messages'][self::$_levels[$type]] = array();
}
$this->_data['messages'][self::$_levels[$type]][] = $message;
return $this;
}
public function addCritical($message, $_ = null)
{
$args = func_get_args();
array_shift($args);
return $this->addMessage(vsprintf($message, $args), self::CRIT);
}
public function addError($message, $_ = null)
{
$args = func_get_args();
array_shift($args);
return $this->addMessage(vsprintf($message, $args), self::ERROR);
}
public function addWarning($message, $_ = null)
{
$args = func_get_args();
array_shift($args);
return $this->addMessage(vsprintf($message, $args), self::WARN);
}
public function addSuccess($message, $_ = null)
{
$args = func_get_args();
array_shift($args);
return $this->addMessage(vsprintf($message, $args), self::SUCCESS);
}
public function addInfo($message, $_ = null)
{
$args = func_get_args();
array_shift($args);
return $this->addMessage(vsprintf($message, $args), self::INFO);
}
public function addDebug($message, $_ = null)
{
$args = func_get_args();
array_shift($args);
return $this->addMessage(vsprintf($message, $args), self::DEBUG);
}
public function getFormKey($reset = false)
{
if (!$this->getData('form_key')) {
$this->setData('form_key', uniqid());
return $this->getData('form_key');
}
$key = $this->getData('form_key');
if ($reset == true) {
$this->setData('form_key', uniqid());
}
return $key;
}
}

View file

@ -1,6 +0,0 @@
<?php
interface Wootook_Core_Singleton
{
public static function getSingleton();
}

View file

@ -1,13 +0,0 @@
<?php
class Wootook_Core_Time
{
public static function init()
{
$config = include ROOT_PATH . 'config.php';
$timezone = $config['global']['date']['timezone'];
date_default_timezone_set($timezone);
}
}

View file

@ -1,51 +0,0 @@
<?php
class Wootook_Database
extends PDO
{
protected static $_singleton = null;
protected static $_prefix = null;
public static $options = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
);
public static function getSingleton()
{
if (self::$_singleton === null) {
$config = include ROOT_PATH . 'config.php';
$hostname = $config['global']['database']['options']['hostname'];
$username = $config['global']['database']['options']['username'];
$password = $config['global']['database']['options']['password'];
$database = $config['global']['database']['options']['database'];
$port = 3306;
if (isset($config['global']['database']['options']['port'])) {
$port = $config['global']['database']['options']['port'];
}
$event = Wootook::dispatchEvent('database.prepare-options', array(
'options' => self::$options
));
self::$options = $event->getData('options');
self::$_singleton = new self("mysql:dbname={$database};host={$hostname};port={$port}", $username, $password, self::$options);
Wootook::dispatchEvent('database.init', array(
'handler' => self::$_singleton
));
}
return self::$_singleton;
}
public function getTable($name)
{
if (self::$_prefix === null) {
$config = include ROOT_PATH . 'config.php';
self::$_prefix = $config['global']['database']['table_prefix'];
}
return self::$_prefix . $name;
}
}

View file

@ -1,63 +0,0 @@
<?php
class Wootook_Empire_Block_Planet_Buildings_Queue_Item
extends Wootook_Empire_Block_Planet_Builder_Queue_ItemAbstract
{
protected $_itemIdField = 'building_id';
public function getLevel()
{
return $this->getPlanet()->getElement($this->getItemId());
}
public function getResourcesNeeded($level)
{
return $this->getPlanet()->getResourcesNeeded($this->getItemId(), $this->getQueuedLevel() + 1);
}
public function getItemQueuedLevel()
{
return $this->getItem()->getData('level');
}
public function getQueuedLevel()
{
return $this->getPlanet()->getBuildingLevelQueued($this->getItemId());
}
public function getBuildingTime($level)
{
return $this->getPlanet()->getBuildingTime($this->getItemId(), $level);
}
public function getResourcesConfigForLevel($level)
{
$resources = $this->getResourcesNeeded($level);
$resourceConfig = array();
foreach ($resources as $resourceId => $resourceValue) {
$resourceConfig[$resourceId] = new Wootook_Object(array(
'resource_id' => $resourceId,
'value' => $resourceValue
));
$amount = $this->getPlanet()->getResourceAmount($resourceId);
if (Math::comp($amount, $resourceValue) < 0) {
$resourceConfig[$resourceId]->setData('requirement', Math::sub($amount, $resourceValue));
} else {
$resourceConfig[$resourceId]->setData('overflow', Math::sub($amount, $resourceValue));
}
}
return $resourceConfig;
}
public function getResourcesConfigForNextLevel()
{
return $this->getResourcesConfigForLevel($this->getNextLevel());
}
public function getBuildingTimeForNextLevel()
{
return $this->getBuildingTime($this->getNextLevel());
}
}

View file

@ -1,3 +0,0 @@
<?php
interface Legacies_Empire_Exception extends Legacies_Exception {}

View file

@ -1,7 +0,0 @@
<?php
class Wootook_Empire_Exception_Exception
extends Exception
implements Wootook_Empire_Exception
{
}

View file

@ -1,7 +0,0 @@
<?php
class Wootook_Empire_Exception_RuntimeException
extends RuntimeException
implements Wootook_Empire_Exception
{
}

View file

@ -1,32 +0,0 @@
<?php
class Wootook_Empire_Model_Galaxy_Position
extends Wootook_Core_Entity_SubTable
{
protected function _init()
{
$this->_tableName = 'galaxy';
$this->_idFieldNames = array('id_planet');
}
static function initPlanetListerner($eventData)
{
if (!isset($eventData['planet'])) {
return;
}
$planet = $eventData['planet'];
if (!$planet->isPlanet()) {
return;
}
$galaxy = new self();
$galaxy
->setData('galaxy', $planet->getGalaxy())
->setData('system', $planet->getSystem())
->setData('planet', $planet->getPosition())
->setData('id_planet', $planet->getId())
->save()
;
}
}

View file

@ -1,3 +0,0 @@
<?php
class Wootook_Empire_Model_Planet_Exception implements Wootook_Empire_Exception {}

View file

@ -1,29 +0,0 @@
<?php
class Wootook_Empire_Model_Planet_PluginLoader
extends Wootook_Core_Plugin_LoaderAbstract
{
protected $_currentUser = null;
protected $_currentPlanet = null;
public function __construct($currentPlanet, $currentUser)
{
$this->_currentUser = $currentUser;
$this->_currentPlanet = $currentPlanet;
}
protected function _load($className, $useSingleton)
{
$reflection = new ClassReflection($className);
if ($useSingleton && $reflection->implementsInterface('Wootook_Core_Singleton')) {
$method = $reflection->getMethod('getSingleton');
$method->invoke();
}
try {
return $reflection->invoke($this->_currentPlanet, $this->_currentUser);
} catch (ReflectionException $e) {
return null;
}
}
}

View file

@ -1,27 +0,0 @@
<?php
abstract class Wootook_Empire_Model_Planet_ShipAbstract
implements Wootook_Empire_Model_Planet_ShipInterface
{
public function getBaseSpeed(Wootook_Empire_Model_User $user)
{
$prices = Wootook_Empire_Model_Game_Prices::getSingleton();
return $prices[Legacies_Empire::ID_SHIP_SUPERNOVA][Legacies_Empire::SHIPS_CELERITY_PRIMARY];
}
public function getSpeedMultiplier(Wootook_Empire_Model_User $user)
{
return pow(1.1, $user->getElement(Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE));
}
public function getActualSpeed(Wootook_Empire_Model_User $user)
{
return $this->getBaseSpeed($user) * $this->getSpeedMultiplier($user);
}
public function getActualConsumption(Wootook_Empire_Model_User $user, $speed)
{
return $this->getBaseConsumption($user) * ($speed / 100) * $this->getSpeedMultiplier($user);
}
}

View file

@ -1,11 +0,0 @@
<?php
interface Wootook_Empire_Model_Planet_ShipInterface
{
public function getBaseSpeed(Wootook_Empire_Model_User $user);
public function getSpeedMultiplier(Wootook_Empire_Model_User $user);
public function getActualSpeed(Wootook_Empire_Model_User $user);
public function getBaseConsumption(Wootook_Empire_Model_User $user);
public function getActualConsumption(Wootook_Empire_Model_User $user, $speed);
}

View file

@ -1,560 +0,0 @@
<?php
/**
*
* Enter description here ...
*
* @uses Wootook_Object
* @uses Legacies_Empire
*/
class Wootook_Empire_Model_User
extends Wootook_Core_Entity
{
protected static $_instances = array();
protected static $_singleton = null;
protected $_eventPrefix = 'user';
protected $_eventObject = 'user';
public static $hashCallback = 'md5';
protected $_homePlanet = null;
protected $_currentPlanet = null;
const SESSION_KEY = 'user';
const COOKIE_NAME = 'Wootook';
const COOKIE_LIFETIME = 2592000;
const PLANET_SORT_DATE = 0;
const PLANET_SORT_POSITION = 1;
const PLANET_SORT_NAME = 2;
protected static $_cookieName = self::COOKIE_NAME;
public static function setCookieName($name)
{
self::$_cookieName = $name;
}
public static function factory($id)
{
if ($id === null) {
return new self();
}
$id = intval($id);
if (!isset(self::$_instances[$id])) {
$instance = new self();
$params = func_get_args();
call_user_func_array(array($instance, 'load'), $params);
self::$_instances[$id] = $instance;
}
return self::$_instances[$id];
}
public function getUsername()
{
return $this->getData('username');
}
public static function getSingleton()
{
if (self::$_singleton === null) {
$session = Wootook::getSession(self::SESSION_KEY);
if ($session->hasData('user_id')) {
$id = intval($session->getData('user_id'));
} else if (Wootook::getRequest() !== null && ($cookieData = Wootook::getRequest()->getCookie(self::$_cookieName)) !== null) {
//$cookieData = unserialize(stripslashes($cookie));
if (is_array($cookieData)) {
$collection = new Wootook_Core_Collection(array('user' => 'users'));
$cookieData = array(
'id' => (isset($cookieData['id']) ? intval($cookieData['id']) : 0),
'key' => (isset($cookieData['key']) ? $collection->quote($cookieData['key']) : null)
);
$collection
->column('id')
->where('user.id=:id')
->where(':key=CONCAT((@salt:=MID(:key, 0, 4)), SHA1(CONCAT(user.username, user.password, @salt)))')
->load($cookieData)
;
if ($collection->count() > 0) {
$session->setData(self::SESSION_KEY, $cookieData['id']);
} else {
$session->addError('Your session has expired, please login.');
return null;
}
}
} else {
$session->addError('Your session has expired, please login.');
return null;
}
try {
self::$_singleton = self::factory($id);
} catch (Wootook_Core_Exception_DataAccessException $e) {
$session->addError('Session error.');
return null;
}
self::$_singleton->_updateActivity();
}
return self::$_singleton;
}
public static function hash($password, $salt = null)
{
if ($salt === null) {
return call_user_func(self::$hashCallback, ($password));
}
return call_user_func(self::$hashCallback, ($password . $salt));
}
protected function _init()
{
$this->setIdFieldName('id');
$this->setTableName('users');
}
protected function _updateActivity()
{
$this
->setData('current_page', $_SERVER['REQUEST_URI'])
->setData('user_lastip', $_SERVER['REMOTE_ADDR'])
->setData('user_agent', $_SERVER['HTTP_USER_AGENT'])
->setData('onlinetime', time())
->save()
;
return $this;
}
public function logout()
{
Wootook::getResponse()->unsetCookie(self::$_cookieName);
Wootook_Core_Model_Session::destroy();
}
public static function login($username, $password, $remember = false)
{
$session = Wootook::getSession(self::SESSION_KEY);
try {
$collection = new Wootook_Core_Collection(array('user' => 'users'));
$passwordHash = md5($password);
$collection
->column('user.id')
->column('user.username')
->column('user.password')
->column('user.banaday')
->column('CONCAT((@salt:=MID(MD5(RAND()), 0, 4)), SHA1(CONCAT(user.username, user.password, @salt))) AS login_rememberme')
->column('(CASE WHEN user.password="' . $passwordHash . '" THEN 1 ELSE 0 END) AS login_success')
->where('user.username=:username')
->load(array(
'username' => $username
))
;
} catch (Wootook_Core_Exception_DataAccessException $e) {
Wootook_Core_ErrorProfiler::getSingleton()->exceptionManager($e);
$session->addError('No such user.');
return null;
}
if ($collection->count() <= 0) {
$session->addError('No such user.');
return null;
}
$login = $collection->current();
if (intval($login['login_success']) == 1) {
if ($login['banaday'] != 0) {
if($login['banaday'] <= time()) {
$user->setData('banaday', 0)
->setData('bana', 0)
->setData('urlaubs_modus', 0)
->save()
;
} else {
$session->addError('You were banned, please contact admin for more information.');
return null;
}
}
if (isset($_POST["rememberme"]) && Wootook::getResponse() !== null) {
Wootook::getResponse()->setCookie(self::$_cookieName, array('id' => $login['id'], 'key' => $login['login_rememberme']), self::COOKIE_LIFETIME);
}
self::$_singleton = self::factory($login['id']);
self::$_singleton->_updateActivity();
$session->setData('user_id', intval($login['id']));
return self::$_singleton;
}
$session->addError('Your username or credential is invalid, please check your input.');
return null;
}
public static function register($username, $email, $password)
{
try {
$request = Wootook::getRequest();
$user = new self(array(
'username' => $username,
'password' => md5($password),
'email' => $email,
'email_2' => $email,
'register_time' => Wootook::now(),
'onlinetime' => Wootook::now(),
'ip_at_reg' => $request->getServer('REMOTE_ADDR'),
'user_lastip' => $request->getServer('REMOTE_ADDR'),
'user_agent' => $request->getServer('HTTP_USER_AGENT')
));
$user->save();
Wootook::dispatchEvent('user.init', array(
'user' => $user
));
$user->save();
} catch (Wootook_Core_Exception_DataAccessException $e) {
$session = Wootook_Core_Model_Session::factory(Wootook_Empire_Model_User::SESSION_KEY);
trigger_error($e->getMessage(), E_USER_ERROR);
$session->addError($e->getMessage());
return null;
}
return $user;
}
/**
*
* Enter description here ...
* @param int|Wootook_Empire_Model_Planet $planet
*/
public function updateCurrentPlanet($planet)
{
if (!$planet instanceof Wootook_Empire_Model_Planet) {
$planetCollection = $this->_preparePlanetCollection()->where('id=:id');
$planetCollection->load(array(
'id' => $planet,
'user' => $this->getId()
));
if ($planetCollection->count() !== 1) {
return $this;
}
$planet = $planetCollection->current();
}
if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) {
return $this;
}
$this->setData('current_planet', $planet->getId())->save();
return $this;
}
/**
*
* Enter description here ...
* @param Wootook_Empire_Model_Planet $planet
*/
public function setHomePlanet(Wootook_Empire_Model_Planet $planet)
{
if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) {
return $this;
}
$this->setData('id_planet', $planet->getId());
$this->_homePlanet = $planet;
return $this;
}
/**
*
* Enter description here ...
* @param Wootook_Empire_Model_Planet $planet
*/
public function setCurrentPlanet(Wootook_Empire_Model_Planet $planet)
{
if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) {
return $this;
}
$this->setData('current_planet', $planet->getId());
$this->_currentPlanet = $planet;
return $this;
}
/**
*
* Enter description here ...
* @return Wootook_Empire_Model_Planet
*/
public function getHomePlanet()
{
if ($this->_homePlanet === null) {
$planetId = $this->getData('id_planet');
if (!$planetId) {
return null;
}
$planet = Wootook_Empire_Model_Planet::factory($planetId);
if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) {
return null;
}
$this->_homePlanet = $planet;
}
return $planet;
}
/**
*
* Enter description here ...
* @return Wootook_Empire_Model_Planet
*/
public function getCurrentPlanet()
{
if ($this->_currentPlanet === null) {
$planetId = $this->getData('current_planet');
if (!$planetId) {
$this->_currentPlanet = $this->getHomePlanet();
$this->setData('current_planet', $this->_currentPlanet->getId())->save();
return $this->_currentPlanet;
}
$planet = Wootook_Empire_Model_Planet::factory($planetId);
if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) {
$this->_currentPlanet = $this->getHomePlanet();
$this->setData('current_planet', $this->_currentPlanet->getId())->save();
return $this->_currentPlanet;
}
$this->_currentPlanet = $planet;
}
return $this->_currentPlanet;
}
protected function _preparePlanetCollection()
{
$planetCollection = new Wootook_Core_Collection(array('planet' => 'planets'), 'Wootook_Empire_Model_Planet');
$planetCollection->where('id_owner=:user');
$order = ($this->getData('planet_sort_order') == 1) ? 'DESC' : 'ASC';
switch ($this->getData('planet_sort')) {
case self::PLANET_SORT_POSITION:
$planetCollection
->order('planet.galaxy', $order)
->order('planet.system', $order)
->order('planet.planet', $order)
->order('planet.planet_type', $order)
;
break;
case self::PLANET_SORT_NAME:
$planetCollection->order('planet.name', $order);
break;
case self::PLANET_SORT_DATE:
default:
$planetCollection->order('planet.id', $order);
break;
}
return $planetCollection;
}
public function getPlanetCollection(Array $typeFilter = array())
{
$planetCollection = $this->_preparePlanetCollection();
if (!empty($typeFilter)) {
$planetCollection->where('planet.planet_type IN(' . implode(',', $typeFilter) . ')');
}
$planetCollection->load(array(
'user' => $this->getId()
));
return $planetCollection;
}
protected function _prepareFleetCollection()
{
$collection = new Wootook_Core_Collection(array('fleet' => 'fleets'));
$collection
->setEntityClassName('Wootook_Empire_Model_Fleet')
->where('fleet_owner <= :user_id')
;
return $collection;
}
public function getFleets()
{
return $this->_prepareFleetCollection()->load(array('user_id' => $this->getId()));
}
public function getFleetCount()
{
return $this->_prepareFleetCollection()->getSize(array('user_id' => $this->getId()));
}
public function getVisibleFleets()
{
$user = Wootook_Empire_Model_User::getSingleton();
$firstCollection = new Wootook_Core_Collection(array('fleet' => 'fleets'));
$firstCollection
// ->column('*')
->column('fleet.fleet_start_galaxy', 'galaxy')
->column('fleet.fleet_start_system', 'system')
->column('fleet.fleet_start_planet', 'planet')
->column('fleet.fleet_start_type', 'planet_type')
->where('fleet_end_time <= :now')
;
$backCollection = new Wootook_Core_Collection(array('fleet' => 'fleets'));
$backCollection
// ->column('*')
->column('fleet.fleet_end_galaxy', 'galaxy')
->column('fleet.fleet_end_system', 'system')
->column('fleet.fleet_end_planet', 'planet')
->column('fleet.fleet_end_type', 'planet_type')
->where('fleet_end_time <= :now')
;
$collection = new Wootook_Core_Collection();
$collection
->setEntityClassName('Wootook_Empire_Model_Fleet')
->union($firstCollection)
->union($backCollection)
->load(array('now' => time()));
return $collection;
}
public function getElement($elementId)
{
$fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton();
return $this->getData($fields[$elementId]);
}
public function setElement($elementId, $level)
{
$fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton();
return $this->setData($fields[$elementId], $level);
}
public function hasElement($elementId, $levelRequired = 0)
{
$fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton();
return $this->hasData($fields[$elementId]) && Math::comp($this->getElement($elementId), $levelRequired) > 0;
}
public function getSkinPath($default = null)
{
if ($path = $this->getData('dpath')) {
return $path;
}
return $default;
}
public function setSkinPath($path)
{
$this->setData('dpath', $path);
return $this;
}
public function checkPassword($password)
{
if (self::hash($password) == $this->getData('password')) {
return true;
}
return false;
}
public function getFleetCollection($time = null)
{
$firstCollection = new Wootook_Core_Collection(array('fleet' => 'fleets'));
$firstCollection
->column('*')
->where('fleet.fleet_owner = :user')
;
$backCollection = new Wootook_Core_Collection(array('fleet' => 'fleets'));
$backCollection
->column('*')
->where('fleet.fleet_target_owner = :user')
;
$options = array(
'user' => $this->getId()
);
if ($time !== null) {
$options['now'] = $time;
$firstCollection->where('fleet_start_time <= :now');
$backCollection->where('fleet_end_time <= :now');
}
$collection = new Wootook_Core_Collection();
$collection
->setEntityClassName('Wootook_Empire_Model_Fleet')
->union($firstCollection)
->union($backCollection)
->load($options)
;
return $collection;
}
public function getNewMessagesCount()
{
$messageCollection = new Wootook_Core_Collection('messages');
$messageCollection->where('message_owner=:user');
$messageCollection->where('message_read_at<=0');
$newMessages = null;
if (($count = $messageCollection->getSize(array('user' => $this->getId()))) > 0) {
return $count;
}
return null;
}
public static function layoutPrepareAfterListener($eventData)
{
$player = self::getSingleton();
if ($player === null || !$player->getId() || !in_array($player->getData('authlevel'), array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
return;
}
if (!isset($eventData['layout']) || !$eventData['layout'] instanceof Wootook_Core_Layout) {
return;
}
$layout = $eventData['layout'];
$navigation = $layout->getBlock('navigation');
$navigation->addLink('tools/admin', 'Admin Panel', 'Admin Panel', 'admin/index.php', array(), array('admin'));
}
}

View file

@ -1,3 +0,0 @@
<?php
interface Wootook_Exception {}

View file

@ -1,27 +0,0 @@
var _gaq = _gaq || [];
(function()){
var trackErrorThroughEvent = function(exception, f) {
_gaq.push(['_trackEvent',
'JS ERROR: '+ (f || 'native') + ' (nav:'+ navigator.userAgent +') Exception: '+ (exception.name || 'Error'),
exception.message || exception,
' url: '+document.location.href+' referer: '+ document.referrer
]);
};
var outLink = function(link){
var _gA = link.href.split('/');
var _gS = link.href.split('#');
var _gT = '/out-link/' + _gA[2] + '/?d=' + _gS[0];
_gaq.push(['_trackPageview',_gT]);
_gaq.push(function() {
try {
setTimeout('window.open(_gat._getTrackerByName()._getLinkerUrl(\'' + lien.href + '\',false),\'_blank\')', 100);
} catch(err) {
window.open(lien.href, '_blank'); /* préserve le fonctionnement du lien href en cas de pb */
trackErrorThroughEvent(err,'lienSortant : '+lien.href );
}
});
}
})();

View file

@ -1,519 +0,0 @@
<?php return array(
'empire' => array(
'update' => '1column',
'reference' => array(
'navigation' => array(
'actions' => array(
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'development',
'title' => 'Development'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/overview',
'label' => 'Overview',
'title' => 'Overview',
'uri' => 'overview.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/buildings',
'label' => 'Buildings',
'title' => 'Buildings',
'uri' => 'buildings.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/research-lab',
'label' => 'Research Lab',
'title' => 'Research Lab',
'uri' => 'buildings.php',
'params' => array(
'mode' => 'research'
)
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/shipyard',
'label' => 'Shipyard',
'title' => 'Shipyard',
'uri' => 'buildings.php',
'params' => array(
'mode' => 'fleet'
)
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/defenses',
'label' => 'Defenses',
'title' => 'Defenses',
'uri' => 'buildings.php',
'params' => array(
'mode' => 'defense'
)
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/officers',
'label' => 'Officers',
'title' => 'Officers',
'uri' => 'officers.php'
)
),
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'navigation',
'title' => 'Navigation'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/alliance',
'label' => 'Alliance',
'title' => 'Alliance',
'uri' => 'alliance.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/fleet',
'label' => 'Fleet',
'title' => 'Fleet',
'uri' => 'fleet.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/galaxy',
'label' => 'Galaxy',
'title' => 'Galaxy',
'uri' => 'galaxy.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/empire',
'label' => 'Empire',
'title' => 'Empire',
'uri' => 'imperium.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/resources',
'label' => 'Resources Production',
'title' => 'Resources Production',
'uri' => 'resources.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/retailer',
'label' => 'Retailer',
'title' => 'Retailer',
'uri' => 'marchand.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/tech-tree',
'label' => 'Technology Tree',
'title' => 'Technology Tree',
'uri' => 'techtree.php'
)
),
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'tools',
'title' => 'Tools'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/messages',
'label' => 'Messages',
'title' => 'Messages',
'uri' => 'messages.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/records',
'label' => 'Records',
'title' => 'Records',
'uri' => 'records.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/statistics',
'label' => 'Stats',
'title' => 'Stats',
'uri' => 'stat.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/banned',
'label' => 'Banned Players',
'title' => 'Banned Players',
'uri' => 'banned.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/announcement',
'label' => 'Announcements',
'title' => 'Announcements',
'uri' => 'annonce.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/notes',
'label' => 'Note Pad',
'title' => 'Note Pad',
'uri' => 'notes.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/options',
'label' => 'Account Options',
'title' => 'Account Options',
'uri' => 'options.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/logout',
'label' => 'Log Out',
'title' => 'Log Out',
'uri' => 'logout.php'
)
),
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'community',
'title' => 'Community'
)
),
array(
'method' => 'addExternalLink',
'params' => array(
'name' => 'community/board',
'label' => 'Forum board',
'title' => 'Forum board',
'url' => 'http://www.wootook.org/'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/search-player',
'label' => 'Search Player',
'title' => 'Search Player',
'uri' => 'search.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/chat',
'label' => 'Chat',
'title' => 'Chat',
'uri' => 'chat.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/multi',
'label' => 'Declare Multi-account',
'title' => 'Declare Multi-account',
'uri' => 'delclare_multi.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/rules',
'label' => 'Rules',
'title' => 'Rules',
'uri' => 'rules.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/contact',
'label' => 'Contact Admin',
'title' => 'Contact Admin',
'uri' => 'contact.php'
)
)
)
)
)
),
'overview' => array(
'update' => 'empire',
'reference' => array(
'content' => array(
'children' => array(
'overview.forms' => array(
'type' => 'core/concat'
),
'overview' => array(
'type' => 'empire/overview',
'template' => 'empire/overview.phtml'
),
)
),
'left' => array(
)
)
),
'overview.rename-planet' => array(
'update' => 'overview',
'reference' => array(
'overview.forms' => array(
'children' => array(
'rename-planet' => array(
'type' => 'empire/overview.rename-planet',
'template' => 'empire/overview/form/rename-planet.phtml'
),
)
)
)
),
'overview.destroy-planet' => array(
'update' => 'overview',
'reference' => array(
'overview.forms' => array(
'children' => array(
'destroy-planet' => array(
'type' => 'empire/overview.destroy-planet',
'template' => 'empire/overview/form/destroy-planet.phtml'
),
)
)
)
),
'planet.buildings' => array(
'update' => 'empire',
'reference' => array(
'content' => array(
'children' => array(
'topnav' => array(
'type' => 'empire/topnav',
'template' => 'empire/topnav.phtml',
),
'queue' => array(
'type' => 'empire/planet.buildings.queue',
'template' => 'empire/planet/buildings/queue.phtml',
'actions' => array(
array(
'method' => 'setItemTemplate',
'params' => array(
'template' => 'empire/planet/buildings/queue/item.phtml'
)
),
array(
'method' => 'setItemBlockType',
'params' => array(
'blockType' => 'empire/planet.buildings.queue.item'
)
)
)
),
'item-list' => array(
'type' => 'empire/planet.buildings',
'template' => 'empire/planet/buildings.phtml',
'children' => array(
'item-list.items' => array(
'type' => 'core/concat'
),
),
'actions' => array(
array(
'method' => 'setItemTemplate',
'params' => array(
'template' => 'empire/planet/buildings/item.phtml'
)
),
array(
'method' => 'setItemBlockType',
'params' => array(
'blockType' => 'empire/planet.buildings.item'
)
)
)
),
)
)
)
),
'planet.shipyard' => array(
'update' => 'empire',
'reference' => array(
'content' => array(
'children' => array(
'topnav' => array(
'type' => 'empire/topnav',
'template' => 'empire/topnav.phtml',
),
'item-list' => array(
'type' => 'legacies_empire/planet.shipyard',
'template' => 'empire/planet/shipyard.phtml',
'children' => array(
'item-list.items' => array(
'type' => 'core/concat'
),
),
'actions' => array(
array(
'method' => 'setItemTemplate',
'params' => array(
'template' => 'empire/planet/shipyard/item.phtml'
)
),
array(
'method' => 'setItemBlockType',
'params' => array(
'blockType' => 'legacies_empire/planet.shipyard.item'
)
),
)
),
'queue' => array(
'type' => 'legacies_empire/planet.shipyard.queue',
'template' => 'empire/planet/shipyard/queue.phtml',
'actions' => array(
array(
'method' => 'setItemTemplate',
'params' => array(
'template' => 'empire/planet/shipyard/queue/item.phtml'
)
),
array(
'method' => 'setItemBlockType',
'params' => array(
'blockType' => 'legacies_empire/planet.shipyard.queue.item'
)
)
)
),
)
)
)
),
'planet.defense' => array(
'update' => 'planet.shipyard',
'reference' => array(
'item-list' => array(
'actions' => array(
array(
'method' => 'setType',
'params' => array(
'type' => Legacies_Empire::TYPE_DEFENSE
)
)
)
)
)
),
'planet.research-lab' => array(
'update' => 'empire',
'reference' => array(
'content' => array(
'children' => array(
'topnav' => array(
'type' => 'empire/topnav',
'template' => 'empire/topnav.phtml',
),
'item-list' => array(
'type' => 'legacies_empire/planet.research-lab',
'template' => 'empire/planet/research-lab.phtml',
'children' => array(
'item-list.items' => array(
'type' => 'core/concat'
),
),
'actions' => array(
array(
'method' => 'setItemTemplate',
'params' => array(
'template' => 'empire/planet/research-lab/item.phtml'
)
),
array(
'method' => 'setItemBlockType',
'params' => array(
'blockType' => 'legacies_empire/planet.research-lab.item'
)
),
)
),
'queue' => array(
'type' => 'legacies_empire/planet.research-lab.queue',
'template' => 'empire/planet/research-lab/queue.phtml',
'actions' => array(
array(
'method' => 'setItemTemplate',
'params' => array(
'template' => 'empire/planet/research-lab/queue/item.phtml'
)
),
array(
'method' => 'setItemBlockType',
'params' => array(
'blockType' => 'legacies_empire/planet.research-lab.queue.item'
)
)
)
)
)
)
)
)
);

View file

@ -1,222 +0,0 @@
<?php return array(
'1column' => array(
'update' => 'default',
'reference' => array(
'content' => array(
'children' => array(
'navigation' => array(
'type' => 'core/html.navigation',
'template' => 'page/html/navigation.phtml'
)
)
)
)
),
'2columns-left' => array(
'update' => 'default',
'template' => 'page/2columns-left.phtml',
'reference' => array(
'root' => array(
'children' => array(
'left' => array(
'type' => 'core/concat',
'children' => array(
'navigation' => array(
'type' => 'core/html.navigation',
'template' => 'page/html/navigation.phtml'
)
)
)
)
)
)
),
'2columns-right' => array(
'update' => 'default',
'template' => 'page/2columns-right.phtml',
'reference' => array(
'root' => array(
'children' => array(
'right' => array(
'type' => 'core/concat'
),
)
)
)
),
'3columns' => array(
'update' => 'default',
'template' => 'page/3columns.phtml',
'reference' => array(
'root' => array(
'children' => array(
'left' => array(
'type' => 'core/concat'
),
'right' => array(
'type' => 'core/concat'
),
)
)
)
),
'default' => array(
'type' => 'core/html.page',
'template' => 'page/1column.phtml',
'children' => array(
'head' => array(
'type' => 'core/html.head',
'template' => 'page/html/head.phtml',
'actions' => array(
array(
'method' => 'addCss',
'params' => array(
'stylesheet' => 'css/deprecated/default.css'
)
),
array(
'method' => 'addCss',
'params' => array(
'stylesheet' => 'css/deprecated/formate.css'
)
),
array(
'method' => 'addCss',
'params' => array(
'stylesheet' => 'css/legacies.css'
)
),
array(
'method' => 'addJs',
'params' => array(
'script' => 'scripts/jquery/jquery-1.6.4.js'
)
)
)
),
'header' => array(
'type' => 'core/template',
'template' => 'page/html/header.phtml',
'children' => array(
'menu' => array(
'type' => 'core/html.navigation',
'template' => 'page/html/navigation.phtml',
),
'planet-list' => array(
'type' => 'empire/planet-list',
'template' => 'empire/planet-list.phtml',
)
)
),
'footer' => array(
'type' => 'core/template',
'template' => 'page/html/footer.phtml'
),
'content' => array(
'type' => 'core/concat'
)
)
),
'ajax' => array(
'type' => 'core/html.page',
'template' => 'page/empty.phtml',
'children' => array(
'content' => array(
'type' => 'core/concat'
)
)
),
'empty' => array(
'type' => 'core/html.page',
'template' => 'page/empty.phtml',
'children' => array(
'head' => array(
'type' => 'core/html.head',
'template' => 'page/html/head.phtml'
),
'content' => array(
'type' => 'core/concat'
)
)
),
'message' => array(
'update' => 'default',
'reference' => array(
'content' => array(
'children' => array(
'message' => array(
'type' => 'core/template',
'template' => 'page/html/message.phtml'
),
)
)
)
),
'login' => array(
'update' => '1column',
'reference' => array(
'content' => array(
'children' => array(
'login' => array(
'type' => 'core/template',
'template' => 'user/login.phtml'
),
)
),
'head' => array(
'actions' => array(
array(
'method' => 'addCss',
'params' => array(
'stylesheet' => 'css/deprecated/styles.css'
)
),
array(
'method' => 'addCss',
'params' => array(
'stylesheet' => 'css/deprecated/about.css'
)
)
)
)
)
),
'registration' => array(
'update' => '1column',
'reference' => array(
'content' => array(
'children' => array(
'registration' => array(
'type' => 'core/template',
'template' => 'user/registration.phtml'
),
)
),
'head' => array(
'actions' => array(
array(
'method' => 'addCss',
'params' => array(
'stylesheet' => 'css/deprecated/styles.css'
)
),
array(
'method' => 'addCss',
'params' => array(
'stylesheet' => 'css/deprecated/about.css'
)
)
)
)
)
)
);

View file

@ -1,35 +0,0 @@
<br><br>
<h2><?php echo $this->getData('adm_ov_title')?></h2>
<table width="600">
<tr>
<td class="c" colspan="2"><?php echo $this->getData('adm_ov_infos')?></td>
</tr><tr>
<td class="b" style="color:#FFFFFF"><?php echo $this->getData('adm_ov_yourv')?>: <strong><?php echo $this->getData('adm_ov_data_yourv')?></strong></td>
<td class="b" style="color:#FFFFFF"><?php echo $this->getData('adm_ov_lastv')?>: <b><a style="color:orange;" href="http://www.xnova-ng.org/"><?php echo $this->getData('adm_ov_here')?></a></b></td>
</tr>
</table>
<br>
<table width="600">
<tr>
<td class="c" colspan="13"><?php echo $this->getData('adm_ov_onlin')?></td>
</tr>
<tr>
<th><a href="?cmd=sort&type=id"><?php echo $this->getData('adm_ul_id')?></a></th>
<th><a href="?cmd=sort&type=username"><?php echo $this->getData('adm_ul_name')?></a></th>
<th><a href="?cmd=sort&type=user_lastip"><?php echo $this->getData('adm_ul_adip')?></a></th>
<th><a href="?cmd=sort&type=ally_name"><?php echo $this->getData('adm_ov_ally')?></a></th>
<th><?php echo $this->getData('adm_ov_point')?></th>
<th><a href="?cmd=sort&type=onlinetime"><?php echo $this->getData('adm_ov_activ')?></a></th>
<th><?php echo $this->getData('usr_email')?></th>
<th><?php echo $this->getData('xp_raid')?></th>
<th><?php echo $this->getData('xp_min')?></th>
<th><?php echo $this->getData('lang_vacancy')?></th>
<th><?php echo $this->getData('banned_lang')?></th>
<th><?php echo $this->getData('usr_current_planet')?></th>
<th><?php echo $this->getData('usr_current_page')?></th>
</tr>
<?php echo $this->getData('adm_ov_data_table')?>
<tr>
<th class="b" colspan="13"><?php echo $this->getData('adm_ov_count')?>: <?php echo $this->getData('adm_ov_data_count')?></th>
</tr>
</table>

View file

@ -1,70 +0,0 @@
<br>
<table width=519><tr><td class=c colspan=11><?php echo $this->getData('Configure_laws')?></td></tr>
<?php echo $this->getData('list')?>
</table>
<br>
<form action="alliance.php?mode=admin&edit=rights&add=name" method=POST>
<table width=519>
<tr>
<td class=c colspan=2><?php echo $this->getData('Range_make')?></td>
</tr>
<tr>
<th><?php echo $this->getData('Range_name')?></th>
<th><input type=text name="newrangname" size=20 maxlength=30></th>
</tr>
<tr>
<th colspan=2><input type=submit value="<?php echo $this->getData('Make')?>"></th>
</tr>
</form>
</table>
<form action="alliance.php?mode=admin&edit=rights" method=POST>
<table width=519>
<tr>
<td class=c colspan=2><?php echo $this->getData('Law_leyends')?></td>
</tr>
<tr>
<th><img src=images/r1.png></th>
<th><?php echo $this->getData('Alliance_dissolve')?></th>
</tr>
<tr>
<th><img src=images/r2.png></th>
<th><?php echo $this->getData('Expel_users')?></th>
</tr>
<tr>
<th><img src=images/r3.png></th>
<th><?php echo $this->getData('See_the_requests')?></th>
</tr>
<tr>
<th><img src=images/r4.png></th>
<th><?php echo $this->getData('See_the_list_members')?></th>
</tr>
<tr>
<th><img src=images/r5.png></th>
<th><?php echo $this->getData('Check_the_requests')?></th>
</tr>
<tr>
<th><img src=images/r6.png></th>
<th><?php echo $this->getData('Alliance_admin')?></th>
</tr>
<tr>
<th><img src=images/r7.png></th>
<th><?php echo $this->getData('See_the_online_list_member')?></th>
</tr>
<tr>
<th><img src=images/r8.png></th><th><?php echo $this->getData('Make_a_circular_message')?></th>
</tr>
<tr>
<th><img src=images/r9.png></th><th><?php echo $this->getData('Left_hand_text')?></th>
</tr>
<tr>
<td class="c" colspan="2"><a href="alliance.php?mode=admin&edit=ally"><?php echo $this->getData('Return_to_overview')?></a></td>
</tr>
</form>
</table>

View file

@ -1,15 +0,0 @@
<br>
<form action="alliance.php?mode=admin&edit=rights" method=POST>
<tr>
<th></th>
<th><?php echo $this->getData('Range_name')?></th>
<th><img src=images/r1.png></th>
<th><img src=images/r2.png></th>
<th><img src=images/r3.png></th>
<th><img src=images/r4.png></th>
<th><img src=images/r5.png></th>
<th><img src=images/r6.png></th>
<th><img src=images/r7.png></th>
<th><img src=images/r8.png></th>
<th><img src=images/r9.png></th>
</tr>

View file

@ -1,16 +0,0 @@
<br>
<tr>
<th><?php echo $this->getData('delete')?></th>
<th>&nbsp;<?php echo $this->getData('r0')?>&nbsp;</th>
<input type="hidden" name="id[]" value="<?php echo $this->getData('a')?>">
<th><?php echo $this->getData('r1')?></th>
<th><?php echo $this->getData('r2')?></th>
<th><?php echo $this->getData('r3')?></th>
<th><?php echo $this->getData('r4')?></th>
<th><?php echo $this->getData('r5')?></th>
<th><?php echo $this->getData('r6')?></th>
<th><?php echo $this->getData('r7')?></th>
<th><?php echo $this->getData('r8')?></th>
<th><?php echo $this->getData('r9')?></th>
</tr>
<tr>

View file

@ -1,44 +0,0 @@
<tr>
<th colspan="2">
<br><?php echo $this->getData('ins_tx_acc1')?><br>
<?php echo $this->getData('ins_tx_acc2')?><br><br>
<table width="270" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><?php echo $this->getData('ins_acc_user')?>:</td>
<td><input name="adm_user" size="20" maxlength="20" type="text" onKeypress="
if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
if (event.which==60 || event.which==62) return false;"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_acc_pass')?>:</td>
<td><input name="adm_pass" size="20" maxlength="20" type="password" onKeypress="
if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
if (event.which==60 || event.which==62) return false;"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_acc_email')?>:</td>
<td><input name="adm_email" size="20" maxlength="40" type="text" onKeypress="
if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
if (event.which==60 || event.which==62) return false;"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_acc_planet')?>:</td>
<td><input name="adm_planet" size="20" maxlength="20" type="text" onKeypress="
if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
if (event.which==60 || event.which==62) return false;"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_acc_sex')?>:</td>
<td><select name="adm_sex">
<option value=""><?php echo $this->getData('ins_acc_sex0')?></option>
<option value="M"><?php echo $this->getData('ins_acc_sex1')?></option>
<option value="F"><?php echo $this->getData('ins_acc_sex2')?></option>
</select></td>
</tr>
</table>
<br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_creat')?>" ></th>
</tr>

View file

@ -1,9 +0,0 @@
<tr>
<th colspan="2">
<br><?php echo $this->getData('ins_tx_done2')?><br>
<?php echo $this->getData('ins_tx_done3')?><br><br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="self.location.href='../'" value="<?php echo $this->getData('ins_btn_login')?>" ></th>
</tr>

View file

@ -1,28 +0,0 @@
<br><br>
<table width="700">
<tbody><tr>
<td width="120px" class="c" align="left"><font size="2px"><?php echo $this->getData('ins_appname')?></font></td>
<td width="580px" rowspan="2" class="c" align="right"><font size="2px"><?php echo $this->getData('ins_tx_sys')?></font><br /><?php echo $this->getData('ins_tx_state')?> <?php echo $this->getData('ins_state')?></td>
</tr><tr>
<th rowspan="4"><table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="124" align="center"><a href="index.php?mode=intro" accesskey="i"><?php echo $this->getData('ins_mnu_intro')?></a></td>
</tr>
<tr>
<td align="center"><a href="index.php?mode=ins&page=1" accesskey="i"><?php echo $this->getData('ins_mnu_inst')?></a></td>
</tr>
<tr>
<td align="center"><a href="index.php?mode=goto&page=1" accesskey="b"><?php echo $this->getData('ins_mnu_goto')?></a></td>
</tr>
<tr>
<td align="center"><a href="index.php?mode=upg" accesskey="u"><?php echo $this->getData('ins_mnu_upgr')?></a></td>
</tr>
<tr>
<td align="center"><a href="index.php?mode=bye" accesskey="b"><?php echo $this->getData('ins_mnu_quit')?></a></td>
</tr>
</table></th>
</tr>
<form action="<?php echo $this->getData('dis_ins_btn')?>" method="post">
<?php echo $this->getData('ins_page')?>
</form>
</table>

View file

@ -1,33 +0,0 @@
<tr>
<th colspan="2">
<br><?php echo $this->getData('ins_tx_inst1')?><br>
<?php echo $this->getData('ins_tx_inst2')?><br>
<?php echo $this->getData('ins_tx_inst3')?><br><br>
<table width="270" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><?php echo $this->getData('ins_form_server')?>:</td>
<td><input type="text" name="host" value="localhost" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_db')?>:</td>
<td><input type="text" name="db" value="" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_prefix')?>:</td>
<td><input type="text" name="prefix" value="game_" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_login')?>:</td>
<td><input type="text" name="user" value="" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_pass')?>:</td>
<td><input type="password" name="passwort" value="" size="20"></td>
</tr>
</table>
<br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_inst')?>" ></th>
</tr>

View file

@ -1,8 +0,0 @@
<tr>
<th colspan="2">
<br><br><?php echo $this->getData('ins_tx_done1')?><br><br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_next')?>" ></th>
</tr>

View file

@ -1,9 +0,0 @@
<tr>
<th colspan="2">
<br><?php echo $this->getData('ins_tx_done4')?><br>
<?php echo $this->getData('ins_tx_done3')?><br><br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="self.location.href='../'" value="<?php echo $this->getData('ins_btn_login')?>" ></th>
</tr>

View file

@ -1,33 +0,0 @@
<tr>
<th colspan="2">
<br><?php echo $this->getData('ins_tx_inst1')?><br>
<?php echo $this->getData('ins_tx_goto4')?><br>
<?php echo $this->getData('ins_tx_goto5')?><br><br>
<table width="270" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><?php echo $this->getData('ins_form_server')?>:</td>
<td><input type="text" name="host" value="localhost" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_db')?>:</td>
<td><input type="text" name="db" value="" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_prefix')?>:</td>
<td><input type="text" name="prefix" value="game_" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_login')?>:</td>
<td><input type="text" name="user" value="" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_pass')?>:</td>
<td><input type="password" name="passwort" value="" size="20"></td>
</tr>
</table>
<br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_inst')?>" ></th>
</tr>

View file

@ -1,10 +0,0 @@
<tr>
<th colspan="2">
<br><?php echo $this->getData('ins_tx_goto1')?><br>
<?php echo $this->getData('ins_tx_goto2')?><br>
<?php echo $this->getData('ins_tx_goto3')?><br><br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_next')?>" ></th>
</tr>

View file

@ -1,11 +0,0 @@
<tr>
<th colspan="2">
<br><?php echo $this->getData('ins_tx_welco')?><br>
<?php echo $this->getData('ins_tx_intr1')?><br>
<?php echo $this->getData('ins_tx_intr2')?><br>
<?php echo $this->getData('ins_tx_intr3')?><br><br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="self.location.href='index.php?mode=ins&page=1'" value="<?php echo $this->getData('ins_btn_next')?>" ></th>
</tr>

View file

@ -1,21 +0,0 @@
<?php $fleet = $this->getData('fleet')?>
<?php $user = $this->getData('user')?>
<tr class="<?php echo $this->getData('class')?>">
<?php echo $this->getData('fleet_javai')?>
<td>
<div class="z">-</div>
<font color="lime"><?php echo $fleet->getArrivalTime()?></font>
</td>
<td colspan="3">
<?php if (!$fleet->isOwnedBy($user) || $fleet->isMission(Legacies_Empire::ID_MISSION_TRANSPORT) || $fleet->isMission(Legacies_Empire::ID_MISSION_STATION) || $fleet->isMission(Legacies_Empire::ID_MISSION_STATION_ALLY)):?>
<span class="<?php echo $fleet->getRowClass($user)?>"><?php echo $this->__('An hostile fleet sent by %1$s, coming from %2$s, reaches your planet %3$d. It has been sent with the mission: %4$d', $fleet->getOwner()->getUsername(), $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?></span>
<?php elseif ($fleet->isOwnedBy($user) || $fleet->isMission(Legacies_Empire::ID_MISSION_ATTACK) || $fleet->isMission(Legacies_Empire::ID_MISSION_GROUP_ATTACK) || $fleet->isMission(Legacies_Empire::ID_MISSION_DESTROY) || $fleet->isMission(Legacies_Empire::ID_MISSION_MISSILES) || $fleet->isMission(Legacies_Empire::ID_MISSION_SPY)):?>
<span class="<?php echo $fleet->getRowClass($user)?>"><?php echo $this->__('Your hostile fleet, sent from %1$s, reaches %2$d\'s planet %3$d. It has been sent with the mission: %4$d', $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getUser()->getUsername(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?></span>
<?php elseif ($fleet->isOwnedBy($user)):?>
<span class="<?php echo $fleet->getRowClass($user)?>"><?php echo $this->__('Your peaceful fleet, sent from %2$s, reaches the planet %3$d. It has been sent with the mission: %4$d', $fleet->getOwner()->getUsername(), $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?></span>
<?php else:?>
<span class="<?php echo $fleet->getRowClass($user)?>"><?php echo $this->__('A peaceful fleet sent by %1$s, coming from %2$s, reaches your planet %3$d. It has been sent with the mission: %4$d', $fleet->getOwner()->getUsername(), $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?></span>
<?php endif?>
</td>
<?php echo $this->getData('fleet_javas')?>
</tr>

View file

@ -1,10 +0,0 @@
<form name="rename-planet" id="overview:rename-planet" method="post" action="">
<fieldset>
<input type="hidden" name="form_key" value="<?php echo $this->getFormKey()?>" />
<label for="overview:rename-planet:password"><?php echo $this->__('Password:')?></label>
<input id="overview:rename-planet:password" type="password" name="password" />
<label for="overview:rename-planet:name"><?php echo $this->__('New name:')?></label>
<input id="overview:rename-planet:name" type="text" name="name" />
<input type="submit" />
</fieldset>
</form>

View file

@ -1 +0,0 @@
<?php echo $this->planetList->render() ?>

View file

@ -1,4 +0,0 @@
<div class="buildings item-list">
<h1><?php echo $this->__('Buildings')?></h1>
<?php echo $this->getPartial('item-list.items')->render()?>
</div>

View file

@ -1,27 +0,0 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item title">
<h2><a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a> (<?php echo $this->renderNumber($this->getLevel())?>)</h2>
</div>
<div class="item details">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="120" height="120" /></a>
<div class="details">
<p><?php echo $this->getDescription()?></p>
<ul>
<?php foreach ($this->getResourcesConfigForNextLevel() as $resourceId => $resourceConfig):?>
<li class="resource">
<span class="label"><?php echo $this->getResourceName($resourceId)?></span>
<span class="cost<?php if ($resourceConfig->hasData('requirement')):?> capped<?php endif?>"><?php echo $this->renderNumber($resourceConfig->getData('value'))?></span>
<?php if ($resourceConfig->hasData('requirement')):?>
<span class="requirement">(<?php echo $this->renderNumber($resourceConfig->getData('requirement'))?>)</span>
<?php else:?>
<span class="overflow">(<?php echo $this->renderNumber($resourceConfig->getData('overflow'))?>)</span>
<?php endif?>
</li>
<?php endforeach?>
</ul>
<p><?php echo $this->__('Building time: %s', $this->renderTime($this->getBuildingTimeForNextLevel(), true))?>
</div>
<div class="buy">
<p><a class="build" href="<?php echo $this->getUrl('buildings.php', array('building' => $this->getItemId()))?>"><?php echo $this->__('Build next level (%s)', $this->renderNumber($this->getNextLevel()))?></a></p>
</div>
</div>

View file

@ -1,8 +0,0 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item queue">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="30" height="30" /></a>
<a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a> (<?php echo $this->renderNumber($this->getItemQueuedLevel())?>)
<div class="cancel">
<p><a class="build" href="<?php echo $this->getUrl('buildings.php', array('cancel' => $this->getItem()->getIndex()))?>"><?php echo $this->__('Cancel')?></a></p>
</div>
</div>

View file

@ -1,4 +0,0 @@
<div class="shipyard item-list">
<h1><?php echo $this->__('Research Laboratory')?></h1>
<?php echo $this->getPartial('item-list.items')->render()?>
</div>

View file

@ -1,27 +0,0 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item title">
<h2><a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a> (<?php echo $this->renderNumber($this->getLevel())?>)</h2>
</div>
<div class="item details">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="120" height="120" /></a>
<div class="details">
<p><?php echo $this->getDescription()?></p>
<ul>
<?php foreach ($this->getResourcesConfigForNextLevel() as $resourceId => $resourceConfig):?>
<li class="resource">
<span class="label"><?php echo $this->getResourceName($resourceId)?></span>
<span class="cost<?php if ($resourceConfig->hasData('requirement')):?> capped<?php endif?>"><?php echo $this->renderNumber($resourceConfig->getData('value'))?></span>
<?php if ($resourceConfig->hasData('requirement')):?>
<span class="requirement">(<?php echo $this->renderNumber($resourceConfig->getData('requirement'))?>)</span>
<?php else:?>
<span class="overflow">(<?php echo $this->renderNumber($resourceConfig->getData('overflow'))?>)</span>
<?php endif?>
</li>
<?php endforeach?>
</ul>
<p><?php echo $this->__('Building time: %s', $this->renderTime($this->getBuildingTime(1), false))?>
</div>
<div class="buy">
<p><a class="build" href="<?php echo $this->getUrl('buildings.php', array('building' => $this->getItemId(), 'mode' => 'research'))?>"><?php echo $this->__('Build next level (%s)', $this->renderNumber($this->getNextLevel()))?></a></p>
</div>
</div>

View file

@ -1,8 +0,0 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item queue">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="30" height="30" /></a>
<a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a> (<?php echo $this->renderNumber($this->getItemQueuedLevel())?>)
<div class="cancel">
<p><a class="build" href="<?php echo $this->getUrl('buildings.php', array('cancel' => $this->getItem()->getIndex()))?>"><?php echo $this->__('Cancel')?></a></p>
</div>
</div>

View file

@ -1,20 +0,0 @@
<div class="shipyard item-list">
<h1><?php echo $this->__('Shipyard')?></h1>
<form action="<?php echo $this->getUrl('buildings.php', array('mode' => 'fleet'))?>" method="post">
<dl>
<?php echo $this->getPartial('item-list.items')->render()?>
</dl>
<input type="submit" value="<?php echo $this->__('Build')?>">
</form>
<script type="text/javascript">
/*<![CDATA[*/
(function($){
$(document).ready(function(){
$('.shipyard .buy .max').click(function(){
$('#' + this.rel).val($('#' + this.rel + ':max').val());
});
});
})(jQuery);
/*]]>*/
</script>
</div>

View file

@ -1,29 +0,0 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item title">
<h2><a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a> (<?php echo $this->renderNumber($this->getQty())?>)</h2>
</div>
<div class="item details">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="120" height="120" /></a>
<div class="details">
<p><?php echo $this->getDescription()?></p>
<ul>
<?php foreach ($this->getResourcesConfigForQty(1) as $resourceId => $resourceConfig):?>
<li class="resource">
<span class="label"><?php echo $this->getResourceName($resourceId)?></span>
<span class="cost<?php if ($resourceConfig->hasData('requirement')):?> capped<?php endif?>"><?php echo $this->renderNumber($resourceConfig->getData('value'))?></span>
<?php if ($resourceConfig->hasData('requirement')):?>
<span class="requirement">(<?php echo $this->renderNumber($resourceConfig->getData('requirement'))?>)</span>
<?php else:?>
<span class="overflow">(<?php echo $this->renderNumber($resourceConfig->getData('overflow'))?>)</span>
<?php endif?>
</li>
<?php endforeach?>
</ul>
<p><?php echo $this->__('Building time: %s', $this->renderTime($this->getBuildingTime(1), false))?>
</div>
<div class="buy">
<p><input type="text" name="ship[<?php echo $this->getItemId()?>]" id="ship:<?php echo $this->getItemId()?>" /></p>
<input type="hidden" id="ship:<?php echo $this->getItemId()?>:max" value="<?php echo $this->escape($this->getMaximumBuildableElementsCount())?>" />
<p><a class="max" rel="ship:<?php echo $this->getItemId()?>"><?php echo $this->__('Max (%s)', $this->renderNumber($this->getMaximumBuildableElementsCount()))?></a></p>
</div>
</div>

View file

@ -1,94 +0,0 @@
<?php $currentPlanet = $this->getCurrentPlanet();?>
<div class="planet-carrousel">
<div class="arrow left"><!--&#8678;--></div>
<div class="items">
<?php foreach ($this->getPlanetCollection() as $planet):?>
<?php if ($planet->getId() != $currentPlanet->getId()):?>
<div class="planet item">
<p class="planet-name"><a href="<?php echo $this->getUrl('overview.php', array('cp' => $planet->getId()))?>"><?php echo $this->escape($planet->getName())?></a></p>
<div class="planet-image">
<?php if (false && ($moon = $planet->getMoon()) !== null): ?>
<a href="<?php echo $this->getUrl('overview.php', array('cp' => $moon->getId()))?>" class="moon">
<img src="<?php echo $this->getSkinUrl($moon->getImage())?>" width="20" height="20"/>
</a>
<?php endif?>
<a href="<?php echo $this->getUrl('overview.php', array('cp' => $planet->getId()))?>" class="planet">
<img src="<?php echo $this->getSkinUrl($planet->getImage())?>" width="50" height="50"/>
</a>
</div>
<p class="planet-position"><a href="<?php echo $this->getUrl('overview.php', array('cp' => $planet->getId()))?>">[<?php echo $this->escape($planet->getCoords())?>]</a></p>
</div>
<?php else:?>
<div class="planet item selected">
<p class="planet-name"><?php echo $this->escape($planet->getName())?></p>
<div class="planet-image">
<?php if (false && ($moon = $planet->getMoon()) !== null): ?>
<span class="moon">
<img src="<?php echo $this->getSkinUrl($moon->getImage())?>" width="20" height="20"/>
</span>
<?php endif?>
<span class="planet">
<img src="<?php echo $this->getSkinUrl($planet->getImage())?>" width="50" height="50"/>
</span>
</div>
<p class="planet-position">[<?php echo $this->escape($planet->getCoords())?>]</p>
</div>
<?php endif?>
<?php endforeach?>
</div>
<div class="arrow right"><!--&#8680;--></div>
</div>
<div class="resources-display">
<div class="resource metal">
<img src="<?php echo $this->getSkinUrl('graphics/images/metall.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Metal')?>" title="<?php echo $this->__('Metal')?>" />
<p>
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_METAL)):?>
<span class="resource-capped"><?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_METAL))?></span>
<?php else:?>
<?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_METAL))?>
<?php endif?>
</p>
</div>
<div class="resource cristal">
<img src="<?php echo $this->getSkinUrl('graphics/images/kristall.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Cristal')?>" title="<?php echo $this->__('Cristal')?>" />
<p>
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_CRISTAL)):?>
<span class="resource-capped"><?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_CRISTAL))?></span>
<?php else:?>
<?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_CRISTAL))?>
<?php endif?>
</p>
</div>
<div class="resource deuterium">
<img src="<?php echo $this->getSkinUrl('graphics/images/deuterium.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Deuterium')?>" title="<?php echo $this->__('Deuterium')?>" />
<p>
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_DEUTERIUM)):?>
<span class="resource-capped"><?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_DEUTERIUM))?></span>
<?php else:?>
<?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_DEUTERIUM))?>
<?php endif?>
</p>
</div>
<div class="resource energy">
<img src="<?php echo $this->getSkinUrl('graphics/images/energie.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Energy')?>" title="<?php echo $this->__('Energy')?>" />
<p>
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_ENERGY)):?>
<span class="resource-capped"><?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_ENERGY))?> / <?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceCap(Legacies_Empire::RESOURCE_ENERGY))?></span>
<?php else:?>
<?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_ENERGY))?> / <?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceCap(Legacies_Empire::RESOURCE_ENERGY))?>
<?php endif?>
</p>
</div>
<div class="messages">
<img src="<?php echo $this->getSkinUrl('graphics/images/message.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Messages')?>" title="<?php echo $this->__('Messages')?>" />
<p>
<?php if (($count = $this->getCurrentUser()->getNewMessagesCount()) > 1):?>
<a href="<?php echo $this->getUrl('messages.php')?>" title="<?php echo $this->__('You have %1$d new messages.', $count)?>"><?php echo $this->__('%1$d messages.', $count)?></a>
<?php elseif ($count == 1):?>
<a href="<?php echo $this->getUrl('messages.php')?>" title="<?php echo $this->__('You have 1 new message.')?>"><?php echo $this->__('1 message.')?></a>
<?php else:?>
<a href="<?php echo $this->getUrl('messages.php')?>" title="<?php echo $this->__('You have no new message.')?>"><?php echo $this->__('No message.')?></a>
<?php endif?>
</p>
</div>
</div>

View file

@ -1,54 +0,0 @@
<div id="main">
<div id="login">
<div id="login_input">
<form name="formular" action="" method="post" onsubmit="changeAction('login');">
<table width="400" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr style="vertical-align: top;">
<td style="padding-right: 4px;">
<?php echo $this->__('Username')?> <input name="username" value="" type="text">
<?php echo $this->__('Password')?> <input name="password" value="" type="password">
</td>
</tr><tr>
<td style="padding-right: 4px;">
<?php echo $this->__('Remember me')?> <input name="rememberme" type="checkbox">
<input name="submit" value="<?php echo $this->__('Log in!')?>" type="submit">
</td>
</tr><tr>
<td style="padding-right: 4px;">
<a href="lostpassword.php"><?php echo $this->__('I have lost my password.')?></a>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<div id="mainmenu" style="margin-top: 20px;">
<a href="reg.php"><?php echo $this->__('Register')?></a>
<a href="<?php echo $this->getData('board_url')?>"><?php echo $this->__('Boards')?></a>
<a href="contact.php"><?php echo $this->__('Contact')?></a>
</div>
<div id="rightmenu" class="rightmenu">
<div id="title"><?php echo $this->__('Welcome on %s!', $this->escape($this->getData('server_name')))?></div>
<div id="content">
<center>
<div id="text1">
<div style="text-align: left;"><?php echo $this->__('<strong>%1$s</strong> make you an emperor. Conquer outer space and master other players on <strong>%1$s</strong>.', $this->getData('server_name'))?></div>
</div>
<div id="register" class="bigbutton" onclick="document.location.href='reg.php';"><font color="#cc0000"><?php echo $this->__('Register now!')?></font></div>
<div id="text2">
<div id="text3">
<center>
<b>
<font color="#00cc00"><?php echo $this->__('Player count: ')?></font><font color="#c6c7c6"><?php echo $this->getData('user_count')?></font> -
<font color="#00cc00"><?php echo $this->__('Latest player: ')?></font><font color="#c6c7c6"><?php echo $this->getData('latest_player')?></font> -
<font color="#00cc00"><?php echo $this->__('Online players: ')?></font> <font color="#c6c7c6"><?php echo $this->getData('online_players')?></font>
</b>
</center>
</div>
</div>
</center>
</div>
</div>
</div>

View file

@ -1,9 +0,0 @@
<?php return array(
'block' => array(
'core' => array('Wootook_Core_Block_' => 'Wootook/Core/Block'),
'empire' => array('Wootook_Empire_Block_' => 'Wootook/Empire/Block'),
'legacies_core' => array('Legacies_Core_Block_' => 'Legacies/Core/Block'),
'legacies_empire' => array('Legacies_Empire_Block_' => 'Legacies/Empire/Block'),
'legacies_officers' => array('Legacies_Officers_Block_' => 'Legacies/Officers/Block')
)
);

View file

@ -1,71 +0,0 @@
<?php return array(
//
// Buildings production
// {{{
Legacies_Empire::ID_BUILDING_METAL_MINE => array(
Legacies_Empire::RESOURCE_METAL => 40,
Legacies_Empire::RESOURCE_CRISTAL => 10,
Legacies_Empire::RESOURCE_DEUTERIUM => 0,
Legacies_Empire::RESOURCE_ENERGY => 0,
Legacies_Empire::RESOURCE_MULTIPLIER => 1.5,
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_MetalMine'
),
Legacies_Empire::ID_BUILDING_CRISTAL_MINE => array(
Legacies_Empire::RESOURCE_METAL => 30,
Legacies_Empire::RESOURCE_CRISTAL => 15,
Legacies_Empire::RESOURCE_DEUTERIUM => 0,
Legacies_Empire::RESOURCE_ENERGY => 0,
Legacies_Empire::RESOURCE_MULTIPLIER => 1.6,
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_CristalMine'
),
Legacies_Empire::ID_BUILDING_DEUTERIUM_SYNTHETISER => array(
Legacies_Empire::RESOURCE_METAL => 150,
Legacies_Empire::RESOURCE_CRISTAL => 50,
Legacies_Empire::RESOURCE_DEUTERIUM => 0,
Legacies_Empire::RESOURCE_ENERGY => 0,
Legacies_Empire::RESOURCE_MULTIPLIER => 1.5,
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_DeuteriumSynthetiser'
),
Legacies_Empire::ID_BUILDING_SOLAR_PLANT => array(
Legacies_Empire::RESOURCE_METAL => 50,
Legacies_Empire::RESOURCE_CRISTAL => 20,
Legacies_Empire::RESOURCE_DEUTERIUM => 0,
Legacies_Empire::RESOURCE_ENERGY => 0,
Legacies_Empire::RESOURCE_MULTIPLIER => 1.5,
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_SolarPlant'
),
Legacies_Empire::ID_BUILDING_FUSION_REACTOR => array(
Legacies_Empire::RESOURCE_METAL => 500,
Legacies_Empire::RESOURCE_CRISTAL => 200,
Legacies_Empire::RESOURCE_DEUTERIUM => 100,
Legacies_Empire::RESOURCE_ENERGY => 0,
Legacies_Empire::RESOURCE_MULTIPLIER => 1.8,
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_FusionReactor'
),
// }}}
//
// Ships production
// {{{
Legacies_Empire::ID_SHIP_SOLAR_SATELLITE => array(
Legacies_Empire::RESOURCE_METAL => 0,
Legacies_Empire::RESOURCE_CRISTAL => 2000,
Legacies_Empire::RESOURCE_DEUTERIUM => 500,
Legacies_Empire::RESOURCE_ENERGY => 0,
Legacies_Empire::RESOURCE_MULTIPLIER => 0.5,
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Ship_SolarSatellite'
),
Legacies_Empire::ID_SHIP_SUPERNOVA => array(
Legacies_Empire::RESOURCE_METAL => 0,
Legacies_Empire::RESOURCE_CRISTAL => 2000,
Legacies_Empire::RESOURCE_DEUTERIUM => 500,
Legacies_Empire::RESOURCE_ENERGY => 0,
Legacies_Empire::RESOURCE_MULTIPLIER => 0.5,
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Ship_Supernova'
)
// }}}
);

View file

@ -1,265 +0,0 @@
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing XNova.
*
*/
/**
* Main application script execution class
*
* @param string responder
* @param int messageOffset
*/
function Legacies_Client(responder, messageOffset) {
if (!document.querySelectorAll) {
alert("Your browser is not compatible with CSS selectors API.\n\nCould not continue.");
return;
}
this.responder = responder;
this.messages = [];
this.messageId = messageOffset || 1;
this.callbacks = {};
this.recurrentMessages = [];
this.send = (function() {
if (this.messages.length == 0) {
return this;
}
var request = new XMLHttpRequest();
request.open('POST', this.responder, false);
request.send(JSON.stringify(this.messages));
this.messages = [];
for (var i in this.recurrentMessages) {
this.enqueue(this.recurrentMessages[i].action, this.recurrentMessages[i].params, this.recurrentMessages[i].callback);
}
if(request.status == 404) {
alert('Request failed, responder not found.');
return this;
}
try {
var response = JSON.parse(request.responseText);
} catch (e) {
alert('Invalid response.');
return this;
}
if(request.status == 200) {
for (var i in response) {
this._callback(response[i]);
}
}
return this;
}).bind(this);
this.main = (function(interval) {
setInterval(this.send, interval || 30000);
}).bind(this);
this.enqueue = (function(action, params){
this.messages.push({'uid':this.messageId++,'action':action,'params':params});
return this;
}).bind(this);
this.enqueueRecurrent = (function(action, params, callback) {
this.recurrentMessages.push({'callback':callback,'action':action,'params':params});
this.enqueue(action, params, callback);
}).bind(this);
this._callback = (function(message){
if (message.error === undefined || message.payload === undefined) {
return this;
}
if (message.error === true) {
if (typeof(message.payload.messages) == 'string') {
alert(message.payload.messages);
} else {
var info = '';
for (var i in message.payload.messages) {
info = info + "\n[" + i + "]:\n" + message.payload.messages[i].join("\n") + "\n";
}
alert("Errors were returned:\n" + info);
}
return this;
}
if (message.callback && this.CallbackType[message.callback]) {
(this.CallbackType[message.callback]).bind(this)(message.payload);
}
return this;
}).bind(this);
this.login = (function(username, password, rememberme) {
var params = {
'username': username,
'password': password,
'rememberme': rememberme || false
};
this.enqueue('user.account.login', params).send();
return this;
}).bind(this);
this.logout = (function() {
this.enqueue('user.account.logout', {}).send();
return this;
}).bind(this);
this.form = (function(event) {
event.preventDefault();
var form = event.target;
var params = {};
for (var i = 0; i < form.length; i++) {
if (!form[i].name || !form[i].type) {
continue;
}
if (form[i].type == 'checkbox') {
if (form[i].checked) {
params[form[i].name] = true;
} else {
params[form[i].name] = false;
}
} else if (form[i].type == 'radio') {
params[form[i].name] = form[i].value;
} else if (form[i].value !== undefined) {
params[form[i].name] = form[i].value;
}
}
var action = form.action.slice(form.action.indexOf('#') + 1);
this.enqueue(action, params, this.CallbackType.updater).send();
}).bind(this);
this.CallbackType = {
redirector: function(payload) {
if (payload.redirect) {
document.location.href = payload.redirect;
}
},
updater: function(payload) {
if (payload.html && payload.selector) {
var parent = $$(payload.selector);
var handler = document.createElement("div");
handler.innerHTML = payload.html;
var fragment = document.createDocumentFragment();
for (var i = 0; i < handler.childNodes.length; i++) {
fragment.appendChild(handler.childNodes[i]);
}
for (var i = 0; i < parent.length; i++) {
parent[i].appendChild(fragment.cloneNode(true));
}
}
},
script: function(payload) {
if (payload.script) {
eval(payload.script);
}
},
error: function(payload) {
if (payload.messages) {
alert(payload.messages.join(', '));
}
},
show: function(payload) {
if (payload.selector) {
var elementList = $$(payload.selector);
for (var i = 0; i < elementList.length; i++) {
elementList[i].style.display = 'block';
}
}
},
hide: function(payload) {
if (payload.selector) {
var elementList = $$(payload.selector);
for (var i = 0; i < elementList.length; i++) {
elementList[i].style.display = 'none';
}
}
},
callback: function(payload) {
if (payload.callback) {
payload.callback.apply(this, payload.params);
}
},
enqueueRecurrent: function(payload) {
if (payload.action && payload.params && payload.callback) {
this.enqueueRecurrent(payload.action, payload.params, payload.callback);
}
}
};
}
function Legacies_Element(object) {
object.listen = (function(event, callback) {
this.addEventListener(event, callback, false);
return this;
}).bind(object);
return object;
}
function Legacies_List(object) {
object.listen = (function(event, callback) {
for (var i in this) {
Legacies_Element(Legacies_Element[i]);
this[i].listen(event, callback);
}
return this;
}).bind(object);
return object;
}
function $A(object) {
return Array.prototype.slice.call(object);
}
function $(element) {
if (typeof(element) == 'string') {
element = document.getElementById(element);
}
Legacies_Element(element);
return element;
}
function $$(selector, context) {
context = context || document;
var nodeList = context.querySelectorAll(selector);
Legacies_List(nodeList);
return nodeList;
}
function $E(element, methods) {
for (var i in methods) {
if (methods[i] === undefined) {
continue;
}
element[i] = function(){
var args = $A(arguments);
args.unshift(element);
methods[i].apply(element, args);
}
element[i].bind(element);
}
return element;
}

File diff suppressed because it is too large Load diff

View file

@ -1,163 +0,0 @@
<?php
include './bootstrap.php';
if (!extension_loaded('xdebug')) {
header('Content-Type: text/plain');
}
$user = new Legacies_Empire_Model_User(array(
'rpg_stockeur' => 0,
'b_laboratory' => 0,
'b_laboratory_id' => serialize(array()),
"spy_tech" => 12,
"computer_tech" => 8,
"military_tech" => 10,
"defence_tech" => 10,
"shield_tech" => 10,
"energy_tech" => 8,
"hyperspace_tech" => 8,
"combustion_tech" => 6,
"impulse_motor_tech" => 6,
"hyperspace_motor_tech" => 6,
"laser_tech" => 6,
"ionic_tech" => 6,
"buster_tech" => 6,
"intergalactic_tech" => 0,
"expedition_tech" => 0,
"graviton_tech" => 0,
));
$data = array(
'last_update' => 0,
'planet_type' => 1,
'b_building_id' => '',
'b_hangar_id' => serialize(array(/*array(
'ship_id' => Legacies_Empire::ID_SHIP_LIGHT_TRANSPORT,
'qty' => 10,
'created_at' => 0,
'updated_at' => 0
), array(
'ship_id' => Legacies_Empire::ID_SHIP_LARGE_TRANSPORT,
'qty' => 20,
'created_at' => 600,
'updated_at' => 600
), array(
'ship_id' => Legacies_Empire::ID_SHIP_LARGE_TRANSPORT,
'qty' => 30,
'created_at' => 650,
'updated_at' => 650
), array(
'ship_id' => Legacies_Empire::ID_SHIP_LARGE_TRANSPORT,
'qty' => 40,
'created_at' => 700,
'updated_at' => 700
)*/)),
'metal' => 500000,
'metal_perhour' => 20,
'cristal' => 500000,
'cristal_perhour' => 10,
'deuterium' => 300000,
'deuterium_perhour' => 0,
'energy_max' => 0,
'energy_used' => 0,
'metal_mine_porcent' => 10,
'cristal_mine_porcent' => 10,
'solar_plant_porcent' => 10,
'fusion_plant_porcent' => 10,
'solar_satelit_porcent' => 10,
'deuterium_sintetizer_porcent' => 10,
'metal_mine' => 20,
'cristal_mine' => 19,
'deuterium_sintetizer' => 0,
'solar_plant' => 20,
'fusion_plant' => 0,
'robot_factory' => 0,
'nano_factory' => 0,
'hangar' => 12,
'metal_store' => 10,
'cristal_store' => 10,
'deuterium_store' => 10,
'rpg_stockeur' => 0
);
$planet = new Legacies_Empire_Model_Planet($data);
$planet->setUser($user);
//var_dump(array('$planet->setUser($user)', array_diff($planet->getAllDatas(), $data)));
$data = $planet->getAllDatas();
$planet->updateStorages(0);
//var_dump(array('$planet->updateStorages(0)', array_diff($planet->getAllDatas(), $data)));
$data = $planet->getAllDatas();
$planet->updateResourceProduction(0);
//var_dump(array('$planet->updateResourceProduction(0)', array_diff($planet->getAllDatas(), $data)));
$data = $planet->getAllDatas();
$planet->getShipyard()->appendQueue(Legacies_Empire::ID_SHIP_LIGHT_FIGHTER, 10, 0);
//var_dump(array('$planet->getShipyard()->appendQueue(Legacies_Empire::ID_SHIP_LIGHT_FIGHTER, 10, 0)', array_diff($planet->getAllDatas(), $data)));
$data = $planet->getAllDatas();
$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_CRISTAL_MINE, false, 0);
//var_dump(array('$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_CRISTAL_MINE, false, 0)', array_diff($planet->getAllDatas(), $data)));
$data = $planet->getAllDatas();
$userData = $user->getAllDatas();
$planet->getResearchLab()->appendQueue(Legacies_Empire::ID_RESEARCH_ENERGY_TECHNOLOGY, false, 0);
var_dump(array('$planet->getResearchLab()->appendQueue(Legacies_Empire::ID_RESEARCH_ENERGY_TECHNOLOGY, false, 0)', array_diff($planet->getAllDatas(), $data), array_diff($user->getAllDatas(), $userData)));
$data = $planet->getAllDatas();
var_dump(array_diff($planet->getAllDatas(), $data));
$data = $planet->getAllDatas();
Wootook::dispatchEvent('planet.update', array(
'planet' => $planet,
'time' => 5400
));
var_dump(array_diff($planet->getAllDatas(), $data));
$data = $planet->getAllDatas();
Wootook::dispatchEvent('planet.update', array(
'planet' => $planet,
'time' => (3600 * 20)
));
$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_CRISTAL_MINE, false, 3600);
var_dump(array_diff($planet->getAllDatas(), $data));
$data = $planet->getAllDatas();
Wootook::dispatchEvent('planet.update', array(
'planet' => $planet,
'time' => (3600 * 30)
));
var_dump(array_diff($planet->getAllDatas(), $data));
$data = $planet->getAllDatas();
Wootook::dispatchEvent('planet.update', array(
'planet' => $planet,
'time' => (3600 * 5000)
));
var_dump(array_diff($planet->getAllDatas(), $data));
$data = $planet->getAllDatas();
$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_CRISTAL_MINE, false, 0);
$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_SOLAR_PLANT, false, 0);
Wootook::dispatchEvent('planet.update', array(
'planet' => $planet,
'time' => (3600 * 10000)
));
var_dump(array_diff($planet->getAllDatas(), $data));
$data = $planet->getAllDatas();

View file

@ -1,46 +0,0 @@
<?php
//define('BCNUMBERS', true);
if (!defined('DEBUG') && in_array(strtolower(getenv('DEBUG')), array('1', 'on', 'true'))) {
define('DEBUG', true);
}
if (!defined('DEBUG')) {
@ini_set('display_errors', false);
} else {
@ini_set('display_errors', true);
@error_reporting(E_ALL | E_STRICT);
}
defined('ROOT_PATH') || define('ROOT_PATH', dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR);
defined('APPLICATION_PATH') || define('APPLICATION_PATH', ROOT_PATH . 'includes' . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR);
defined('PHPEXT') || define('PHPEXT', require ROOT_PATH . 'extension.inc');
defined('VERSION') || define('VERSION', '2009.5');
set_include_path(implode(PATH_SEPARATOR, array(
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'core',
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'community',
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'local',
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'libraries',
get_include_path()
)));
function __autoload($class) {
include_once str_replace('_', '/', $class) . '.php';
}
if (0 === filesize(ROOT_PATH . 'config.php')) {
header('Location: install/');
die();
}
foreach (include ROOT_PATH . 'includes/data/events.php' as $event => $listenerList) {
foreach ($listenerList as $listener) {
Wootook::registerListener($event, $listener);
}
}
include ROOT_PATH . 'includes/constants.php';

View file

@ -1,43 +0,0 @@
<?php
include './bootstrap.php';
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="test.csv"');
/*
$datas = array(
'galaxy' => array(),
'system' => array(),
);
*/
for ($i = 0; $i < 10000; $i++) {
$collection = Legacies_Empire_Model_Planet::searchMostFreeSystems();
$collection->limit(1)->load();
$systemInfo = $collection->current();
//var_dump($systemInfo->getallDatas());
echo $systemInfo->getData('galaxy') . ';' . $systemInfo->getData('system') . PHP_EOL;
/*
$galaxy = $systemInfo->getData('galaxy');
if (!isset($datas['galaxy'][$galaxy])) {
$datas['galaxy'][$galaxy] = 1;
} else {
$datas['galaxy'][$galaxy]++;
}
$system = $systemInfo->getData('system');
if (!isset($datas['system'][$system])) {
$datas['system'][$system] = 1;
} else {
$datas['system'][$system]++;
}
*/
}
/*
asort($datas['galaxy'], SORT_NUMERIC);
asort($datas['system'], SORT_NUMERIC);
var_dump($datas);
*/

146
build.xml Normal file
View file

@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="name-of-project" default="build">
<target name="build"
depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdoc,phpunit,phpcb"/>
<target name="build-parallel"
depends="prepare,lint,tools-parallel,phpunit,phpcb"/>
<target name="tools-parallel"
description="Run tools in parallel">
<parallel threadCount="2">
<sequential>
<antcall target="pdepend"/>
<antcall target="phpmd-ci"/>
</sequential>
<antcall target="phpcpd"/>
<antcall target="phpcs-ci"/>
<antcall target="phploc"/>
<antcall target="phpdoc"/>
</parallel>
</target>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>
</target>
<target name="prepare" depends="clean"
description="Prepare for build">
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>
<target name="lint">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${basedir}/src">
<include name="**/*.php" />
<modified />
</fileset>
<fileset dir="${basedir}/tests">
<include name="**/*.php" />
<modified />
</fileset>
</apply>
</target>
<target name="phploc" description="Measure project size using PHPLOC">
<exec executable="phploc">
<arg value="--log-csv" />
<arg value="${basedir}/build/logs/phploc.csv" />
<arg path="${basedir}/src" />
</exec>
</target>
<target name="pdepend"
description="Calculate software metrics using PHP_Depend">
<exec executable="pdepend">
<arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
<arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
<arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
<arg path="${basedir}/src" />
</exec>
</target>
<target name="phpmd"
description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
<exec executable="phpmd">
<arg path="${basedir}/src" />
<arg value="text" />
<arg value="${basedir}/build/phpmd.xml" />
</exec>
</target>
<target name="phpmd-ci"
description="Perform project mess detection using PHPMD creating a log file for the continuous integration server">
<exec executable="phpmd">
<arg path="${basedir}/src" />
<arg value="xml" />
<arg value="${basedir}/build/phpmd.xml" />
<arg value="--reportfile" />
<arg value="${basedir}/build/logs/pmd.xml" />
</exec>
</target>
<target name="phpcs"
description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
<exec executable="phpcs">
<arg value="--standard=${basedir}/build/phpcs.xml" />
<arg path="${basedir}/src" />
</exec>
</target>
<target name="phpcs-ci"
description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
<exec executable="phpcs" output="/dev/null">
<arg value="--report=checkstyle" />
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
<arg value="--standard=${basedir}/build/phpcs.xml" />
<arg path="${basedir}/src" />
</exec>
</target>
<target name="phpcpd" description="Find duplicate code using PHPCPD">
<exec executable="phpcpd">
<arg value="--log-pmd" />
<arg value="${basedir}/build/logs/pmd-cpd.xml" />
<arg path="${basedir}/src" />
</exec>
</target>
<target name="phpdoc"
description="Generate API documentation using PHPDocumentor">
<exec executable="phpdoc">
<arg value="--directory" />
<arg path="${basedir}/src" />
<arg value="--target" />
<arg path="${basedir}/build/api" />
</exec>
</target>
<target name="phpunit" description="Run unit tests with PHPUnit">
<exec executable="phpunit" failonerror="true"/>
</target>
<target name="phpcb"
description="Aggregate tool output with PHP_CodeBrowser">
<exec executable="phpcb">
<arg value="--log" />
<arg path="${basedir}/build/logs" />
<arg value="--source" />
<arg path="${basedir}/src" />
<arg value="--output" />
<arg path="${basedir}/build/code-browser" />
</exec>
</target>
</project>

36
build/phpcs.xml Normal file
View file

@ -0,0 +1,36 @@
<?xml version="1.0"?>
<ruleset name="PPW-DEFAULT">
<description>Default coding standard</description>
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.Commenting.Todo"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Files.LineEndings"/>
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
<rule ref="Generic.Formatting.MultipleStatementAlignment"/>
<rule ref="Generic.Formatting.NoSpaceAfterCast"/>
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
<rule ref="PEAR.Functions.ValidDefaultValue"/>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="PEAR.NamingConventions.ValidClassName"/>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.PHP.NoSilencedErrors"/>
<rule ref="Generic.PHP.UpperCaseConstant"/>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
</ruleset>

26
build/phpmd.xml Normal file
View file

@ -0,0 +1,26 @@
<?xml version="1.0"?>
<ruleset name="PPW-DEFAULT"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>Default coding standard</description>
<rule ref="rulesets/codesize.xml/CyclomaticComplexity" />
<rule ref="rulesets/codesize.xml/NPathComplexity" />
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity" />
<rule ref="rulesets/codesize.xml/ExcessiveClassLength" />
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength" />
<rule ref="rulesets/codesize.xml/ExcessiveParameterList" />
<rule ref="rulesets/design.xml/EvalExpression" />
<rule ref="rulesets/design.xml/ExitExpression" />
<rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" />
<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter" />
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable" />
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField" />
<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod" />
</ruleset>

View file

@ -1,151 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
includeLang('buildings');
$user = Wootook_Empire_Model_User::getSingleton();
$planet = $user->getCurrentPlanet();
$mode = isset($_GET['mode']) ? $_GET['mode'] : null;
switch ($mode) {
case 'fleet':
if ($planet->getElement(Legacies_Empire::ID_BUILDING_SHIPYARD) < 1) {
$layout = new Wootook_Core_Layout();
$layout->load('message');
$block = $layout->getBlock('message');
$block['title'] = Wootook::__('Shipyard is required');
$block['message'] = Wootook::__('In order to build ships you will need to build a shipyard building.');
echo $layout->render();
break;
}
/** @var Legacies_Empire_Model_Planet_Building_Shipyard $shipyard */
$shipyard = $planet->getShipyard();
if (isset($_POST['ship']) && is_array($_POST['ship'])) {
foreach ($_POST['ship'] as $shipId => $count) {
$shipId = intval($shipId);
$count = intval($count);
$shipyard->appendQueue($shipId, $count);
}
$planet->save();
}
$layout = new Wootook_Core_Layout();
$layout->load('planet.shipyard');
echo $layout->render();
break;
case 'research':
if ($planet->getElement(Legacies_Empire::ID_BUILDING_RESEARCH_LAB) < 1) {
$layout = new Wootook_Core_Layout();
$layout->load('message');
$block = $layout->getBlock('message');
$block['title'] = Wootook::__('Research lab is required');
$block['message'] = Wootook::__('In order to do technological researches, you will need to build a research lab building.');
echo $layout->render();
break;
}
if (isset($_GET['research']) && !empty($_GET['research'])) {
$data = $planet->getAllDatas();
$planet->appendBuildingQueue(intval($_GET['research']), isset($_GET['destroy']));
$planet->save();
} else if (isset($_GET['cancel']) && !empty($_GET['cancel'])) {
$planet->dequeueItem($_GET['cancel']);
$planet->save();
}
$layout = new Wootook_Core_Layout();
$layout->load('planet.research-lab');
echo $layout->render();
break;
case 'defense':
if ($planet->getElement(Legacies_Empire::ID_BUILDING_SHIPYARD) < 1) {
$layout = new Wootook_Core_Layout();
$layout->load('message');
$block = $layout->getBlock('message');
$block['title'] = Wootook::__('Shipyard is required');
$block['message'] = Wootook::__('In order to build ships you will need to build a shipyard building.');
echo $layout->render();
break;
}
/** @var Legacies_Empire_Model_Planet_Building_Shipyard $shipyard */
$shipyard = $planet->getShipyard();
if (isset($_POST['defense']) && is_array($_POST['defense'])) {
foreach ($_POST['defense'] as $defenseId => $count) {
$defenseId = intval($defenseId);
$count = intval($count);
$shipyard->appendQueue($defenseId, $count);
}
$planet->save();
}
$layout = new Wootook_Core_Layout();
$layout->load('planet.defense');
/** @var Legacies_Empire_Block_Planet_Shipyard $block */
$block = $layout->getBlock('item-list');
$block->setType(Legacies_Empire::TYPE_DEFENSE);
echo $layout->render();
break;
default:
if (isset($_GET['building']) && !empty($_GET['building'])) {
$data = $planet->getAllDatas();
$planet->appendBuildingQueue(intval($_GET['building']), isset($_GET['destroy']));
$planet->save();
} else if (isset($_GET['cancel']) && !empty($_GET['cancel'])) {
$planet->dequeueItem($_GET['cancel']);
$planet->save();
}
$layout = new Wootook_Core_Layout();
$layout->load('planet.buildings');
echo $layout->render();
break;
}

View file

@ -1,34 +0,0 @@
<?php return array(
'global' => array(
'storyline' => array(
'universe' => 'legacies',
'episode' => 'default',
),
'web' => array(
'base_url' => 'http://testing.xnova-legacies.org/'
),
'date' => array(
'timezone' => 'Europe/Paris'
),
'database' => array(
'engine' => 'mysql',
'options' => array(
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'db_xnova'
),
'table_prefix' => 'game_',
),
'layout' => array(
'page' => 'page.php',
'empire' => 'empire.php'
),
'locales' => array(
'fr' => 'fr_FR',
'fr_FR' => 'fr_FR',
'en' => 'en_US',
'en_US' => 'en_US'
)
)
);

View file

@ -1,73 +0,0 @@
<?php
/*
Galacticnova : An open-source web-based game !
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
License: AGPL
Author: Vincent Debarre <vinilox@vinilox.eu>
Website: http://project.galacticnova.vinilox.eu/
Last revision: 13/07/11
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
includeLang('fleet');
$BoxTitle = $lang['fl_error'];
$TxtColor = "red";
$BoxMessage = $lang['fl_notback'];
if ( is_numeric($_POST['fleetid']) ) {
$fleetid = intval($_POST['fleetid']);
$FleetRow = doquery("SELECT * FROM {{table}} WHERE `fleet_id` = '". $fleetid ."';", 'fleets', true);
$i = 0;
if ($FleetRow['fleet_owner'] == $user['id']) {
if ($FleetRow['fleet_mess'] == 0 || $FleetRow['fleet_mess'] == 2) {
if ($FleetRow['fleet_end_stay'] != 0) {
// Faut calculer le temps reel de retour
if ($FleetRow['fleet_start_time'] > time()) {
// On a pas encore entamé le stationnement
// Il faut calculer la parcelle de temps ecoulée depuis le lancement de la flotte
$CurrentFlyingTime = time() - $FleetRow['start_time'];
} else {
// On est deja en stationnement
// Il faut donc directement calculer la durée d'un vol aller ou retour
$CurrentFlyingTime = $FleetRow['fleet_start_time'] - $FleetRow['start_time'];
}
} else {
// C'est quoi le stationnement ??
// On calcule sagement la parcelle de temps ecoulée depuis le depart
$CurrentFlyingTime = time() - $FleetRow['start_time'];
}
// Allez houste au bout du compte y a la maison !! (E.T. phone home.............)
$ReturnFlyingTime = $CurrentFlyingTime + time();
$QryUpdateFleet = "UPDATE {{table}} SET ";
$QryUpdateFleet .= "`fleet_start_time` = '". (time() - 1) ."', ";
$QryUpdateFleet .= "`fleet_end_stay` = '0', ";
$QryUpdateFleet .= "`fleet_end_time` = '". ($ReturnFlyingTime + 1) ."', ";
$QryUpdateFleet .= "`fleet_target_owner` = '". $user['id'] ."', ";
$QryUpdateFleet .= "`fleet_mess` = '1' ";
$QryUpdateFleet .= "WHERE ";
$QryUpdateFleet .= "`fleet_id` = '" . $fleetid . "';";
doquery( $QryUpdateFleet, 'fleets');
$BoxTitle = $lang['fl_sback'];
$TxtColor = "lime";
$BoxMessage = $lang['fl_isback'];
} elseif ($FleetRow['fleet_mess'] == 1) {
$BoxMessage = $lang['fl_notback'];
}
} else {
$BoxMessage = $lang['fl_onlyyours'];
}
}
message ("<font color=\"".$TxtColor."\">". $BoxMessage ."</font>", $BoxTitle, "fleet.". PHPEXT, 2);
// -----------------------------------------------------------------------------------------------------------
?>

View file

@ -1,165 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
$mode = $_GET['mode'];
$a = $_GET['a'];
/*
Este script es original xD
La funcion de este script es administrar una variable del $user
Permite agregar y quitar arrays...
*/
//Lets start!
if(isset($_GET['mode'])){
if($_POST){
//Pegamos el texto :P
if($_POST["n"] == ""){$_POST["n"] = "Unbenannt";}
$r = strip_tags($_POST[n]).",".intval($_POST[g]).",".intval($_POST[s]).",".intval($_POST[p]).",".intval($_POST[t])."\r\n";
$user['fleet_shortcut'] .= $r;
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
message("Le raccourcis a &eacute;t&eacute; enregistr&eacute; !","Enregistrment","fleetshortcut.php");
}
$page = "<form method=POST><table border=0 cellpadding=0 cellspacing=1 width=519>
<tr height=20>
<td colspan=2 class=c>Nom [Galaxie/Syst&egrave;me solaire/Plan&egrave;te]</td>
</tr><tr height=\"20\"><th>
<input type=text name=n value=\"$g\" size=32 maxlength=32 title=\"Name\">
<input type=text name=g value=\"$s\" size=3 maxlength=1 title=\"Galaxie\">
<input type=text name=s value=\"$p\" size=3 maxlength=3 title=\"Sonnensystem\">
<input type=text name=p value=\"$t\" size=3 maxlength=3 title=\"Planet\">
<select name=t>";
$page .= '<option value="1"'.(($c[4]==1)?" SELECTED":"").">Plan&egrave;te</option>";
$page .= '<option value="2"'.(($c[4]==2)?" SELECTED":"").">D&eacute;bris</option>";
$page .= '<option value="3"'.(($c[4]==3)?" SELECTED":"").">Lune</option>";
$page .= "</select>
</th></tr><tr>
<th><input type=\"reset\" value=\"Zur&uuml;cksetzen\"> <input type=\"submit\" value=\"Enregistrer\">";
//Muestra un (L) si el destino pertenece a luna, lo mismo para escombros
$page .= "</th></tr>";
$page .= '<tr><td colspan=2 class=c><a href=fleetshortcut.php>Effacer</a></td></tr></tr></table></form>';
}
elseif(isset($_GET['a'])){
if($_POST){
//Armamos el array...
$scarray = explode("\r\n",$user['fleet_shortcut']);
if($_POST["delete"]){
unset($scarray[$a]);
$user['fleet_shortcut'] = implode("\r\n",$scarray);
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
message("Shortcut wurde gel&ouml;scht","Gel&ouml;scht","fleetshortcut.php");
}
else{
$r = explode(",",$scarray[$a]);
$r[0] = strip_tags($_POST['n']);
$r[1] = intval($_POST['g']);
$r[2] = intval($_POST['s']);
$r[3] = intval($_POST['p']);
$r[4] = intval($_POST['t']);
$scarray[$a] = implode(",",$r);
$user['fleet_shortcut'] = implode("\r\n",$scarray);
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
message("Le raccourcis a &eacute;t&eacute; &eacute;dit&eacute; !.","Editer","fleetshortcut.php");
}
}
if($user['fleet_shortcut']){
$scarray = explode("\r\n",$user['fleet_shortcut']);
$c = explode(',',$scarray[$a]);
$page = "<form method=POST><table border=0 cellpadding=0 cellspacing=1 width=519>
<tr height=20>
<td colspan=2 class=c>Editer: {$c[0]} [{$c[1]}:{$c[2]}:{$c[3]}]</td>
</tr>";
//if($i==0){$page .= "";}
$page .= "<tr height=\"20\"><th>
<input type=hidden name=a value=$a>
<input type=text name=n value=\"{$c[0]}\" size=32 maxlength=32>
<input type=text name=g value=\"{$c[1]}\" size=3 maxlength=1>
<input type=text name=s value=\"{$c[2]}\" size=3 maxlength=3>
<input type=text name=p value=\"{$c[3]}\" size=3 maxlength=3>
<select name=t>";
$page .= '<option value="1"'.(($c[4]==1)?" SELECTED":"").">Plan&egrave;te</option>";
$page .= '<option value="2"'.(($c[4]==2)?" SELECTED":"").">D&eacute;bris</option>";
$page .= '<option value="3"'.(($c[4]==3)?" SELECTED":"").">Lune</option>";
$page .= "</select>
</th></tr><tr>
<th><input type=reset value=\"Reset\"> <input type=submit value=\"Enregistrer\"> <input type=submit name=delete value=\"Supprimer\">";
$page .= "</th></tr>";
}else{$page .= message("Le raccourcis a &eacute;t&eacute; enregistr&eacute; !","Enregistrer","fleetshortcut.php");}
$page .= '<tr><td colspan=2 class=c><a href=fleetshortcut.php>Retour</a></td></tr></tr></table></form>';
}
else{
$page = '<table border="0" cellpadding="0" cellspacing="1" width="519">
<tr height="20">
<td colspan="2" class="c">Raccourcis(<a href="?mode=add">Ajout</a>)</td>
</tr>';
if($user['fleet_shortcut']){
/*
Dentro de fleet_shortcut, se pueden almacenar las diferentes direcciones
de acceso directo, el formato es el siguiente.
Nombre, Galaxia,Sistema,Planeta,Tipo
*/
$scarray = explode("\r\n",$user['fleet_shortcut']);
$i=$e=0;
foreach($scarray as $a => $b){
if($b!=""){
$c = explode(',',$b);
if($i==0){$page .= "<tr height=\"20\">";}
$page .= "<th><a href=\"?a=".$e++."\">";
$page .= "{$c[0]} {$c[1]}:{$c[2]}:{$c[3]}";
//Muestra un (L) si el destino pertenece a luna, lo mismo para escombros
if($c[4]==2){$page .= " (E)";}elseif($c[4]==3){$page .= " (L)";}
$page .= "</a></th>";
if($i==1){$page .= "</tr>";}
if($i==1){$i=0;}else{$i=1;}
}
}
if($i==1){$page .= "<th></th></tr>";}
}else{$page .= "<th colspan=\"2\">Pas de Raccourcis</th>";}
$page .= '<tr><td colspan=2 class=c><a href=fleet.php>Retour</a></td></tr></tr></table>';
}
display($page,"Shortcutmanager");
// Created by Perberos. All rights reversed (C) 2006
?>

View file

@ -1,502 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
includeLang('fleet');
$session = Wootook::getSession('fleet');
$user = Wootook_Empire_Model_User::getSingleton();
$planet = $user->getCurrentPlanet();
$galaxy = isset($_POST['galaxy']) ? intval($_POST['galaxy']) : 0;
$system = isset($_POST['system']) ? intval($_POST['system']) : 0;
$position = isset($_POST['planet']) ? intval($_POST['planet']) : 0;
$type = isset($_POST['planettype']) ? intval($_POST['planettype']) : 0;
$mission = isset($_POST['mission']) ? intval($_POST['mission']) : 0;
$galaxy = isset($session['galaxy']) ? $session['galaxy'] : 0;
$system = isset($session['system']) ? $session['system'] : 0;
$position = isset($session['position']) ? $session['position'] : 0;
$type = isset($session['type']) ? $session['type'] : 0;
$speed = isset($session['speed']) ? $session['speed'] : 10;
$protection = $gameConfig['noobprotection'];
$protectiontime = $gameConfig['noobprotectiontime'];
$protectionmulti = $gameConfig['noobprotectionmulti'];
if ($protectiontime < 1) {
$protectiontime = 9999999999999999;
}
$fleetArray = $session['fleet'];
if (!is_array($fleetArray)) {
message ("<font color=\"red\"><b>". $lang['fl_fleet_err'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
// On verifie s'il y a assez de vaisseaux sur la planete !
foreach ($fleetArray as $shipId => $count) {
if ($Count > $planet->getElement($shipId)) {
message ("<font color=\"red\"><b>". $lang['fl_fleet_err'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
}
$allowedPlanetTypes = array(
Wootook_Empire_Model_Planet::TYPE_PLANET,
Wootook_Empire_Model_Planet::TYPE_DEBRIS,
Wootook_Empire_Model_Planet::TYPE_MOON
);
if (!in_array($type, $allowedPlanetTypes)) {
message ("<font color=\"red\"><b>". $lang['fl_fleet_err_pl'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if ($planet->getGalaxy() == $galaxy &&
$planet->getSystem() == $system &&
$planet->getPosition() == $position &&
$planet->getType() == $type) {
message ("<font color=\"red\"><b>". $lang['fl_ownpl_err'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
$YourPlanet = false;
$UsedPlanet = false;
$coords = array(
'galaxy' => $galaxy,
'system' => $system,
'position' => $position
);
if ($mission == Legacies_Empire::ID_MISSION_RECYCLE) {
$destination = Wootook_Empire_Model_Planet::factoryFromCoords($coords);
} else {
$destination = Wootook_Empire_Model_Planet::factoryFromCoords($coords, $type);
}
// Test d'existence de l'enregistrement dans la galaxie !
if ($mission != Legacies_Empire::ID_MISSION_EXPEDITION) {
if (!$destination->getId()) {
if ($mission != Legacies_Empire::ID_MISSION_SETTLE_COLONY) {
message ("<font color=\"red\"><b>". $lang['fl_unknow_target'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
} else if ($mission == Legacies_Empire::ID_MISSION_DESTROY) {
message ("<font color=\"red\"><b>". $lang['fl_used_target'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
} else if ($mission == Legacies_Empire::ID_MISSION_DESTROY && !$destination->isMoon()) {
message ("<font color=\"red\"><b>". $lang['fl_used_target'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
} else {
$EnvoiMaxExpedition = $user->getElement(Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY);
$Expedition = 0;
if ($EnvoiMaxExpedition > 0) {
$maxexpde = doquery("SELECT 1 FROM {{table}} WHERE `fleet_owner` = '".$user['id']."' AND `fleet_mission` = '15';", 'fleets');
$Expedition = $maxexpde->rowCount();
$maxexpde->closeCursor();
}
if ($EnvoiMaxExpedition == 0 ) {
message ("<font color=\"red\"><b>". $lang['fl_expe_notech'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
} else if ($Expedition >= $EnvoiMaxExpedition ) {
message ("<font color=\"red\"><b>". $lang['fl_expe_max'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
}
if ($destination->getUserId() == $user['id']) {
$YourPlanet = true;
$UsedPlanet = true;
} else if ($destination->getId()) {
$UsedPlanet = true;
}
$missionTypes = array();
// Determinons les type de missions possibles par rapport a la planete cible
if ($position == (MAX_PLANET_IN_SYSTEM + 1)) {
$missionTypes[Legacies_Empire::ID_MISSION_EXPEDITION] = $lang['type_mission'][Legacies_Empire::ID_MISSION_EXPEDITION];
} else {
if ($type == Wootook_Empire_Model_Planet::TYPE_DEBRIS) {
if (isset($fleetArray[Legacies_Empire::ID_SHIP_RECYCLER]) && $fleetArray[Legacies_Empire::ID_SHIP_RECYCLER] > 0) {
$missionTypes[Legacies_Empire::ID_MISSION_RECYCLE] = $lang['type_mission'][Legacies_Empire::ID_MISSION_RECYCLE];
}
} else if ($type == Wootook_Empire_Model_Planet::TYPE_PLANET) {
if (isset($fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP]) && $fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP] > 0 && !$UsedPlanet) {
$missionTypes[Legacies_Empire::ID_MISSION_SETTLE_COLONY] = $lang['type_mission'][7];
}
} else if ($type == Wootook_Empire_Model_Planet::TYPE_MOON) {
if (((isset($fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR]) && $fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR] > 0) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_SUPERNOVA]) && $fleetArray[Legacies_Empire::ID_SHIP_SUPERNOVA] > 0)) &&
!$YourPlanet && $UsedPlanet) {
$missionTypes[Legacies_Empire::ID_MISSION_DESTROY] = $lang['type_mission'][Legacies_Empire::ID_MISSION_DESTROY];
}
}
if (in_array($type, array(Wootook_Empire_Model_Planet::TYPE_MOON, Wootook_Empire_Model_Planet::TYPE_PLANET))) {
if (isset($fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE]) && $fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE] > 0 && !$YourPlanet) {
$missionTypes[Legacies_Empire::ID_MISSION_SPY] = $lang['type_mission'][Legacies_Empire::ID_MISSION_SPY];
}
if ((isset($fleetArray[Legacies_Empire::ID_SHIP_LIGHT_TRANSPORT]) && $fleetArray[Legacies_Empire::ID_SHIP_LIGHT_TRANSPORT] > 0) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_LARGE_TRANSPORT]) && $fleetArray[Legacies_Empire::ID_SHIP_LARGE_TRANSPORT] > 0) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_LIGHT_FIGHTER]) && $fleetArray[Legacies_Empire::ID_SHIP_LIGHT_FIGHTER] > 0) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_HEAVY_FIGHTER]) && $fleetArray[Legacies_Empire::ID_SHIP_HEAVY_FIGHTER] > 0) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_CRUISER]) && $fleetArray[Legacies_Empire::ID_SHIP_CRUISER] > 0) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_BATTLESHIP]) && $fleetArray[Legacies_Empire::ID_SHIP_BATTLESHIP] > 0) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP]) && $fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP] > 0) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_RECYCLER]) && $fleetArray[Legacies_Empire::ID_SHIP_RECYCLER] > 0) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE]) && $fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE] > 0 && ALLOW_SPY_DRONE_ATTACKS) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_BOMBER]) && $fleetArray[Legacies_Empire::ID_SHIP_BOMBER] > 0) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_DESTRUCTOR]) && $fleetArray[Legacies_Empire::ID_SHIP_DESTRUCTOR] > 0) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR]) && $fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR] > 0) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_BATTLECRUISER]) && $fleetArray[Legacies_Empire::ID_SHIP_BATTLECRUISER] > 0) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_SUPERNOVA]) && $fleetArray[Legacies_Empire::ID_SHIP_SUPERNOVA] > 0)) {
if (!$YourPlanet) {
$missionTypes[Legacies_Empire::ID_MISSION_ATTACK] = $lang['type_mission'][Legacies_Empire::ID_MISSION_ATTACK];
$missionTypes[Legacies_Empire::ID_MISSION_GROUP_ATTACK] = $lang['type_mission'][Legacies_Empire::ID_MISSION_GROUP_ATTACK];
$missionTypes[Legacies_Empire::ID_MISSION_STATION_ALLY] = $lang['type_mission'][Legacies_Empire::ID_MISSION_STATION_ALLY];
}
$missionTypes[Legacies_Empire::ID_MISSION_TRANSPORT] = $lang['type_mission'][Legacies_Empire::ID_MISSION_TRANSPORT];
}
if ($YourPlanet) {
$missionTypes[Legacies_Empire::ID_MISSION_STATION] = $lang['type_mission'][Legacies_Empire::ID_MISSION_STATION];
}
}
}
if (isset($fleetArray[Legacies_Empire::ID_SHIP_SOLAR_SATELLITE])) {
$missionTypes = array();
}
if (!isset($missionTypes[$mission])) {
message ("<font color=\"red\"><b>". $lang['fl_bad_mission'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if (!$destination->getId()) {
$destinationUser = $user;
} else {
$destinationUser = $destination->getUser();
}
$userPoints = doquery("SELECT total_points FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner`='{$user->getId()}'", 'statpoints', true);
$myGameLevel = $userPoints['total_points'];
if ($destinationUser->getId()) {
$destinationPoints = doquery("SELECT total_points FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '{$destinationUser->getId()}';", 'statpoints', true);
$hisGameLevel = $destinationPoints['total_points'];
} else {
$hisGameLevel = 0;
}
$vacationMode = $destinationUser['urlaubs_modus'];
if ($protection) {
$protectedMissions = array(
Legacies_Empire::ID_MISSION_ATTACK,
Legacies_Empire::ID_MISSION_GROUP_ATTACK,
Legacies_Empire::ID_MISSION_STATION_ALLY,
Legacies_Empire::ID_MISSION_SPY,
Legacies_Empire::ID_MISSION_DESTROY
);
if ($myGameLevel > ($hisGameLevel * $protectionmulti) && $destinationUser->getId() &&
in_array($mission, $protectedMissions) && $hisGameLevel < ($protectiontime * 1000)) {
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
}
if (($myGameLevel * $protectionmulti) < $hisGameLevel && $destinationUser->getId() &&
in_array($mission, $protectedMissions) && $myGameLevel < ($protectiontime * 1000)) {
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
}
}
if ($vacationMode && $mission != Legacies_Empire::ID_MISSION_RECYCLE) {
message("<font color=\"lime\"><b>".$lang['fl_vacation_pla']."</b></font>", $lang['fl_vacation_ttl'], "fleet." . PHPEXT, 2);
}
$currentFleets = $user->getFleets()->count();
if (($user->getElement(Legacies_Empire::ID_RESEARCH_COMPUTER_TECHNOLOGY) + 1) <= $currentFleets) {
message("Pas de slot disponible", "Erreur", "fleet." . PHPEXT, 1);
}
$metal = isset($_POST['resource1']) ? intval($_POST['resource1']) : 0;
$cristal = isset($_POST['resource2']) ? intval($_POST['resource2']) : 0;
$deuterium = isset($_POST['resource3']) ? intval($_POST['resource3']) : 0;
if ($metal + $cristal + $deuterium < 1 && $mission == Legacies_Empire::ID_MISSION_TRANSPORT) {
message("<font color=\"lime\"><b>".$lang['fl_noenoughtgoods']."</b></font>", $lang['type_mission'][3], "fleet." . PHPEXT, 1);
}
if ($mission != Legacies_Empire::ID_MISSION_EXPEDITION) {
$userMissions = array(
Legacies_Empire::ID_MISSION_ATTACK,
Legacies_Empire::ID_MISSION_GROUP_ATTACK,
Legacies_Empire::ID_MISSION_TRANSPORT,
Legacies_Empire::ID_MISSION_STATION,
Legacies_Empire::ID_MISSION_STATION_ALLY,
Legacies_Empire::ID_MISSION_SPY
);
if (!$destination->getUserId() && in_array($mission, $userMissions)) {
message ("<font color=\"red\"><b>". $lang['fl_bad_planet01'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if ($destination->getId() && $mission == Legacies_Empire::ID_MISSION_SETTLE_COLONY) {
message ("<font color=\"red\"><b>". $lang['fl_bad_planet02'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if ($destination->getId() != $planet->getId() && $mission == Legacies_Empire::ID_MISSION_STATION) {
message ("<font color=\"red\"><b>". $lang['fl_dont_stay_here'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if ($destination->getElement(Legacies_Empire::ID_BUILDING_ALLIANCE_DEPOT) < 1 && $destinationUser->getId() != $user->getId() && $mission == Legacies_Empire::ID_MISSION_STATION_ALLY) {
message ("<font color=\"red\"><b>". $lang['fl_no_allydeposit'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if ($destinationUser->getId() == $user->getId() && ($mission == Legacies_Empire::ID_MISSION_ATTACK)) {
message ("<font color=\"red\"><b>". $lang['fl_no_self_attack'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if ($destinationUser->getId() == $user->getId() && ($mission == Legacies_Empire::ID_MISSION_SPY)) {
message ("<font color=\"red\"><b>". $lang['fl_no_self_spy'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if ($destinationUser->getId() != $user->getId() && $mission == Legacies_Empire::ID_MISSION_STATION) {
message ("<font color=\"red\"><b>". $lang['fl_only_stay_at_home'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
}
$possibleSpeeds = array(10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
$AllFleetSpeed = GetFleetMaxSpeed($fleetArray, 0, $user);
$SpeedFactor = GetGameSpeedFactor();
$MaxFleetSpeed = min($AllFleetSpeed);
if (!in_array($speed, $possibleSpeeds)) {
message ("<font color=\"red\"><b>". $lang['fl_cheat_speed'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
$error = 0;
$errorlist = "";
if ($galaxy > MAX_GALAXY_IN_WORLD || $galaxy < 1) {
$error++;
$errorlist .= $lang['fl_limit_galaxy'];
}
if ($system > MAX_SYSTEM_IN_GALAXY || $system < 1) {
$error++;
$errorlist .= $lang['fl_limit_system'];
}
if ($position > (MAX_PLANET_IN_SYSTEM + 1) || $position < 1) {
$error++;
$errorlist .= $lang['fl_limit_planet'];
}
if ($error > 0) {
message ("<font color=\"red\"><ul>" . $errorlist . "</ul></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if (!isset($fleetArray)) {
message ("<font color=\"red\"><b>". $lang['fl_no_fleetarray'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
$distance = GetTargetDistance($planet->getGalaxy(), $galaxy, $planet->getSystem(), $system, $planet->getPosition(), $position);
$duration = GetMissionDuration($speed, $MaxFleetSpeed, $distance, $SpeedFactor);
$consumption = GetFleetConsumption($fleetArray, $SpeedFactor, $duration, $distance, $MaxFleetSpeed, $user);
/***************/
$fleet['start_time'] = $duration + time();
if ($mission == Legacies_Empire::ID_MISSION_EXPEDITION) {
$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;
}
$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 = $planet['metal'];
$StockCrystal = $planet['cristal'];
$StockDeuterium = $planet['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." . PHPEXT, 2);
}
if ( $StorageNeeded > $FleetStorage) {
message ("<font color=\"red\"><b>". $lang['fl_nostoragespa'] . pretty_number($StorageNeeded - $FleetStorage) ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if ($destination['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." . PHPEXT, 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` = '". intval($TransMetal) ."', ";
$QryInsertFleet .= "`fleet_resource_cristal` = '". intval($TransCrystal) ."', ";
$QryInsertFleet .= "`fleet_resource_deuterium` = '". intval($TransDeuterium) ."', ";
$QryInsertFleet .= "`fleet_target_owner` = '". $destination['id_owner'] ."', ";
$QryInsertFleet .= "`start_time` = '". time() ."';";
doquery( $QryInsertFleet, 'fleets');
$planet["metal"] = $planet["metal"] - $TransMetal;
$planet["cristal"] = $planet["cristal"] - $TransCrystal;
$planet["deuterium"] = $planet["deuterium"] - $TransDeuterium;
$planet["deuterium"] = $planet["deuterium"] - $consumption;
$QryUpdatePlanet = "UPDATE {{table}} SET ";
$QryUpdatePlanet .= $FleetSubQRY;
$QryUpdatePlanet .= "`metal` = '". $planet["metal"] ."', ";
$QryUpdatePlanet .= "`cristal` = '". $planet["cristal"] ."', ";
$QryUpdatePlanet .= "`deuterium` = '". $planet["deuterium"] ."' ";
$QryUpdatePlanet .= "WHERE ";
$QryUpdatePlanet .= "`id` = '". $planet['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<64>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>". $missionTypes[$_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("M D d H:i:s", $fleet['start_time']) ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_time_back'] ."</th>";
$page .= "<th>". date("M D d H:i:s", $fleet['end_time']) ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<td class=\"c\" colspan=\"2\">". $lang['fl_title'] ."</td>";
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` = '". $planet['id'] ."';", 'planets', true);
display($page, $lang['fl_title']);

View file

@ -1,247 +0,0 @@
<?php
// Si la constante n'est pas defini on bloque l'execution du fichier
if(!defined('PHPSIMUL_PAGES') || @PHPSIMUL_PAGES != 'PHPSIMULLL')
{
die('Erreur 404 - Le fichier n\'a pas <20>t<EFBFBD> trouv<75>');
}
/* PHPsimul : Cr<EFBFBD>ez votre jeu de simulation en PHP
Copyright (<EFBFBD>) - 2007 - CAPARROS S<EFBFBD>bastien (Camaris)
Codeur officiel: Camaris & Max485
http://forum.epic-arena.fr
*/
class bb
{
##############################################################################################################
// Fonction d<>vlopp<70> par Max485 pour affichez le bbcode
function bbcode($texte)
{
//on supprime les slashs qui se seraient ajout<75>s automatiquement
$texte = stripslashes($texte) ;
//on d<>sactive le HTML
$texte = htmlspecialchars($texte) ;
//on g<>n<EFBFBD>re des retours chariots automatiques !!!
$texte = nl2br($texte) ;
//on cr<63>e le bbcode qui sera appliqu<71> <20> notre texte !
$bbcode=array(
//mise en gras
"!\[b\](.+)\[/b\]!isU",
//soulignement
"!\[u\](.+)\[/u\]!isU",
//mise en italique
"!\[i\](.+)\[/i\]!isU",
//mise en couleur
"!\[color=(.+)\](.+)\[/color\]!isU",
//liste <20> puces 1
"!\[ul\](.+)\[/ul\]!U",
//liste <20> puces 2
"!\[li\](.+)\[/li\]!U",
// Lien nomm<6D>
"!\[url=(.+?)\](.+?)\[\/url\]!i",
//afficher les images
"!\[img\](.+)\[/img\]!i",
// Lien
"!\[url\](.+?)\[\/url\]!i",
// Email nomm<6D>
"!\[email=(.+?)\](.+?)\[\/email\]!i",
// Email
"!\[email\](.+?)\[\/email\]!i",
// Size H1
"!\[size=1\](.+)\[/size\]!i",
// Size H2
"!\[size=2\](.+)\[/size\]!i",
// Size H3
"!\[size=3\](.+)\[/size\]!i",
// Size H4
"!\[size=4\](.+)\[/size\]!i",
// Size H5
"!\[size=5\](.+)\[/size\]!i",
// Size Tres petit
"!\[size=tres petit\](.+)\[/size\]!i",
// Size Petit
"!\[size=petit\](.+)\[/size\]!i",
// Size Normal
"!\[size=normal\](.+)\[/size\]!i",
// Size Moyen
"!\[size=moyen\](.+)\[/size\]!i",
// Size Grand
"!\[size=grand\](.+)\[/size\]!i",
// Size 18
"!\[size=18\](.+)\[/size\]!i",
// Quote
"!\[quote\](.+)\[/quote\]!i",
//Quote nomm<6D>
"!\[quote=(.+)\](.+)\[/quote\]!i",
// Code
"!\[code\](.+)\[/code\]!i",
);
$html = array(
//mise en gras
"<b>$1</b>",
//soulignement
"<u>$1</u>",
//mise en italique
"<i>$1</i>",
//mise en couleur
"<span style=\"color:$1\">$2</span>",
//liste <20> puce 1
"<ul>$1</ul>",
//liste <20> puce 2
"<li>$1</li>",
// Lien nomm<6D>
"<a href=\"$1\">$2</a>",
//afficher les images
"<img src=\"$1\">",
// Lien
"<a href=\"$1\">$1</a>",
// Email nomm<6D>
"<a href=\"mailto:$1\">$2</a>",
// Email
"<a href=\"mailto:$1\">$1</a>",
//Size H1
"<h1>$1</h1>",
//Size H2
"<h2>$1</h2>",
//Size H3
"<h3>$1</h3>",
//Size H4
"<h4>$1</h4>",
//Size H5
"<h5>$1</h5>",
//Size Tres Petit
"<h1>$1</h1>",
//Size Petit
"<h3>$1</h3>",
//Size Normal
"<h4>$1</h4>",
//Size Moyen
"<h6>$1</h6>",
//Size Grand
"<h7>$1</h7>",
// Size 18
"<h6>$1</h6>",
// Quote
"<br><u><b>Citation :</b></u><table cellpadding=\"2\" cellspacing=\"1\" border=\"0\" width=\"100%\" align=\"left\" bgcolor=\"red\"><tr><td bgcolor=\"#FFFFFF\"><font color=\"#000000\"><b>$1</b><br></font></td></tr></table><br><br>",
// Quote nomm<6D>
"<br><u><b>$1 :</b></u><table cellpadding=\"2\" cellspacing=\"1\" border=\"0\" width=\"100%\" align=\"left\" bgcolor=\"red\"><tr><td bgcolor=\"#FFFFFF\"><font color=\"#000000\"><b>$2</b><br></font></td></tr></table><br><br>",
// Code
"<br><u><b>Code :</b></u><table cellpadding=\"2\" cellspacing=\"1\" border=\"0\" width=\"100%\" align=\"left\" bgcolor=\"red\"><tr><td bgcolor=\"#FFFFFF\"><font color=\"#000000\"><b>$1</b><br></font></td></tr></table><br><br>",
);
$texte = preg_replace($bbcode,$html,$texte);
return $texte ;
}
##############################################################################################################
function div_page($nb_s,$d,$id,$cat,$nb_ep)
{
if($nb_s > $nb_ep)
{
$nb_p = ceil($nb_s / $nb_ep);
$p_suiv = $d+1;
$p_prec = $d-1;
if($d > 1)
{
echo '<a href="?cat='.$cat.'&amp;id='.$id.'&amp;d=1">&lt;&lt;&nbsp;</a>';
echo '<a href="?cat='.$cat.'&amp;id='.$id.'&amp;d='.$p_prec.'">&lt;&nbsp;</a>';
}
echo '<span class="p">&nbsp;Page n<> '.$d.' / '.$nb_p.'</span>';
if($d < $nb_p)
{
echo '<a href="?cat='.$cat.'&amp;id='.$id.'&amp;d='.$p_suiv.'">&nbsp;&gt;</a>';
echo '<a href="?cat='.$cat.'&amp;id='.$id.'&amp;d='.$nb_p.'">&nbsp;&gt;&gt;</a>';
}
echo ' <br /><br />';
}
}
function div_page_l($nb_s,$d,$id,$p,$s)
{
if(strlen($s) > 1)
{
$s_lien = "&amp;s=".$s;
}
else
{
$s_lien = "";
}
if($nb_s > 10)
{
echo' <br />';
$nb_p = ceil($nb_s / 10);
$p_suiv = $p+1;
$p_prec = $p-1;
if($p > 1)
{
echo '<a href="?cat=4&amp;id='.$id.'&amp;d='.$d.'&amp;p=1'.$s_lien.'">&lt;&lt;&nbsp;</a>';
echo '<a href="?cat=4&amp;id='.$id.'&amp;d='.$d.'&amp;p='.$p_prec.$s_lien.'">&lt;&nbsp;</a>';
}
echo '<span class="p">&nbsp;Page n<> '.$p.' / '.$nb_p.'</span>';
if($p < $nb_p)
{
echo '<a href="?cat=4&amp;id='.$id.'&amp;d='.$d.'&amp;p='.$p_suiv.$s_lien.'">&nbsp;&gt;</a>';
echo '<a href="?cat=4&amp;id='.$id.'&amp;d='.$d.'&amp;p='.$nb_p.$s_lien.'">&nbsp;&gt;&gt;</a>';
}
echo ' <br />';
}
}
##############################################################################################################
function smileys($chaine)
{
global $userrow;
$chaine = str_replace(":D", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/sourire.gif' />", $chaine);
$chaine = str_replace(";)", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/clin.gif' />", $chaine);
$chaine = str_replace(":(", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/triste.gif' />", $chaine);
$chaine = str_replace(":surpris:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/yeuxrond.gif' />", $chaine);
$chaine = str_replace(":o", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/etonne.gif' />", $chaine);
$chaine = str_replace(":confus:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/confus.gif' />", $chaine);
$chaine = str_replace(":lol:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/lol.gif' />", $chaine);
$chaine = str_replace(":fire:", "&nbsp;<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/flame.gif' />", $chaine);
$chaine = str_replace(":splif:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/petard.gif' />", $chaine);
$chaine = str_replace(":bigsmile:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/green.gif' />", $chaine);
$chaine = str_replace(":x", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/mod.gif' />", $chaine);
$chaine = str_replace(":roll:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/rolleyes.gif' />", $chaine);
$chaine = str_replace(":bigcry:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/crying.gif' />", $chaine);
$chaine = str_replace(":colere:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/colere.gif' />", $chaine);
$chaine = str_replace(":P", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/razz.gif' />", $chaine);
$chaine = str_replace("8)", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/lunettes.gif' />", $chaine);
$chaine = str_replace(":)", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/sourire.gif' />", $chaine);
$chaine = str_replace("^^oops:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/redface.gif.gif' />", $chaine);
return($chaine);
}
}
?>

View file

@ -1,551 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
$QryTableAks = "CREATE TABLE `{{table}}` ( ";
$QryTableAks .= "`id` bigint(20) unsigned NOT NULL auto_increment, ";
$QryTableAks .= "`name` varchar(50) collate latin1_general_ci default NULL, ";
$QryTableAks .= "`teilnehmer` text collate latin1_general_ci, ";
$QryTableAks .= "`flotten` text collate latin1_general_ci, ";
$QryTableAks .= "`ankunft` int(32) default NULL, ";
$QryTableAks .= "`galaxy` int(2) default NULL, ";
$QryTableAks .= "`system` int(4) default NULL, ";
$QryTableAks .= "`planet` int(2) default NULL, ";
$QryTableAks .= "`eingeladen` int(11) default NULL, ";
$QryTableAks .= "PRIMARY KEY (`id`) ";
$QryTableAks .= ") ENGINE=MyISAM;";
// Table annonce
$QryTableAnnonce = "CREATE TABLE `{{table}}` ( ";
$QryTableAnnonce .= "`id` int(11) NOT NULL auto_increment, ";
$QryTableAnnonce .= "`user` text collate latin1_general_ci NOT NULL, ";
$QryTableAnnonce .= "`galaxie` int(11) NOT NULL, ";
$QryTableAnnonce .= "`systeme` int(11) NOT NULL, ";
$QryTableAnnonce .= "`metala` bigint(11) NOT NULL, ";
$QryTableAnnonce .= "`cristala` bigint(11) NOT NULL, ";
$QryTableAnnonce .= "`deuta` bigint(11) NOT NULL, ";
$QryTableAnnonce .= "`metals` bigint(11) NOT NULL, ";
$QryTableAnnonce .= "`cristals` bigint(11) NOT NULL, ";
$QryTableAnnonce .= "`deuts` bigint(11) NOT NULL, ";
$QryTableAnnonce .= "PRIMARY KEY (`id`) ";
$QryTableAnnonce .= ") ENGINE=MyISAM;";
// Table alliance
$QryTableAlliance = "CREATE TABLE `{{table}}` ( ";
$QryTableAlliance .= "`id` bigint(11) NOT NULL auto_increment, ";
$QryTableAlliance .= "`ally_name` varchar(32) character set latin1 default '', ";
$QryTableAlliance .= "`ally_tag` varchar(8) character set latin1 default '', ";
$QryTableAlliance .= "`ally_owner` int(11) NOT NULL default '0', ";
$QryTableAlliance .= "`ally_register_time` int(11) NOT NULL default '0', ";
$QryTableAlliance .= "`ally_description` text character set latin1, ";
$QryTableAlliance .= "`ally_web` varchar(255) character set latin1 default '', ";
$QryTableAlliance .= "`ally_text` text character set latin1, ";
$QryTableAlliance .= "`ally_image` varchar(255) character set latin1 default '', ";
$QryTableAlliance .= "`ally_request` text character set latin1, ";
$QryTableAlliance .= "`ally_request_waiting` text character set latin1, ";
$QryTableAlliance .= "`ally_request_notallow` tinyint(4) NOT NULL default '0', ";
$QryTableAlliance .= "`ally_owner_range` varchar(32) character set latin1 default '', ";
$QryTableAlliance .= "`ally_ranks` text character set latin1, ";
$QryTableAlliance .= "`ally_members` int(11) NOT NULL default '0', ";
$QryTableAlliance .= "PRIMARY KEY (`id`) ";
$QryTableAlliance .= ") ENGINE=MyISAM;";
// Table banned
$QryTableBanned = "CREATE TABLE `{{table}}` ( ";
$QryTableBanned .= "`id` bigint(11) NOT NULL auto_increment, ";
$QryTableBanned .= "`who` varchar(11) character set latin1 NOT NULL default '', ";
$QryTableBanned .= "`theme` text character set latin1 NOT NULL, ";
$QryTableBanned .= "`who2` varchar(11) character set latin1 NOT NULL default '', ";
$QryTableBanned .= "`time` int(11) NOT NULL default '0', ";
$QryTableBanned .= "`longer` int(11) NOT NULL default '0', ";
$QryTableBanned .= "`author` varchar(11) character set latin1 NOT NULL default '', ";
$QryTableBanned .= "`email` varchar(20) character set latin1 NOT NULL default '', ";
$QryTableBanned .= "KEY `ID` (`id`) ";
$QryTableBanned .= ") ENGINE=MyISAM;";
// Table buddy
$QryTableBuddy = "CREATE TABLE `{{table}}` ( ";
$QryTableBuddy .= "`id` bigint(11) NOT NULL auto_increment, ";
$QryTableBuddy .= "`sender` int(11) NOT NULL default '0', ";
$QryTableBuddy .= "`owner` int(11) NOT NULL default '0', ";
$QryTableBuddy .= "`active` tinyint(3) NOT NULL default '0', ";
$QryTableBuddy .= "`text` text character set latin1, ";
$QryTableBuddy .= "PRIMARY KEY (`id`) ";
$QryTableBuddy .= ") ENGINE=MyISAM;";
// Table chat
$QryTableChat = "CREATE TABLE `{{table}}` ( ";
$QryTableChat .= "`messageid` int(5) unsigned NOT NULL auto_increment, ";
$QryTableChat .= "`user` varchar(255) NOT NULL default '', ";
$QryTableChat .= "`message` text NOT NULL, ";
$QryTableChat .= "`timestamp` int(11) NOT NULL default '0', ";
$QryTableChat .= "PRIMARY KEY (`messageid`) ";
$QryTableChat .= ") ENGINE=MyISAM;";
// Table config
$QryTableConfig = "CREATE TABLE `{{table}}` ( ";
$QryTableConfig .= "`config_name` varchar(64) character set latin1 NOT NULL default '', ";
$QryTableConfig .= "`config_value` text character set latin1 NOT NULL ";
$QryTableConfig .= ") ENGINE=MyISAM;";
// Valeurs de base de la config
$QryInsertConfig = "INSERT INTO `{{table}}` ";
$QryInsertConfig .= "(`config_name` , `config_value`) VALUES ";
$QryInsertConfig .= "('users_amount' , '0'), ";
$QryInsertConfig .= "('game_speed' , '2500'), ";
$QryInsertConfig .= "('fleet_speed' , '2500'), ";
$QryInsertConfig .= "('resource_multiplier' , '1'), ";
$QryInsertConfig .= "('Fleet_Cdr' , '30'), ";
$QryInsertConfig .= "('Defs_Cdr' , '30'), ";
$QryInsertConfig .= "('initial_fields' , '163'), ";
$QryInsertConfig .= "('COOKIE_NAME' , 'Wootook Legacies'), ";
$QryInsertConfig .= "('game_name' , 'Wootook Legacies'), ";
$QryInsertConfig .= "('game_disable' , '1'), ";
$QryInsertConfig .= "('close_reason' , 'Le jeu est clos pour le moment!'), ";
$QryInsertConfig .= "('metal_basic_income' , '20'), ";
$QryInsertConfig .= "('crystal_basic_income' , '10'), ";
$QryInsertConfig .= "('deuterium_basic_income', '0'), ";
$QryInsertConfig .= "('energy_basic_income' , '0'), ";
$QryInsertConfig .= "('BuildLabWhileRun' , '0'), ";
$QryInsertConfig .= "('LastSettedGalaxyPos' , '1'), ";
$QryInsertConfig .= "('LastSettedSystemPos' , '8'), ";
$QryInsertConfig .= "('LastSettedPlanetPos' , '3'), ";
$QryInsertConfig .= "('urlaubs_modus_erz' , '1'), ";
$QryInsertConfig .= "('noobprotection' , '1'), ";
$QryInsertConfig .= "('noobprotectiontime' , '5000'), ";
$QryInsertConfig .= "('noobprotectionmulti' , '5'), ";
$QryInsertConfig .= "('forum_url' , 'http://board.xnova-ng.org/' ), ";
$QryInsertConfig .= "('OverviewNewsFrame' , '1' ), ";
$QryInsertConfig .= "('OverviewNewsText' , 'Bienvenue sur le nouveau serveur Wootook Legacies' ), ";
$QryInsertConfig .= "('OverviewExternChat' , '0' ), ";
$QryInsertConfig .= "('OverviewExternChatCmd' , '' ), ";
$QryInsertConfig .= "('OverviewBanner' , '0' ), ";
$QryInsertConfig .= "('OverviewClickBanner' , '' ), ";
$QryInsertConfig .= "('ExtCopyFrame' , '0' ), ";
$QryInsertConfig .= "('ExtCopyOwner' , '' ), ";
$QryInsertConfig .= "('ExtCopyFunct' , '' ), ";
$QryInsertConfig .= "('ForumBannerFrame' , '0' ), ";
$QryInsertConfig .= "('stat_settings' , '1000' ), ";
$QryInsertConfig .= "('link_enable' , '0' ), ";
$QryInsertConfig .= "('link_name' , '' ), ";
$QryInsertConfig .= "('link_url' , '' ), ";
$QryInsertConfig .= "('enable_announces' , '1' ), ";
$QryInsertConfig .= "('enable_marchand' , '1'), ";
$QryInsertConfig .= "('enable_notes' , '1'), ";
$QryInsertConfig .= "('bot_name' , 'XNoviana Reali'), ";
$QryInsertConfig .= "('bot_adress' , 'xnova@xnova-ng.org' ), ";
$QryInsertConfig .= "('banner_source_post' , '../images/bann.png' ), ";
$QryInsertConfig .= "('ban_duration' , '30' ), ";
$QryInsertConfig .= "('enable_bot' , '0' ), ";
$QryInsertConfig .= "('enable_bbcode' , '1' ), ";
$QryInsertConfig .= "('debug' , '0') ";
$QryInsertConfig .= ";";
// Table declared (multicomptes)
$QryTabledeclared = "CREATE TABLE `{{table}}` ( ";
$QryTabledeclared .= "`declarator`TEXT NOT NULL, ";
$QryTabledeclared .= "`declared_1`TEXT NOT NULL, ";
$QryTabledeclared .= "`declared_2`TEXT NOT NULL, ";
$QryTabledeclared .= "`declared_3`TEXT NOT NULL, ";
$QryTabledeclared .= "`reason`TEXT NOT NULL, ";
$QryTabledeclared .= "`declarator_name`TEXT NOT NULL ";
$QryTabledeclared .= ") ENGINE=MyISAM;";
// Table errors
$QryTableErrors = "CREATE TABLE `{{table}}` ( ";
$QryTableErrors .= "`error_id` bigint(11) NOT NULL auto_increment, ";
$QryTableErrors .= "`error_sender` varchar(32) character set latin1 NOT NULL default '0', ";
$QryTableErrors .= "`error_time` int(11) NOT NULL default '0', ";
$QryTableErrors .= "`error_type` varchar(32) character set latin1 NOT NULL default 'unknown', ";
$QryTableErrors .= "`error_text` text character set latin1, ";
$QryTableErrors .= "PRIMARY KEY (`error_id`) ";
$QryTableErrors .= ") ENGINE=MyISAM;";
// Table fleets
$QryTableFleets = "CREATE TABLE `{{table}}` ( ";
$QryTableFleets .= "`fleet_id` bigint(11) NOT NULL auto_increment, ";
$QryTableFleets .= "`fleet_owner` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_mission` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_amount` bigint(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_array` text character set latin1, ";
$QryTableFleets .= "`fleet_start_time` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_start_galaxy` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_start_system` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_start_planet` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_start_type` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_end_time` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_end_stay` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_end_galaxy` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_end_system` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_end_planet` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_end_type` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_taget_owner` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_resource_metal` bigint(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_resource_crystal` bigint(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_resource_deuterium` bigint(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_target_owner` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`fleet_group` int (11) NOT NULL DEFAULT '0', ";
$QryTableFleets .= "`fleet_mess` int(11) NOT NULL default '0', ";
$QryTableFleets .= "`start_time` int(11) default NULL, ";
$QryTableFleets .= "PRIMARY KEY (`fleet_id`) ";
$QryTableFleets .= ") ENGINE=MyISAM;";
// Table galaxy
$QryTableGalaxy = "CREATE TABLE `{{table}}` ( ";
$QryTableGalaxy .= "`galaxy` int(2) NOT NULL default '0', ";
$QryTableGalaxy .= "`system` int(3) NOT NULL default '0', ";
$QryTableGalaxy .= "`planet` int(2) NOT NULL default '0', ";
$QryTableGalaxy .= "`id_planet` int(11) NOT NULL default '0', ";
$QryTableGalaxy .= "`metal` bigint(11) NOT NULL default '0', ";
$QryTableGalaxy .= "`crystal` bigint(11) NOT NULL default '0', ";
$QryTableGalaxy .= "`id_luna` int(11) NOT NULL default '0', ";
$QryTableGalaxy .= "`luna` int(2) NOT NULL default '0', ";
$QryTableGalaxy .= "KEY `galaxy` (`galaxy`), ";
$QryTableGalaxy .= "KEY `system` (`system`), ";
$QryTableGalaxy .= "KEY `planet` (`planet`) ";
$QryTableGalaxy .= ") ENGINE=MyISAM;";
// Table iraks
$QryTableIraks = "CREATE TABLE `{{table}}` ( ";
$QryTableIraks .= "`id` bigint(20) unsigned NOT NULL auto_increment, ";
$QryTableIraks .= "`zeit` int(32) default NULL, ";
$QryTableIraks .= "`galaxy` int(2) default NULL, ";
$QryTableIraks .= "`system` int(4) default NULL, ";
$QryTableIraks .= "`planet` int(2) default NULL, ";
$QryTableIraks .= "`galaxy_angreifer` int(2) default NULL, ";
$QryTableIraks .= "`system_angreifer` int(4) default NULL, ";
$QryTableIraks .= "`planet_angreifer` int(2) default NULL, ";
$QryTableIraks .= "`owner` int(32) default NULL, ";
$QryTableIraks .= "`zielid` int(32) default NULL, ";
$QryTableIraks .= "`anzahl` int(32) default NULL, ";
$QryTableIraks .= "`primaer` int(32) default NULL, ";
$QryTableIraks .= "PRIMARY KEY (`id`) ";
$QryTableIraks .= ") ENGINE=MyISAM;";
// Table lunas
$QryTableLunas = "CREATE TABLE `{{table}}` ( ";
$QryTableLunas .= "`id` bigint(11) NOT NULL auto_increment, ";
$QryTableLunas .= "`id_luna` int(11) NOT NULL default '0', ";
$QryTableLunas .= "`name` varchar(11) character set latin1 NOT NULL default 'Lune', ";
$QryTableLunas .= "`image` varchar(11) character set latin1 NOT NULL default 'mond', ";
$QryTableLunas .= "`destruyed` int(11) NOT NULL default '0', ";
$QryTableLunas .= "`id_owner` int(11) default NULL, ";
$QryTableLunas .= "`galaxy` int(11) default NULL, ";
$QryTableLunas .= "`system` int(11) default NULL, ";
$QryTableLunas .= "`lunapos` int(11) default NULL, ";
$QryTableLunas .= "`temp_min` int(11) NOT NULL default '0', ";
$QryTableLunas .= "`temp_max` int(11) NOT NULL default '0', ";
$QryTableLunas .= "`diameter` int(11) NOT NULL default '0', ";
$QryTableLunas .= "PRIMARY KEY (`id`) ";
$QryTableLunas .= ") ENGINE=MyISAM;";
// Table messages
$QryTableMessages = "CREATE TABLE `{{table}}` ( ";
$QryTableMessages .= "`message_id` bigint(11) NOT NULL auto_increment, ";
$QryTableMessages .= "`message_owner` int(11) NOT NULL default '0', ";
$QryTableMessages .= "`message_sender` int(11) NOT NULL default '0', ";
$QryTableMessages .= "`message_time` int(11) NOT NULL default '0', ";
$QryTableMessages .= "`message_type` int(11) NOT NULL default '0', ";
$QryTableMessages .= "`message_from` varchar(48) character set latin1 default NULL, ";
$QryTableMessages .= "`message_subject` varchar(48) character set latin1 default NULL, ";
$QryTableMessages .= "`message_text` text character set latin1, ";
$QryTableMessages .= "PRIMARY KEY (`message_id`) ";
$QryTableMessages .= ") ENGINE=MyISAM;";
// Table notes
$QryTableNotes = "CREATE TABLE `{{table}}` ( ";
$QryTableNotes .= "`id` bigint(11) NOT NULL auto_increment, ";
$QryTableNotes .= "`owner` int(11) default NULL, ";
$QryTableNotes .= "`time` int(11) default NULL, ";
$QryTableNotes .= "`priority` tinyint(1) default NULL, ";
$QryTableNotes .= "`title` varchar(32) character set latin1 default NULL, ";
$QryTableNotes .= "`text` text character set latin1, ";
$QryTableNotes .= "PRIMARY KEY (`id`) ";
$QryTableNotes .= ") ENGINE=MyISAM;";
// Table planets
$QryTablePlanets = "CREATE TABLE `{{table}}` ( ";
$QryTablePlanets .= "`id` bigint(11) NOT NULL auto_increment, ";
$QryTablePlanets .= "`name` varchar(255) character set latin1 default NULL, ";
$QryTablePlanets .= "`id_owner` int(11) default NULL, ";
$QryTablePlanets .= "`id_level` int(11) default NULL, ";
$QryTablePlanets .= "`galaxy` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`system` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`planet` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`last_update` int(11) default NULL, ";
$QryTablePlanets .= "`planet_type` int(11) NOT NULL default '1', ";
$QryTablePlanets .= "`destruyed` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`b_building` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`b_building_id` text character set latin1 NOT NULL, ";
$QryTablePlanets .= "`b_tech` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`b_tech_id` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`b_hangar` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`b_hangar_id` text character set latin1 NOT NULL, ";
$QryTablePlanets .= "`b_hangar_plus` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`image` varchar(32) character set latin1 NOT NULL default 'normaltempplanet01', ";
$QryTablePlanets .= "`diameter` int(11) NOT NULL default '12800', ";
$QryTablePlanets .= "`points` bigint(20) default '0', ";
$QryTablePlanets .= "`ranks` bigint(20) default '0', ";
$QryTablePlanets .= "`field_current` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`field_max` int(11) NOT NULL default '163', ";
$QryTablePlanets .= "`temp_min` int(3) NOT NULL default '-17', ";
$QryTablePlanets .= "`temp_max` int(3) NOT NULL default '23', ";
$QryTablePlanets .= "`metal` double(132,8) NOT NULL default '0.00000000', ";
$QryTablePlanets .= "`metal_perhour` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`metal_max` bigint(20) default '100000', ";
$QryTablePlanets .= "`crystal` double(132,8) NOT NULL default '0.00000000', ";
$QryTablePlanets .= "`crystal_perhour` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`crystal_max` bigint(20) default '100000', ";
$QryTablePlanets .= "`deuterium` double(132,8) NOT NULL default '0.00000000', ";
$QryTablePlanets .= "`deuterium_perhour` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`deuterium_max` bigint(20) default '100000', ";
$QryTablePlanets .= "`energy_used` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`energy_max` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`metal_mine` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`crystal_mine` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`deuterium_sintetizer` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`solar_plant` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`fusion_plant` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`robot_factory` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`nano_factory` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`hangar` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`metal_store` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`crystal_store` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`deuterium_store` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`laboratory` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`terraformer` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`ally_deposit` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`silo` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`small_ship_cargo` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`big_ship_cargo` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`light_hunter` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`heavy_hunter` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`crusher` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`battle_ship` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`colonizer` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`recycler` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`spy_sonde` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`bomber_ship` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`solar_satelit` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`destructor` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`dearth_star` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`battleship` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`supernova` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`misil_launcher` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`small_laser` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`big_laser` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`gauss_canyon` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`ionic_canyon` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`buster_canyon` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`small_protection_shield` enum('0', '1') NOT NULL default '0', ";
$QryTablePlanets .= "`big_protection_shield` enum('0', '1') NOT NULL default '0', ";
$QryTablePlanets .= "`interceptor_misil` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`interplanetary_misil` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "`metal_mine_porcent` int(11) NOT NULL default '10', ";
$QryTablePlanets .= "`crystal_mine_porcent` int(11) NOT NULL default '10', ";
$QryTablePlanets .= "`deuterium_sintetizer_porcent` int(11) NOT NULL default '10', ";
$QryTablePlanets .= "`solar_plant_porcent` int(11) NOT NULL default '10', ";
$QryTablePlanets .= "`fusion_plant_porcent` int(11) NOT NULL default '10', ";
$QryTablePlanets .= "`solar_satelit_porcent` int(11) NOT NULL default '10', ";
$QryTablePlanets .= "`mondbasis` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`phalanx` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`sprungtor` bigint(11) NOT NULL default '0', ";
$QryTablePlanets .= "`last_jump_time` int(11) NOT NULL default '0', ";
$QryTablePlanets .= "PRIMARY KEY (`id`) ";
$QryTablePlanets .= ") ENGINE=MyISAM;";
// Table rw
$QryTableRw = "CREATE TABLE `{{table}}` ( ";
$QryTableRw .= "`id_owner1` int(11) NOT NULL default '0', ";
$QryTableRw .= "`id_owner2` int(11) NOT NULL default '0', ";
$QryTableRw .= "`rid` varchar(72) character set latin1 NOT NULL, ";
$QryTableRw .= "`raport` text character set latin1 NOT NULL, ";
$QryTableRw .= "`a_zestrzelona` tinyint(3) unsigned NOT NULL default '0', ";
$QryTableRw .= "`time` int(10) unsigned NOT NULL default '0', ";
$QryTableRw .= "UNIQUE KEY `rid` (`rid`), ";
$QryTableRw .= "KEY `id_owner1` (`id_owner1`,`rid`), ";
$QryTableRw .= "KEY `id_owner2` (`id_owner2`,`rid`), ";
$QryTableRw .= "KEY `time` (`time`), ";
$QryTableRw .= "FULLTEXT KEY `raport` (`raport`) ";
$QryTableRw .= ") ENGINE=MyISAM;";
// Table statpoints
$QryTableStatPoints = "CREATE TABLE `{{table}}` ( ";
$QryTableStatPoints .= "`id_owner` int(11) NOT NULL, ";
$QryTableStatPoints .= "`id_ally` int(11) NOT NULL, ";
$QryTableStatPoints .= "`stat_type` int(2) NOT NULL, ";
$QryTableStatPoints .= "`stat_code` int(11) NOT NULL, ";
$QryTableStatPoints .= "`tech_rank` int(11) NOT NULL, ";
$QryTableStatPoints .= "`tech_old_rank` int(11) NOT NULL, ";
$QryTableStatPoints .= "`tech_points` bigint(20) NOT NULL, ";
$QryTableStatPoints .= "`tech_count` int(11) NOT NULL, ";
$QryTableStatPoints .= "`build_rank` int(11) NOT NULL, ";
$QryTableStatPoints .= "`build_old_rank` int(11) NOT NULL, ";
$QryTableStatPoints .= "`build_points` bigint(20) NOT NULL, ";
$QryTableStatPoints .= "`build_count` int(11) NOT NULL, ";
$QryTableStatPoints .= "`defs_rank` int(11) NOT NULL, ";
$QryTableStatPoints .= "`defs_old_rank` int(11) NOT NULL, ";
$QryTableStatPoints .= "`defs_points` bigint(20) NOT NULL, ";
$QryTableStatPoints .= "`defs_count` int(11) NOT NULL, ";
$QryTableStatPoints .= "`fleet_rank` int(11) NOT NULL, ";
$QryTableStatPoints .= "`fleet_old_rank` int(11) NOT NULL, ";
$QryTableStatPoints .= "`fleet_points` bigint(20) NOT NULL, ";
$QryTableStatPoints .= "`fleet_count` int(11) NOT NULL, ";
$QryTableStatPoints .= "`total_rank` int(11) NOT NULL, ";
$QryTableStatPoints .= "`total_old_rank` int(11) NOT NULL, ";
$QryTableStatPoints .= "`total_points` bigint(20) NOT NULL, ";
$QryTableStatPoints .= "`total_count` int(11) NOT NULL, ";
$QryTableStatPoints .= "`stat_date` int(11) NOT NULL, ";
$QryTableStatPoints .= "KEY `TECH` (`tech_points`), ";
$QryTableStatPoints .= "KEY `BUILDS` (`build_points`), ";
$QryTableStatPoints .= "KEY `DEFS` (`defs_points`), ";
$QryTableStatPoints .= "KEY `FLEET` (`fleet_points`), ";
$QryTableStatPoints .= "KEY `TOTAL` (`total_points`) ";
$QryTableStatPoints .= ") ENGINE=MyISAM;";
// Table users
$QryTableUsers = "CREATE TABLE `{{table}}` ( ";
$QryTableUsers .= "`id` bigint(11) unsigned NOT NULL auto_increment PRIMARY KEY, ";
$QryTableUsers .= "`username` varchar(64) character set latin1 NOT NULL default '', ";
$QryTableUsers .= "`password` varchar(64) character set latin1 NOT NULL default '', ";
$QryTableUsers .= "`email` varchar(64) character set latin1 NOT NULL default '', ";
$QryTableUsers .= "`email_2` varchar(64) character set latin1 NOT NULL default '', ";
$QryTableUsers .= "`lang` varchar(8) character set latin1 NOT NULL default 'fr', ";
$QryTableUsers .= "`authlevel` tinyint(4) NOT NULL default '0', ";
$QryTableUsers .= "`sex` char(1) character set latin1 default NULL, ";
$QryTableUsers .= "`avatar` varchar(255) character set latin1 NOT NULL default '', ";
$QryTableUsers .= "`sign` text character set latin1, ";
$QryTableUsers .= "`id_planet` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`galaxy` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`system` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`planet` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`current_planet` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`user_lastip` varchar(16) character set latin1 NOT NULL default '', ";
$QryTableUsers .= "`ip_at_reg` varchar(16) character set latin1 NOT NULL default '', ";
$QryTableUsers .= "`user_agent` text character set latin1 NOT NULL, ";
$QryTableUsers .= "`current_page` text character set latin1 NOT NULL, ";
$QryTableUsers .= "`register_time` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`onlinetime` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`dpath` varchar(255) character set latin1 NOT NULL default '', ";
$QryTableUsers .= "`design` tinyint(4) NOT NULL default '1', ";
$QryTableUsers .= "`noipcheck` tinyint(4) NOT NULL default '1', ";
$QryTableUsers .= "`planet_sort` tinyint(1) NOT NULL default '0', ";
$QryTableUsers .= "`planet_sort_order` tinyint(1) NOT NULL default '0', ";
$QryTableUsers .= "`spio_anz` tinyint(4) NOT NULL default '1', ";
$QryTableUsers .= "`settings_tooltiptime` tinyint(4) NOT NULL default '5', ";
$QryTableUsers .= "`settings_fleetactions` tinyint(4) NOT NULL default '0', ";
$QryTableUsers .= "`settings_allylogo` tinyint(4) NOT NULL default '0', ";
$QryTableUsers .= "`settings_esp` tinyint(4) NOT NULL default '1', ";
$QryTableUsers .= "`settings_wri` tinyint(4) NOT NULL default '1', ";
$QryTableUsers .= "`settings_bud` tinyint(4) NOT NULL default '1', ";
$QryTableUsers .= "`settings_mis` tinyint(4) NOT NULL default '1', ";
$QryTableUsers .= "`settings_rep` tinyint(4) NOT NULL default '0', ";
$QryTableUsers .= "`urlaubs_modus` tinyint(4) NOT NULL default '0', ";
$QryTableUsers .= "`urlaubs_until` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`db_deaktjava` tinyint(4) NOT NULL default '0', ";
$QryTableUsers .= "`new_message` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`fleet_shortcut` text character set latin1, ";
$QryTableUsers .= "`b_tech_planet` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`spy_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`computer_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`military_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`defence_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`shield_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`energy_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`hyperspace_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`combustion_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`impulse_motor_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`hyperspace_motor_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`laser_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`ionic_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`buster_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`intergalactic_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`expedition_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`graviton_tech` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`ally_id` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`ally_name` varchar(32) character set latin1 default '', ";
$QryTableUsers .= "`ally_request` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`ally_request_text` text character set latin1, ";
$QryTableUsers .= "`ally_register_time` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`ally_rank_id` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`current_luna` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`kolorminus` varchar(11) character set latin1 NOT NULL default 'red', ";
$QryTableUsers .= "`kolorplus` varchar(11) character set latin1 NOT NULL default '#00FF00', ";
$QryTableUsers .= "`kolorpoziom` varchar(11) character set latin1 NOT NULL default 'yellow', ";
$QryTableUsers .= "`rpg_geologue` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_amiral` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_ingenieur` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_technocrate` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_espion` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_constructeur` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_scientifique` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_commandant` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_points` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_stockeur` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_defenseur` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_destructeur` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_general` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_bunker` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_raideur` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`rpg_empereur` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`lvl_minier` int(11) NOT NULL default '1', ";
$QryTableUsers .= "`lvl_raid` int(11) NOT NULL default '1', ";
$QryTableUsers .= "`xpraid` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`xpminier` int(11) NOT NULL default '0', ";
$QryTableUsers .= "`raids` bigint(20) NOT NULL default '0', ";
$QryTableUsers .= "`p_infligees` bigint(20) NOT NULL default '0', ";
$QryTableUsers .= "`mnl_alliance` INT( 11 ) NOT NULL , ";
$QryTableUsers .= "`mnl_joueur` INT( 11 ) NOT NULL , ";
$QryTableUsers .= "`mnl_attaque` INT( 11 ) NOT NULL , ";
$QryTableUsers .= "`mnl_spy` INT( 11 ) NOT NULL , ";
$QryTableUsers .= "`mnl_exploit` INT( 11 ) NOT NULL , ";
$QryTableUsers .= "`mnl_transport` INT( 11 ) NOT NULL , ";
$QryTableUsers .= "`mnl_expedition` INT( 11 ) NOT NULL , ";
$QryTableUsers .= "`mnl_general` INT( 11 ) NOT NULL , ";
$QryTableUsers .= "`mnl_buildlist` INT (11) NOT NULL , ";
$QryTableUsers .= "`bana` int(11) default NULL , ";
$QryTableUsers .= "`multi_validated` int(11) default NULL , ";
$QryTableUsers .= "`banaday` int(11) default NULL , ";
$QryTableUsers .= "`raids1` int(11) default NULL , ";
$QryTableUsers .= "`raidswin` int(11) default NULL , ";
$QryTableUsers .= "`raidsloose` int(11) default NULL ";
$QryTableUsers .= ") ENGINE=MyISAM;";
// Multi
$QryTableMulti = "CREATE TABLE `{{table}}` ( ";
$QryTableMulti .= "`id` int(11) NOT NULL auto_increment, ";
$QryTableMulti .= "`player` bigint(11) unsigned NOT NULL, ";
$QryTableMulti .= "`sharer` bigint(11) unsigned NOT NULL, ";
$QryTableMulti .= "`reason` text character set latin1 NOT NULL, ";
$QryTableMulti .= "PRIMARY KEY (`id`) ";
$QryTableMulti .= ") ENGINE=MyISAM;";
?>

View file

@ -1,156 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
* Debug class
*
* @todo Clean up source code
*/
class Nova_Core_Debug
{
const CRITICAL = 0x80;
const ERROR = 0x40;
const WARNING = 0x20;
const INFO = 0x10;
const MESSAGE = 0x08;
const AUDIT_FAILED = 0x04;
const AUDIT_SUCCESS = 0x02;
const DEBUG = 0x01;
const DEFAULT_LOGFILE = 'var/log/system.log';
protected $_logLevelNames = array(
self::CRITICAL => 'CRITICAL',
self::ERROR => 'ERROR',
self::WARNING => 'WARNING',
self::INFO => 'INFO',
self::MESSAGE => 'MESSAGE',
self::AUDIT_FAILED => 'AUDIT_FAILED',
self::AUDIT_SUCCESS => 'AUDIT_SUCCESS',
self::DEBUG => 'DEBUG'
);
/**
* Clean logging method
*
* @param string $message
* @param string $resource
* @param int $level
* @return unknown_type
*/
public function log($message, $resource = self::DEFAULT_LOGFILE, $level = self::DEBUG)
{
if(!($fp = fopen($resource, 'a'))) {
trigger_error('Unable to open logs.', E_USER_ERROR);
trigger_error($message, E_USER_ERROR);
return false;
}
fprintf($fp, '[%s] | %s - %s', $this->_logLevelNames[$level], date('r'), $message);
fclose($fp);
return true;
}
}
/**
* @deprecated
* @todo Clean up source code
*/
class Debug
extends Nova_Core_Debug
{
protected $_logMessages = array();
/**
* @deprecated
* @param string $message
* @return void
*/
function add($message)
{
$this->log($message);
$this->_logMessages[] = $message;
}
/**
* @deprecated
* @return void
*/
function echo_log()
{
$messages = implode(PHP_EOL, $this->_logMessages);
echo <<<EOF
<dl class="k">
<dt>
<a href="admin/settings.php">Debug Log</a>:
</dt>
<dd>
<pre><code>{$messages}</code></pre>
</dd>
</dl>
EOF;
die();
}
/**
* @deprecated
* @todo Clean up source code
* @param $message
* @param $title
* @return unknown_type
*/
public function error($message, $title)
{
$gameConfig = Legacies_Core_Model_Config::getSingleton();
if ($gameConfig['debug'] == 1) {
echo "<h2>$title</h2><br><font color=red>$message</font><br><hr>";
echo "<table>".$this->log."</table>";
}
$user = Legacies_Empire_Model_User::getSingleton();
$db = Legacies_Database::getSingleton();
$config = include ROOT_PATH . 'config.' . PHPEXT;
if(!$link) die('La base de donnee n est pas disponible pour le moment, desole pour la gene occasionnee...');
$query = "INSERT INTO {$db->getTable('errors')} SET
`error_sender` = {$user->getId()} ,
`error_time` = {$db->quote(time())},
`error_type` = {$db->quote($title)},
`error_text` = {$db->quote($message)}";
$db->query($query);
$id = $db->lastInsertId($db->getTable('errors'));
if (!function_exists('message')) {
echo "Erreur, merci de contacter l'admin. Erreur n<>: <b>".$id."</b>";
} else {
message("Erreur, merci de contacter l'admin. Erreur n<>: <b>".$id."</b>", "Erreur");
}
}
}

View file

@ -1,39 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $String
*/
function CheckInputStrings($string)
{
return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
}

View file

@ -1,129 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $Galaxy
* @param unknown_type $System
* @param unknown_type $Planet
* @param unknown_type $Owner
* @param unknown_type $MoonID
* @param unknown_type $MoonName
* @param unknown_type $Chance
*/
function CreateOneMoonRecord ( $Galaxy, $System, $Planet, $Owner, $MoonID, $MoonName, $Chance ) {
global $lang;
$PlanetName = "";
$QryGetMoonPlanetData = "SELECT * FROM {{table}} ";
$QryGetMoonPlanetData .= "WHERE ";
$QryGetMoonPlanetData .= "`galaxy` = '". $Galaxy ."' AND ";
$QryGetMoonPlanetData .= "`system` = '". $System ."' AND ";
$QryGetMoonPlanetData .= "`planet` = '". $Planet ."';";
$MoonPlanet = doquery ( $QryGetMoonPlanetData, 'planets', true);
$QryGetMoonGalaxyData = "SELECT * FROM {{table}} ";
$QryGetMoonGalaxyData .= "WHERE ";
$QryGetMoonGalaxyData .= "`galaxy` = '". $Galaxy ."' AND ";
$QryGetMoonGalaxyData .= "`system` = '". $System ."' AND ";
$QryGetMoonGalaxyData .= "`planet` = '". $Planet ."';";
$MoonGalaxy = doquery ( $QryGetMoonGalaxyData, 'galaxy', true);
if ($MoonGalaxy['id_luna'] == 0) {
if ($MoonPlanet['id'] != 0) {
$SizeMin = 2000 + ( $Chance * 100 );
$SizeMax = 6000 + ( $Chance * 200 );
$PlanetName = $MoonPlanet['name'];
$maxtemp = $MoonPlanet['temp_max'] - rand(10, 45);
$mintemp = $MoonPlanet['temp_min'] - rand(10, 45);
$size = rand ($SizeMin, $SizeMax);
$QryInsertMoonInLunas = "INSERT INTO {{table}} SET ";
$QryInsertMoonInLunas .= "`name` = '". ( ($MoonName == '') ? $lang['sys_moon'] : $MoonName ) ."', ";
$QryInsertMoonInLunas .= "`galaxy` = '". $Galaxy ."', ";
$QryInsertMoonInLunas .= "`system` = '". $System ."', ";
$QryInsertMoonInLunas .= "`lunapos` = '". $Planet ."', ";
$QryInsertMoonInLunas .= "`id_owner` = '". $Owner ."', ";
$QryInsertMoonInLunas .= "`temp_max` = '". $maxtemp ."', ";
$QryInsertMoonInLunas .= "`temp_min` = '". $mintemp ."', ";
$QryInsertMoonInLunas .= "`diameter` = '". $size ."', ";
$QryInsertMoonInLunas .= "`id_luna` = '". $MoonID ."';";
doquery( $QryInsertMoonInLunas , 'lunas' );
$QryGetMoonIdFromLunas = "SELECT * FROM {{table}} ";
$QryGetMoonIdFromLunas .= "WHERE ";
$QryGetMoonIdFromLunas .= "`galaxy` = '". $Galaxy ."' AND ";
$QryGetMoonIdFromLunas .= "`system` = '". $System ."' AND ";
$QryGetMoonIdFromLunas .= "`lunapos` = '". $Planet ."';";
$lunarow = doquery( $QryGetMoonIdFromLunas , 'lunas', true);
$QryUpdateMoonInGalaxy = "UPDATE {{table}} SET ";
$QryUpdateMoonInGalaxy .= "`id_luna` = '". $lunarow['id'] ."', ";
$QryUpdateMoonInGalaxy .= "`luna` = '0' ";
$QryUpdateMoonInGalaxy .= "WHERE ";
$QryUpdateMoonInGalaxy .= "`galaxy` = '". $Galaxy ."' AND ";
$QryUpdateMoonInGalaxy .= "`system` = '". $System ."' AND ";
$QryUpdateMoonInGalaxy .= "`planet` = '". $Planet ."';";
doquery( $QryUpdateMoonInGalaxy , 'galaxy');
$QryInsertMoonInPlanet = "INSERT INTO {{table}} SET ";
$QryInsertMoonInPlanet .= "`name` = '" .$lang['sys_moon'] ."', ";
$QryInsertMoonInPlanet .= "`id_owner` = '". $Owner ."', ";
$QryInsertMoonInPlanet .= "`galaxy` = '". $Galaxy ."', ";
$QryInsertMoonInPlanet .= "`system` = '". $System ."', ";
$QryInsertMoonInPlanet .= "`planet` = '". $Planet ."', ";
$QryInsertMoonInPlanet .= "`last_update` = '". time() ."', ";
$QryInsertMoonInPlanet .= "`planet_type` = '3', ";
$QryInsertMoonInPlanet .= "`image` = 'mond', ";
$QryInsertMoonInPlanet .= "`diameter` = '". $size ."', ";
$QryInsertMoonInPlanet .= "`field_max` = '1', ";
$QryInsertMoonInPlanet .= "`temp_min` = '". $maxtemp ."', ";
$QryInsertMoonInPlanet .= "`temp_max` = '". $mintemp ."', ";
$QryInsertMoonInPlanet .= "`metal` = '0', ";
$QryInsertMoonInPlanet .= "`metal_perhour` = '0', ";
$QryInsertMoonInPlanet .= "`metal_max` = '".BASE_STORAGE_SIZE."', ";
$QryInsertMoonInPlanet .= "`crystal` = '0', ";
$QryInsertMoonInPlanet .= "`crystal_perhour` = '0', ";
$QryInsertMoonInPlanet .= "`crystal_max` = '".BASE_STORAGE_SIZE."', ";
$QryInsertMoonInPlanet .= "`deuterium` = '0', ";
$QryInsertMoonInPlanet .= "`deuterium_perhour` = '0', ";
$QryInsertMoonInPlanet .= "`deuterium_max` = '".BASE_STORAGE_SIZE."';";
doquery( $QryInsertMoonInPlanet , 'planets');
}
}
return $PlanetName;
}
?>

View file

@ -1,227 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $Position
* @param unknown_type $HomeWorld
*/
function PlanetSizeRandomiser ($Position, $HomeWorld = false) {
global $gameConfig;
if (!$HomeWorld) {
$ClassicBase = 163;
$SettingSize = $gameConfig['initial_fields'];
$PlanetRatio = floor ( ($ClassicBase / $SettingSize) * 10000 ) / 100;
$RandomMin = array ( 40, 50, 55, 100, 95, 80, 115, 120, 125, 75, 80, 85, 60, 40, 50);
$RandomMax = array ( 90, 95, 95, 240, 240, 230, 180, 180, 190, 125, 120, 130, 160, 300, 150);
$CalculMin = floor ( $RandomMin[$Position - 1] + ( $RandomMin[$Position - 1] * $PlanetRatio ) / 100 );
$CalculMax = floor ( $RandomMax[$Position - 1] + ( $RandomMax[$Position - 1] * $PlanetRatio ) / 100 );
$RandomSize = mt_rand($CalculMin, $CalculMax);
$MaxAddon = mt_rand(0, 110);
$MinAddon = mt_rand(0, 100);
$Addon = ($MaxAddon - $MinAddon);
$PlanetFields = ($RandomSize + $abweichung);
} else {
$PlanetFields = $gameConfig['initial_fields'];
}
$PlanetSize = ($PlanetFields ^ (14 / 1.5)) * 75;
$return['diameter'] = $PlanetSize;
$return['field_max'] = $PlanetFields;
return $return;
}
/**
*
* @deprecated
* @param unknown_type $Galaxy
* @param unknown_type $System
* @param unknown_type $Position
* @param unknown_type $PlanetOwnerID
* @param unknown_type $PlanetName
* @param unknown_type $HomeWorld
*/
function CreateOnePlanetRecord($Galaxy, $System, $Position, $PlanetOwnerID, $PlanetName = '', $HomeWorld = false) {
global $lang;
// Avant tout, on verifie s'il existe deja une planete a cet endroit
$QrySelectPlanet = "SELECT `id` ";
$QrySelectPlanet .= "FROM {{table}} ";
$QrySelectPlanet .= "WHERE ";
$QrySelectPlanet .= "`galaxy` = '". $Galaxy ."' AND ";
$QrySelectPlanet .= "`system` = '". $System ."' AND ";
$QrySelectPlanet .= "`planet` = '". $Position ."';";
$PlanetExist = doquery( $QrySelectPlanet, 'planets', true);
// Si $PlanetExist est autre chose que false ... c'est qu'il y a quelque chose l<> bas ...
// C'est donc aussi que je ne peux pas m'y poser !!
if (!$PlanetExist) {
$planet = PlanetSizeRandomiser ($Position, $HomeWorld);
$planet['diameter'] = ($planet['field_max'] ^ (14 / 1.5)) * 75 ;
$planet['metal'] = BUILD_METAL;
$planet['crystal'] = BUILD_CRISTAL;
$planet['deuterium'] = BUILD_DEUTERIUM;
$planet['metal_perhour'] = $gameConfig['metal_basic_income'];
$planet['crystal_perhour'] = $gameConfig['crystal_basic_income'];
$planet['deuterium_perhour'] = $gameConfig['deuterium_basic_income'];
$planet['metal_max'] = BASE_STORAGE_SIZE;
$planet['crystal_max'] = BASE_STORAGE_SIZE;
$planet['deuterium_max'] = BASE_STORAGE_SIZE;
// Posistion 1 - 3: 80% entre 40 et 70 Cases ( 55+ / -15 )
// Posistion 4 - 6: 80% entre 120 et 310 Cases ( 215+ / -95 )
// Posistion 7 - 9: 80% entre 105 et 195 Cases ( 150+ / -45 )
// Posistion 10 - 12: 80% entre 75 et 125 Cases ( 100+ / -25 )
// Posistion 13 - 15: 80% entre 60 et 190 Cases ( 125+ / -65 )
$planet['galaxy'] = $Galaxy;
$planet['system'] = $System;
$planet['planet'] = $Position;
if ($Position == 1 || $Position == 2 || $Position == 3) {
$PlanetType = array('trocken');
$PlanetClass = array('planet');
$PlanetDesign = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10');
$planet['temp_min'] = rand(0, 100);
$planet['temp_max'] = $planet['temp_min'] + 40;
} elseif ($Position == 4 || $Position == 5 || $Position == 6) {
$PlanetType = array('dschjungel');
$PlanetClass = array('planet');
$PlanetDesign = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10');
$planet['temp_min'] = rand(-25, 75);
$planet['temp_max'] = $planet['temp_min'] + 40;
} elseif ($Position == 7 || $Position == 8 || $Position == 9) {
$PlanetType = array('normaltemp');
$PlanetClass = array('planet');
$PlanetDesign = array('01', '02', '03', '04', '05', '06', '07');
$planet['temp_min'] = rand(-50, 50);
$planet['temp_max'] = $planet['temp_min'] + 40;
} elseif ($Position == 10 || $Position == 11 || $Position == 12) {
$PlanetType = array('wasser');
$PlanetClass = array('planet');
$PlanetDesign = array('01', '02', '03', '04', '05', '06', '07', '08', '09');
$planet['temp_min'] = rand(-75, 25);
$planet['temp_max'] = $planet['temp_min'] + 40;
} elseif ($Position == 13 || $Position == 14 || $Position == 15) {
$PlanetType = array('eis');
$PlanetClass = array('planet');
$PlanetDesign = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10');
$planet['temp_min'] = rand(-100, 10);
$planet['temp_max'] = $planet['temp_min'] + 40;
} else {
$PlanetType = array('dschjungel', 'gas', 'normaltemp', 'trocken', 'wasser', 'wuesten', 'eis');
$PlanetClass = array('planet');
$PlanetDesign = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '00',);
$planet['temp_min'] = rand(-120, 10);
$planet['temp_max'] = $planet['temp_min'] + 40;
}
$planet['image'] = $PlanetType[ rand( 0, count( $PlanetType ) -1 ) ];
$planet['image'] .= $PlanetClass[ rand( 0, count( $PlanetClass ) - 1 ) ];
$planet['image'] .= $PlanetDesign[ rand( 0, count( $PlanetDesign ) - 1 ) ];
$planet['planet_type'] = 1;
$planet['id_owner'] = $PlanetOwnerID;
$planet['last_update'] = time();
$planet['name'] = ($PlanetName == '') ? $lang['sys_colo_defaultname'] : $PlanetName;
$QryInsertPlanet = "INSERT INTO {{table}} SET ";
$QryInsertPlanet .= "`name` = '". $planet['name'] ."', ";
$QryInsertPlanet .= "`id_owner` = '". $planet['id_owner'] ."', ";
$QryInsertPlanet .= "`galaxy` = '". $planet['galaxy'] ."', ";
$QryInsertPlanet .= "`system` = '". $planet['system'] ."', ";
$QryInsertPlanet .= "`planet` = '". $planet['planet'] ."', ";
$QryInsertPlanet .= "`last_update` = '". $planet['last_update'] ."', ";
$QryInsertPlanet .= "`planet_type` = '". $planet['planet_type'] ."', ";
$QryInsertPlanet .= "`image` = '". $planet['image'] ."', ";
$QryInsertPlanet .= "`diameter` = '". $planet['diameter'] ."', ";
$QryInsertPlanet .= "`field_max` = '". $planet['field_max'] ."', ";
$QryInsertPlanet .= "`temp_min` = '". $planet['temp_min'] ."', ";
$QryInsertPlanet .= "`temp_max` = '". $planet['temp_max'] ."', ";
$QryInsertPlanet .= "`metal` = '". $planet['metal'] ."', ";
$QryInsertPlanet .= "`metal_perhour` = '". $planet['metal_perhour'] ."', ";
$QryInsertPlanet .= "`metal_max` = '". $planet['metal_max'] ."', ";
$QryInsertPlanet .= "`crystal` = '". $planet['crystal'] ."', ";
$QryInsertPlanet .= "`crystal_perhour` = '". $planet['crystal_perhour'] ."', ";
$QryInsertPlanet .= "`crystal_max` = '". $planet['crystal_max'] ."', ";
$QryInsertPlanet .= "`deuterium` = '". $planet['deuterium'] ."', ";
$QryInsertPlanet .= "`deuterium_perhour` = '". $planet['deuterium_perhour'] ."', ";
$QryInsertPlanet .= "`deuterium_max` = '". $planet['deuterium_max'] ."';";
doquery( $QryInsertPlanet, 'planets');
// On recupere l'id de planete nouvellement cr<63><72>
$QrySelectPlanet = "SELECT `id` ";
$QrySelectPlanet .= "FROM {{table}} ";
$QrySelectPlanet .= "WHERE ";
$QrySelectPlanet .= "`galaxy` = '". $planet['galaxy'] ."' AND ";
$QrySelectPlanet .= "`system` = '". $planet['system'] ."' AND ";
$QrySelectPlanet .= "`planet` = '". $planet['planet'] ."' AND ";
$QrySelectPlanet .= "`id_owner` = '". $planet['id_owner'] ."';";
$GetPlanetID = doquery( $QrySelectPlanet , 'planets', true);
// Testons s'il y a deja eu une planete ici
$QrySelectGalaxy = "SELECT * ";
$QrySelectGalaxy .= "FROM {{table}} ";
$QrySelectGalaxy .= "WHERE ";
$QrySelectGalaxy .= "`galaxy` = '". $planet['galaxy'] ."' AND ";
$QrySelectGalaxy .= "`system` = '". $planet['system'] ."' AND ";
$QrySelectGalaxy .= "`planet` = '". $planet['planet'] ."';";
$GetGalaxyID = doquery( $QrySelectGalaxy, 'galaxy', true);
if ($GetGalaxyID) {
// Ah ... Ce secteur de ce vaste monde a deja ete occup<75>
$QryUpdateGalaxy = "UPDATE {{table}} SET ";
$QryUpdateGalaxy .= "`id_planet` = '". $GetPlanetID['id'] ."' ";
$QryUpdateGalaxy .= "WHERE ";
$QryUpdateGalaxy .= "`galaxy` = '". $planet['galaxy'] ."' AND ";
$QryUpdateGalaxy .= "`system` = '". $planet['system'] ."' AND ";
$QryUpdateGalaxy .= "`planet` = '". $planet['planet'] ."';";
doquery( $QryUpdateGalaxy, 'galaxy');
} else {
// C'est tout vide ... y a que dalle ... j'm'y pose !!
$QryInsertGalaxy = "INSERT INTO {{table}} SET ";
$QryInsertGalaxy .= "`galaxy` = '". $planet['galaxy'] ."', ";
$QryInsertGalaxy .= "`system` = '". $planet['system'] ."', ";
$QryInsertGalaxy .= "`planet` = '". $planet['planet'] ."', ";
$QryInsertGalaxy .= "`id_planet` = '". $GetPlanetID['id'] ."';";
doquery( $QryInsertGalaxy, 'galaxy');
}
$RetValue = true;
} else {
$RetValue = false;
}
return $RetValue;
}
?>

View file

@ -1,74 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $UserID
*/
function DeleteSelectedUser ( $UserID ) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$TheUser = doquery ( "SELECT * FROM {{table}} WHERE `id` = '" . $UserID . "';", 'users', true );
if ( $TheUser['ally_id'] != 0 ) {
$TheAlly = doquery ( "SELECT * FROM {{table}} WHERE `id` = '" . $TheUser['ally_id'] . "';", 'alliance', true );
$TheAlly['ally_members'] -= 1;
if ( $TheAlly['ally_members'] > 0 ) {
doquery ( "UPDATE {{table}} SET `ally_members` = '" . $TheAlly['ally_members'] . "' WHERE `id` = '" . $TheAlly['id'] . "';", 'alliance' );
} else {
doquery ( "DELETE FROM {{table}} WHERE `id` = '" . $TheAlly['id'] . "';", 'alliance' );
doquery ( "DELETE FROM {{table}} WHERE `stat_type` = '2' AND `id_owner` = '" . $TheAlly['id'] . "';", 'statpoints' );
}
}
doquery ( "DELETE FROM {{table}} WHERE `stat_type` = '1' AND `id_owner` = '" . $UserID . "';", 'statpoints' );
$ThePlanets = doquery ( "SELECT * FROM {{table}} WHERE `id_owner` = '" . $UserID . "';", 'planets' );
while ( $OnePlanet = $ThePlanets->fetch(PDO::FETCH_ASSOC) ) {
if ( $OnePlanet['planet_type'] == 1 ) {
doquery ( "DELETE FROM {{table}} WHERE `galaxy` = '" . $OnePlanet['galaxy'] . "' AND `system` = '" . $OnePlanet['system'] . "' AND `planet` = '" . $OnePlanet['planet'] . "';", 'galaxy' );
} elseif ( $OnePlanet['planet_type'] == 3 ) {
doquery ( "DELETE FROM {{table}} WHERE `galaxy` = '" . $OnePlanet['galaxy'] . "' AND `system` = '" . $OnePlanet['system'] . "' AND `lunapos` = '" . $OnePlanet['planet'] . "';", 'lunas' );
}
doquery ( "DELETE FROM {{table}} WHERE `id` = '" . $OnePlanet['id'] . "';", 'planets' );
}
doquery ( "DELETE FROM {{table}} WHERE `message_sender` = '" . $UserID . "';", 'messages' );
doquery ( "DELETE FROM {{table}} WHERE `message_owner` = '" . $UserID . "';", 'messages' );
doquery ( "DELETE FROM {{table}} WHERE `owner` = '" . $UserID . "';", 'notes' );
doquery ( "DELETE FROM {{table}} WHERE `fleet_owner` = '" . $UserID . "';", 'fleets' );
doquery ( "DELETE FROM {{table}} WHERE `id_owner1` = '" . $UserID . "';", 'rw' );
doquery ( "DELETE FROM {{table}} WHERE `id_owner2` = '" . $UserID . "';", 'rw' );
doquery ( "DELETE FROM {{table}} WHERE `sender` = '" . $UserID . "';", 'buddy' );
doquery ( "DELETE FROM {{table}} WHERE `owner` = '" . $UserID . "';", 'buddy' );
doquery ( "DELETE FROM {{table}} WHERE `user` = '" . $UserID . "';", 'annonce' );
doquery ( "DELETE FROM {{table}} WHERE `id` = '" . $UserID . "';", 'users' );
}
?>

View file

@ -1,71 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $CurrentUser
* @param unknown_type $CurrentPlanet
*/
function ElementBuildListBox ( $CurrentUser, $CurrentPlanet ) {
global $lang, $pricelist;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
// // Array del b_hangar_id
// $ElementQueue = explode(';', $CurrentPlanet['b_hangar_id']);
// $NbrePerType = "";
// $NamePerType = "";
// $TimePerType = "";
//
// foreach($ElementQueue as $ElementLine => $Element) {
// if ($Element != '') {
// $Element = explode(',', $Element);
// $ElementTime = GetBuildingTime( $CurrentUser, $CurrentPlanet, $Element[0] );
// $QueueTime += $ElementTime * $Element[1];
// $TimePerType .= "".$ElementTime.",";
// $NamePerType .= "'". html_entity_decode($lang['tech'][$Element[0]]) ."',";
// $NbrePerType .= "".$Element[1].",";
// }
// }
//
// $parse = $lang;
// $parse['a'] = $NbrePerType;
// $parse['b'] = $NamePerType;
// $parse['c'] = $TimePerType;
// $parse['b_hangar_id_plus'] = $CurrentPlanet['b_hangar'];
//
// $parse['pretty_time_b_hangar'] = pretty_time($QueueTime - $CurrentPlanet['b_hangar']);
//
// $text .= parsetemplate(gettemplate('buildings_script'), $parse);
//
// return $text;
}
?>

View file

@ -1,108 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $planet
*/
function FlyingFleetHandler($planet) {
global $resource;
$sql =<<<SQL_EOF
LOCK TABLE
{{table}}lunas WRITE,
{{table}}rw WRITE,
{{table}}errors WRITE,
{{table}}messages WRITE,
{{table}}fleets WRITE,
{{table}}planets WRITE,
{{table}}galaxy WRITE,
{{table}}users WRITE
SQL_EOF;
//doquery($sql, ''); // FIXME: use transactions
foreach ($planet->getFleetCollection(Wootook::now()) as $CurrentFleet) {
switch ($CurrentFleet["fleet_mission"]) {
case Legacies_Empire::ID_MISSION_ATTACK:
// Attaquer
MissionCaseAttack ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_TRANSPORT:
// Transporter
MissionCaseTransport ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_STATION:
// Stationner
MissionCaseStay ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_STATION_ALLY:
// Stationner chez un Allié
MissionCaseStayAlly ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_SPY:
// Flotte d'espionnage
MissionCaseSpy ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_SETTLE_COLONY:
// Coloniser
MissionCaseColonisation ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_RECYCLE:
// Recyclage
MissionCaseRecycling ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_DESTROY:
// Detruire ??? dans le code ogame c'est 9 !!
MissionCaseDestruction ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_EXPEDITION:
// Expeditions
MissionCaseExpedition ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_GROUP_ATTACK: // TODO: implement mission type
case Legacies_Empire::ID_MISSION_MISSILES: // TODO: implement mission type
default:
$CurrentFleet->delete();
break;
}
}
//doquery("UNLOCK TABLES", ""); // FIXME: use transactions
}

View file

@ -1,141 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $GalaxyRow
* @param unknown_type $GalaxyRowPlanet
* @param unknown_type $GalaxyRowUser
* @param unknown_type $Galaxy
* @param unknown_type $System
* @param unknown_type $Planet
* @param unknown_type $PlanetType
*/
function GalaxyRowUser ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType ) {
global $lang, $user;
// Joueur
$Result = "<th width=150>";
if ($GalaxyRowUser && $GalaxyRowPlanet["destruyed"] == 0) {
$NoobProt = doquery("SELECT * FROM {{table}} WHERE `config_name` = 'noobprotection';", 'config', true);
$NoobTime = doquery("SELECT * FROM {{table}} WHERE `config_name` = 'noobprotectiontime';", 'config', true);
$NoobMulti = doquery("SELECT * FROM {{table}} WHERE `config_name` = 'noobprotectionmulti';", 'config', true);
$UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $user['id'] ."';", 'statpoints', true);
$User2Points = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $GalaxyRowUser['id'] ."';", 'statpoints', true);
$CurrentPoints = $UserPoints['total_points'];
$RowUserPoints = $User2Points['total_points'];
$CurrentLevel = $CurrentPoints * $NoobMulti['config_value'];
$RowUserLevel = $RowUserPoints * $NoobMulti['config_value'];
if ($GalaxyRowUser['bana'] == 1 AND
$GalaxyRowUser['urlaubs_modus'] == 1) {
$Systemtatus2 = $lang['vacation_shortcut']." <a href=\"banned.php\"><span class=\"banned\">".$lang['banned_shortcut']."</span></a>";
$Systemtatus = "<span class=\"vacation\">";
} elseif ($GalaxyRowUser['bana'] == 1) {
$Systemtatus2 = "<a href=\"banned.php\"><span class=\"banned\">".$lang['banned_shortcut']."</span></a>";
$Systemtatus = "";
} elseif ($GalaxyRowUser['urlaubs_modus'] == 1) {
$Systemtatus2 = "<span class=\"vacation\">".$lang['vacation_shortcut']."</span>";
$Systemtatus = "<span class=\"vacation\">";
} elseif ($GalaxyRowUser['onlinetime'] < (time()-60 * 60 * 24 * 7) AND
$GalaxyRowUser['onlinetime'] > (time()-60 * 60 * 24 * 28)) {
$Systemtatus2 = "<span class=\"inactive\">".$lang['inactif_7_shortcut']."</span>";
$Systemtatus = "<span class=\"inactive\">";
} elseif ($GalaxyRowUser['onlinetime'] < (time()-60 * 60 * 24 * 28)) {
$Systemtatus2 = "<span class=\"inactive\">".$lang['inactif_7_shortcut']."</span><span class=\"longinactive\"> ".$lang['inactif_28_shortcut']."</span>";
$Systemtatus = "<span class=\"longinactive\">";
} elseif ($RowUserLevel < $CurrentPoints AND
$NoobProt['config_value'] == 1 AND
$NoobTime['config_value'] * 1000 > $RowUserPoints) {
$Systemtatus2 = "<span class=\"noob\">".$lang['weak_player_shortcut']."</span>";
$Systemtatus = "<span class=\"noob\">";
} elseif ($RowUserPoints > $CurrentLevel AND
$NoobProt['config_value'] == 1 AND
$NoobTime['config_value'] * 1000 > $CurrentPoints) {
$Systemtatus2 = $lang['strong_player_shortcut'];
$Systemtatus = "<span class=\"strong\">";
} else {
$Systemtatus2 = "";
$Systemtatus = "";
}
$Systemtatus4 = $User2Points['total_rank'];
if ($Systemtatus2 != '') {
$Systemtatus6 = "<font color=\"white\">(</font>";
$Systemtatus7 = "<font color=\"white\">)</font>";
}
if ($Systemtatus2 == '') {
$Systemtatus6 = "";
$Systemtatus7 = "";
}
$admin = "";
if ($GalaxyRowUser['authlevel'] == LEVEL_ADMIN) {
$admin = "<font color=\"red\"><blink>A</blink></font>";
} else if ($GalaxyRowUser['authlevel'] == LEVEL_OPERATOR) {
$admin = "<font color=\"lime\"><blink>O</blink></font>";
} else if ($GalaxyRowUser['authlevel'] == LEVEL_MODERATOR) {
$admin = "<font color=\"skyblue\"><blink>M</blink></font>";
}
$Systemtart = $User2Points['total_rank'];
if (strlen($Systemtart) < 3) {
$Systemtart = 1;
} else {
$Systemtart = (floor( $User2Points['total_rank'] / 100 ) * 100) + 1;
}
$Result .= "<a style=\"cursor: pointer;\"";
$Result .= " onmouseover='return overlib(\"";
$Result .= "<table width=190>";
$Result .= "<tr>";
$Result .= "<td class=c colspan=2>".$lang['Player']." ".$GalaxyRowUser['username']." ".$lang['Place']." ".$Systemtatus4."</td>";
$Result .= "</tr><tr>";
if ($GalaxyRowUser['id'] != $user['id']) {
$Result .= "<td><a href=messages.php?mode=write&id=".$GalaxyRowUser['id'].">".$lang['gl_sendmess']."</a></td>";
$Result .= "</tr><tr>";
$Result .= "<td><a href=buddy.php?a=2&u=".$GalaxyRowUser['id'].">".$lang['gl_buddyreq']."</a></td>";
$Result .= "</tr><tr>";
}
$Result .= "<td><a href=stat.php?who=player&start=".$Systemtart.">".$lang['gl_stats']."</a></td>";
$Result .= "</tr>";
$Result .= "</table>\"";
$Result .= ", STICKY, MOUSEOFF, DELAY, 750, CENTER, OFFSETX, -40, OFFSETY, -40 );'";
$Result .= " onmouseout='return nd();'>";
$Result .= $Systemtatus;
$Result .= $GalaxyRowUser["username"]."</span>";
$Result .= $Systemtatus6;
$Result .= $Systemtatus;
$Result .= $Systemtatus2;
$Result .= $Systemtatus7." ".$admin;
$Result .= "</span></a>";
}
$Result .= "</th>";
return $Result;
}
?>

View file

@ -1,80 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $Element
* @param unknown_type $Ressources
*/
function GetMaxConstructibleElements ($Element, $Ressources) {
global $pricelist;
// On test les 4 Type de ressource pour voir si au moins on sait en construire 1
if ($pricelist[$Element]['metal'] != 0) {
$ResType_1_Needed = $pricelist[$Element]['metal'];
$Buildable = floor($Ressources["metal"] / $ResType_1_Needed);
$MaxElements = $Buildable;
}
if ($pricelist[$Element]['crystal'] != 0) {
$ResType_2_Needed = $pricelist[$Element]['crystal'];
$Buildable = floor($Ressources["crystal"] / $ResType_2_Needed);
}
if (!isset($MaxElements)) {
$MaxElements = $Buildable;
} elseif ($MaxElements > $Buildable) {
$MaxElements = $Buildable;
}
if ($pricelist[$Element]['deuterium'] != 0) {
$ResType_3_Needed = $pricelist[$Element]['deuterium'];
$Buildable = floor($Ressources["deuterium"] / $ResType_3_Needed);
}
if (!isset($MaxElements)) {
$MaxElements = $Buildable;
} elseif ($MaxElements > $Buildable) {
$MaxElements = $Buildable;
}
if ($pricelist[$Element]['energy'] != 0) {
$ResType_4_Needed = $pricelist[$Element]['energy'];
$Buildable = floor($Ressources["energy_max"] / $ResType_4_Needed);
}
if ($Buildable < 1) {
$MaxElements = 0;
}
return $MaxElements;
}
// Verion History
// - 1.0 Version initiale (creation)
// - 1.1 Correction bug ressources n<>gatives ...
// - 1.2 Correction bug quand pas de m<>tal
?>

View file

@ -1,75 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $user
* @param unknown_type $planet
* @param unknown_type $Element
* @param unknown_type $userfactor
*/
function GetRestPrice ($user, $planet, $Element, $userfactor = true) {
global $pricelist, $resource, $lang;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if ($userfactor) {
$level = ($planet[$resource[$Element]]) ? $planet[$resource[$Element]] : $user[$resource[$Element]];
}
$array = array(
'metal' => $lang["Metal"],
'crystal' => $lang["Crystal"],
'deuterium' => $lang["Deuterium"],
'energy_max' => $lang["Energy"]
);
$text = "<br><font color=\"#7f7f7f\">". $lang['Rest_ress'] .": ";
foreach ($array as $ResType => $ResTitle) {
if ($pricelist[$Element][$ResType] != 0) {
$text .= $ResTitle . ": ";
if ($userfactor) {
$cost = floor($pricelist[$Element][$ResType] * pow($pricelist[$Element]['factor'], $level));
} else {
$cost = floor($pricelist[$Element][$ResType]);
}
if ($cost > $planet[$ResType]) {
$text .= "<b style=\"color: rgb(127, 95, 96);\">". pretty_number($planet[$ResType] - $cost) ."</b> ";
} else {
$text .= "<b style=\"color: rgb(95, 127, 108);\">". pretty_number($planet[$ResType] - $cost) ."</b> ";
}
}
}
$text .= "</font>";
return $text;
}
?>

View file

@ -1,78 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $CurrentUser
* @param unknown_type $CurrentPlanet
* @param unknown_type $Element
* @param unknown_type $Incremental
* @param unknown_type $ForDestroy
*/
function IsElementBuyable ($CurrentUser, $CurrentPlanet, $Element, $Incremental = true, $ForDestroy = false) {
global $pricelist, $resource;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if (IsVacationMode($CurrentUser)) {
return false;
}
if ($Incremental) {
$level = ($CurrentPlanet[$resource[$Element]]) ? $CurrentPlanet[$resource[$Element]] : $CurrentUser[$resource[$Element]];
}
$array = array(
Legacies_Empire::RESOURCE_METAL,
Legacies_Empire::RESOURCE_CRISTAL,
Legacies_Empire::RESOURCE_DEUTERIUM,
'energy_max'
);
$cost = array();
foreach ($array as $ResType) {
if ($pricelist[$Element][$ResType] != 0) {
if ($Incremental) {
$cost[$ResType] = bcmul($pricelist[$Element][$ResType], bcpow($pricelist[$Element]['factor'], $level), 0);
} else {
$cost[$ResType] = $pricelist[$Element][$ResType];
}
if ($ForDestroy) {
$cost[$ResType] = bcdiv($cost[$ResType], 2, 0);
}
if (bccomp($cost[$ResType], $CurrentPlanet[$ResType]) > 0) {
return false;
}
}
}
return true;
}

View file

@ -1,58 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $CurrentUser
* @param unknown_type $Officier
*/
function IsOfficierAccessible ($CurrentUser, $Officier) {
global $requirements, $resource, $pricelist;
if (isset($requirements[$Officier])) {
$enabled = true;
foreach($requirements[$Officier] as $ReqOfficier => $OfficierLevel) {
if ($CurrentUser[$resource[$ReqOfficier]] &&
$CurrentUser[$resource[$ReqOfficier]] >= $OfficierLevel) {
$enabled = 1;
} else {
return 0;
}
}
}
if ($CurrentUser[$resource[$Officier]] < $pricelist[$Officier]['max'] ) {
return 1;
} else {
return -1;
}
}
?>

View file

@ -1,58 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $user
* @param unknown_type $planet
* @param unknown_type $element
*/
function IsTechnologieAccessible($user, $planet, $element)
{
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
global $requirements, $resource;
if (isset($requirements[$element])) {
$enabled = true;
foreach($requirements[$element] as $ReqElement => $EleLevel) {
if (@$user[$resource[$ReqElement]] && $user[$resource[$ReqElement]] >= $EleLevel) {
// break;
} elseif ($planet[$resource[$ReqElement]] && $planet[$resource[$ReqElement]] >= $EleLevel) {
$enabled = true;
} else {
return false;
}
}
return $enabled;
} else {
return true;
}
}

Some files were not shown because too many files have changed in this diff Show more