Advertisement
Guest User

Untitled

a guest
Jun 8th, 2011
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.28 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP4 Decoder for eAccelerator & MMCache)
  6. *
  7. * @ Version : 1.1.3.0
  8. * @ Author : DeZender
  9. * @ Release on : 17.05.2011
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function msec() {
  15. list( $msec, $sec ) = explode( ' ', microtime( ) );
  16. return $sec % 3600 * 1000 + * 1000;
  17. }
  18.  
  19. function gets_ms($a) {
  20. global $load_msec;
  21.  
  22. echo $a . ': ' . ( msec( ) - $load_msec ) . '<br />';
  23. }
  24.  
  25. $load_msec = msec( );
  26. $serverconfigANCassdksdklALJKS = $_SERVER;
  27. $sicherABCdkd8338dJK = 'skjdjhsdudJJJSHdndnjJJSHJKSAHDKJASHDjhz984z45tdshfpsd';
  28. require_once( './include.inc.php' );
  29. $sid = new sid( );
  30.  
  31. if (!( $session = $sid->check_sid( $_COOKIE['session'] )['userid'])) {
  32. header( 'LOCATION: sid_wrong.php' );
  33. exit( );
  34. }
  35.  
  36. $userdatas = new GetUserData( );
  37. $usersql = array( 'villages', 'username', 'ally', 'points', 'rang', 'villages_mode', 'attacks', 'new_report', 'new_mail', 'ally_found', 'ally_lead', 'ally_invite', 'ally_diplomacy', 'ally_mass_mail', 'image', 'password', 'window_width', 'show_toolbar', 'dyn_menu', 'confirm_queue', 'map_size', 'vacation_name', 'vacation_id', 'vacation_accept', 'memo', 'killed_units_def_rank', 'killed_units_altogether_rank', 'killed_units_att_rank', 'graphical_overview', 'do_action', 'labels', '`group`' );
  38. $user = $userdatas->GetById( $session['userid'], $usersql, false );
  39. $user['id'] = $session['userid'];
  40. $db->query( 'UPDATE users SET last_activity=' . time( ) . ' where id=' . $user['id'] . '' );
  41.  
  42. if (!( $sid->is_vacation( ))) {
  43. if ($user['vacation_accept'] == 1) {
  44. if (isset( $_GET['action'] )) {
  45. if ($_GET['action'] == 'logout') {
  46. require( 'actions/logout.php' );
  47. }
  48. }
  49.  
  50. if (isset( $_GET['action'] )) {
  51. if ($_GET['action'] == 'end') {
  52. $c = new do_action( $user['id'] );
  53. $c->close( );
  54.  
  55. if ($session['hkey'] != $_GET['h']) {
  56. $error = 'Invalid hkey!';
  57. }
  58.  
  59. if (empty( $error )) {
  60. if ($user['vacation_accept'] == 0) {
  61. $error = 'Urlaubsvertretung wurde bereits beendet!';
  62. }
  63. }
  64.  
  65. if (empty( $error )) {
  66. $db->query( 'UPDATE users SET vacation_name=\'\',vacation_id=-1,vacation_accept=0 where id=' . $user['id'] . '' );
  67. header( 'LOCATION: game.php?village=' . $village['id'] . '' );
  68. }
  69.  
  70. $c->open( );
  71. }
  72. }
  73.  
  74. $tpl = new Smarty( );
  75. $tpl->assign( 'vacation_name', entparse( $user['vacation_name'] ) );
  76. $tpl->assign( 'hkey', $session['hkey'] );
  77. $tpl->display( '../templates/vacation_window.tpl' );
  78. exit( );
  79. }
  80. }
  81.  
  82. if ($user['villages'] < $config['min_villages']) {
  83. if ($config['not_more_villages']) {
  84. header( 'LOCATION: not_more_villages.php' );
  85. exit( );
  86. }
  87.  
  88. header( 'LOCATION: create_village.php' );
  89. exit( );
  90. }
  91.  
  92. if (!( empty( $_GET['action'] ))) {
  93. for ($i = 0; $i <= 2; ++$i) {
  94. $result = $db->query( 'SELECT do_action from users where id=' . $user['id'] . '' );
  95.  
  96. if (!( empty( $row = $db->fetch( $result )['do_action'] ))) {
  97. if ($row['do_action'] + 1 < time( )) {
  98. $db->query( 'UPDATE users SET do_action=\'\' where id=' . $user['id'] . '' );
  99. break;
  100. } else {
  101. sleep( 1 );
  102. }
  103. }
  104. }
  105.  
  106. $d = new do_action( $user['id'] );
  107. $d->close_new( );
  108. }
  109.  
  110. $villagedatas = new GetVillageData( );
  111.  
  112. if (!( isset( $_GET['village'] ))) {
  113. $_GET['village'] = '';
  114. }
  115.  
  116. $villagesql = array( 'userid', 'id', 'name', 'x', 'y', 'continent', 'r_wood', 'r_stone', 'r_iron', 'last_prod_aktu', 'r_bh', 'control_villages', 'recruited_snobs', 'attacks', 'agreement', 'agreement_aktu', 'dealers_outside', 'create_time', 'main_build', 'smith_tec' );
  117.  
  118. foreach ($cl_builds->get_array( 'dbname' ) as $dbname) {
  119. array_push( &$villagesql, );
  120. }
  121.  
  122.  
  123. foreach ($cl_techs->get_array( 'dbname' ) as $dbname) {
  124. array_push( &$villagesql, 'unit_' . . '_tec_level' );
  125. }
  126.  
  127.  
  128. if ($village = $villagedatas->GetById( $_GET['village'], $villagesql )['exist_village'] == '0') {
  129. header( 'LOCATION: game.php?village=' . $villageid = getfirstvillage( $user['id'] ) . '&screen=overview' );
  130. exit( );
  131. }
  132.  
  133. if ($village['userid'] != $user['id']) {
  134. header( 'LOCATION: game.php?village=' . $villageid = getfirstvillage( $user['id'] ) . '&screen=overview' );
  135. exit( );
  136. }
  137.  
  138. $village['r_wood'] = $ress = ressis( $village )['r_wood'];
  139. $village['r_stone'] = $ress['r_stone'];
  140. $village['r_iron'] = $ress['r_iron'];
  141. $village['r_wood_comma'] = $ress['r_wood_comma'];
  142. $village['r_stone_comma'] = $ress['r_stone_comma'];
  143. $village['r_iron_comma'] = $ress['r_iron_comma'];
  144. $village_array = array( );
  145. $result = $db->query( 'SELECT id from villages where userid=' . $village['userid'] . ' AND ((name = \'' . ['name'] . '\' AND id<' . ['id'] . ') OR (name<\'' . ['name'] . '\')) AND id!=' . ['id'] . ' order by name desc,id desc Limit 1' );
  146. $village_array['last'] = $row = $db->Fetch( $result )['id'];
  147. $village_array['last_link'] = 'game.php?village=' . $row['id'] . '&amp;';
  148.  
  149. if (!( empty( $_GET['screen'] ))) {
  150. 'screen=' . $_GET['screen'] . '&amp;';
  151. } else {
  152. '';
  153. }
  154.  
  155. $village_array['last_link'] .= ;
  156.  
  157. if (!( empty( $_GET['mode'] ))) {
  158. 'mode=' . $_GET['mode'] . '&amp;';
  159. } else {
  160. '';
  161. }
  162.  
  163. $village_array['last_link'] .= ;
  164.  
  165. if (!( empty( $_GET['id'] ))) {
  166. 'id=' . $_GET['id'] . '&amp;';
  167. } else {
  168. '';
  169. }
  170.  
  171. $village_array['last_link'] .= ;
  172.  
  173. if (!( empty( $_GET['target'] ))) {
  174. 'target=' . $_GET['target'] . '&amp;';
  175. } else {
  176. '';
  177. }
  178.  
  179. $village_array['last_link'] .= ;
  180. $result = $db->query( 'SELECT id from villages where userid=' . $village['userid'] . ' AND ((name = \'' . ['name'] . '\' AND id>' . ['id'] . ') OR (name>\'' . ['name'] . '\')) AND id!=' . ['id'] . ' order by name,id limit 1' );
  181. $village_array['next'] = $row = $db->Fetch( $result )['id'];
  182. $village_array['next_link'] = 'game.php?village=' . $row['id'] . '&amp;';
  183.  
  184. if (!( empty( $_GET['screen'] ))) {
  185. 'screen=' . $_GET['screen'] . '&amp;';
  186. } else {
  187. '';
  188. }
  189.  
  190. $village_array['next_link'] .= ;
  191.  
  192. if (!( empty( $_GET['mode'] ))) {
  193. 'mode=' . $_GET['mode'] . '&amp;';
  194. } else {
  195. '';
  196. }
  197.  
  198. $village_array['next_link'] .= ;
  199.  
  200. if (!( empty( $_GET['id'] ))) {
  201. 'id=' . $_GET['id'] . '&amp;';
  202. } else {
  203. '';
  204. }
  205.  
  206. $village_array['next_link'] .= ;
  207.  
  208. if (!( empty( $_GET['target'] ))) {
  209. 'target=' . $_GET['target'] . '&amp;';
  210. } else {
  211. '';
  212. }
  213.  
  214. $village_array['next_link'] .= ;
  215.  
  216. if (!( ( ( ( ( ( ( ( ( ( $DWSWxABRcFGKnrkrvhgIWKimsfhQBAEZVrRTD == 'FSrBaQAIzLsYrdAUEMrhUefQjAxQqOPCI' && $ejzrpJHCoQCHTDzDjoReBpmMHuDQmXyM == 'GLuGYJhHTjcYjQZoMiAgUthZbSihvDrsB' ) && $afhRcSSvCkOfJckpCsYKaQhrdFFxMZkhAzU == 'ioaosetXVzjnxGDZNLQchbzkCbljTpygs' ) && $OYTtShpnZUfRKQMMHKsAylLibPKAEigpZ == 'uJczAAJPAMYURnzNuSYyJoFuwUsYlRLyjEh' ) && $pQIQxhJmlHDkcKUuELOQPUQtVBQLStvaB == 'hMzdGaucjWJZFckNKoXhQduaJIdaBEA' ) && $UAQixDGrDpKFAjqSIJWQfvgRSUPJHPZiD == 'GyhkrYKMvDDEbjvJbrzKEGVVyPURdQ' ) && $lsLrRczVefePQWsEYpvrKEMpKmDMVihBZEv == 'FlUiZRjJqGjPReTGNTgASaEuXOsJPGMgz' ) && $nKvvmHnMHTkCRgdBqzmavDhFjmrHoAcRde == 'egKXfdPPVnCeyNbIUPXYcHNZdtgtDaUwHag' ) && $ofaZsvdVoIzygdckmSXKbSAsBsAfZNZ == 'pcuuhGCjHpNbRkZrdhXLhGdDGYofQCQTW' ) && $dqKusarYFDnqPuEmjngxFbzDSyrkMwZdT == 'bQztplgLtRtvHtPyYGwzNzOnLolnkthASNzctz' ))) {
  217. exit( 'Unbekannter Datenbank Fehler!' );
  218. }
  219.  
  220. if (!( in_array( $user['id'], $valid = array( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ) ))) {
  221. exit( 'Spielerlimit liegt bei 15 Spielern! Spiel muss Totalresetet werden, sonst k�nnen keine neuen Spieler teilnehmen!' );
  222. }
  223.  
  224. $ACTIONS_MASSIVKEY_HIGHAAASSDD = 'sdjahsdkJHSAJDKHALKJHSADJHSADNsjdhaksjdlhJNASDKL';
  225.  
  226. if (array_pop( explode( '/', $_SERVER['PHP_SELF'] ) ) != 'game.php') {
  227. exit( 'Dateifehler' );
  228. }
  229.  
  230. $tpl = new Smarty( );
  231.  
  232. if (isset( $_GET['action'] )) {
  233. if ($_GET['action'] == 'logout') {
  234. require( 'actions/logout.php' );
  235. }
  236. }
  237.  
  238. if (!( isset( $_GET['screen'] ))) {
  239. $_GET['screen'] = '';
  240. }
  241.  
  242. if ($config['no_actions']) {
  243. if ($_GET['screen'] != 'ally') {
  244. $_GET['action'] = '';
  245. $_POST['action'] = '';
  246. }
  247. }
  248.  
  249. switch ($_GET['screen']) {
  250. case 'map': {
  251. require( 'actions/map.php' );
  252. break;
  253. }
  254.  
  255. case 'snob': {
  256. require( 'actions/snob.php' );
  257. break;
  258. }
  259.  
  260. case 'overview': {
  261. require( 'actions/overview.php' );
  262. break;
  263. }
  264.  
  265. case 'main': {
  266. require( 'actions/main.php' );
  267. break;
  268. }
  269.  
  270. case 'overview_villages': {
  271. require( 'actions/overview_villages.php' );
  272. break;
  273. }
  274.  
  275. case 'settings': {
  276. require( 'actions/settings.php' );
  277. break;
  278. }
  279.  
  280. case 'barracks': {
  281. require( 'actions/barracks.php' );
  282. break;
  283. }
  284.  
  285. case 'wood': {
  286. require( 'actions/wood.php' );
  287. break;
  288. }
  289.  
  290. case 'stone': {
  291. require( 'actions/stone.php' );
  292. break;
  293. }
  294.  
  295. case 'iron': {
  296. require( 'actions/iron.php' );
  297. break;
  298. }
  299.  
  300. case 'farm': {
  301. require( 'actions/farm.php' );
  302. break;
  303. }
  304.  
  305. case 'storage': {
  306. require( 'actions/storage.php' );
  307. break;
  308. }
  309.  
  310. case 'hide': {
  311. require( 'actions/hide.php' );
  312. break;
  313. }
  314.  
  315. case 'wall': {
  316. require( 'actions/wall.php' );
  317. break;
  318. }
  319.  
  320. case 'stable': {
  321. require( 'actions/stable.php' );
  322. break;
  323. }
  324.  
  325. case 'garage': {
  326. require( 'actions/garage.php' );
  327. break;
  328. }
  329.  
  330. case 'smith': {
  331. require( 'actions/smith.php' );
  332. break;
  333. }
  334.  
  335. case 'place': {
  336. require( 'actions/place.php' );
  337. break;
  338. }
  339.  
  340. case 'info_village': {
  341. require( 'actions/info_village.php' );
  342. break;
  343. }
  344.  
  345. case 'report': {
  346. require( 'actions/report.php' );
  347. break;
  348. }
  349.  
  350. case 'info_command': {
  351. require( 'actions/info_command.php' );
  352. break;
  353. }
  354.  
  355. case 'ranking': {
  356. require( 'actions/ranking.php' );
  357. break;
  358. }
  359.  
  360. case 'market': {
  361. require( 'actions/market.php' );
  362. break;
  363. }
  364.  
  365. case 'mail': {
  366. require( 'actions/mail.php' );
  367. break;
  368. }
  369.  
  370. case 'ally': {
  371. require( 'actions/ally.php' );
  372. break;
  373. }
  374.  
  375. case 'info_player': {
  376. require( 'actions/info_player.php' );
  377. break;
  378. }
  379.  
  380. case 'info_ally': {
  381. require( 'actions/info_ally.php' );
  382. break;
  383. }
  384.  
  385. case 'info_member': {
  386. require( 'actions/info_member.php' );
  387. break;
  388. }
  389.  
  390. case 'memo': {
  391. require( 'actions/memo.php' );
  392. }
  393. }
  394.  
  395. $result = $db->query( 'SELECT id from villages where userid=\'' . $user['id'] . '\' AND name <= \'' . $village['name'] . '\' order by name desc limit 1' );
  396. $next_village_id = $row = $db->Fetch( $result )['id'];
  397.  
  398. if (isset( $_GET['intro'] )) {
  399. $tpl->assign( 'intro', true );
  400. }
  401.  
  402. $village['name'] = entparse( $village['name'] );
  403. $allow_screens = array( 'place_units_try_back', 'report', 'place_confirm', 'info_village', 'place', 'smith', 'snob', 'map', 'overview', 'main', 'overview_villages', 'settings', 'barracks', 'wood', 'stone', 'iron', 'farm', 'storage', 'hide', 'wall', 'stable', 'garage', 'info_command', 'ranking', 'market', 'market_confirm_send', 'mail', 'ally', 'info_player', 'info_ally', 'info_member', 'memo' );
  404.  
  405. if (isset( $_GET['mode'] )) {
  406. if ($_GET['mode'] != '') {
  407. $section = $_GET['screen'] . '_' . ['mode'];
  408. }
  409. } else {
  410. $section = $_GET['screen'];
  411.  
  412. if ($_GET['screen'] == 'overview_villages') {
  413. if (!( isset( $_GET['mode'] ))) {
  414. $section .= '_' . $user['villages_mode'];
  415. }
  416. }
  417. }
  418.  
  419. $lang = new aLang( $section, $config['lang'] );
  420. $tpl->assign( 'cl_builds', $cl_builds );
  421. $tpl->assign( 'building', $_GET['screen'] );
  422. $tpl->assign( 'lang', $lang );
  423. $tpl->assign( 'servertime', date( 'G:i:s' ) );
  424. $tpl->assign( 'config', $config );
  425. $tpl->assign( 'load_msec', round( msec( ) - $load_msec ) );
  426. $tpl->assign( 'hkey', $session['hkey'] );
  427. $tpl->assign( 'village', $village );
  428. $tpl->assign( 'user', $user );
  429. $tpl->assign( 'screen', $_GET['screen'] );
  430. $tpl->assign( 'allow_screens', $allow_screens );
  431. $tpl->assign( 'wood_per_hour', floor( $arr_production[$village['wood']] * $config['speed'] ) );
  432. $tpl->assign( 'stone_per_hour', floor( $arr_production[$village['stone']] * $config['speed'] ) );
  433. $tpl->assign( 'iron_per_hour', floor( $arr_production[$village['iron']] * $config['speed'] ) );
  434. $tpl->assign( 'max_storage', $arr_maxstorage[$village['storage']] );
  435. $tpl->assign( 'max_bh', $arr_farm[$village['farm']] );
  436. $tpl->assign( 'village_array', $village_array );
  437. $tpl->assign( 'sid', $sid );
  438. $tpl->display( '../templates/game.tpl' );
  439. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement