Skip to content
OGame-like Game Engine
PHP Smarty JavaScript CSS TSQL
Branch: master
Clone or download
Latest commit ce12976 Aug 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
action_logs Remove indentation & file ending inconsistencies Dec 15, 2018
admin Use the helper function to calculate max storage capacities of each r… Aug 22, 2019
ajax Simplify chat.del.php Jul 12, 2019
cache Remove indentation & file ending inconsistencies Dec 15, 2018
class Remove the old smarty code from the repo Jan 15, 2019
config Create new storage for future configs & instance files Feb 14, 2019
css Properly localise and improve UX of sending broadcast messages Jun 25, 2019
dist Compare current resource amount, not the overflow capacity, to the ma… Aug 22, 2019
docs Minor typos fix in docs and README.md Jun 30, 2019
images Move jQuery farbtastic to libs directory Jan 3, 2019
includes Define basic navigating router as getter of available URLs Aug 22, 2019
install Remove unused constant (GAMEURL_REMOTE_TESTSERVERHOST) from "includes… Jul 6, 2019
js Compare current resource amount, not the overflow capacity, to the ma… Aug 22, 2019
language Generate storages capacity-per-level table in infos.php Aug 22, 2019
libs Add en i18n for jquery-ui-datepicker Jun 25, 2019
modules All pages & functions should use mysqli extension Jan 14, 2019
other Remove indentation & file ending inconsistencies Dec 15, 2018
skins Remove indentation & file ending inconsistencies Dec 15, 2018
templates Generate storages capacity-per-level table in infos.php Aug 22, 2019
tmp Change all php opening tags to "<?php" Jul 25, 2013
utils/migrator Remove unused constant (GAMEURL_REMOTE_TESTSERVERHOST) from "includes… Jul 6, 2019
.editorconfig Define .editorconfig Dec 11, 2018
.eslintignore Do not test gulpfile.js Jan 6, 2019
.eslintrc.json Re-enable no-console rule (now NOT recommended in ESLint by default) Jun 30, 2019
.gitignore Move actual rules definitions to a separate file and support custom, … Jun 20, 2019
.stylelintignore Add libs/ to CSS & JS linters ignore Jan 4, 2019
.stylelintrc.json Add and configure CSS files linter (stylelint) with bare minimum rules Dec 31, 2018
.travis.yml Test on Ubuntu Xenial (16.04 LTS) Jan 6, 2019
LICENSE Update LICENSE file (formatting fixes) Jan 6, 2019
OTHERLICENSES Remove the old Recaptcha code from the repo Jan 17, 2019
README.md Minor typos fix in docs and README.md Jun 30, 2019
aboutpro.php Remove indentation & file ending inconsistencies Dec 15, 2018
activate.php All pages & functions should use mysqli extension Jan 14, 2019
ainfo.php Remove indentation & file ending inconsistencies Dec 15, 2018
alliance.php Fix a bug when a new alliance leader could have invalid rank ID Jan 14, 2019
attackslist.php All pages & functions should use mysqli extension Jan 14, 2019
banned.php All pages & functions should use mysqli extension Jan 14, 2019
battlereport.php Remove indentation & file ending inconsistencies Dec 15, 2018
buddy.php All pages & functions should use mysqli extension Jan 14, 2019
buildings.php Remove indentation & file ending inconsistencies Dec 15, 2018
changelog.php Remove indentation & file ending inconsistencies Dec 15, 2018
chat.php Do not use "prettyMonth" formatting in Chat anymore Mar 19, 2019
chat_edit.php All pages & functions should use mysqli extension Jan 14, 2019
common.minimal.php Move the most basic constants to common.minimal.php and unify their n… Jul 3, 2019
common.php Add getUsersCurrentIP() helper function & replace all direct IP getti… Jul 14, 2019
composer.json Create migration helper scripts in composer.json file Feb 19, 2019
composer.lock Update PHP dependencies in lockfile Jun 30, 2019
config.php Uncommit changes to "empty in repo" files Dec 30, 2018
contact.php All pages & functions should use mysqli extension Jan 14, 2019
converter.php Remove indentation & file ending inconsistencies Dec 15, 2018
declaration.php Make sure that some variables are properly initialised as arrays Jan 19, 2019
destroy_rockets.php Remove indentation & file ending inconsistencies Dec 15, 2018
disassembler.php Remove indentation & file ending inconsistencies Dec 15, 2018
email_change.php Remove indentation & file ending inconsistencies Dec 15, 2018
empire.php Make sure that some variables are properly initialised as arrays Jan 19, 2019
fleet.php Use getShipsCurrentSpeed() when we need one ship's speed only Jul 10, 2019
fleet1.php Rename GetGameSpeedFactor() to getUniFleetsSpeedFactor() Jul 11, 2019
fleet2.php Rename GetGameSpeedFactor() to getUniFleetsSpeedFactor() Jul 11, 2019
fleet3.php Rename GetGameSpeedFactor() to getUniFleetsSpeedFactor() Jul 11, 2019
fleetretreat.php Remove indentation & file ending inconsistencies Dec 15, 2018
fleetshortcut.php All pages & functions should use mysqli extension Jan 14, 2019
galacticshop.php Reformat galacticshop.lang file May 5, 2019
galaxy.php Make previously unused InsertGalaxyScripts useful again Mar 6, 2019
generate_sig.php Move uni, user & fleet related helpers to separate files Jul 11, 2019
gulpfile.js Rename script & remove redundant function Jan 4, 2019
index.php Use include_once() to allow repetitive usage Aug 22, 2019
infos.php Remove unused argument Aug 22, 2019
jumpgate.php Move jumpgate's lang data to a separate file May 25, 2019
login.php Add getUsersCurrentIP() helper function & replace all direct IP getti… Jul 14, 2019
logout.php Replace raw access to session cookie key by using helper getter Jul 2, 2019
lostcode.php Fix the "main page" link on the Lost code page Jun 29, 2019
lostpassword.php All pages & functions should use mysqli extension Jan 14, 2019
merchant.php Remove indentation & file ending inconsistencies Dec 15, 2018
messages.php All pages & functions should use mysqli extension Jan 14, 2019
moon_sim.php Remove indentation & file ending inconsistencies Dec 15, 2018
morale_info.php Remove indentation & file ending inconsistencies Dec 15, 2018
notes.php All pages & functions should use mysqli extension Jan 14, 2019
officers.php Officer purchase & stats details should not be part of translation file Mar 18, 2019
overview.php Add getUsersCurrentIP() helper function & replace all direct IP getti… Jul 14, 2019
package-lock.json Bump lodash from 4.17.11 to 4.17.14 Jul 12, 2019
package.json Update terser Jun 30, 2019
phalanx.php All pages & functions should use mysqli extension Jan 14, 2019
phpcs.xml Remove redundant excludes (libs moved to composer) Jan 16, 2019
polls.php All pages & functions should use mysqli extension Jan 14, 2019
profile.php Initialise counters as numbers, not empty strings Jan 19, 2019
records.php All pages & functions should use mysqli extension Jan 14, 2019
redirect.php Remove indentation & file ending inconsistencies Dec 15, 2018
ref_table.php All pages & functions should use mysqli extension Jan 14, 2019
reg_ajax.php Add getUsersCurrentIP() helper function & replace all direct IP getti… Jul 14, 2019
reg_mainpage.php Respect selected language when showing ReCaptcha Jun 30, 2019
report.php All pages & functions should use mysqli extension Jan 14, 2019
resources.php Use the helper function to calculate max storage capacities of each r… Aug 22, 2019
rocket_simulator.php Remove indentation & file ending inconsistencies Dec 15, 2018
rules.php When in rules View, do not rely on a globally set flag to determine a… Jul 9, 2019
search.php All pages & functions should use mysqli extension Jan 14, 2019
settings.php Initialise the array correctly Jul 15, 2019
simulator.php Simulator should no longer support "moon creation & destruction simul… Mar 7, 2019
stats.php All pages & functions should use mysqli extension Jan 14, 2019
tasks.php Hide the "skip button" better Apr 20, 2019
techtree.php Remove indentation & file ending inconsistencies Dec 15, 2018
texts.php Remove indentation & file ending inconsistencies Dec 15, 2018

README.md

UniEngine

Build Status Release: Stable (latest)

OGame-clone browser based game engine.


Requirements

  • PHP
    • >= 7.0 && < 7.3
    • >= 5.4 (deprecated)
  • Composer
    • >= 1.6
  • MySQL
    • >= 5
  • A webserver (eg. nginx)

(Additional) Development requirements

  • Node.js
    • >= 11

Installation

  1. Setup a webserver capable of running PHP scripts.
    • php.ini file should have E_NOTICE reporting disabled, eg.:
      • error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
    • PHP needs to have write permissions to these files / directories:
      • config.php
        • (one-off, installation purposes)
      • includes/constants.php
        • (one-off, installation purposes)
      • tmp/
        • (permanent, eg. for Smarty cache)
  2. Setup a MySQL server.
    • Disable STRICT_TRANS_TABLES mode.
  3. Create a DB user and DB database for your game server.
  4. Move source files of the project to your webserver's directory.
  5. Install PHP dependencies.
    • composer install --no-dev
  6. Run installation wizard: http://your_server_address:port/install
  7. Remove install/ directory

Updating from older versions

  1. Check Releases section to see if migration scripts have been provided between your current version and the latest version you want to upgrade to.
    • In case of missing migration scripts, do not try to use the auto-migrate functionality! It may completely break your game server.
    • In case of major breaking changes (which for some reason were not possible to auto-migrate), there should be a release note explaining why and what manual actions have to be performed to proceed with migration.
  2. Close your game server (prevent players from accessing the game).
  3. Perform a full backup of your game server's state (database, configuration, files, etc...).
  4. Make sure that your PHP server has write access to game server's files (in case if one of the migration scripts might need this).
  5. Update files to the desired version.
  6. Update PHP dependencies.
    • composer install --no-dev
  7. Run migration script from project's root directory:
  8. Restart PHP server.

Development guides

Preparations

  1. Install PHP dependencies (normal & dev):
    • composer install --dev
  2. Install Node.js dependencies:
    • npm ci

Available scripts

  • Run PHP code linting (powered by PHP Code Sniffer)
    • composer run-script ci-php-phpcs
  • Run all not-yet-applied migrations
    • composer run-script migrate:run [-- --confirm-manual-action]
    • Script will automatically apply all outstanding migrations.
    • A manual interaction might be required. If that's the case, follow the instructions printed to the command line and then run the script again with --confirm-manual-action flag.
    • After successful migration, a marker file will be created (config/latest-applied-migration) for future migrations.
  • Generate new migration file using a template
    • composer run-script migrate:make -- <MIGRATION_FILE_NAME>
    • New migration file with autogenerated ID (date) will be created in utils/migrator/migrations/ directory.
  • Run JavaScript code linting (powered by ESLint):
    • npm run ci-js-eslint
  • Run CSS code linting (powered by stylelint):
    • npm run ci-css-stylelint
  • Rebuild (minification + cachebusting) JS & CSS files:
    • npm run build-minify
    • All files from js/ and css/ directories will be re-minified (only when actually changed) and saved in their respective dist/ directories.
    • Note: when a file has no changes, this script won't remove the old minified & cachebusted file from dist/. File replacement happens only if a source file has changes, or there is no result file yet.
    • Note: this script does not automatically replace filepaths in templates. For now, this has to be done manually by a developer.
    • Note: due to legacy reasons, all files in dist/ are stored in the repo.

Documentation

Visit docs/index.md to see project's documentation.

Languages

  • English 🇬🇧
  • Polish / Polski 🇵🇱

Credits

Authors

Contributors

License

GPL-2.0

See LICENSE file for this project's license details.

See OTHERLICENSES for the licenses of included external resources.

You can’t perform that action at this time.