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
This commit is contained in:
Emmanuel BENOîT 2012-02-03 16:25:03 +01:00
parent ba6a1e2b41
commit 56eddcc4f0
93 changed files with 4004 additions and 578 deletions
legacyworlds-server-data/db-structure/tests/admin/050-updates/015-empire-resources

View file

@ -2,6 +2,12 @@
* Test the sys.process_empire_resources_updates() function
*/
BEGIN;
/* Start by deleting all update types except for the one
* we're interested in.
*/
DELETE FROM sys.update_types
WHERE updtype_name <> 'EmpireResources';
/* We need:
* - three types of resources,
* - two empire with resources records, and the corresponding update
@ -35,14 +41,15 @@ BEGIN;
/* Make sure update 0 is set to be processed for testEmp1 */
UPDATE sys.updates
SET status = 'PROCESSING' , last_tick = 0;
SET update_state = 'PROCESSING' , update_last = 0;
/* Create testEmp2 empire, make sure it will not be processed */
SELECT emp.create_empire( _get_emp_name( 'testEmp2' ) , _get_map_name( 'testPlanet2' ) , 1 );
UPDATE sys.updates _su
SET status = 'PROCESSED' , last_tick = 0
FROM emp.updates _eu
WHERE _eu.update_id = _su.id AND _eu.empire_id = _get_emp_name( 'testEmp2' );
SET update_state = 'PROCESSED' , update_last = 0
FROM emp.empires_updates _eu
WHERE _eu.update_id = _su.update_id
AND _eu.name_id = _get_emp_name( 'testEmp2' );
/****** TESTS BEGIN HERE ******/
SELECT plan( 19 );