Added tables that store event access interfaces and event states per
interface, as well as functions which allow events to be retrieved:
* events.interfaces lists access interfaces,
* events.unprocessed_events lists events which haven't been processed
for each type of interface, with a "pre-processed" flag
* events.ep_read() is a set of function variants which will read events
* events.ep_access() is a set of function variants which read events
then update their states.
Added the necessary database code to convert the contents of event
queues into actual event records. The changes include:
* a new table, events.pending_events, which is automatically filled by
a trigger when events are inserted into queue tables,
* the game.events.batchSize constant which defines the maximal amount
of events to process in a single transaction,
* the events.eq_process() stored procedure, which processes the events.
In addition, the "hstore" extension was added as it is the easiest way
to convert events from the queues' table model to the store's
meta-model.
Added tables allowing event data to be stored on the long term:
* events.events_v2 (which will need to be renamed) contains the events'
main entry
* events.field_values stores field values for all events.
Added functions that allow new event types to be defined. The functions
are:
* events.evdef_start() which starts recording a definition,
* events.evdef_addfld_*(), a set of functions to add fields to
the current definition,
* events.evdef_finalise() which adds the definition records and creates
the event queue table.
It is not possible to modify or delete event definitions at this time.
They will be added if and when they become necessary.
* Modified buildable definitions and loader to use technologies from the
tech graph as dependencies instead of the old research system
* Modified planet-related views and functions accordingly
* Added stored procedures which manipulate technology definitions
themselves (defs.uoc_technology) or their dependencies (defs.techdep_add
and defs.techdep_remove)
* 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.
* 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)
* 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
* 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
* 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)
* 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.
* 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
* 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.
* The main loader script has been updated to generate the list of files
it needs to load automatically. As a consequence, files that contained
manually-maintained lists of scripts have been removed, and definition
directories have been renamed accordingly.
* PostgreSQL extension loading and configuration has been moved to a
separate script to be loaded automatically in the main transaction.
* Data and function definition scripts that had the -data or -functions
suffix have been renamed (the suffix is unnecessary).
* Unit tests have been reorganised to follow the definition's structure.
* Documentation has been improved