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
This commit is contained in:
parent
f3aa563758
commit
bf6bea5a79
35 changed files with 863 additions and 372 deletions
legacyworlds-server-data/db-structure/tests/user/040-functions/147-empire-mining
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* Test privileges on emp.mset_update_start( INT )
|
||||
*/
|
||||
BEGIN;
|
||||
|
||||
SELECT plan( 1 );
|
||||
|
||||
SELECT diag_test_name( 'emp.mset_update_start( INT ) - Privileges' );
|
||||
SELECT lives_ok( $$
|
||||
SELECT emp.mset_update_start( 1 )
|
||||
$$ );
|
||||
|
||||
SELECT * FROM finish( );
|
||||
ROLLBACK;
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* Test privileges on emp.mset_update_start( INT , INT )
|
||||
*/
|
||||
BEGIN;
|
||||
|
||||
SELECT plan( 1 );
|
||||
|
||||
SELECT diag_test_name( 'emp.mset_update_start( INT , INT ) - Privileges' );
|
||||
SELECT lives_ok( $$
|
||||
SELECT emp.mset_update_start( 1 , 1 )
|
||||
$$ );
|
||||
|
||||
SELECT * FROM finish( );
|
||||
ROLLBACK;
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* Test privileges on emp.mset_update_set()
|
||||
*/
|
||||
BEGIN;
|
||||
SELECT emp.mset_update_start( 1 );
|
||||
SELECT plan( 1 );
|
||||
|
||||
SELECT diag_test_name( 'emp.mset_update_set() - Privileges' );
|
||||
SELECT lives_ok( $$
|
||||
SELECT emp.mset_update_set( 'a' , -1 )
|
||||
$$ );
|
||||
|
||||
SELECT * FROM finish( );
|
||||
ROLLBACK;
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* Test privileges on emp.mset_update_set()
|
||||
*/
|
||||
BEGIN;
|
||||
SELECT emp.mset_update_start( 1 );
|
||||
|
||||
SELECT plan( 1 );
|
||||
|
||||
SELECT diag_test_name( 'emp.mset_update_apply() - Privileges' );
|
||||
SELECT lives_ok( $$
|
||||
SELECT emp.mset_update_apply( )
|
||||
$$ );
|
||||
|
||||
SELECT * FROM finish( );
|
||||
ROLLBACK;
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* Test privileges on emp.mset_toggle_source( INT , INT )
|
||||
*/
|
||||
BEGIN;
|
||||
SELECT emp.mset_update_start( 1 );
|
||||
|
||||
SELECT plan( 1 );
|
||||
|
||||
SELECT diag_test_name( 'emp.mset_toggle_source() - Privileges' );
|
||||
SELECT lives_ok( $$
|
||||
SELECT emp.mset_toggle_source( 1 , 1 )
|
||||
$$ );
|
||||
|
||||
SELECT * FROM finish( );
|
||||
ROLLBACK;
|
Reference in a new issue