Repository: supernova-ws/SuperNova Branch: master Commit: 5b4df5b56ab3 Files: 814 Total size: 6.7 MB Directory structure: gitextract_i4qucyb1/ ├── .gitattributes ├── .gitignore ├── .htaccess ├── README.MD ├── _error-404.php ├── admin/ │ ├── add_moon.php │ ├── adm_flying_fleets.php │ ├── adm_log_main.php │ ├── adm_message_list.php │ ├── adm_metamatter.php │ ├── adm_planet_list.php │ ├── adm_quest.php │ ├── adm_user_analyze.php │ ├── adm_user_stat.php │ ├── admin_analyze_matter.php │ ├── admin_chat.php │ ├── admin_darkmatter.php │ ├── admin_locale.php │ ├── admin_user_activity.php │ ├── ajax_maintenance.php │ ├── banned.php │ ├── includes/ │ │ └── admin_planet_edit.inc.php │ ├── index.html │ ├── maintenance.php │ ├── overview.php │ ├── planet_compensate.php │ ├── planet_edit.php │ ├── settings.php │ ├── statbuilder.php │ ├── sxd/ │ │ ├── .htaccess │ │ ├── backup/ │ │ │ ├── .htaccess │ │ │ └── index.htm │ │ ├── bsd_license.txt │ │ ├── img/ │ │ │ └── index.htm │ │ ├── index.php │ │ ├── info.php │ │ ├── lang/ │ │ │ ├── index.htm │ │ │ ├── list.php │ │ │ ├── lng_en.php │ │ │ ├── lng_ru.php │ │ │ ├── lng_uk.php │ │ │ └── update.php │ │ ├── load.php │ │ ├── readme_en.txt │ │ ├── readme_ru.txt │ │ ├── sxd.css │ │ ├── sxd.js │ │ └── tmpl.php │ ├── tools.php │ └── userlist.php ├── affilates.php ├── ajax_version_check.php ├── alliance.php ├── annonce.php ├── announce.php ├── artifacts.php ├── banned.php ├── banner.php ├── blitz_register.php ├── buddy.php ├── buildings.php ├── captcha.php ├── classes/ │ ├── Account.php │ ├── AjaxController.php │ ├── Alliance/ │ │ ├── Alliance.php │ │ ├── AllianceHelper.php │ │ ├── AllianceMember.php │ │ ├── AllianceMemberList.php │ │ ├── AllianceTitle.php │ │ ├── AllianceTitleList.php │ │ ├── DBStaticAlly.php │ │ └── RecordAlliance.php │ ├── AuthProvider.php │ ├── BBCodeParser.php │ ├── BanHammer.php │ ├── Bonus/ │ │ ├── BonusAtom.php │ │ ├── BonusAtomAbility.php │ │ ├── BonusAtomAdd.php │ │ ├── BonusAtomMultiply.php │ │ ├── BonusAtomPercent.php │ │ ├── BonusCatalog.php │ │ ├── BonusFactory.php │ │ ├── BonusListAtom.php │ │ ├── ValueBonused.php │ │ └── ValueStorage.php │ ├── Chat/ │ │ └── Chat.php │ ├── Common/ │ │ ├── AccessAccessors.php │ │ ├── AccessLogged.php │ │ ├── AccessLoggedAbstract.php │ │ ├── AccessLoggedTranslatedV2.php │ │ ├── AccessLoggedV2.php │ │ ├── AccessMagic.php │ │ ├── AccessorsV2.php │ │ ├── ContainerPlus.php │ │ ├── EmptyCountableIterator.php │ │ ├── Exceptions/ │ │ │ ├── DbalFieldInvalidException.php │ │ │ └── ExceptionSnLocalized.php │ │ ├── Hooker/ │ │ │ ├── Hooker.php │ │ │ └── Pimp.php │ │ ├── Interfaces/ │ │ │ ├── IContainer.php │ │ │ └── ICountableIterator.php │ │ ├── Invoker.php │ │ ├── NullContainer.php │ │ ├── OutcomeManager.php │ │ ├── Pimple/ │ │ │ ├── Container.php │ │ │ └── ServiceProviderInterface.php │ │ ├── Tools/ │ │ │ └── VersionCheckerDeprecated.php │ │ ├── Traits/ │ │ │ ├── TContainer.php │ │ │ ├── TJsonSerializable.php │ │ │ └── TSingleton.php │ │ ├── Vector.php │ │ └── oldArrayAccessNd.php │ ├── Confirmation.php │ ├── Core/ │ │ ├── Autoloader.php │ │ ├── Crypto.php │ │ ├── Entity.php │ │ ├── EntityDb.php │ │ ├── GlobalContainer.php │ │ ├── HttpRequest.php │ │ ├── HttpUrl.php │ │ ├── RepoV2.php │ │ ├── Repository.php │ │ ├── Scheduler/ │ │ │ ├── Lock.php │ │ │ ├── TaskConditional.php │ │ │ ├── TaskPeriodic.php │ │ │ └── Watchdog.php │ │ ├── Singleton.php │ │ ├── SnBootstrap.php │ │ ├── SnPimp.php │ │ ├── StorageV2.php │ │ ├── Updater.php │ │ └── Worker.php │ ├── DBAL/ │ │ ├── ActiveRecord.php │ │ ├── ActiveRecordAbstract.php │ │ ├── ActiveRecordAbstractIndexed.php │ │ ├── DbAbstractResultIterator.php │ │ ├── DbFieldDescription.php │ │ ├── DbIndexDescription.php │ │ ├── DbIndexField.php │ │ ├── DbMysqliResultIterator.php │ │ ├── DbQuery.php │ │ ├── DbSqlPaging.php │ │ ├── OldDbChangeSet.php │ │ ├── PropertyDescription.php │ │ ├── RecordV2.php │ │ ├── RecordV3.php │ │ ├── Schema.php │ │ ├── StorageSqlV2.php │ │ ├── TableSchema.php │ │ └── db_mysql.php │ ├── Design.php │ ├── Fleet/ │ │ ├── Constants.php │ │ ├── DbFleetStatic.php │ │ ├── Fleet.php │ │ ├── FleetDispatchEvent.php │ │ ├── FleetDispatcher.php │ │ ├── FleetRowObject.php │ │ ├── FleetStatic.php │ │ ├── FleetWatchdog.php │ │ ├── MissionData.php │ │ ├── MissionEspionage.php │ │ ├── MissionEspionageReport.php │ │ ├── MissionExploreResult.php │ │ ├── RecordFleet.php │ │ └── TaskDispatchFleets.php │ ├── General/ │ │ ├── Helpers/ │ │ │ ├── PagingRenderer.php │ │ │ └── URLHelper.php │ │ ├── LogCounterShrinker.php │ │ ├── VisitAccumulator.php │ │ └── VisitMerger.php │ ├── General.php │ ├── HelperArray.php │ ├── HelperString.php │ ├── Meta/ │ │ └── Economic/ │ │ ├── BuildDataStatic.php │ │ ├── EconomicHelper.php │ │ └── ResourceCalculations.php │ ├── Modules/ │ │ ├── ModulesManager.php │ │ └── sn_module.php │ ├── Note/ │ │ └── Note.php │ ├── Notification/ │ │ └── RecordNotification.php │ ├── Old/ │ │ └── Avatar.php │ ├── PTLTag.php │ ├── Pages/ │ │ ├── Deprecated/ │ │ │ ├── PageAdminMining.php │ │ │ ├── PageAdminModules.php │ │ │ ├── PageAdminPayment.php │ │ │ ├── PageAdminUserView.php │ │ │ ├── PageDeprecated.php │ │ │ ├── PageFleet5Gathering.php │ │ │ ├── PageImperium.php │ │ │ ├── PageMercenary.php │ │ │ ├── PageMessage.php │ │ │ └── PageOverview.php │ │ ├── Helpers/ │ │ │ └── PageHelperAlly.php │ │ ├── IPage.php │ │ ├── PageAjax.php │ │ ├── PageAjaxIgnore.php │ │ ├── PageQuest.php │ │ └── PageTutorial.php │ ├── Payment/ │ │ ├── PaymentMethods.php │ │ └── PaymentsMethodsActive.php │ ├── Planet/ │ │ ├── DBStaticPlanet.php │ │ ├── Planet.php │ │ └── RecordPlanet.php │ ├── Player/ │ │ ├── PlayerLevelHelper.php │ │ ├── PlayerStatic.php │ │ ├── RecordPlayer.php │ │ ├── playerTimeDiff.php │ │ └── userOptions.php │ ├── PlayerToAccountTranslate.php │ ├── Pm/ │ │ ├── DecodeEspionage.php │ │ ├── PlayerIgnore.php │ │ └── RecordPlayerIgnore.php │ ├── Ptl/ │ │ └── PtlVariableDecorator.php │ ├── Que/ │ │ ├── DBStaticQue.php │ │ └── QueUnitStatic.php │ ├── RequestInfo.php │ ├── ResultMessages.php │ ├── SN.php │ ├── SkinInterface.php │ ├── SkinModel.php │ ├── SkinV2.php │ ├── SnTemplate.php │ ├── StatCalculator.php │ ├── StatUpdateLauncher.php │ ├── Storage.php │ ├── Template/ │ │ └── TemplateMeta.php │ ├── TextEntity.php │ ├── TextModel.php │ ├── TextRecordDescription.php │ ├── TheUser.php │ ├── Timer.php │ ├── Tools.php │ ├── Ube/ │ │ └── Ube4_1/ │ │ ├── Ube4_1Calc.php │ │ └── Ube4_1Prepare.php │ ├── Unit/ │ │ ├── DBStaticUnit.php │ │ ├── Governor.php │ │ ├── RecordUnit.php │ │ └── Unit.php │ ├── Universe/ │ │ └── Universe.php │ ├── Universe.php │ ├── Validators.php │ ├── auth_abstract.php │ ├── auth_local.php │ ├── classCache.php │ ├── classConfig.php │ ├── classLocale.php │ ├── classPersistent.php │ ├── core_auth.php │ ├── debug.php │ ├── sn_module_payment.php │ ├── template.php │ └── template_compile.php ├── common.php ├── composer.json ├── dark_matter.php ├── design/ │ ├── css/ │ │ ├── blitz_login_background.css │ │ ├── global-ie.css │ │ ├── global.css │ │ ├── index.html │ │ ├── jquery-ui.css │ │ ├── login.css │ │ ├── login_background.css │ │ └── menu_icons.css │ ├── images/ │ │ ├── index.html │ │ ├── lang/ │ │ │ └── index.html │ │ └── smileys/ │ │ └── index.html │ └── templates/ │ ├── OpenGame/ │ │ ├── .htaccess │ │ ├── _ajax.tpl.html │ │ ├── _number_color_maximum.tpl.html │ │ ├── _number_color_percent.tpl.html │ │ ├── _number_color_planet_fill_bg.tpl.html │ │ ├── _number_color_production_bg.tpl.html │ │ ├── _number_color_value.tpl.html │ │ ├── _number_percent_class.tpl.html │ │ ├── _page/ │ │ │ ├── _00_header.tpl.html │ │ │ ├── _01_head.tpl.html │ │ │ ├── _40_js.tpl.html │ │ │ ├── _99_footer.tpl.html │ │ │ ├── navbar.tpl.html │ │ │ ├── navbar_additions.tpl.html │ │ │ ├── navbar_buttons.tpl.html │ │ │ ├── navbar_planet_select.tpl.html │ │ │ ├── navbar_resources.tpl.html │ │ │ ├── navbar_resources_flex.tpl.html │ │ │ ├── navbar_resources_horizontal.tpl.html │ │ │ └── navbar_resources_vertical.tpl.html │ │ ├── _paging.tpl.html │ │ ├── _redirect.tpl.html │ │ ├── _result_message.tpl.html │ │ ├── _table.tpl.html │ │ ├── _template.css │ │ ├── _template.ini │ │ ├── admin/ │ │ │ ├── add_moon.tpl.html │ │ │ ├── adm_flying_fleets.tpl.html │ │ │ ├── adm_log_main.tpl.html │ │ │ ├── adm_log_main_detail.tpl.html │ │ │ ├── adm_messagelist.tpl.html │ │ │ ├── adm_metamatter.tpl.html │ │ │ ├── adm_overview.tpl.html │ │ │ ├── adm_planet_list.tpl.html │ │ │ ├── admin_ally_all.tpl.html │ │ │ ├── admin_ally_one.tpl.html │ │ │ ├── admin_analyze_matter.tpl.html │ │ │ ├── admin_ban.tpl.html │ │ │ ├── admin_chat.tpl.html │ │ │ ├── admin_darkmatter.tpl.html │ │ │ ├── admin_locale.tpl.html │ │ │ ├── admin_mining.tpl.html │ │ │ ├── admin_modules.tpl.html │ │ │ ├── admin_payment.tpl.html │ │ │ ├── admin_planet_edit.tpl.html │ │ │ ├── admin_ptl_test.tpl.html │ │ │ ├── admin_tools.tpl.html │ │ │ ├── admin_user.tpl.html │ │ │ ├── admin_user_activity.tpl.html │ │ │ ├── md5enc.tpl.html │ │ │ ├── planet_compensate.tpl.html │ │ │ ├── reset_body.tpl.html │ │ │ ├── settings.tpl.html │ │ │ ├── simple_header.tpl.html │ │ │ ├── tests/ │ │ │ │ └── _number_color_value.tpl.html │ │ │ └── userlist.tpl.html │ │ ├── affilates.tpl.html │ │ ├── agreement.tpl.html │ │ ├── ali_admin.tpl.html │ │ ├── ali_admin_diplomacy.tpl.html │ │ ├── ali_admin_mail.tpl.html │ │ ├── ali_admin_request.tpl.html │ │ ├── ali_admin_rights.tpl.html │ │ ├── ali_external.tpl.html │ │ ├── ali_external_make.tpl.html │ │ ├── ali_info.tpl.html │ │ ├── ali_members.tpl.html │ │ ├── ali_request.tpl.html │ │ ├── ali_request_waiting.tpl.html │ │ ├── ali_search.tpl.html │ │ ├── announce.tpl.html │ │ ├── artifacts.tpl.html │ │ ├── banned_body.tpl.html │ │ ├── blitz_register.tpl.html │ │ ├── buddy.tpl.html │ │ ├── buildings_builds.tpl.html │ │ ├── chat/ │ │ │ ├── chat_body.tpl.html │ │ │ ├── chat_frame.tpl.html │ │ │ ├── chat_header.tpl.html │ │ │ ├── chat_messages.tpl.html │ │ │ └── chat_online.tpl.html │ │ ├── contact.tpl.html │ │ ├── dark_matter.tpl.html │ │ ├── eco_bld_queue_list.tpl.html │ │ ├── eco_queue.tpl.html │ │ ├── fleet0.tpl.html │ │ ├── fleet1.tpl.html │ │ ├── fleet2.tpl.html │ │ ├── fleet3.tpl.html │ │ ├── fleet5.tpl.html │ │ ├── fleet_aks_invite.tpl.html │ │ ├── fleet_javascript.tpl.html │ │ ├── fleet_miniatures.tpl.html │ │ ├── fleet_page_0_buttons.tpl.html │ │ ├── fleet_page_0_buttons_action.tpl.html │ │ ├── flying_fleets.tpl.html │ │ ├── imperator.tpl.html │ │ ├── imperium.tpl.html │ │ ├── imperium_resource_cell.tpl.html │ │ ├── index.html │ │ ├── jumpgate.tpl.html │ │ ├── login_body.tpl.html │ │ ├── login_header.tpl.html │ │ ├── login_menu.tpl.html │ │ ├── login_player_register.tpl.html │ │ ├── lostpassword.tpl.html │ │ ├── market.tpl.html │ │ ├── market_fleet.tpl.html │ │ ├── market_info.tpl.html │ │ ├── market_trader.tpl.html │ │ ├── menu.tpl.html │ │ ├── message_body.tpl.html │ │ ├── metamatter.tpl.html │ │ ├── mrc_mercenary_hire.tpl.html │ │ ├── msg_message_class.tpl.html │ │ ├── msg_message_compose.tpl.html │ │ ├── msg_message_list.tpl.html │ │ ├── msg_message_list_paging.tpl.html │ │ ├── msg_message_spy.tpl.html │ │ ├── navbar_button_queued.tpl.html │ │ ├── navbar_news.tpl.html │ │ ├── navbar_notes.tpl.html │ │ ├── news_list.tpl.html │ │ ├── note_list.tpl.html │ │ ├── notes.tpl.html │ │ ├── novapedia.tpl.html │ │ ├── options.tpl.html │ │ ├── options_block.tpl.html │ │ ├── overview_fleet_event.tpl.html │ │ ├── page_hint.tpl.html │ │ ├── planet_fleet_list.tpl.html │ │ ├── planet_governor.tpl.html │ │ ├── planet_list.tpl.html │ │ ├── planet_list_info.tpl.html │ │ ├── planet_list_overview.tpl.html │ │ ├── planet_manage.tpl.html │ │ ├── planet_overview.tpl.html │ │ ├── planet_sector_bar.tpl.html │ │ ├── planet_sector_buy.tpl.html │ │ ├── que_total.tpl.html │ │ ├── quest.tpl.html │ │ ├── quest_edit_form.tpl.html │ │ ├── rank_list.tpl.html │ │ ├── records.tpl.html │ │ ├── registry_form.tpl.html │ │ ├── resources.tpl.html │ │ ├── search.tpl.html │ │ ├── server_info.tpl.html │ │ ├── simple_table.tpl.html │ │ ├── simulator.tpl.html │ │ ├── stat_statistics.tpl.html │ │ ├── techtree.tpl.html │ │ ├── techtree_computer.tpl.html │ │ ├── techtree_mobile.tpl.html │ │ ├── tutorial.tpl.html │ │ ├── ube_combat_report.tpl.html │ │ ├── universe.tpl.html │ │ ├── universe_navigation.tpl.html │ │ ├── universe_new.tpl.html │ │ ├── universe_old.tpl.html │ │ ├── universe_rename.tpl.html │ │ ├── vacation.tpl.html │ │ └── viewreport.tpl.html │ └── index.html ├── docs/ │ ├── SuperNova - All you didn't want to know but forced to.docx │ ├── balance.txt │ ├── changelog.dev.todo.txt │ ├── changelog.txt │ ├── changelog_dev.txt │ ├── class_tree.txt │ ├── config.php.sample │ ├── credits.txt │ ├── extra/ │ │ ├── readme.txt │ │ └── sql/ │ │ └── account_by_user_name.sql │ ├── html/ │ │ ├── .htaccess │ │ ├── changelog.html │ │ ├── coding-guidelines.html │ │ ├── developer.html │ │ ├── readme.html │ │ └── stylesheet.css │ ├── install-en.md │ ├── install.md │ ├── license.txt │ ├── readme-en.txt │ ├── readme.txt │ ├── similar_characters_detect.md │ ├── supernova-data.sql │ ├── supernova.sql │ ├── todo.txt │ ├── todo.xls │ ├── tricks.txt │ ├── txt2html.php │ └── work-fleets.txt ├── fleet.php ├── flotenajax.php ├── flying_fleets.php ├── galaxy.php ├── includes/ │ ├── .htaccess │ ├── alliance/ │ │ ├── ali_external_create_ally.inc │ │ ├── ali_external_request.inc │ │ ├── ali_info.inc │ │ ├── ali_internal_admin.inc │ │ ├── ali_internal_admin_diplomacy.inc │ │ ├── ali_internal_admin_mail.inc │ │ ├── ali_internal_admin_request.inc │ │ ├── ali_internal_admin_rights.inc │ │ └── ali_internal_members.inc │ ├── constants/ │ │ ├── constants.php │ │ ├── constants_fake.php │ │ ├── constants_params.php │ │ ├── constants_payments.php │ │ ├── constants_rpg.php │ │ ├── constants_ube.php │ │ └── constants_units.php │ ├── db/ │ │ ├── db_helpers.php │ │ ├── db_queries.php │ │ └── db_queries_users.php │ ├── db.php │ ├── debug.tools.php │ ├── functions/ │ │ ├── _deprecated.php │ │ ├── _news.php │ │ ├── ali_alliances.php │ │ ├── cht_message_parse.php │ │ ├── eco_get_build_data.php │ │ ├── eco_planet_update.php │ │ ├── eco_queue.php │ │ ├── flt_mission_missile.php │ │ ├── geoip.php │ │ ├── index.html │ │ ├── int_banner_create.php │ │ ├── int_fleet_events.php │ │ ├── lng_language.php │ │ ├── msg_send_simple_message.php │ │ ├── qst_quest.php │ │ ├── rpg_points.php │ │ ├── sys_maintenance.php │ │ ├── sys_user.php │ │ ├── tpl_helpers.php │ │ └── uni_functions.php │ ├── general/ │ │ ├── general.php │ │ ├── general_compatibility.php │ │ ├── general_formatters.php │ │ ├── general_math.php │ │ ├── general_nickRender.php │ │ ├── general_params.php │ │ ├── general_planetFunctions.php │ │ ├── general_playerFunctions.php │ │ ├── general_pname.php │ │ ├── general_unitFunctions.php │ │ ├── general_urlAndHttp.php │ │ └── general_validators.php │ ├── includes/ │ │ ├── art_artifact.php │ │ ├── coe_simulator_helpers.php │ │ ├── eco_bld_structures.php │ │ ├── flt_functions.php │ │ ├── flt_mission_attack.php │ │ ├── flt_mission_colonize.php │ │ ├── flt_mission_hold.php │ │ ├── flt_mission_recycle.php │ │ ├── flt_mission_relocate.php │ │ ├── flt_mission_transport.php │ │ ├── flt_page0.inc │ │ ├── flt_page1.inc │ │ ├── flt_page2.inc │ │ ├── flt_page3.inc │ │ ├── flt_page4.inc │ │ ├── market_fleeter.inc │ │ ├── market_info.inc │ │ ├── market_trader.inc │ │ ├── sys_avatar.php │ │ ├── ube_attack_calculate.php │ │ ├── ube_report.php │ │ ├── ube_zi_helpers.php │ │ ├── uni_rename.php │ │ └── user_birthday_celebrate.php │ ├── index.html │ ├── init.php │ ├── pages/ │ │ ├── admin/ │ │ │ └── admin_ally.php │ │ ├── battle_report.php │ │ ├── contact.php │ │ ├── imperator.php │ │ ├── options.php │ │ └── techtree.php │ ├── update.php │ ├── vars.php │ ├── vars_combats.php │ ├── vars_menu.php │ ├── vars_powerups.php │ └── vars_structures.php ├── index.php ├── infos.php ├── js/ │ ├── build_unit.js │ ├── chat_advanced.js │ ├── cnt.js │ ├── fleet.js │ ├── fleet_gather.js │ ├── generate.js │ ├── index.html │ ├── lib/ │ │ ├── fm.checkator.jquery.js │ │ ├── ion.sound.js │ │ ├── jquery-ui.js │ │ ├── jquery.bpopup.js │ │ ├── jquery.grayscale.js │ │ ├── jquery.js │ │ └── js.cookie.js │ ├── market.js │ ├── metamatter.js │ ├── planet_manage.js │ ├── sn_ajax_send_fleet.js │ ├── sn_global.js │ ├── sn_notes.js │ ├── sn_sound.js │ ├── sn_survey.js │ ├── sn_timer.js │ ├── sn_universe.js │ └── tutorial.js ├── jumpgate.php ├── language/ │ ├── .htaccess │ ├── de/ │ │ ├── admin.mo.php │ │ ├── affilates.mo.php │ │ ├── alliance.mo.php │ │ ├── announce.mo.php │ │ ├── artifacts.mo.php │ │ ├── buddy.mo.php │ │ ├── buildings.mo.php │ │ ├── chat_advanced.mo.php │ │ ├── fleet.mo.php │ │ ├── infos.mo.php │ │ ├── language.mo.php │ │ ├── login.mo.php │ │ ├── market.mo.php │ │ ├── menu.mo.php │ │ ├── messages.mo.php │ │ ├── mrc_mercenary.mo.php │ │ ├── notes.mo.php │ │ ├── options.mo.php │ │ ├── overview.mo.php │ │ ├── payment.mo.php │ │ ├── quest.mo.php │ │ ├── search.mo.php │ │ ├── stat.mo.php │ │ ├── system.mo.php │ │ ├── tech.mo.php │ │ └── universe.mo.php │ ├── en/ │ │ ├── admin.mo.php │ │ ├── affilates.mo.php │ │ ├── alliance.mo.php │ │ ├── announce.mo.php │ │ ├── artifacts.mo.php │ │ ├── buddy.mo.php │ │ ├── buildings.mo.php │ │ ├── chat_advanced.mo.php │ │ ├── fleet.mo.php │ │ ├── index.html │ │ ├── infos.mo.php │ │ ├── language.mo.php │ │ ├── login.mo.php │ │ ├── market.mo.php │ │ ├── menu.mo.php │ │ ├── messages.mo.php │ │ ├── mrc_mercenary.mo.php │ │ ├── notes.mo.php │ │ ├── options.mo.php │ │ ├── overview.mo.php │ │ ├── payment.mo.php │ │ ├── quest.mo.php │ │ ├── search.mo.php │ │ ├── stat.mo.php │ │ ├── system.mo.php │ │ ├── tech.mo.php │ │ └── universe.mo.php │ ├── es/ │ │ ├── admin.mo.php │ │ ├── affilates.mo.php │ │ ├── alliance.mo.php │ │ ├── announce.mo.php │ │ ├── artifacts.mo.php │ │ ├── buddy.mo.php │ │ ├── buildings.mo.php │ │ ├── chat_advanced.mo.php │ │ ├── fleet.mo.php │ │ ├── infos.mo.php │ │ ├── language.mo.php │ │ ├── login.mo.php │ │ ├── market.mo.php │ │ ├── menu.mo.php │ │ ├── messages.mo.php │ │ ├── mrc_mercenary.mo.php │ │ ├── notes.mo.php │ │ ├── options.mo.php │ │ ├── overview.mo.php │ │ ├── payment.mo.php │ │ ├── quest.mo.php │ │ ├── search.mo.php │ │ ├── stat.mo.php │ │ ├── system.mo.php │ │ ├── tech.mo.php │ │ └── universe.mo.php │ └── ru/ │ ├── admin.mo.php │ ├── affilates.mo.php │ ├── alliance.mo.php │ ├── announce.mo.php │ ├── artifacts.mo.php │ ├── buddy.mo.php │ ├── buildings.mo.php │ ├── chat_advanced.mo.php │ ├── fleet.mo.php │ ├── index.html │ ├── infos.mo.php │ ├── language.mo.php │ ├── login.mo.php │ ├── market.mo.php │ ├── menu.mo.php │ ├── messages.mo.php │ ├── mrc_mercenary.mo.php │ ├── notes.mo.php │ ├── options.mo.php │ ├── overview.mo.php │ ├── payment.mo.php │ ├── quest.mo.php │ ├── search.mo.php │ ├── stat.mo.php │ ├── system.mo.php │ ├── tech.mo.php │ └── universe.mo.php ├── login.php ├── logout.php ├── lostpassword.php ├── market.php ├── messages.php ├── metamatter.php ├── notes.php ├── officer.php ├── overview.php ├── phalanx.php ├── quest.php ├── ranks.php ├── records.php ├── reg.php ├── resources.php ├── robots.txt ├── scheduler.php ├── search.php ├── server_info.php ├── simulator.php ├── skins/ │ ├── EpicBlue/ │ │ ├── skin.css │ │ ├── skin.ini │ │ └── tmpl.ini │ ├── index.html │ └── supernova-ivash/ │ ├── skin.css │ ├── skin.ini │ └── tmpl.ini ├── sounds/ │ ├── beer_can_opening.aac │ ├── beer_can_opening.ogg │ ├── bell_ring.aac │ ├── bell_ring.ogg │ ├── branch_break.aac │ ├── branch_break.ogg │ ├── button_click.aac │ ├── button_click.ogg │ ├── button_click_on.aac │ ├── button_click_on.ogg │ ├── button_push.aac │ ├── button_push.ogg │ ├── button_tiny.aac │ ├── button_tiny.ogg │ ├── camera_flashing.aac │ ├── camera_flashing.ogg │ ├── camera_flashing_2.aac │ ├── camera_flashing_2.ogg │ ├── cd_tray.aac │ ├── cd_tray.ogg │ ├── computer_error.aac │ ├── computer_error.ogg │ ├── door_bell.aac │ ├── door_bell.ogg │ ├── door_bump.aac │ ├── door_bump.ogg │ ├── glass.aac │ ├── glass.ogg │ ├── keyboard_desk.aac │ ├── keyboard_desk.ogg │ ├── light_bulb_breaking.aac │ ├── light_bulb_breaking.ogg │ ├── metal_plate.aac │ ├── metal_plate.ogg │ ├── metal_plate_2.aac │ ├── metal_plate_2.ogg │ ├── pop_cork.aac │ ├── pop_cork.ogg │ ├── snap.aac │ ├── snap.ogg │ ├── staple_gun.aac │ ├── staple_gun.ogg │ ├── tap.aac │ ├── tap.ogg │ ├── water_droplet.aac │ ├── water_droplet.ogg │ ├── water_droplet_2.aac │ ├── water_droplet_2.ogg │ ├── water_droplet_3.aac │ └── water_droplet_3.ogg ├── stat.php ├── tests/ │ ├── Bonus/ │ │ ├── BonusAtomAbilityTest.php │ │ ├── BonusAtomAddTest.php │ │ ├── BonusAtomMultiplyTest.php │ │ ├── BonusAtomPercentTest.php │ │ ├── BonusAtomTest.php │ │ ├── BonusCatalogTest.php │ │ ├── BonusFactoryTest.php │ │ └── BonusListAtomTest.php │ ├── DBAL/ │ │ └── Tests/ │ │ ├── ActiveRecordAbstractTest.php │ │ └── Fixtures/ │ │ ├── ActiveAbstractObjectDump.php │ │ └── RecordActiveAbstractObject.php │ ├── Fixtures/ │ │ └── UnitInfo.php │ ├── Meta/ │ │ └── Economic/ │ │ └── EcoHelperTest.php │ ├── Tests/ │ │ └── Common/ │ │ ├── Hooker/ │ │ │ ├── HookerTest.php │ │ │ └── PimpTest.php │ │ └── Pimple/ │ │ ├── Fixtures/ │ │ │ ├── Invokable.php │ │ │ ├── NonInvokable.php │ │ │ ├── PimpleServiceProvider.php │ │ │ └── Service.php │ │ ├── PimpleServiceProviderInterfaceTest.php │ │ └── PimpleTest.php │ ├── bootstrap.php │ ├── classes/ │ │ ├── AccessAccessorsTest.php │ │ ├── AccessLoggedTest.php │ │ ├── AccessMagicTest.php │ │ ├── AccessorsV2Test.php │ │ ├── DbQueryTest.php │ │ ├── HelperArrayTest.php │ │ ├── InvokerTest.php │ │ ├── ToolsTest.php │ │ ├── ValidatorsTest.php │ │ └── VectorTest.php │ ├── includes/ │ │ ├── test_constants.php │ │ └── test_functions.php │ └── phpunit.xml ├── time_probe.php ├── tools/ │ ├── classes/ │ │ ├── ImageContainer.php │ │ ├── ImageFile.php │ │ ├── Sprite.php │ │ ├── SpriteLine.php │ │ ├── SpriteLineGif.php │ │ └── Spritify.php │ ├── generate.php │ ├── spritify.md │ └── spritify.php └── viewreport.php ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitattributes ================================================ .gitattributes export-ignore .gitignore export-ignore *.jpg binary *.gif binary *.png binary *.ttf binary *.zip binary *.rar binary *.gz binary *.min.js diff=nodiff *.min.css diff=nodiff ================================================ FILE: .gitignore ================================================ # Ignore config.php in any directory config.php *config.php badqrys.txt # Ignore Yandex and Google placeholders /yandex_*.txt /google*.txt /google*.html # Ignore override CSS files /desing/css/*override* # Ignore uploaded files /files # Ignore local folder, test folder and test files /test/ /.local/ t.* # Ignore update flag /includes/update.last # Ignore cache folder /cache/ /design/cache/ # Ignore avatar folder /images/avatar/ # Ignore instanced servers /servers/ # Ignore all dotfiles... .* # ...except for .gitignore & .gitattributes !.gitignore !.gitattributes !.htaccess # Ignoring all files started with "__" - it's a local or global test files __* # Ignore backup folder /admin/sxd/cfg.php /admin/sxd/error.log /admin/sxd/ses.php /admin/sxd/backup/*.job.php # Ignore backups /admin/backup/*.gz /admin/backup/*.bz2 /admin/backup/*.sql /admin/sxd/backup/*.gz /admin/sxd/backup/*.bz2 /admin/sxd/backup/*.sql # Ignore skin xNova /skins/xnova/ # Ignore forums /phpBB3/ /forum/ # Ignore DirInfo dirinfo # Ignore CMD-files /*.cmd # Ignore xcache interface /xcache/ /xcache-admin/ /xcache-admin2/ ================================================ FILE: .htaccess ================================================ AddDefaultCharset UTF-8 # Disable index list Options -Indexes # Disable access to config.php order allow,deny deny from all order allow,deny deny from all # Deny access to all dotted fields and folders RedirectMatch 404 /\..*$ # # order allow,deny # deny from all # ================================================ FILE: README.MD ================================================ # We Want YOU! SuperNova need YOU! We need maintainers for localizations. Any language is fine! Currently we need maintainer for English locale to check and fix it as base for other non-Russian speaker users! # Project "SuperNova.WS" "SuperNova.WS" (shortly SN) is a massive multiplayer online browser space strategy game (like oGame). SN is a very heavily modified XNova RageRepack v226 SN written on PHP. It require MySQL-server for work SN developed under GNU GENERAL PUBLIC LICENSE Version 2, June 1991. You can read it in /docs/license.txt (English). Also there is additional restrictions: 1. You can not remove or change any copyright notices from any part of SN. If you wish to use any part of code in your development you should also add all copyright notices 2. You absolutly can not sell SN-based product without my special permission. If you want to sell such product - contact me Currently SN supports Russian and English languages ## Disclaimer WARNING! Project status is "Alpha"! It means that any update can seriously change any aspect of gameplay! Also it means that there may be lack of documentation, no user-friendly installer. Also it means that any user that want to use this code should have some knowledge about configuring web-server with PHP and MySQL and have knowledge about installing and configuring PHP-scripts. However code is pretty stable and has "beta"-quality. WARNING! SN PROVIDED "AS-IS" WITH NO EXPLICIT OR IMPLIED WARRANTY AT ALL! WARNING! MANY ASPECTS OF GAMEPLAY AND ALGORYTHMS DIFFERS FROM OGAME OFFICIAL SERVERS! IT'S NOT A BUG - IT WAS MADE INTENTIONALLY! DO NOT COMPLY IF YOU ENCOUNTER SUCH DIFFERENCE! Some notes about SN future development can be read in /docs/todo.txt (Russian) ## Web-resources ### Main Hub For Your SuperNova Experience Russian Version http://supernova.ws/index.htm English Version http://supernova.ws/index-en.htm ### GitHub You encouraged to use GitHub as main source for SN releases and builds SN on GitHub: http://github.com/supernova-ws/SuperNova GIT-repository: git://github.com/supernova-ws/SuperNova.git GIT-repository through HTTP: https://github.com/supernova-ws/SuperNova# Latest stable release: https://github.com/supernova-ws/SuperNova/zipball/master Latest night build (stability is not guaranted!): https://github.com/supernova-ws/SuperNova/zipball/trunk SVN-interface (SVN-interface on GitHub works very unstable): http://svn.github.com/supernova-ws/SuperNova.git There are 3 branches on GitHub repository - "master" contains last stable version. - "trunk" contains most recent and feature-rich code. Here can be some minor bugs - "test" contains developer snapshot. It can be partially or fully non-functional. Hovewer here you can see currently developing features. ### SourceForge GIT-repository on SourceForge: git://supernova-ws.git.sourceforge.net/gitroot/supernova-ws/supernova-ws Release archives: http://sourceforge.net/projects/supernova-ws/files/releases/ DIFFs http://sourceforge.net/projects/supernova-ws/files/diffs/ Patches (archive of differences between indicated versions) http://sourceforge.net/projects/supernova-ws/files/patches/ ### Support Forum (Russian and English): http://forum.supernova.ws/viewforum.php?f=73 ### Live Demo Universes SuperNova (x1): http://supernova.ws oGame (x2): http://ogame.supernova.ws Beta (x50): http://beta.supernova.ws ## Documentation All documentation located in folder `/docs`. License (English): `/docs/license.txt` Project documentation (Russian): `/docs/readme.txt` User-level changelog (Russian): `/docs/changelog.txt` Installation instructions (Russian): `/docs/install.md` Installation instructions (English, google-translated): `/docs/install-en.md` Documentation for developers & administrators (Russian): `/docs/html/developer.html` Changelog for developers & administrators (Russian): `/docs/changelog_dev.txt` Plans for further development (Russian): `/docs/todo.txt` Coding Gudelines for developers (English): `/docs/html/coding-guidelines.html` Bellitrized game background (Russian): `/docs/SuperNova - All you didn't want to know but forced to.docx` # Copyright notice СуперНова copyright (c) 2009-2020 Gorlum для http://supernova.ws Project "SuperNova.WS" copyright (c) 2009-2020 by Gorlum for http://supernova.ws ================================================ FILE: _error-404.php ================================================ /* */ ================================================ FILE: admin/add_moon.php ================================================ $MoonName]); db_mysql::db_transaction_commit(); SnTemplate::messageBoxAdmin($lang['addm_done'], $lang['addm_title']); } SnTemplate::display($template, $lang['addm_title']); ================================================ FILE: admin/adm_flying_fleets.php ================================================ $CurrentFleet) { $FleetOwner = db_user_by_id($CurrentFleet['fleet_owner']); $TargetOwner = db_user_by_id($CurrentFleet['fleet_target_owner']); $fleet_data = tpl_parse_fleet_db($CurrentFleet, ++$i, $FleetOwner); $fleet_data['fleet']['OWNER_NAME'] = htmlentities($FleetOwner['username'], ENT_COMPAT, 'UTF-8'); $fleet_data['fleet']['TARGET_OWNER_NAME'] = htmlentities($TargetOwner['username'], ENT_COMPAT, 'UTF-8'); $fleet_data['fleet']['STAY_TIME_INT'] = $CurrentFleet['fleet_end_stay']; $template->assign_block_vars('fleets', $fleet_data['fleet']); foreach($fleet_data['ships'] as $ship_data) { $template->assign_block_vars('fleets.ships', $ship_data); } } SnTemplate::display($template, $lang['flt_title']); ================================================ FILE: admin/adm_log_main.php ================================================ '; foreach ($value as $key => $val) { $result .= '' . $key . '' . var_export($val, true) . ''; } $result .= ''; } else { $result = var_export($value, true); } return $result; } if($detail = sys_get_param_id('detail')) { $template = SnTemplate::gettemplate('admin/adm_log_main_detail', true); $errorInfo = doquery("SELECT * FROM `{{logs}}` WHERE `log_id` = {$detail} LIMIT 1;", true); $error_dump = json_decode($errorInfo['log_dump'], true); if(is_array($error_dump)) { foreach ($error_dump as $key => $value) { // Parsing user options to readable state if($key == 'user' ) { if(!empty($value['options'])) { $value['options'] = explode(USER_OPTIONS_SPLIT, $value['options']); } } $val = $key == 'query_log' ? $value : admLogRender($value); $template->assign_block_vars('vars', [ 'VAR_NAME' => $key, 'VAR_VALUE' => $val, ]); } } // Replacing LF with HTML
tag for better readability $errorInfo['log_text'] = str_replace("\n", '
', $errorInfo['log_text']); $template->assign_vars($errorInfo); } else { $template = SnTemplate::gettemplate('admin/adm_log_main', true); $i = 0; $query = doquery("SELECT * FROM `{{logs}}` ORDER BY log_id DESC LIMIT 100;"); while($u = db_fetch($query)) { $i++; $v = []; $u['log_text'] = str_replace("\n", "
", $u['log_text']); foreach($u as $key => $value) { $v[strtoupper($key)] = $value; } $template->assign_block_vars('error', $v); } $query = doquery("SELECT COUNT(*) AS LOG_MESSAGES_TOTAL, {$i} AS LOG_MESSAGES_VISIBLE FROM `{{logs}}`;", true); $template->assign_vars($query); } SnTemplate::display($template, $lang['adm_er_ttle']); ================================================ FILE: admin/adm_message_list.php ================================================ array( 'VALUE' => -1, 'TEXT' => $lang['adm_pay_filter_all'] ), ); $template->assign_block_vars('int_type_selected', $allowed_types[-1]); foreach($sn_message_class_list as $key => $value) { if($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX) { continue; } $template->assign_block_vars('int_type_selected', $allowed_types[$key] = array( 'VALUE' => $key, 'TEXT' => $lang['msg_class'][$key], )); } $message_delete = sys_get_param_id('msg_del'); if(sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete)) { $message_delete = implode(', ', $message_delete); } if($message_delete) { doquery("DELETE FROM {{messages}} WHERE `message_id` in ({$message_delete});"); $template->assign_block_vars('result', array('MESSAGE' => sprintf($lang['mlst_messages_deleted'], $message_delete))); } if(sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year'))) { $delete_date = "{$year}-{$month}-{$day}"; doquery("DELETE FROM {{messages}} WHERE message_time <= UNIX_TIMESTAMP('{$delete_date}')" . ($int_type_selected >= 0 ? " AND `message_type` = {$int_type_selected}" : '')); $template->assign_block_vars('result', array('MESSAGE' => sprintf($lang['mlst_messages_deleted_date'], $allowed_types[$int_type_selected]['TEXT'], $delete_date))); } $page_max = doquery('SELECT COUNT(*) AS `max` FROM `{{messages}}`' . ($int_type_selected >= 0 ? " WHERE `message_type` = {$int_type_selected};" : ''), true); $page_max = ceil($page_max['max'] / 25); $int_page_current = min(sys_get_param_id('int_page_current', 1), $page_max); if(sys_get_param('page_prev') && $int_page_current > 1) { $int_page_current--; } elseif(sys_get_param('page_next') && $int_page_current < $page_max) { $int_page_current++; } for($i = 1; $i <= $page_max; $i++) { $template->assign_block_vars('page', array('NUMBER' => $i)); } $StartRec = ($int_page_current - 1) * 25; $Messages = db_message_list_admin_by_type($int_type_selected, $StartRec); while($row = db_fetch($Messages)) { $row['FROM'] = htmlentities($row['FROM'], ENT_COMPAT, 'UTF-8'); $row['OWNER_NAME'] = htmlentities($row['OWNER_NAME'], ENT_COMPAT, 'UTF-8'); $row['TEXT'] = nl2br($row['TEXT']); $template->assign_block_vars('message', $row); } $template->assign_vars(array( 'PAGE_MAX' => $page_max, 'PAGE_CURRENT' => $int_page_current, 'TYPE_SELECTED' => $int_type_selected, )); SnTemplate::display($template, $lang['mlst_title']); ================================================ FILE: admin/adm_metamatter.php ================================================ modules->countModulesInGroup('payment')) { sys_redirect(SN_ROOT_VIRTUAL . 'admin/overview.php'); } SnTemplate::messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR); /** * @param classLocale $lang * @param array $user * @param string $accountIdOrName_unsafe * @param string $playerIdOrName_unsafe * @param float $points * @param string $reason_unsafe * @param bool $confirmed * * @throws ExceptionSnLocalized */ function admin_meta_matter_model($lang, $user, $accountIdOrName_unsafe, $playerIdOrName_unsafe, $points, $reason_unsafe, $confirmed) { // If no points and no username - nothing to do if (!$points && !$playerIdOrName_unsafe && !$accountIdOrName_unsafe) { return; } if (!$points) { throw new ExceptionSnLocalized('adm_mm_err_points_empty', ERR_ERROR); } $account = new Account(SN::$auth->account->db); if (!empty($accountIdOrName_unsafe)) { if ( !$account->db_get_by_id($accountIdOrName_unsafe) && !$account->db_get_by_name($accountIdOrName_unsafe) && !$account->db_get_by_email($accountIdOrName_unsafe) ) { throw new ExceptionSnLocalized('adm_mm_err_account_not_found', ERR_ERROR); } } elseif (!empty($playerIdOrName_unsafe)) { $row = dbPlayerByIdOrName($playerIdOrName_unsafe); if (empty($row['id'])) { throw new ExceptionSnLocalized('adm_mm_err_player_not_found', ERR_ERROR, null, array($playerIdOrName_unsafe)); } if (!$account->dbGetByPlayerId($row['id'])) { throw new ExceptionSnLocalized('adm_mm_err_player_no_account', ERR_ERROR, null, array($playerIdOrName_unsafe)); } } else { throw new ExceptionSnLocalized('adm_mm_err_account_and_player_empty', ERR_ERROR); } $sprintfPayload = array( $account->account_name, $account->account_id, HelperString::numberFloorAndFormat($points), !empty($row['id']) ? $row['id'] : 0, !empty($row['username']) ? $row['username'] : '' ); if ($confirmed) { if (empty($account->metamatter_change( RPG_ADMIN, $points, sprintf( $lang['adm_mm_msg_change_mm_log_record'], $account->account_id, $account->account_name, $user['id'], $user['username'], $reason_unsafe, core_auth::$main_provider->account->account_id, core_auth::$main_provider->account->account_name, !empty($row['id']) ? $row['id'] : 0, !empty($row['username']) ? $row['username'] : '' ) ))) { throw new ExceptionSnLocalized($lang['adm_mm_err_mm_change_failed'], ERR_ERROR); } throw new ExceptionSnLocalized('adm_mm_msg_mm_changed', ERR_NONE, null, $sprintfPayload); } else { throw new ExceptionSnLocalized('adm_mm_msg_confirm_mm_change', ERR_WARNING, null, $sprintfPayload); } } /** * @param array $user * @param classLocale $lang */ function admin_meta_matter_view($user, $lang) { $accountIdOrName_unsafe = sys_get_param_str_unsafe('accountId'); $playerIdOrName_unsafe = sys_get_param_str_unsafe('playerId'); $points = sys_get_param_float('points'); $reason_unsafe = sys_get_param_str_unsafe('reason'); $confirmed = sys_get_param('confirm_mm_change'); $confirmed = !empty($confirmed); // can't use empty() or isset() with function result in PHP 5.3 $template = SnTemplate::gettemplate("admin/adm_metamatter", true); try { admin_meta_matter_model($lang, $user, $accountIdOrName_unsafe, $playerIdOrName_unsafe, $points, $reason_unsafe, $confirmed); } catch (ExceptionSnLocalized $e) { $template->assign_block_vars('result', array( 'MESSAGE' => $e->getMessageLocalized(), 'STATUS' => $e->getCode() ? $e->getCode() : ERR_NONE, )); if ($e->getCode() != ERR_NONE) { $template->assign_vars(array( 'ACCOUNT_ID' => sys_safe_output($accountIdOrName_unsafe), 'PLAYER_ID' => sys_safe_output($playerIdOrName_unsafe), 'POINTS' => $points, 'REASON' => sys_safe_output($reason_unsafe), )); }; if ($e->getCode() == ERR_WARNING) { $template->assign_vars(array( 'NEED_CONFIRMATION' => 1, )); } } SnTemplate::display($template, $lang['adm_dm_title']); } global $user, $lang; admin_meta_matter_view($user, $lang); ================================================ FILE: admin/adm_planet_list.php ================================================ game_users_online_timeout; } $table_parent_columns = $planet_type == 3 || $planet_active; $template = SnTemplate::gettemplate('admin/adm_planet_list', true); $query = db_planet_list_admin_list($table_parent_columns, $planet_active, $active_time, $planet_type); while ($planet_row = db_fetch($query)) { $template->assign_block_vars('planet', array( 'ID' => $planet_row['id'], 'NAME' => js_safe_string($planet_row['name']), 'GALAXY' => $planet_row['galaxy'], 'SYSTEM' => $planet_row['system'], 'PLANET' => $planet_row['planet'], 'PLANET_TYPE' => $planet_row['planet_type'], 'PLANET_TYPE_PRINT' => $lang['sys_planet_type_sh'][$planet_row['planet_type']], 'PARENT_ID' => js_safe_string($planet_row['parent_planet']), 'PARENT_NAME' => js_safe_string($planet_row['parent_name']), 'OWNER' => js_safe_string($planet_row['username']), 'OWNER_ID' => $planet_row['id_owner'], )); } $page_title = $lang['adm_planet_list_title'] . ': ' . ($planet_active ? $lang['adm_planet_active'] : ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '') ); $template->assign_vars(array( 'PAGE_TITLE' => $page_title, 'PLANET_COUNT' => SN::$db->db_num_rows($query), 'PARENT_COLUMN' => $table_parent_columns, )); SnTemplate::display($template, $page_title); ================================================ FILE: admin/adm_quest.php ================================================ SUSPICIOUS_LONG) { $session[2] = pretty_time($session[2]); $session[0] = date(FMT_DATE_TIME_SQL, $session[0]); $session[1] = date(FMT_DATE_TIME_SQL, $session[1]); $session_list_last_id[] = $session; } //$row ? $session = array( // 0 => $row['time'], // start // 1 => $row['time'], // end 0 => $row['visit_time'], // start 1 => $row['visit_time'], // end ) //: false ; } $session_list = array(); $query = doquery("SELECT `visit_time`, user_id FROM {{counter}} where user_id <> 0 and visit_time > UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY)) order by user_id, visit_time;"); $session = array(); if($row = db_fetch($query)) { $session = array( 0 => strtotime($row['visit_time']), // start 1 => strtotime($row['visit_time']), // end ); $last_id = $row['user_id']; } while($row = db_fetch($query)) { $row['visit_time'] = strtotime($row['visit_time']); if($last_id == $row['user_id']) { // Тот же юзер if($row['visit_time'] - $session[1] <= SESSION_INTERRUPT) { // Та же сессия $session[1] = $row['visit_time']; } else { // Новая сессия // check_suspicious($session, $session_list[$last_id], $row); $session[2] = $session[1] - $session[0]; if($session[2] > SUSPICIOUS_LONG) { $session[2] = pretty_time($session[2]); $session[0] = date(FMT_DATE_TIME_SQL, $session[0]); $session[1] = date(FMT_DATE_TIME_SQL, $session[1]); $session_list[$last_id][] = $session; } $session = array( 0 => $row['visit_time'], // start 1 => $row['visit_time'], // end ); } } else { // check_suspicious($session, $session_list[$last_id], $row); $session[2] = $session[1] - $session[0]; if($session[2] > SUSPICIOUS_LONG) { $session[2] = pretty_time($session[2]); $session[0] = date(FMT_DATE_TIME_SQL, $session[0]); $session[1] = date(FMT_DATE_TIME_SQL, $session[1]); $session_list[$last_id][] = $session; } $session = array( 0 => $row['visit_time'], // start 1 => $row['visit_time'], // end ); $last_id = $row['user_id']; } } if($last_id) { // check_suspicious($session, $session_list[$last_id], $row = array('time' => 0)); $session[2] = $session[1] - $session[0]; if($session[2] > SUSPICIOUS_LONG) { $session[2] = pretty_time($session[2]); $session[0] = date(FMT_DATE_TIME_SQL, $session[0]); $session[1] = date(FMT_DATE_TIME_SQL, $session[1]); $session_list[$last_id][] = $session; } } print(""); print(""); print(""); print(""); print(""); foreach($session_list as $user_id => $value) { $user_record = doquery("SELECT `username`, onlinetime FROM {{users}} WHERE id = {$user_id};", true); foreach($value as $interval_data) { print(""); print(""); print(""); print(""); } } print("
IDUsernameStartEndLengthLast online
{$user_id}{$user_record['username']}{$interval_data[0]}{$interval_data[1]}{$interval_data[2]}" . date(FMT_DATE_TIME_SQL, $user_record['onlinetime']) . "
"); ================================================ FILE: admin/adm_user_stat.php ================================================ $b['DATE'] ? 1 : -1); } if($user['authlevel'] < 3) { AdminMessage($lang['adm_err_denied']); } $template = SnTemplate::gettemplate('admin/adm_user_stat', true); $dt_from = sys_get_param_date_sql('dt_from', '2000-01-01'); if(strlen($dt_from) == 4) { $dt_from .= '-01'; } $dt_to = sys_get_param_date_sql('dt_to', date('Y-m-d', SN_TIME_NOW + PERIOD_DAY)); if(strlen($dt_to) == 4) { $dt_to .= '-01'; } $sql_date = ($dt_from ? " AND register_time >= UNIX_TIMESTAMP(STR_TO_DATE('{$dt_from}', '%Y-%m-%d %H:%i:%s')) " : '') . ($dt_to ? " AND register_time < UNIX_TIMESTAMP(STR_TO_DATE('{$dt_to}', '%Y-%m-%d %H:%i:%s')) " : ''); $min_max_dates = doquery($q = "SELECT min(register_time) AS min_register, max(register_time) AS max_register, avg(onlinetime - register_time) AS avg_play_time, STR_TO_DATE('{$dt_to}', '%Y-%m-%d %H:%i:%s') FROM {{users}} WHERE 1 " . $sql_date, true); $interval = $min_max_dates['max_register'] - $min_max_dates['min_register']; switch(true) { case $interval >= PERIOD_YEAR * 4: $sql_group_format = "%Y"; $sql_date_add = 'year'; break; case $interval > PERIOD_DAY * 32: $sql_group_format = "%Y-%m"; $sql_date_add = 'month'; break; case $interval > PERIOD_DAY: $sql_group_format = "%Y-%m-%d"; $sql_date_add = 'day'; break; default: $sql_group_format = "%Y-%m-%d %H:00:00"; $sql_date_add = 'hour'; $stop_next = true; break; } $stat_date = array(); $max_registered = 0; $max_accounts = 0; $sql_group_by2 = "DATE_FORMAT(account_register_time, '{$sql_group_format}')"; $sql_date2 = ($dt_from ? " AND account_register_time >= (STR_TO_DATE('{$dt_from}', '%Y-%m-%d %H:%i:%s')) " : '') . ($dt_to ? " AND account_register_time < (STR_TO_DATE('{$dt_to}', '%Y-%m-%d %H:%i:%s')) " : ''); $query = doquery( "SELECT count(*) AS the_count, DATE_FORMAT(account_register_time, '{$sql_group_format}') AS the_date, DATE_FORMAT(account_register_time, '%a') AS DoW, DATE_FORMAT(DATE_ADD(account_register_time, INTERVAL 1 {$sql_date_add}), '{$sql_group_format}') AS date_next FROM {{account}} WHERE 1 " . $sql_date2 . " GROUP BY {$sql_group_by2}"); while($row = db_fetch($query)) { $stat_date[$row['the_date']] = array( 'DATE' => $row['the_date'], 'DOW' => $row['DoW'], 'DATE_URL' => urlencode($row['the_date']), 'DATE_NEXT_URL' => urlencode($row['date_next']), 'ACCOUNTS' => $row['the_count'], ); $max_accounts = max($max_accounts, $row['the_count']); } $sql_group_by = "DATE_FORMAT(FROM_UNIXTIME(register_time), '{$sql_group_format}')"; $query = doquery("SELECT count(*) AS the_count, {$sql_group_by} AS the_date, DATE_FORMAT(DATE_ADD(FROM_UNIXTIME(register_time), INTERVAL 1 {$sql_date_add}), '{$sql_group_format}') AS date_next FROM {{users}} WHERE user_as_ally IS NULL " . $sql_date . " GROUP BY {$sql_group_by}"); while($row = db_fetch($query)) { $stat_date[$row['the_date']]['REGISTERED'] = $row['the_count']; $max_registered = max($max_registered, $row['the_count']); } $query = doquery("SELECT count(*) AS the_count, {$sql_group_by} AS the_date FROM {{users}} WHERE user_as_ally IS NULL " . " AND onlinetime <= register_time + " . PERIOD_DAY . ' AND UNIX_TIMESTAMP(NOW()) >= register_time + ' . PERIOD_DAY . $sql_date . " GROUP BY {$sql_group_by}"); while($row = db_fetch($query)) { $stat_date[$row['the_date']]['REJECTED'] = $row['the_count']; } $query = doquery("SELECT count(*) AS the_count, {$sql_group_by} AS the_date FROM {{users}} WHERE user_as_ally IS NULL " . " AND onlinetime > register_time + " . PERIOD_DAY . ' AND onlinetime <= register_time + ' . PERIOD_WEEK . ' AND UNIX_TIMESTAMP(NOW()) >= register_time + ' . PERIOD_WEEK . $sql_date . " GROUP BY {$sql_group_by}"); while($row = db_fetch($query)) { $stat_date[$row['the_date']]['LEAVED'] = $row['the_count']; } $query = doquery("SELECT count(*) AS the_count, {$sql_group_by} AS the_date FROM {{users}} WHERE user_as_ally IS NULL " . ' AND UNIX_TIMESTAMP(NOW()) - onlinetime <= ' . PERIOD_DAY . ' AND UNIX_TIMESTAMP(NOW()) - register_time >= ' . PERIOD_DAY . $sql_date . " GROUP BY {$sql_group_by}"); while($row = db_fetch($query)) { $stat_date[$row['the_date']]['ACTIVE'] = $row['the_count']; } $query = doquery("SELECT count(*) AS the_count, {$sql_group_by} AS the_date FROM {{users}} WHERE user_as_ally IS NULL " . ' AND UNIX_TIMESTAMP(NOW()) - onlinetime > ' . PERIOD_DAY . ' AND UNIX_TIMESTAMP(NOW()) - onlinetime <= ' . PERIOD_WEEK . ' AND UNIX_TIMESTAMP(NOW()) - register_time >= ' . PERIOD_WEEK . $sql_date . " GROUP BY {$sql_group_by}"); while($row = db_fetch($query)) { $stat_date[$row['the_date']]['DORMANT'] = $row['the_count']; } uasort($stat_date, 'admin_date_sort'); $total = array(); foreach($stat_date as $key => &$value) { $value['TOTAL'] = $value['REJECTED'] + $value['LEAVED']; $value['LEAVED_PERCENT'] = $value['REGISTERED'] ? round($value['TOTAL'] / $value['REGISTERED'] * 100) : 0; $value['ACTIVE_PERCENT'] = $value['REGISTERED'] ? round($value['ACTIVE'] / $value['REGISTERED'] * 100) : 0; $value['DORMANT_PERCENT'] = $value['REGISTERED'] ? round($value['DORMANT'] / $value['REGISTERED'] * 100) : 0; foreach($value as $key2 => $value2) { $total[$key2] += $value2; } $value['REGISTERED_PERCENT'] = ceil($max_registered ? $value['REGISTERED'] * 100 / $max_registered : 0); $template->assign_block_vars('stats', $value); } $total['DATE'] = 'Всего'; $total['TH'] = 1; $total['LEAVED_PERCENT'] = count($stat_date) ? round($total['TOTAL'] / $total['REGISTERED'] * 100) : 0; $total['ACTIVE_PERCENT'] = count($stat_date) ? round($total['ACTIVE'] / $total['REGISTERED'] * 100) : 0; $total['DORMANT_PERCENT'] = count($stat_date) ? round($total['DORMANT'] / $total['REGISTERED'] * 100) : 0; $template->assign_block_vars('stats', $total); $template->assign_vars(array( 'AVG_PLAY_TIME' => round($min_max_dates['avg_play_time'] / PERIOD_DAY, 2), 'STOP_NEXT' => intval($stop_next), 'INTERVAL' => $sql_date_add, )); SnTemplate::display($template, $lang['adm_user_stat'], false, '', true); ================================================ FILE: admin/admin_analyze_matter.php ================================================ $constantValue) { if(substr($constantName, 0, 4) == 'RPG_') { $rpgConstants[$constantValue] = $constantName; } } $spent = array(); $result = SN::$db->doquery( "SELECT CONCAT(log_dark_matter_reason, '_', IF(sign(sum(log_dark_matter_amount)) > 0, 1, -1)) as `BALANCE`, log_dark_matter_reason as `REASON`, sum(log_dark_matter_amount) as `DM_AMOUNT`, count(log_dark_matter_amount) as `DM_COUNT`, sign(sum(log_dark_matter_amount)) as `SIGN` FROM `{{log_dark_matter}}` GROUP BY log_dark_matter_reason, IF(sign((log_dark_matter_amount)) > 0, 1, -1) ORDER BY sum(log_dark_matter_amount) DESC;" ); while($row = SN::$db->db_fetch($result)) { $row['CONSTANT'] = $rpgConstants[$row['REASON']]; $row['DM_AMOUNT_TEXT'] = HelperString::numberFloorAndFormat($row['DM_AMOUNT']); // $row['TOTAL_AMOUNT'] = $row['DM_AMOUNT']; // $row['TOTAL_COUNT'] = $row['DM_COUNT']; // $row['TOTAL_AMOUNT_TEXT'] = pretty_number($row['TOTAL_AMOUNT']); $spent[$row['BALANCE']] = $row; } $result = SN::$db->doquery( "SELECT CONCAT(reason, '_', IF(sign(sum(amount)) > 0, 1, -1)) as `BALANCE`, reason as `REASON`, sum(amount) as `MM_AMOUNT`, count(amount) as `MM_COUNT`, sign(sum(amount)) as `SIGN` FROM `{{log_metamatter}}` GROUP BY reason, if(sign((amount)) > 0, 1, -1) ORDER BY sum(amount) DESC;" ); while($row = SN::$db->db_fetch($result)) { if(empty($spent[$row['BALANCE']])) { $spent[$row['BALANCE']] = array(); } $row['CONSTANT'] = $rpgConstants[$row['REASON']]; $row['MM_AMOUNT_TEXT'] = HelperString::numberFloorAndFormat($row['MM_AMOUNT']); $spent[$row['BALANCE']] = array_merge_recursive_numeric($spent[$row['BALANCE']], $row); } foreach($spent as &$row) { @$row['TOTAL_COUNT'] = $row['MM_COUNT'] + $row['DM_COUNT']; @$row['TOTAL_AMOUNT'] = $row['MM_AMOUNT'] + $row['DM_AMOUNT']; @$row['TOTAL_AMOUNT_TEXT'] = HelperString::numberFloorAndFormat($row['TOTAL_AMOUNT']); @$row['TOTAL_COUNT_TEXT'] = HelperString::numberFloorAndFormat($row['TOTAL_COUNT']); } usort($spent, function ($a, $b) { return $a['TOTAL_AMOUNT'] < $b['TOTAL_AMOUNT'] ? -1 : ($a['TOTAL_AMOUNT'] > $b['TOTAL_AMOUNT'] ? 1 : 0); }); $template = SnTemplate::gettemplate("admin/admin_analyze_matter", true); foreach ($spent as $row) { $template->assign_block_vars('spent', $row); } $fromDate = SN::$db->doQueryAndFetch("SELECT min(log_dark_matter_timestamp) FROM `{{log_dark_matter}}`;"); $template->assign_var("MIN_DATE", reset($fromDate)); SnTemplate::display($template, '{Анализ расхода и прихода материи}'); ================================================ FILE: admin/admin_chat.php ================================================ assign_block_vars('message', array( 'ID' => $e['messageid'], 'TIMESTAMP' => str_replace(' ', ' ', date(FMT_DATE_TIME, $e['timestamp'])), 'PLAYER_NAME' => $e['user'], 'MESSAGE' => nl2br($e['message']), )); } $template->assign_vars(array( 'PAGE_HEADER' => $lang['adm_ch_ttle'], 'msg_num' => SN::$gc->db->db_num_rows($query), )); SnTemplate::display($template); ================================================ FILE: admin/admin_darkmatter.php ================================================ assign_block_vars('result', array( 'MESSAGE' => $e->getMessageLocalized(), 'STATUS' => $e->getCode() ? $e->getCode() : ERR_NONE, )); if ($e->getCode() != ERR_NONE) { $template->assign_vars(array( 'PLAYER_ID' => sys_safe_output($playerIdOrName_unsafe), 'POINTS' => $points, 'REASON' => sys_safe_output($reason_unsafe), )); }; } SnTemplate::display($template, $lang['adm_dm_title']); return $template; } admin_dark_matter_view(); ================================================ FILE: admin/admin_locale.php ================================================ $sub_value) { adm_lng_assign_string($lang_id, "{$locale_string_name}[{$sub_key}]", $sub_value); } } elseif($value) { if(!isset($locale_string_template[$locale_string_name])) { $locale_string_template[$locale_string_name] = array(); } $locale_string_template[$locale_string_name] = array_merge($locale_string_template[$locale_string_name], array("[{$lang_id}]" => htmlentities($value, ENT_COMPAT, 'utf-8'))); } } function adm_lng_load($full_filename) { // $lang_old = $lang; // $lang = array(); require($full_filename); // $lang_new = $lang; // $lang = $lang_old; // return $lang_new; return $a_lang_array; } function adm_lng_parse_string($string_name, $string_value, $ident = ' ') { global $domain, $lang_id; $return = "{$ident}'{$string_name}' => "; if(isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) { $return .= "'" . str_replace(array("\\", "'"), array('\\\\', "\\'"), $string_value[$lang_id]) . "',"; } else { $return .= "array(\r\n"; foreach($string_value as $arr_name => $arr_data) { $return .= adm_lng_parse_string($arr_name, $arr_data, $ident . ' '); } $return .= "{$ident}),\r\n"; } return $return . "\r\n"; } $honor_constants = array( 'admin' => array( '[adm_opt_ver_response]' => 'SNC_VER_', '[adm_opt_ver_response_short]' => 'SNC_VER_', ), 'alliance' => array( '[ali_dip_relations]' => 'ALLY_DIPLOMACY_', ), 'artifacts' => array( '[art_moon_create]' => 'ART_', ), 'fleet' => array( '[fl_attack_error]' => 'ATTACK_', '[fl_shrtcup]' => 'PT_', '[fl_planettype]' => 'PT_', ), 'infos' => array( '[info]' => array('TECH_', 'MRC_', 'SHIP_', 'RES_', 'ART_', 'STRUC_'), ), 'market' => array( '[eco_mrk_errors]' => 'MARKET_', ), 'quest' => array( '[qst_status_list]' => 'QUEST_STATUS_', ), 'tech' => array( '[type_mission]' => 'MT_', '[tech]' => array('TECH_', 'MRC_', 'SHIP_', 'RES_', 'ART_', 'STRUC_'), ), ); function adm_lng_write_string($string_name, $string_value, $ident = ' ', $string_name_prefix = '') { global $lang_id, $file_handler, $constants, $honor_constants, $domain; $string_name_new = false; if(isset($honor_constants[$domain][$string_name_prefix])) { $found_constants = array_keys($constants, $string_name); foreach($found_constants as $constant_name) { $honor_prefix_list = is_array($honor_constants[$domain][$string_name_prefix]) ? $honor_constants[$domain][$string_name_prefix] : array($honor_constants[$domain][$string_name_prefix]); foreach($honor_prefix_list as $honor_prefix) { if(strpos($constant_name, $honor_prefix) === 0) { $string_name_new = $constant_name; break; } } } } $string_name_new = $string_name_new ? $string_name_new : "'{$string_name}'"; fwrite($file_handler, "{$ident}{$string_name_new} => "); if(isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) { fwrite($file_handler, "'" . str_replace(array("\\", "'"), array('\\\\', "\\'"), $string_value[$lang_id]) . "',"); // fwrite($file_handler, "'" . addslashes($string_value[$lang_id]) . "',"); } else { $string_name_prefix = $string_name_prefix . "[{$string_name}]"; fwrite($file_handler, "array(\r\n"); foreach($string_value as $arr_name => $arr_data) { adm_lng_write_string($arr_name, $arr_data, $ident . ' ', $string_name_prefix); } fwrite($file_handler, "{$ident}),\r\n"); } fwrite($file_handler, "\r\n"); } $template = SnTemplate::gettemplate('admin/admin_locale', true); lng_include('system'); lng_include('tech'); lng_include('admin'); $languages = array(); $language_domains = array(); $languages_info = lng_get_list(); $domain = sys_get_param_str('domain'); if($domain) { $lang_new = sys_get_param('lang_new'); if(!empty($lang_new) && is_array($lang_new)) { $constants = get_defined_constants(true); $constants = $constants['user']; ksort($constants); foreach($languages_info as $lang_id => $land_data) { $file_handler = fopen(SN_ROOT_PHYSICAL . "language/{$lang_id}/{$domain}.mo.php.new", 'w'); fwrite($file_handler, "'), $lang_copyright); fwrite($file_handler, "# {$lang_copyright}\r\n"); } fwrite($file_handler, "#############################################################################\r\n*/\r\n /**\r\n*\r\n* @package language\r\n* @system [{$land_data['LANG_NAME_ENGLISH']}]\r\n* @version " . SN_VERSION . "\r\n*\r\n*/\r\n /**\r\n* DO NOT CHANGE\r\n*/\r\n\r\nif (!defined('INSIDE')) die();\r\n \$a_lang_array = array(\r\n"); foreach($lang_new as $string_name => $string_value) { adm_lng_write_string($string_name, $string_value); } fwrite($file_handler, ");\r\n"); fclose($file_handler); } sys_redirect("admin_locale.php?domain={$domain}"); } foreach($languages_info as $lang_id => $lang_data) { $template->assign_block_vars('language', $lang_data); $full_filename = SN_ROOT_PHYSICAL . "language/{$lang_id}/{$domain}.mo.php"; $languages[$lang_id] = adm_lng_load($full_filename . (file_exists($full_filename . '.new') ? '.new' : '')); foreach($languages[$lang_id] as $locale_string_name => $cork) { adm_lng_assign_string($lang_id, "[{$locale_string_name}]", $languages[$lang_id][$locale_string_name]); } } foreach($locale_string_template as $locale_string_name => $locale_string_list) { $template->assign_block_vars('string', array( 'NAME' => $locale_string_name, )); foreach($languages_info as $lang_id => $cork2) { $template->assign_block_vars('string.locale', array( 'LANG' => $lang_id, 'VALUE' => $locale_string_list["[{$lang_id}]"], )); } } $template->assign_vars(array( 'DOMAIN' => $domain, )); } else { $path = SN_ROOT_PHYSICAL . "language/"; $dir = dir($path); while (false !== ($lang_id = $dir->read())) { $full_path = $path . $lang_id; if($lang_id[0] != "." && is_dir($full_path)) { $lang_file_list = dir($full_path); while (false !== ($filename = $lang_file_list->read())) { $lang_domain = strtolower(substr($filename, 0, strpos($filename, '.'))); if(!$lang_domain) { continue; } $file_ext = strtolower(substr($filename, strpos($filename, '.'))); if($lang_domain != 'language') { if($file_ext == '.mo.php.new' || ($file_ext == '.mo.php' && empty($languages[$lang_id][$lang_domain]))) { $language_domains[$lang_domain] = $lang_domain; $languages[$lang_id][$lang_domain] = $lang_domain; } } } } } $dir->close(); foreach($language_domains as $lang_domain) { $template->assign_block_vars('domain', array( 'NAME' => $lang_domain, )); } } SnTemplate::display($template, $lang['adm_lng_title']); ================================================ FILE: admin/admin_user_activity.php ================================================ assign_recursive($template_result); SnTemplate::display($template, "Активность игрока [{$userId}] {$template_result['USER_NAME']}"); function visualize($userId) { global $template_result; $activityPeriod = PERIOD_HOUR * 1; // $activityPeriod = PERIOD_MINUTE_10; $userIdSafe = round(floatval($userId)); $iter = SN::$gc->db->selectIterator( "SELECT c.visit_time, c.visit_length, c.counter_id FROM `{{counter}}` as c where user_id={$userIdSafe} AND visit_time > '2018-01-01' order by visit_time desc;" ); $user = SN::$db->doQueryAndFetch("SELECT `username` FROM `{{users}}` WHERE `id` = {$userIdSafe}"); $template_result += [ 'RECORDS' => count($iter), 'USER_ID' => $userId, 'USER_NAME' => $user['username'], ]; if (!count($iter)) { return; } $from = null; $to = null; $perHour = []; foreach ($iter as $record) { empty($to) ? $to = $record['visit_time'] : false; $from = $record['visit_time']; $time = strtotime($record['visit_time']); $hourStart = floor($time / $activityPeriod) * $activityPeriod; $length = $record['visit_length']; $length == 0 ? $length = 1 : false; do { $leftOfThisHour = $hourStart + $activityPeriod - $time; if ($length < $leftOfThisHour) { $spendOnThisHour = $length; $length = 0; } else { $spendOnThisHour = $leftOfThisHour; $length -= $leftOfThisHour; } $perHour[$hourStart] += $spendOnThisHour; $hourStart += $activityPeriod; } while ($length > 0); } $template_result += [ 'PERIOD' => $activityPeriod, 'DATE_FROM' => $from, 'DATE_TO' => $to, ]; ksort($perHour); end($perHour); $lastHour = key($perHour); reset($perHour); $firstHour = key($perHour); $thisHour = $firstHour; do { if (empty($perHour[$thisHour])) { $perHour[$thisHour] = 0; } $thisHour += $activityPeriod; } while ($thisHour < $lastHour); krsort($perHour); end($perHour); $lastHour = key($perHour); $dayOpened = null; $toTemplate = []; foreach ($perHour as $hour => $length) { $openDay = false; $closeDay = false; if (!$dayOpened) { $openDay = true; $dayOpened = 1; } if ($dayOpened && (date('H', $hour) == 0 || $hour == $lastHour)) { $closeDay = true; $dayOpened = 0; } $lengthPercent = $length / $activityPeriod * 100; $toTemplate[] = [ 'TIME' => date(FMT_TIME, $hour), 'LENGTH' => $length, 'LENGTH_PERCENT' => $lengthPercent > 100 ? 100 : $lengthPercent, 'MINUTES' => round($length / PERIOD_MINUTE, 1), // unused? 'TIME_CLASS' => $length ? 'present' : 'none', 'OPEN_DAY' => $openDay, 'CLOSE_DAY' => $closeDay, 'DATE' => date(FMT_DATE, $hour), 'DAY_CLASS' => in_array(date('w', $hour), [0, 6]) ? 'weekend' : '', ]; $template_result['.']['hourly'] = $toTemplate; } } ================================================ FILE: admin/ajax_maintenance.php ================================================ admin_http_key) || empty($_GET['admin_http_key']) || $_GET['admin_http_key'] != $config->admin_http_key) ) { SnTemplate::messageBox($lang['sys_noalloaw'], $lang['sys_noaccess']); die(); } // If we have already passed here through admin_http_key - then we can safely assume that it's admin if(empty($user['authlevel'])) { $user['authlevel'] = 3; } define('IN_AJAX', true); lng_include('admin'); $totaltime = microtime(true); $pack_until = date("Y-m-01 00:00:00", SN_TIME_NOW - PERIOD_MONTH * 3); // [#] info_best_battles 1b0 $best_reports = array(); if(defined('MODULE_INFO_BEST_BATTLES_QUERY')) { $query = doquery(MODULE_INFO_BEST_BATTLES_QUERY); while($row = db_fetch($query)) { $best_reports[] = $row['ube_report_id']; } } $best_reports = !empty($best_reports) ? ' AND ube_report_id NOT IN (' . implode(',', $best_reports) . ')' : ''; $ques = array( // 'DELETE {{users}}.* FROM {{users}} WHERE `user_as_ally` IS NULL and `onlinetime` < unix_timestamp(now()) - ( 60 * 60 * 24 * 45) and metamatter_total <= 0;', // Выводим из отпуска игроков, которые находятся там более 4 недель // 'UPDATE {{users}} // SET vacation = 0, vacation_next = 0 // WHERE // authlevel = 0 AND user_as_ally IS NULL AND user_bot = ' . USER_BOT_PLAYER . ' /* Не админы, Не Альянсы, Не боты */ // AND vacation > 0 AND banaday = 0 /* В отпуске и не в бане */ // AND vacation < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 4 WEEK)) /* Находящиеся в отпуске более 4 недель */;', // // Игроки удаляются по Регламенту // 'DELETE FROM `{{users}}` WHERE // authlevel = 0 AND user_as_ally IS NULL AND user_bot = ' . USER_BOT_PLAYER . ' AND metamatter_total = 0 AND /* Не админы, Не Альянсы, Не боты, Не Бессмертные*/ // metamatter = 0 AND /* Нету ММ */ // vacation = 0 AND banaday = 0 AND /* Не в отпуске, Не в бане */ // ( // (onlinetime - register_time < 5 * 60 AND UNIX_TIMESTAMP() - onlinetime > 2*7 *86400) // OR (onlinetime - register_time < 30 * 60 AND UNIX_TIMESTAMP() - onlinetime > 4*7 *86400) // OR (onlinetime - register_time < 10 * 60*60 AND UNIX_TIMESTAMP() - onlinetime > 6*7 *86400) // OR (UNIX_TIMESTAMP() - onlinetime > 8*7 *86400) // );', // Игроки, которые не были активны более 4 недель становятся I-шками. Для них // Отключаем получение писем // 'UPDATE {{users}} // SET OPTIONS = "" // WHERE // authlevel = 0 AND user_as_ally IS NULL AND user_bot = ' . USER_BOT_PLAYER . ' AND vacation = 0 /* Не админы, Не Альянсы, Не боты, Не в отпуске */ // AND onlinetime < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 4 WEEK)) /* Не выходившие в онлайн более 4 недель */;', // // Отключаем производство на планетах // 'UPDATE {{users}} AS u // JOIN {{planets}} AS p ON p.id_owner = u.id // SET // metal_perhour = 0, // crystal_perhour = 0, // deuterium_perhour = 0, // metal_mine_porcent = 0, // crystal_mine_porcent = 0, // deuterium_sintetizer_porcent = 0, // solar_plant_porcent = 0, // fusion_plant_porcent = 0, // solar_satelit_porcent = 0, // ship_sattelite_sloth_porcent = 0 // WHERE // authlevel = 0 AND user_as_ally IS NULL AND user_bot = ' . USER_BOT_PLAYER . ' AND vacation = 0 /* Не админы, Не Альянсы, Не боты, Не в отпуске */ // AND onlinetime < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 4 WEEK)) /* Не выходившие в онлайн более 4 недель */;', // Удаляем все здания из очереди // 'DELETE q FROM {{users}} AS u JOIN {{que}} AS q ON q.que_player_id = u.id // WHERE // authlevel = 0 AND user_as_ally IS NULL AND user_bot = ' . USER_BOT_PLAYER . ' AND vacation = 0 /* Не админы, Не Альянсы, Не боты, Не в отпуске */ // AND onlinetime < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 4 WEEK)) /* Не выходившие в онлайн более 4 недель */;', // Возвращаем все флоты ??? // Пока не будем делать запрос - за 4 недели всяко все флоты должны вернутся... // TODO I-шки - неделя на разграбление - или сколько там стата хранится... // Удаляем планеты без пользователей 'DELETE FROM `{{planets}}` WHERE `id_owner` not in (select id from `{{users}}`) AND id_owner <> 0;', // TODO NO FK Переписать на джоине // Удаляем юниты без планет 'DELETE un FROM `{{unit}}` AS un LEFT JOIN `{{planets}}` AS pl ON pl.id = un.unit_location_id WHERE unit_location_type = ' . LOC_PLANET . ' AND pl.id IS NULL;', // Удаляем пустые юниты с 0 уровнем (кроме Капитана) - TODO - перенести в модуль, если нужно! // 'DELETE FROM {{unit}} WHERE unit_location_type = ' . LOC_PLANET . ' AND unit_level = 0 AND unit_type <> ' . UNIT_CAPTAIN, // Удаляем очереди на ничьих планетах 'DELETE q FROM `{{que}}` AS q LEFT JOIN `{{planets}}` AS p ON p.id = q.que_planet_id WHERE que_type IN (' . QUE_STRUCTURES . ', ' . QUE_HANGAR . ', ' . SUBQUE_FLEET . ', ' . SUBQUE_DEFENSE . ') AND (p.id_owner = 0 OR p.id_owner IS NULL);', // Удаляем пустые САБы 'DELETE FROM `{{aks}}` WHERE `id` NOT IN (SELECT DISTINCT `fleet_group` FROM `{{fleets}}`);', // TODO Переписать на джоине // UBE reports "DELETE FROM `{{ube_report}}` WHERE `ube_report_time_combat` < DATE_SUB(NOW(), INTERVAL 60 DAY) {$best_reports};", // TODO Настройка // Чистка сообщений - ВРЕМЕННО ОТКЛЮЧЕНО // 'DELETE FROM `{{messages}}` WHERE `message_owner` not in (select id from {{users}});', // TODO NO FK // Удаляются сообщения, старше 4 недель, кроме личных и Альянсовских 'DELETE FROM `{{messages}}` WHERE UNIX_TIMESTAMP() - message_time > 4*7 * 24 * 60 * 60 AND message_type NOT IN (' . MSG_TYPE_PLAYER . ', ' . MSG_TYPE_ALLIANCE . ', ' . MSG_TYPE_ADMIN . ');', // Удаляются сообщения у пользователей, которые неактивны больше 4 недель - кроме личных и Альянсовских 'DELETE m FROM `{{users}}` AS u JOIN `{{messages}}` AS m ON m.message_owner = u.id WHERE message_type NOT IN (' . MSG_TYPE_PLAYER . ', ' . MSG_TYPE_ALLIANCE . ') AND authlevel = 0 AND user_as_ally IS NULL AND /* Не админы, Не Альянсы */ UNIX_TIMESTAMP() - onlinetime > 4*7 *86400;', 'DELETE FROM `{{chat}}` WHERE timestamp < unix_timestamp(now()) - (60 * 60 * 24 * 14);', // Recalculate Alliance members "UPDATE `{{alliance}}` as a LEFT JOIN (SELECT ally_id, count(*) as ally_memeber_count FROM `{{users}}` WHERE ally_id IS NOT NULL GROUP BY ally_id) as u ON u.ally_id = a.id SET a.`ally_members` = u.ally_memeber_count;", // Deleting empty Alliances - ВРЕМЕННО ОТКЛЮЧЕНО // 'DELETE FROM {{alliance}} WHERE id not in (select ally_id from {{users}} WHERE `user_as_ally` IS NOT NULL group by ally_id);', // 'DELETE FROM {{alliance}} WHERE ally_members <= 0;', "UPDATE `{{users}}` SET ally_id = null, ally_name = null, ally_tag = null, ally_register_time = 0, ally_rank_id = 0 WHERE ally_id not in (select id from `{{alliance}}`);", // Пакуем данные по логу ТМ array( "INSERT INTO {{log_dark_matter}} (log_dark_matter_timestamp, log_dark_matter_username, log_dark_matter_reason, log_dark_matter_amount, log_dark_matter_comment, log_dark_matter_page, log_dark_matter_sender) SELECT '{$pack_until}', IF(u.username IS NULL, ldm.log_dark_matter_username, u.username), " . RPG_CUMULATIVE . ", sum(ldm.log_dark_matter_amount), 'Баланс на {$pack_until}', 'admin/ajax_maintenance.php', ldm.log_dark_matter_sender FROM {{log_dark_matter}} AS ldm LEFT JOIN {{users}} AS u ON u.id = ldm.log_dark_matter_sender WHERE ldm.log_dark_matter_timestamp < '{$pack_until}' GROUP BY log_dark_matter_sender;", "DELETE FROM `{{log_dark_matter}}` WHERE log_dark_matter_timestamp < '{$pack_until}';", ), // Пакуем статистические данные по онлайну пользователей array( "REPLACE INTO `{{log_users_online}}` (online_timestamp, online_count, online_aggregated) SELECT FROM_UNIXTIME((UNIX_TIMESTAMP(online_timestamp) DIV " . PERIOD_MINUTE_10 . ") * (" . PERIOD_MINUTE_10 . ")), ceil(avg(online_count)), " . LOG_ONLIINE_AGGREGATE_PERIOD_MINUTE_10 . " FROM `{{log_users_online}}` WHERE online_timestamp < '{$pack_until}' AND online_aggregated = " . LOG_ONLIINE_AGGREGATE_NONE . " GROUP BY (UNIX_TIMESTAMP(online_timestamp) DIV " . PERIOD_MINUTE_10 . ") * (" . PERIOD_MINUTE_10 . ");", "DELETE FROM `{{log_users_online}}` WHERE online_timestamp < '{$pack_until}' AND online_aggregated = " . LOG_ONLIINE_AGGREGATE_NONE, ), // Удаляем старые записи из логов "DELETE FROM `{{logs}}` WHERE log_timestamp < '{$pack_until}';", // Удаляем записи о маинтенансе, апдейте и пересчете статистики более чем недельной давности - они нам уже не нужны 'DELETE FROM `{{logs}}` WHERE `log_code` IN (' . LOG_INFO_DB_CHANGE . ', ' . LOG_INFO_MAINTENANCE . ', ' . LOG_INFO_STAT_START . ', ' . LOG_INFO_STAT_PROCESS . ', ' . LOG_INFO_STAT_FINISH . ') AND `log_timestamp` < DATE_SUB(NOW(),INTERVAL 7 DAY);', // Удаляем вхождения игроков, на которые никто не ссылается "DELETE spe FROM `{{security_player_entry}}` AS spe LEFT JOIN `{{counter}}` AS c ON c.player_entry_id = spe.id WHERE c.counter_id IS NULL;", // Удаляем устройства, на которые никто не ссылается "DELETE sd FROM `{{security_device}}` AS sd LEFT JOIN `{{security_player_entry}}` AS spe ON spe.device_id = sd.device_id WHERE spe.id IS NULL;", // Удаляем браузеры, на которые никто не ссылается "DELETE sb FROM `{{security_browser}}` AS sb LEFT JOIN `{{security_player_entry}}` AS spe ON spe.browser_id = sb.browser_id WHERE spe.id IS NULL;", // Удаляем строки запросов, на которые никто не ссылается "DELETE sqs FROM `{{security_query_strings}}` AS sqs LEFT JOIN `{{counter}}` AS c ON c.query_string_id = sqs.id WHERE c.counter_id IS NULL;", // Удаляем УРЛы, на которые никто не ссылается "DELETE su FROM `{{security_url}}` AS su LEFT JOIN `{{counter}}` AS c ON c.page_url_id = su.url_id WHERE c.counter_id IS NULL;", // "INSERT INTO {{counter}} SET // `page_url_id` = {$this->page_address_id}, // Удаляем записи визитов без пользователей // 'DELETE FROM `{{counter}}` WHERE `user_id` NOT IN (SELECT `id` FROM `{{users}}`);', ); function sn_maintenance_pack_user_list($user_list) { $user_list = explode(',', $user_list); foreach($user_list as $key => $user_id) { if(!is_numeric($user_id)) { unset($user_list[$key]); } } $result = array(); if(!empty($user_list)) { $query = doquery("SELECT `id` FROM `{{users}}` WHERE `id` in (" . implode(',', $user_list) . ")"); while($row = db_fetch($query)) { $result[] = $row['id']; } } return implode(',', $result); } global $config, $debug, $lang; db_mysql::db_transaction_start(); $old_server_status = SN::$config->pass()->game_disable; $old_server_status == GAME_DISABLE_NONE ? SN::$config->pass()->game_disable = GAME_DISABLE_MAINTENANCE : false; db_mysql::db_transaction_commit(); foreach($ques as $que_transaction) { db_mysql::db_transaction_start(); !is_array($que_transaction) ? $que_transaction = array($que_transaction) : false; foreach($que_transaction as $que) { set_time_limit(120); $QryResult = doquery($que); //$msg .= '
' . $que . '
'; $que = str_replace(array('{{', '}}'), '', $que); //$que = str_replace('{{', '', $que); //$que = str_replace('}}', '', $que); $msg .= '
  • ' . htmlspecialchars($que) . ' --- OK' : 'error">FAILED!') . ' ' . SN::$db->db_affected_rows() . ' ' . $lang['adm_records'] . "
  • "; $debug->warning($que . ' --- ' . ($QryResult ? 'OK' : 'FAILED!') . ' ' . SN::$db->db_affected_rows() . ' ' . $lang['adm_records'], 'System maintenance', LOG_INFO_MAINTENANCE); } db_mysql::db_transaction_commit(); } db_mysql::db_transaction_start(); SN::$config->pass()->stats_hide_player_list = sn_maintenance_pack_user_list(SN::$config->pass()->stats_hide_player_list); $debug->warning('Упакован stats_hide_player_list', 'System maintenance', LOG_INFO_MAINTENANCE); db_mysql::db_transaction_commit(); db_mysql::db_transaction_start(); SN::$config->db_saveItem('game_watchlist', sn_maintenance_pack_user_list(SN::$config->pass()->game_watchlist)); $debug->warning('Упакован game_watchlist', 'System maintenance', LOG_INFO_MAINTENANCE); db_mysql::db_transaction_commit(); SN::$config->db_saveItem('users_amount', db_user_count()); SN::$config->db_saveItem('game_disable', $old_server_status); $_GET['admin_update'] = 1; include_once('../scheduler.php'); $totaltime = microtime(true) - $totaltime; $result = $result ? "
  • {$lang['adm_stat_title']} - {$result}
  • " : ''; $result = '
    '; echo json_encode($result . ' ' . $totaltime); ================================================ FILE: admin/banned.php ================================================ assign_vars(array( 'name' => $name_output, 'mode' => $mode, )); SnTemplate::display($parsetemplate, $lang['adm_ban_title']); ================================================ FILE: admin/includes/admin_planet_edit.inc.php ================================================ $lang['tech'][UNIT_STRUCTURES], 'fleet' => $lang['tech'][UNIT_SHIPS], 'defense' => $lang['tech'][UNIT_DEFENCE], 'resources_loot' => $lang['tech'][UNIT_RESOURCES], )); $mode = sys_get_param_str('mode'); $admin_planet_edit_mode_list_keys = array_keys($admin_planet_edit_mode_list); $mode = in_array($mode, $admin_planet_edit_mode_list_keys) ? $mode : $admin_planet_edit_mode_list_keys[0]; return $mode; } function admin_planet_edit_template(&$template, $edit_planet_row, $mode){return sn_function_call('admin_planet_edit_template', array(&$template, $edit_planet_row, $mode));} /** * @param template $template * @param $edit_planet_row * @param $mode */ function sn_admin_planet_edit_template(&$template, $edit_planet_row, $mode) { global $lang; $unit_list = sn_get_groups($mode); if(empty($unit_list)) { return; } $name_list = $lang['tech']; foreach($unit_list as $unit_id) { $template->assign_block_vars('unit', array( 'ID' => $unit_id, 'NAME' => $name_list[$unit_id], 'TEXT' => HelperString::numberFloorAndFormat(mrc_get_level($user, $edit_planet_row, $unit_id, false, true)), 'VALUE' => '', )); } } function admin_planet_edit_query_string($unit_id, $unit_amount, $mode){return sn_function_call('admin_planet_edit_query_string', array($unit_id, $unit_amount, $mode));} function sn_admin_planet_edit_query_string($unit_id, $unit_amount, $mode) { if($unit_amount && in_array($unit_id, sn_get_groups($mode))) { $unit_amount = round($unit_amount); $unit_name = get_unit_param($unit_id, P_NAME); $result = "{$unit_name} = GREATEST(0, {$unit_name} + ({$unit_amount}))"; } else { $result = ''; } return $result; } ================================================ FILE: admin/index.html ================================================ ================================================ FILE: admin/maintenance.php ================================================ $(document).ready(function() { $.post("admin/ajax_maintenance.php", function(result) { $("#admin_message").html(result); }, "json" ); }); '; SnTemplate::messageBoxAdmin($script . '
    ' . $lang['sys_wait'], $lang['adm_maintenance_title']); ================================================ FILE: admin/overview.php ================================================ assign_block_vars('error', array( 'TEXT' => $error, )); } } else { db_mysql::db_transaction_start(); SN::$gc->db->lockRecords([ 'users' => [$owner['id'],], 'planets' => [$planet['id'], $destination['id'], !empty($moon['id']) ? $moon['id'] : 0], ]); $planet = sys_o_get_updated($owner['id'], $planet['id'], SN_TIME_NOW); $que = $planet['que']; $planet = $planet['planet']; $destination = sys_o_get_updated($owner['id'], $destination['id'], SN_TIME_NOW); $destination = $destination['planet']; $template->assign_var('CHECK', 1); $final_cost = killer_add_planet($planet); if (!empty($moon)) { $moon = sys_o_get_updated($owner['id'], $moon['id'], SN_TIME_NOW); $moon = $moon['planet']; $final_cost = killer_add_planet($moon, $final_cost); } foreach (sn_get_groups('resources_loot') as $resource_id) { $resource_name = pname_resource_name($resource_id); $template->assign_var("{$resource_name}_cost", $final_cost[$resource_id]); $final_cost[$resource_id] = floor($final_cost[$resource_id] * $bonus); $template->assign_var("{$resource_name}_bonus", $final_cost[$resource_id]); } if ($_GET['btn_confirm']) { $time = SN_TIME_NOW + PERIOD_DAY; DBStaticUnit::db_unit_list_delete($planet['id_owner'], LOC_PLANET, $planet['id']); DBStaticPlanet::db_planet_set_by_id($planet['id'], "id_owner = 0, destruyed = {$time}"); if (!empty($moon)) { DBStaticUnit::db_unit_list_delete($planet['id_owner'], LOC_PLANET, $moon['id']); DBStaticPlanet::db_planet_set_by_id($moon['id'], "id_owner = 0, destruyed = {$time}"); } DBStaticPlanet::db_planet_set_by_id($destination['id'], "metal = metal + '{$final_cost[RES_METAL]}', crystal = crystal + '{$final_cost[RES_CRYSTAL]}', deuterium = deuterium + '{$final_cost[RES_DEUTERIUM]}'"); $template->assign_var('CHECK', 2); } db_mysql::db_transaction_commit(); } } $template->assign_vars(array( 'galaxy_src' => $galaxy_src, 'system_src' => $system_src, 'planet_src' => $planet_src, 'galaxy_dst' => $galaxy_dst, 'system_dst' => $system_dst, 'planet_dst' => $planet_dst, 'bonus' => $bonus, 'username' => $username, )); SnTemplate::display($template, $lang['adm_pl_comp_title']); /** * @param array $planet * @param array $final_cost * * @return array|mixed */ function killer_add_planet($planet, $final_cost = []) { $sn_group_resources_loot = sn_get_groups('resources_loot'); // Adding structures cost foreach (sn_get_groups('structures') as $unit_id) { $build_level = mrc_get_level($user, $planet, $unit_id, true, true); if ($build_level > 0) { $unit_cost = get_unit_param($unit_id, 'cost'); $build_factor = $unit_cost['factor'] != 1 ? (1 - pow($unit_cost['factor'], $build_level)) / (1 - $unit_cost['factor']) : $unit_cost['factor']; foreach ($sn_group_resources_loot as $resource_id) { $final_cost[$resource_id] += isset($unit_cost[$resource_id]) && $unit_cost[$resource_id] > 0 ? floor($unit_cost[$resource_id] * $build_factor) : 0; } } } // Adding fleet and defense cost foreach (sn_get_groups(array('defense', 'fleet')) as $unit_id) { $unit_count = mrc_get_level($user, $planet, $unit_id, true, true); if ($unit_count > 0) { $unit_cost = get_unit_param($unit_id, 'cost'); foreach ($sn_group_resources_loot as $resource_id) { $final_cost[$resource_id] += isset($unit_cost[$resource_id]) && $unit_cost[$resource_id] > 0 ? floor($unit_cost[$resource_id] * $unit_count) : 0; } } } // Adding plain resources foreach ($sn_group_resources_loot as $resource_id) { $final_cost[$resource_id] += floor(mrc_get_level($user, $planet, $resource_id, true, true)); } return $final_cost; } ================================================ FILE: admin/planet_edit.php ================================================ $mode_locale) { $template->assign_block_vars('page_menu', array( 'ID' => $page_mode, 'TEXT' => $mode_locale, )); } $template->assign_vars(array( 'MODE' => $mode, 'PLANET_ID' => $planet_id, 'PLANET_NAME' => empty($edit_planet_row) ? '' : $lang['sys_planet_type'][$edit_planet_row['planet_type']] . ' ' . uni_render_planet($edit_planet_row), 'PAGE_HINT' => $lang['adm_planet_edit_hint'], )); SnTemplate::display($template, $lang['adm_am_ttle']); /** * @param $planet_id * @param array $unit_list * @param $mode */ function planet_edit_model($planet_id, array $unit_list, $mode) { $thePlanet = DBStaticPlanet::db_planet_by_id($planet_id); $theUserId = $thePlanet['id_owner']; $thePlayer = RecordPlayer::findRecordById($theUserId); $query_string = []; foreach ($unit_list as $unit_id => $unit_amount) { if ($mode === 'resources_loot') { if (!floatval($unit_amount)) { continue; } if ($unit_query_string = admin_planet_edit_query_string($unit_id, $unit_amount, $mode)) { $query_string[] = $unit_query_string; } } elseif (in_array($mode, [UNIT_SHIPS_STR, UNIT_STRUCTURES_STR, UNIT_DEFENCE_STR,]) ) { if (!floatval($unit_amount)) { continue; } $currentAmount = mrc_get_level($thePlayer, $thePlanet, $unit_id); $newAmount = $currentAmount + $unit_amount; if ($newAmount <= 0) { DBStaticUnit::db_unit_list_delete($theUserId, LOC_PLANET, $planet_id, $unit_id); } else { DBStaticUnit::dbChangeUnit($theUserId, $planet_id, $unit_id, $unit_amount); DBStaticUnit::cache_clear(); } } } if (!empty($query_string)) { DBStaticPlanet::db_planet_set_by_id($planet_id, implode(', ', $query_string)); } } ================================================ FILE: admin/settings.php ================================================ game_name = sys_get_param_str_unsafe('game_name'); SN::$config->game_mode = sys_get_param_int('game_mode'); SN::$config->game_speed = sys_get_param_float('game_speed', 1); SN::$config->fleet_speed = sys_get_param_float('fleet_speed', 1); SN::$config->resource_multiplier = sys_get_param_float('resource_multiplier', 1); SN::$config->user_vacation_disable = sys_get_param_int('user_vacation_disable', 0); SN::$config->url_faq = sys_get_param_str_unsafe('url_faq'); SN::$config->url_forum = sys_get_param_str_unsafe('url_forum'); SN::$config->url_rules = sys_get_param_str_unsafe('url_rules'); SN::$config->url_purchase_metamatter = sys_get_param_str_unsafe('url_purchase_metamatter'); SN::$config->game_disable = sys_get_param_int('game_disable'); SN::$config->game_disable_reason = sys_get_param_str_unsafe('game_disable_reason'); SN::$config->server_updater_check_auto = sys_get_param_int('server_updater_check_auto'); SN::$config->game_user_changename = sys_get_param_int('game_user_changename', SN::$config->game_user_changename); SN::$config->game_user_changename_cost = sys_get_param_int('game_user_changename_cost', SN::$config->game_user_changename_cost); SN::$config->eco_scale_storage = sys_get_param_int('eco_scale_storage'); SN::$config->game_default_language = sys_get_param_str_unsafe('game_default_language', DEFAULT_LANG); SN::$config->game_default_skin = sys_get_param_str_unsafe('game_default_skin', DEFAULT_SKINPATH); SN::$config->game_default_template = sys_get_param_str_unsafe('game_default_template', SnTemplate::getServerDefaultTemplateName()); SN::$config->game_maxGalaxy = sys_get_param_int('game_maxGalaxy', 5); SN::$config->game_maxSystem = sys_get_param_int('game_maxSystem', 199); SN::$config->game_maxPlanet = sys_get_param_int('game_maxPlanet', 16); SN::$config->player_max_colonies = sys_get_param_int('player_max_colonies', -1); SN::$config->fleet_bashing_attacks = sys_get_param_int('fleet_bashing_attacks', 3); SN::$config->fleet_bashing_interval = sys_get_param_int('fleet_bashing_interval', 30 * 60); SN::$config->fleet_bashing_scope = sys_get_param_int('fleet_bashing_scope', 24 * 60 * 60); SN::$config->fleet_bashing_war_delay = sys_get_param_int('fleet_bashing_war_delay', 12 * 60 * 60); SN::$config->fleet_bashing_waves = sys_get_param_int('fleet_bashing_waves', 3); SN::$config->allow_buffing = sys_get_param_int('allow_buffing'); SN::$config->ally_help_weak = sys_get_param_int('ally_help_weak'); SN::$config->game_email_pm = sys_get_param_int('game_email_pm'); SN::$config->rpg_exchange_metal = sys_get_param_int('rpg_exchange_metal', 1); SN::$config->rpg_exchange_crystal = sys_get_param_int('rpg_exchange_crystal', 2); SN::$config->rpg_exchange_deuterium = sys_get_param_int('rpg_exchange_deuterium', 4); SN::$config->rpg_exchange_darkMatter = sys_get_param_int('rpg_exchange_darkMatter', 400); SN::$config->tpl_minifier = sys_get_param_int('tpl_minifier', 0); SN::$config->initial_fields = sys_get_param_int('initial_fields', 200); SN::$config->eco_planet_starting_metal = sys_get_param_float('eco_planet_starting_metal', 500); SN::$config->eco_planet_starting_crystal = sys_get_param_float('eco_planet_starting_crystal', 500); SN::$config->eco_planet_starting_deuterium = sys_get_param_float('eco_planet_starting_deuterium', 0); SN::$config->metal_basic_income = sys_get_param_float('metal_basic_income', 40); SN::$config->crystal_basic_income = sys_get_param_float('crystal_basic_income', 20); SN::$config->deuterium_basic_income = sys_get_param_float('deuterium_basic_income', 10); SN::$config->energy_basic_income = sys_get_param_float('energy_basic_income', 0); SN::$config->eco_planet_storage_metal = sys_get_param_float('eco_planet_storage_metal', BASE_STORAGE_SIZE); SN::$config->eco_planet_storage_crystal = sys_get_param_float('eco_planet_storage_crystal', BASE_STORAGE_SIZE); SN::$config->eco_planet_storage_deuterium = sys_get_param_float('eco_planet_storage_deuterium', BASE_STORAGE_SIZE); SN::$config->chat_timeout = sys_get_param_int('chat_timeout', 5); SN::$config->game_news_overview = sys_get_param_int('game_news_overview', 5); SN::$config->advGoogleLeftMenuIsOn = sys_get_param_int('advGoogleLeftMenuIsOn'); SN::$config->advGoogleLeftMenuCode = sys_get_param('advGoogleLeftMenuCode'); SN::$config->debug = sys_get_param_int('debug'); SN::$config->game_counter = sys_get_param_int('game_counter'); SN::$config->geoip_whois_url = sys_get_param_str('geoip_whois_url'); SN::$config->uni_price_galaxy = sys_get_param_float('uni_price_galaxy'); SN::$config->uni_price_system = sys_get_param_float('uni_price_system'); SN::$config->user_birthday_gift = sys_get_param_float('user_birthday_gift'); SN::$config->user_birthday_range = sys_get_param_int('user_birthday_range'); SN::$config->stats_hide_admins = sys_get_param_int('stats_hide_admins'); SN::$config->stats_hide_player_list = sys_get_param_str('stats_hide_player_list'); SN::$config->stats_hide_pm_link = sys_get_param_int('stats_hide_pm_link'); SN::$config->stats_schedule = sys_get_param_str('stats_schedule'); SN::$config->empire_mercenary_base_period = sys_get_param_int('empire_mercenary_base_period'); if(SN::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) { if(SN::$config->empire_mercenary_temporary) { DBStaticUnit::db_unit_list_admin_delete_mercenaries_finished(); } else { DBStaticUnit::db_unit_list_admin_set_mercenaries_expire_time(SN::$config->empire_mercenary_base_period); } SN::$config->empire_mercenary_temporary = sys_get_param_int('empire_mercenary_temporary'); } SN::$config->db_saveAll(); $template->assign_var('MESSAGE', $lang['adm_opt_saved']); } $template->assign_vars([ 'ALLOW_BUFFING' => SN::$config->allow_buffing, 'ALLY_HELP_WEAK' => SN::$config->ally_help_weak, 'GAME_EMAIL_PM' => SN::$config->game_email_pm, 'game_mode' => SN::$config->game_mode, 'game_language' => SN::$config->game_default_language, 'ECO_SCALE_STORAGE' => SN::$config->eco_scale_storage, 'USER_VACATION_DISABLE' => SN::$config->user_vacation_disable, 'ADV_LEFT_MENU' => SN::$config->advGoogleLeftMenuIsOn, 'GAME_DISABLE' => SN::$config->game_disable, 'GAME_DEBUG' => SN::$config->debug, 'GAME_COUNTER' => SN::$config->game_counter, 'TPL_MINIFIER' => SN::$config->tpl_minifier, 'EMPIRE_MERCENARY_TEMPORARY' => SN::$config->empire_mercenary_temporary, 'SERVER_UPDATE_CHECK_AUTO' => SN::$config->server_updater_check_auto, 'CHECK_DATE' => SN::$config->server_updater_check_last ? date(FMT_DATE_TIME, SN::$config->server_updater_check_last) : 0, 'CHECK_RESULT' => isset($lang['adm_opt_ver_response'][SN::$config->server_updater_check_result]) ? $lang['adm_opt_ver_response'][SN::$config->server_updater_check_result] : $lang['adm_opt_ver_response'][SNC_VER_UNKNOWN_RESPONSE], 'CHECK_CLASS' => isset($sn_version_check_class[SN::$config->server_updater_check_result]) ? $sn_version_check_class[SN::$config->server_updater_check_result] : $sn_version_check_class[SNC_VER_UNKNOWN_RESPONSE], 'SERVER_UPDATE_ID' => SN::$config->server_updater_id, 'SERVER_UPDATE_KEY' => SN::$config->server_updater_key, 'STATS_HIDE_ADMINS' => SN::$config->stats_hide_admins, 'STATS_HIDE_PM_LINK' => SN::$config->stats_hide_pm_link, 'GAME_CHANGE_NAME' => SN::$config->game_user_changename, 'GAME_CHANGE_NAME_COST' => SN::$config->game_user_changename_cost, ]); SnTemplate::tpl_assign_select($template, 'change_name_options', SN::$lang['adm_opt_player_change_name_options']); SnTemplate::tpl_assign_select($template, 'sys_game_disable_reason', SN::$lang['sys_game_disable_reason'], 'ID', 'NAME'); SnTemplate::tpl_assign_select($template, 'game_modes', SN::$lang['sys_game_mode'], 'ID', 'NAME'); SnTemplate::tpl_assign_select($template, 'ver_response', SN::$lang['adm_opt_ver_response'], 'ID', 'NAME'); $lang_list = lng_get_list(); foreach($lang_list as $lang_id => $lang_data) { $template->assign_block_vars('game_languages', array( 'ID' => $lang_id, 'NAME' => "{$lang_data['LANG_NAME_NATIVE']} ({$lang_data['LANG_NAME_ENGLISH']})", )); } SnTemplate::display($template, $lang['adm_opt_title']); ================================================ FILE: admin/statbuilder.php ================================================ = SN::$config->pass()->var_stat_update_admin_forced && SN_TIME_NOW >= SN::$config->pass()->var_stat_update_end) { SN::$config->pass()->var_stat_update_admin_forced = SN_TIME_NOW + 120; $script = ''; SnTemplate::messageBoxAdmin("{$script}
    {$lang['sys_wait']}", $lang['adm_stat_title'], '', 0); } else { SnTemplate::messageBoxAdmin($lang['adm_stat_already_started'], $lang['adm_stat_title'], 'admin/overview.php'); } // require_once('../scheduler.php'); ================================================ FILE: admin/sxd/.htaccess ================================================ order allow,deny deny from all order allow,deny deny from all order allow,deny deny from all order allow,deny deny from all ================================================ FILE: admin/sxd/backup/.htaccess ================================================ AddType application/octetstream .gz .bz2 .sql order allow,deny deny from all ================================================ FILE: admin/sxd/backup/index.htm ================================================ ================================================ FILE: admin/sxd/bsd_license.txt ================================================ Copyright (c) 2003-2009, zapimir portions copyright (c) 2005-2009 Binovator All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Sypex nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: admin/sxd/img/index.htm ================================================ ================================================ FILE: admin/sxd/index.php ================================================ init(!empty($argc) && $argc > 1 ? $argv : false); class Sypex_Dumper { function Sypex_Dumper() { define('C_DEFAULT', 1); define('C_RESULT', 2); define('C_ERROR', 3); define('C_WARNING', 4); define('SXD_DEBUG', false); define('TIMER', array_sum(explode(' ', microtime()))); define('V_SXD', 20011); define('V_PHP', sxd_ver2int(phpversion())); $this->name = 'Sypex Dumper 2.0.11'; } function loadLang($lng_name = 'auto'){ if($lng_name == 'auto'){ include('lang/list.php'); $this->langs = &$langs; $lng = 'en'; if(preg_match_all('/[a-z]{2}(-[a-z]{2})?/', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $m)) { foreach($m[0] AS $l){ if(isset($langs[$l])){ $lng_name = $l; break; } } } } if(file_exists("lang/lng_{$lng_name}.php")) include("lang/lng_{$lng_name}.php"); else include("lang/lng_en.php"); $this->LNG = &$LNG; $this->LNG['name'] = $lng_name; return true; } function init($args = false){ if (get_magic_quotes_gpc()) { $_POST = sxd_antimagic($_POST); } include('cfg.php'); $this->loadLang($CFG['lang']); if (!ini_get('safe_mode') && function_exists('set_time_limit') && strpos(ini_get('disable_functions'), 'set_time_limit') === false) @set_time_limit($CFG['time_web']); elseif (ini_get('max_execution_time') < $CFG['time_web']) $CFG['time_web'] = ini_get('max_execution_time'); $this->CFG = &$CFG; $this->try = false; $this->virtualize = false; $this->cron_mode = false; // Проверяем авторизацию и делаем коннект к базе if(empty($this->CFG['my_user'])){ $this->CFG['my_host'] = 'localhost'; $this->CFG['my_port'] = 3306; $this->CFG['my_user'] = 'root'; $this->CFG['my_pass'] = ''; $this->CFG['my_comp'] = 0; $this->CFG['my_db'] = ''; } if ($args) { // консольный режим foreach($args AS $key => $arg){ if (preg_match("/^-([hupoj])=(.*?)$/", $arg, $m)){ switch ($m[1]) { case 'h': $this->CFG['my_host'] = $m[2]; break; // хост case 'o': $this->CFG['my_port'] = $m[2]; break; // порт case 'u': $this->CFG['my_user'] = $m[2]; break; // логин case 'p': $this->CFG['my_pass'] = $m[2]; break; // пароль case 'j': $this->CFG['sjob'] = $m[2]; break; // job-файл } } } $this->cron_mode = true; set_time_limit($CFG['time_cron']); // Загружаем конфиг файл, если нужно $auth = $this->connect(); if($auth && !empty($this->CFG['sjob'])){ $this->ajax($this->loadJob($this->CFG['sjob'])); echo file_get_contents($this->JOB['file_log']); if(file_exists($this->JOB['file_log'])) unlink($this->JOB['file_log']); if(file_exists($this->JOB['file_rtl'])) unlink($this->JOB['file_rtl']); } else echo 'Auth error'; exit; } elseif(!empty($this->CFG['auth'])){ // Авторизация $auth = false; $sfile = 'ses.php'; if(!empty($_COOKIE['sxd']) && preg_match('/^[\da-f]{32}$/', $_COOKIE['sxd'])){ include($sfile); if(isset($SES[$_COOKIE['sxd']])) { $auth = true; $this->CFG = $SES[$_COOKIE['sxd']]['cfg']; $this->SES = &$SES; $this->loadLang($this->CFG['lang']); } } if(!$auth) { $user = !empty($_POST['user']) ? $_POST['user'] : ''; $pass = !empty($_POST['pass']) ? $_POST['pass'] : ''; $host = !empty($_POST['host']) ? $_POST['host'] : (!empty($this->CFG['my_host']) ? $this->CFG['my_host'] : 'localhost'); $port = !empty($_POST['port']) && is_numeric($_POST['port']) ? $_POST['port'] : 3306; $temp = preg_split('/\s+/', $this->CFG['auth']); if(!empty($_REQUEST['lang']) && preg_match('/^[a-z]{2}(-[a-z]{2})?$/', $_REQUEST['lang'])) {$this->loadLang($_REQUEST['lang']);} foreach($temp AS $a){ switch($a) { case 'cfg': if(empty($user)) {continue;} $auth = !empty($CFG['user']) && isset($CFG['pass']) && $CFG['user']== $user && $CFG['pass'] == $pass; break; case 'mysql': if(empty($user)) {continue;} if($host != 'localhost' && !empty($this->CFG['my_host']) && $this->CFG['my_host'] != $host) {continue;} $auth = $this->connect($host, $port, $user, $pass); break; default: $file = 'auth_' . $a . '.php'; if(!file_exists($file)) continue; include $file; } if($auth) break; } if($auth){ $key = md5(rand(1,100000) . $user . microtime()); $CFG['lang'] = $this->LNG['name']; $_COOKIE['sxd'] = $key; $this->saveCFG(); if(V_PHP > 50200) setcookie('sxd', $key, !empty($_POST['save']) ? time() + 31536000 : 0, '', '', false, true); else setcookie('sxd', $key, !empty($_POST['save']) ? time() + 31536000 : 0, '', '', false); header("Location: ./"); exit; } foreach(array('user', 'pass', 'host', 'port') AS $key){ $_POST[$key] = !empty($_POST[$key]) ? htmlspecialchars($_POST[$key], ENT_NOQUOTES) : ''; } $_POST['save'] = !empty($_POST['save']) ? ' CHECKED' : ''; } if (!$auth) { if(!empty($_POST['ajax'])){ echo "sxd.hideLoading();alert('Session not found');"; exit; } $this->lng_list = '