Commit graph

20 commits

Author SHA1 Message Date
d246f221f0 Event database access
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.
2012-07-03 10:32:15 +02:00
3a0f5bbb78 Events storage procedure
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.
2012-07-01 14:12:22 +02:00
9e84f333e7 Events database structure
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.
2012-06-30 18:47:33 +02:00
a6562052d3 Event definitions - missing I18N properties
Added the display name and template I18N properties to event
definitions. Modified events.evdef_start() accordingly.
2012-06-29 17:31:14 +02:00
8f2fd29c71 Player-defined priority storage
Added the events.custom_priorities that ought to store player-defined
priorities for event types which support it.
2012-06-29 17:19:23 +02:00
0c67d1e799 Event definition functions
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.
2012-06-29 15:18:18 +02:00
ff78c6a2d6 Added event definition tables
* New events.event_definitions table
* New events.field_definitions table
* New types for event field type specification
2012-06-28 12:40:47 +02:00
071257786c Renamed technology tables and views
* Removed the _v2 suffix from some tables and views.
2012-04-09 15:01:04 +02:00
96c296e9d5 Removed old research system
* Removed all tables, views and functions

* Removed references to old system in Java code, including old import
tool

* Replaced XML dump code
2012-04-09 11:36:09 +02:00
070d55dc05 "Buildables" depend on tech graph
* 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
2012-04-08 14:30:43 +02: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
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
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
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
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
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
e50775ec76 Database definition & tests organisation
* 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
2012-01-06 11:19:19 +01:00