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/user/030-data/145-updates

View file

@ -0,0 +1,28 @@
/*
* Test privileges on sys.update_targets
*/
BEGIN;
SELECT plan( 4 );
SELECT diag_test_name( 'sys.update_targets - No INSERT privilege' );
SELECT throws_ok(
$$ INSERT INTO sys.update_targets DEFAULT VALUES; $$ ,
42501 );
SELECT diag_test_name( 'sys.update_targets - No UPDATE privilege' );
SELECT throws_ok(
$$ UPDATE sys.update_targets SET updtgt_id = 42; $$ ,
42501 );
SELECT diag_test_name( 'sys.update_targets - No SELECT privilege' );
SELECT throws_ok(
$$ SELECT * FROM sys.update_targets; $$ ,
42501 );
SELECT diag_test_name( 'sys.update_targets - No DELETE privilege' );
SELECT throws_ok(
$$ DELETE FROM sys.update_targets; $$ ,
42501 );
SELECT * FROM finish( );
ROLLBACK;

View file

@ -0,0 +1,28 @@
/*
* Test privileges on sys.update_types
*/
BEGIN;
SELECT plan( 4 );
SELECT diag_test_name( 'sys.update_types - No INSERT privilege' );
SELECT throws_ok(
$$ INSERT INTO sys.update_types DEFAULT VALUES; $$ ,
42501 );
SELECT diag_test_name( 'sys.update_types - No UPDATE privilege' );
SELECT throws_ok(
$$ UPDATE sys.update_types SET updtgt_id = 42; $$ ,
42501 );
SELECT diag_test_name( 'sys.update_types - No SELECT privilege' );
SELECT throws_ok(
$$ SELECT * FROM sys.update_types; $$ ,
42501 );
SELECT diag_test_name( 'sys.update_types - No DELETE privilege' );
SELECT throws_ok(
$$ DELETE FROM sys.update_types; $$ ,
42501 );
SELECT * FROM finish( );
ROLLBACK;

View file

@ -0,0 +1,28 @@
/*
* Test privileges on sys.updates
*/
BEGIN;
SELECT plan( 4 );
SELECT diag_test_name( 'sys.updates - No INSERT privilege' );
SELECT throws_ok(
$$ INSERT INTO sys.updates DEFAULT VALUES; $$ ,
42501 );
SELECT diag_test_name( 'sys.updates - No UPDATE privilege' );
SELECT throws_ok(
$$ UPDATE sys.updates SET updtgt_id = 42; $$ ,
42501 );
SELECT diag_test_name( 'sys.updates - No SELECT privilege' );
SELECT throws_ok(
$$ SELECT * FROM sys.updates; $$ ,
42501 );
SELECT diag_test_name( 'sys.updates - No DELETE privilege' );
SELECT throws_ok(
$$ DELETE FROM sys.updates; $$ ,
42501 );
SELECT * FROM finish( );
ROLLBACK;