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:
Emmanuel BENOîT 2012-01-16 12:35:20 +01:00
parent 038bba896a
commit 74b6f2ab09
20 changed files with 1139 additions and 2 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;