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)
This commit is contained in:
parent
038bba896a
commit
74b6f2ab09
20 changed files with 1139 additions and 2 deletions
legacyworlds-server-data/db-structure/tests/user
040-functions/145-resource-providers
050-updates/120-planet-mining
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Test privileges on verse.get_extraction_factor()
|
||||
*/
|
||||
BEGIN;
|
||||
SELECT plan( 1 );
|
||||
|
||||
SELECT diag_test_name( 'verse.get_extraction_factor() - Privileges' );
|
||||
SELECT throws_ok( $$
|
||||
SELECT verse.get_extraction_factor( 0.5 , 0.5 )
|
||||
$$ , 42501 );
|
||||
|
||||
SELECT * FROM finish( );
|
||||
ROLLBACK;
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* Test privileges on sys.gu_pmc_weights_view
|
||||
*/
|
||||
BEGIN;
|
||||
SELECT plan( 1 );
|
||||
|
||||
SELECT diag_test_name( 'sys.gu_pmc_weights_view - Privileges' );
|
||||
SELECT throws_ok( 'SELECT * FROM sys.gu_pmc_weights_view' , 42501 );
|
||||
|
||||
SELECT * FROM finish( );
|
||||
ROLLBACK;
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* Test privileges on sys.gu_pmc_totals_view
|
||||
*/
|
||||
BEGIN;
|
||||
SELECT plan( 1 );
|
||||
|
||||
SELECT diag_test_name( 'sys.gu_pmc_totals_view - Privileges' );
|
||||
SELECT throws_ok( 'SELECT * FROM sys.gu_pmc_totals_view' , 42501 );
|
||||
|
||||
SELECT * FROM finish( );
|
||||
ROLLBACK;
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* Test privileges on sys.gu_pmc_get_data( )
|
||||
*/
|
||||
BEGIN;
|
||||
SELECT plan( 1 );
|
||||
|
||||
SELECT diag_test_name( 'sys.gu_pmc_get_data - Privileges' );
|
||||
SELECT throws_ok( 'SELECT * FROM sys.gu_pmc_get_data( 0 )' , 42501 );
|
||||
|
||||
SELECT * FROM finish( );
|
||||
ROLLBACK;
|
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Test privileges on sys.gu_pmc_update_resource( )
|
||||
*/
|
||||
BEGIN;
|
||||
SELECT plan( 1 );
|
||||
|
||||
SELECT diag_test_name( 'sys.gu_pmc_update_resource - Privileges' );
|
||||
SELECT throws_ok( $$
|
||||
SELECT * FROM sys.gu_pmc_update_resource( ROW( NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ) );
|
||||
$$ , 42501 );
|
||||
|
||||
SELECT * FROM finish( );
|
||||
ROLLBACK;
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* Test privileges on sys.process_planet_mining_updates( )
|
||||
*/
|
||||
BEGIN;
|
||||
SELECT plan( 1 );
|
||||
|
||||
SELECT diag_test_name( 'sys.process_planet_mining_updates() - Privileges' );
|
||||
SELECT throws_ok( 'SELECT * FROM sys.process_planet_mining_updates( 0 )' , 42501 );
|
||||
|
||||
SELECT * FROM finish( );
|
||||
ROLLBACK;
|
Reference in a new issue