Commit graph

64 commits

Author SHA1 Message Date
f4e38e4943 Technology implementation
* A stored procedure which implements technologies has been added. It
will mark a pending technology as implemented and remove the
corresponding quantity of money from the empire, then add any newly
available research items to the empire's research.
2012-02-28 16:15:02 +01:00
8c0b4abd1e Empire research initialisation
* When an empire is created, all technologies that have no dependencies
will be added as ongoing research with default priority and no points in
the empire research table.
2012-02-28 12:34:59 +01:00
1f3c7a9202 Technology definitions loader
* Added "dummy" data file for technologies (for now it simply copies the
old, line-based technologies) and corresponding XML schema

* Added missing SQL stored procedure to clear all dependencies and
reverse dependencies from a technology

* Added import classes, loader and import tool for the technology graph

* Added tech graph import tool to post-build tests
2012-02-27 20:04:02 +01:00
c5464212bc Deleted old "test" buildables and technologies
* These 2 definition files were remnants of B6M1's early tests. They did
not belong in the repo any more.
2012-02-27 14:27:33 +01:00
26fe4b926d Fixed package for resources data tests
* The tests for resource definition import classes were not in the right
package. They have been moved.
2012-02-27 18:18:35 +01:00
af57e7d3b5 Technology definition functions
* Added stored procedures which manipulate technology definitions
themselves (defs.uoc_technology) or their dependencies (defs.techdep_add
and defs.techdep_remove)
2012-02-27 14:14:00 +01:00
3b2ec4bb64 Empire technologies table
* Added table to store empire technologies. The table will store
technologies in all states.

* Note: this table is called "emp.technologies_v2" for now. It will need
to be renamed when the old tech system is gone.

* 030-data/110-empires.sql needs to be executed to create the new table
and a type it uses.
2012-02-17 07:46:51 +01:00
1ae9a15f6e Improvements to developer SQL tests runner
* The script will no longer fail when there are no tests matching the
requested name in either admin/ or user/

* The script will ignore non-SQL files when running with --run-name
2012-02-16 18:32:44 +01:00
4f083830f2 Technology dependencies caching and integrity checks
* Added table that will contain the cached technology dependencies.

* Implemented trigger functions that update the cache and make sure
there are no cycles or redundancies in the technology graph.

* The following SQL files need to be (re-)executed:
  -> 030-data/080-techs.sql (for the defs.techdep_cache table)
  -> 040-functions/026-technology-dependencies.sql (new file)
2012-02-16 18:30:58 +01:00
b90491ca73 Technology definition tables
* Added a pair of tables that will contain graph-like technology
definitions. The first table describes a technology, while the second
table is used to list dependencies between technologies. The new tables
contain the basic checks and foreign keys. However, integrity checks on
the dependency graph are not implemented.

* The following SQL files need to be re-executed:
  -> 030-data/080-techs.sql
2012-02-16 11:07:43 +01:00
cb65a6e643 Empire resources and vacation mode
* Modified the empire resources update to check for vacation mode and
apply the modifier from vacation.cashDivider if necessary.

* Some parts of the database need to be reloaded:
  -> 050-updates/015-empire-resources.sql
2012-02-16 10:22:30 +01:00
96670d45be Resources information on planet list
* Added resource information records to the planet list's response.

* Added a database view and the corresponding row mapper and DAO method
which can be used as the data source for the planet list's resource
information. For now this view always returns 0 for both civilian and
military investments.

* Added new tab to display resource information on the planet list page.
The old version of the economy tab will be kept until the corresponding
data no longer exists.

* The following SQL scripts must be re-executed to upgrade a database:
  -> 040-functions/167-planet-list.sql
2012-02-15 14:45:43 +01:00
bf6bea5a79 Extracted quantities update as soon as possible
* The quantities of resources extracted from mines will now be updated
as soon as they have a reason to. This includes planet assignment,
abandonment, ownership changes, and updates to mining priorities.

* The mining update will now remove the current resource income from the
providers, and only then re-compute all extracted quantities. This is
more logical and corresponds to the way the other game updates work.

* Fixed bug in extraction computation where the size of the planet's
happy population was used instead of the happy/total ratio when
adjusting the mining production for riots.

* The following SQL scripts must be re-executed to upgrade a database:
  -> 040-functions/040-empire.sql
  -> 040-functions/145-resource-providers.sql
  -> 040-functions/147-empire-mining.sql
  -> 050-updates/120-planet-mining.sql
2012-02-09 10:54:00 +01:00
f3aa563758 Planet resources interface fix
* Some text in the English version of the planet page's "natural
resources" tab incorrectly used the term "settings" instead of
"priorities".

* The English version of the planet page's "natural resources" tab did
not display any explanation when the planet was following empire-wide
mining priorities.
2012-02-08 11:54:01 +01:00
afa1224391 Production adjustment fix
* The production adjustment function was completely off (and always has
been). It has been fixed.

* The problem with the adjustment function not being reported means that
no-one ever encountered it. As a consequence, happiness strike threshold
has been increased to 50%

/!\ Full database reset required (or at least much easier than other
options).
2012-02-08 15:38:12 +01:00
c94958a058 Added log files to Git ignore list
* Added both "normal" log files and compressed files created when
full-debug.log is rotated.
2012-02-08 08:56:07 +01:00
cb2553d1e5 Build system and documentation update
* Added tests of the command line tools to the post-build scripts

* Local deployment documentation mentions ImportResources
2012-02-08 08:38:56 +01:00
fd117f6f7b Fixed consequences of Spring config clean-up
* While the server works fine, the tools - which use hardcoded paths to
specific parts of the Spring config - were not updated last time. They
should work now.
2012-02-07 19:40:57 +01:00
e64f847ec3 Planet mining settings interface
* Modified owned planet view to include a field which indicates whether
mining settings are specific to the planet or come from the empire;
modified "simple" game components accordingly

* Modified stored procedures to only allow planet-specific mining
settings updates when the planet actually uses planet-specific settings,
and added a stored procedure which toggles the source of a planet's
settings

* Added corresponding parts to mining settings DAO and resources
controller

* Added session commands and server command handlers that toggle the
source of the settings and that upload the settings

* Split planet page template into multiple files for clarity and added
the mining priorities form to the natural resources tab
2012-02-07 17:03:55 +01:00
51b529a09f Removed TODO file
* Since we're now using tasks.legacyworlds.com, the TODO file is no
longer useful.
2012-02-07 09:42:03 +01:00
d38576a5cf Empire mining settings
* Modified mining settings stored procedures to use text identifiers
instead of numeric identifiers

* Added DAO for mining settings and controller for resource operations

* Added UpdateEmpireMiningSettingsCommand and associated command
delegate. The command always returns NullResponse.

* Overview page templates split into multiple files for clarity, added
priority update form to the empire economy view and associated web
server handler
2012-02-05 10:10:43 +01:00
92dd01ffce Fixed project directories
* Because some resources were moved in a previous commit, Git decided to
automatically remove a directory. Re-added that directory with a hidden
file to prevent Git from being such a moron.
2012-02-04 15:32:20 +01:00
b4903d78e4 Object name validator component
* Moved the component from the -user package to the -naming package

* Added a separate interface to the component
2012-02-04 15:26:53 +01:00
35d8891fe3 Spring configuration clean-up
* Regrouped component definitions into one single file per package in
most cases, with a few exceptions

* Added documentation about how the configuration is stored and which
guidelines should be followed when adding or modifying Spring component
configurations.
2012-02-04 12:56:58 +01:00
597429fadf In-game resources views
* Added session records to carry resource information over to the
clients

* Added SQL support code for the various views

* Added interface and implementation of the resource information access
component

* Hooked resources information queries into both the empire and planet
management component

* Added resources display to planet and overview pages
2012-02-04 10:43:12 +01:00
56eddcc4f0 Game updates improvements
* Added a set of tables which define game updates and their targets.
These definitions replace the old enumerate type. Added a set of
triggers which automatically create specific update tables, insert
missing entries, etc... when game update types are being manipulated.

* Removed manual insertion of game updates from empire creation
function and universe generator.

* Added registration of core update targets (i.e. planets and empires),
updated all existing game update processing functions and added type
registrations

* Created Maven project for game updates control components, moved
existing components from the -simple project, rewritten most of what
they contained, added new components for server-side update batch
processing
2012-02-03 16:25:03 +01:00
ba6a1e2b41 SQL unit tests fixes
* Added plan() instead of no_plan() where necessary

* Removed junk from dirty tests system self-check
2012-01-31 12:14:38 +01:00
44b6ec1920 Fixed resource extraction
* Formula was mis-copied from the wiki, the result was multiplied by the
provider's current quantity

* Changed extraction per work unit from 1 to 10
2012-01-30 09:18:20 +01:00
b9bc5e038c Additional Maven projects for unit tests
* Changed names of common packages so they are coherent with the rest

* Added new project for tests on common classes (utilities and session)

* Added new project for tests on the web clients
2012-01-25 09:36:46 +01:00
a4bce68b17 Client/server communications overview
* Added a text file which describes the current client/server protocol,
and the implementation of both the protocol itself and the server-level
support. It also includes a discussion of what is wrong with the current
implementation.
2012-01-24 16:08:30 +01:00
4e27875d87 Maven project & PostgreSQL fix
* Made the PostgreSQL library a compile-time dependency (it used to be
runtime only as it was used as the JDBC driver, however it is now used
directly to access PostgreSQL-specific types; this does not matter, as
the DB code is already 100% specific to PostgreSQL)
2012-01-24 14:51:51 +01:00
775426347a Resource definitions
* Added a few resource definitions and the corresponding strings. While
the descriptions are blank, and resource definitions themselves are
incomplete (relations to e.g. technologies are missing), this should
allow easier testing of the rest of the resources system.
2012-01-24 14:49:23 +01:00
Tim Rosser
f4a16aa431 Resource Definition Loader
* Implemented resource definition loader including tests

* Added resource definition xml file and style definition

* Made a small style change to i18n loader
2012-01-10 22:38:29 +11:00
3637b6e1d1 Mining settings in XML dumps
* Empire mining settings have been included in the empire's resource
information records

* Planet-specific mining settings have been included in the resource
provider information records
2012-01-19 10:28:12 +01:00
9b346a80c2 Empire resources in XML dumps
* Added dump view for empire resources

* Added empire resource information storage class and associated row
mapper

* Integrated empire resource information into the summary generator
2012-01-19 09:35:12 +01:00
ce6d86d344 Planet resources and resource providers in XML dumps
* Dump version bumped up to 2

* Added SQL view that shows resource delta and provider information for
all empire-owned planets

* Added new storage classes for resource providers and resource deltas

* Added row mapper which extracts all planet resources information
(providers and deltas)

* Modified dump generator to include planet resources / resource
providers
2012-01-18 09:28:35 +01:00
95e6019c12 Mock result set class
* Added a mock result set class which can be used to write unit tests
for e.g. RowMapper-based classes. The class is incomplete and should be
extended as necessary.

* Added unit test for BuildingsInformationMapper as a proof of concept
2012-01-17 16:47:05 +01:00
426a1fdfd4 XML dumps code clean-up
* Moved empire summary generator to a separate package, moved all empire
summary data classes to a sub-package of the former

* All row mappers for empire summary contents have been moved to
separate classes with default access

* Added comments to the component and to the mapper classes
2012-01-17 10:50:51 +01:00
2adc754a2c Dependency upgrades
* Spring upgraded from 3.0.3 to 3.1.0 - As a consequence, all code that
used SimpleJdbcTemplate has been modified to use JdbcTemplate, as the
former has been deprecated.

* SLF4J upgraded from 1.5.11 to 1.6.4

* Apache Commons: DBCP upgraded from 1.2.2 to 1.4, Codec upgraded from
1.4 to 1.6

* CGLib upgraded from 2.2 to 2.2.2

* javax.mail upgraded from 1.4.1 to 1.4.4

* XStream upgraded from 1.3.1 to 1.4.2

* JUnit upgraded from 4.7 to 4.10

* FreeMarker upgraded from 2.3.16 to 2.3.18

* PostgreSQL JDBC glue upgraded from 8.4-701 to 9.1-901

* legacyworlds-server-tests no longer considered a dummy package
2012-01-16 18:09:45 +01:00
a981d1653e Universe generator fix
* A function called by the initial universe generator was changed, but
the call wasn't updated accordingly. This problem has been fixed.

* Variable / procedure name errors in some of the old, untested
functions.
2012-01-16 17:42:11 +01:00
30a1080e6e Maven projects fixes and improvements
* Fixed copy of the SQL files to the distribution

* Distribution packages will now execute an automatic clean-up before
assembling. While this will avoid having dirty, old files in the
distribution directory, it also has a negative consequence -
configuration files will be destroyed if they exist.
2012-01-16 16:06:44 +01:00
24f40c5549 Fix for dirty SQL tests
* Fixed an error in the main post-build script which caused dirty SQL
tests to be skipped
2012-01-16 12:50:10 +01:00
74b6f2ab09 Mining computation update
* Added various views and helper functions used by the mining
computation but which may be re-used in other parts.

* Added mining computation update type and associated update function

* New constants: game.resources.weightBase (the value used to compute
weights from mining settings) and game.resources.extraction (the
quantity extracted in a day from a full provider at difficulty 0)
2012-01-16 12:35:20 +01:00
038bba896a Mining computations update
* Added a few that can be used to retrieve mining settings for resource
providers from empire-owned planets from either the empire-wide or
planet-specific settings
2012-01-10 16:28:25 +01:00
c18bdc2d1f Dirty SQL test system
* Added a system that allows "dirty" tests to be written. These tests
actually need to change the database, so a temporary test database must
be created to run them.
2012-01-14 09:02:24 +01:00
04e550709a Empire resources update
* Added a new update that computes the amount of resources possessed and
owed by empires. At the moment this computation ignores fleets, as their
upkeep does not use the resource system.
2012-01-10 13:29:56 +01:00
b49bc1a44f Planet resources
* Added missing table that should store a planet's resources data
(income and upkeep for each type of resource).

* Modified resource definition functions and universe generator to
initialise planet resource records as well

* Heavy clean-up in resource definition function unit tests
2012-01-10 12:30:47 +01:00
37555841ce Empire resources initialisation
* Empire resources will be initialised when an empire is created

* When a new resource is created through the appropriate defs.uoc_...
function, it will be added to all empires as well.
2012-01-10 10:48:56 +01:00
afc66166e0 Mining settings
* Changed the way mining settings work: use a priority value (between 0
and 4) as the weight. Leaving them as they were before would have caused
numerous problems (and a lot of unnecessary code to work around them)

* Empire mining settings will be created along with the empire's own
record. By default all natural resources will have weight = 2.

* Added a set of four stored procedures which can be used to update an
empire's mining settings, including planet-specific settings. The
emp.mset_update_start() function can be used to start an update (on an
empire's settings if there is only one parameter, or on a planet's
settings if there are two parameters); the emp.mset_update_set() and
emp.mset_update_apply() functions are then used to modify the settings
and apply the changes, respectively.
2012-01-10 10:17:47 +01:00
3e109b13bc SQL logging fixes
* Added user mapping on the "remote" logging database for the
administrative user. This allows calls to sys.write_sql_log() to succeed
when they are executed by code with administrative privileges.

* Added test suites for both the link to the database and the function
itself.

* Replaced RAISE NOTICE with actual logging in the universe generator
2012-01-07 11:14:17 +01:00