Commit graph

43 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
dc9ef2292d Event-related functions split
Because the events management functions are definitely going to be quite
big, I thought it would be better to split them into multiple SQL files.
For now, there's a file for event definition functions and one for
functions that manipulate priority overrides. The old file containing
the old code stays around for now.
2012-07-01 01:04:26 +02:00
cf8dee6ec9 Priority settings update procedures
Added stored procedures which can be used to update customisable event
priorities:
 * events.evcp_set() adds or modifies an override,
 * events.clear() can be used to remove a specific override or all
overrides for a given player.
2012-06-30 16:25:50 +02:00
c8f19a4c06 Event record creation bugfix
When I18N strings (name and template) were added to the event definition
table, some of the code was not modified.
2012-06-30 14:47:02 +02:00
aaec345957 Event definition stored procedures bugfix
Fixed a bug which caused events.evdef_finalise() to fail with an
exception when the event type identifier was wrong, and to register the
event type event if error had occurred on field definitions.
2012-06-30 12:43:29 +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
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
071257786c Renamed technology tables and views
* Removed the _v2 suffix from some tables and views.
2012-04-09 15:01:04 +02:00
ab04752169 Research page - Unlocked buildings
* The research page now includes a list of buildings unlocked by each
technology when that technology is not in the "unknown" state.
2012-04-09 13:08:08 +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
6dcd59d7bc New research and technology page
* Added legacyworlds-server-beans-technologies Maven module, including
the player-level DAO and controller.

* Added session classes to carry technology information, modified web
client session façade accordingly

* Various changes to common UI elements (forms, lists, etc...) so the
start and end of some element can be drawn separately

* Added controller, templates and JavaScript for research page
2012-04-07 13:06:03 +02:00
9a7bc03171 Improved I18N support:
* GamePageData now includes the selected language's code.
* Added support for multiple fetches in one call to the Translator
service.
2012-04-05 11:25:08 +02:00
c7949e41cc Research update
* Implemented new research update. Old research system no longer
updates.

* Fixed a major bug in the constants registrar

* Added game.research.vacation constant (determines the rate of
research when players are in vacation mode)
2012-04-02 13:29:43 +02:00
a14601df37 Research weight computations
* Added game.research.weightBase constant

* Added view which computes the weights for each in-progress research

* Added view which computes total weights per empire
2012-03-01 12:42:05 +01:00
c9d8a077bd Moved empire research SQL to separate file
* Empire research & technology SQL code was getting dense, so it was
moved to a separate file.
2012-03-01 11:50:40 +01:00
1dcde71dff Research priorities
* Added stored procedures meant to update research priorities.
2012-03-01 10:52:52 +01:00
b15acadc1b Empire technology views
* Added new research-related constants

* Added set of views and functions to list empires' technologies. This
includes a view which determines the visibility of an in-progress
research's details, and a main list view.
2012-03-01 09:50:20 +01:00
e01eab9c09 Technology dependencies view
* Added SQL view that lists dependencies of technologies as
comma-separated lists of identifiers
2012-02-29 11:50:04 +01:00
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
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
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
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
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
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
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
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
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
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
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
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
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