use new config interface

This commit is contained in:
David Rose 2004-12-23 21:24:11 +00:00
parent 84bcfefc13
commit ef75b6751a
4 changed files with 34 additions and 20 deletions

View File

@ -26,16 +26,23 @@ ConfigureFn(config_distributed) {
init_libdistributed(); init_libdistributed();
} }
// This represents the amount of time to block waiting for the TCP ConfigVariableInt game_server_timeout_ms
// connection to the game server. It is only used when the connection ("game-server-timeout-ms", 20000,
// method is NSPR. PRC_DESC("This represents the amount of time to block waiting for the TCP "
const int game_server_timeout_ms = config_distributed.GetInt("game-server-timeout-ms", 20000); "connection to the game server. It is only used when the connection "
"method is NSPR."));
// These represent the time in seconds by which to artificially lag ConfigVariableDouble min_lag
// inbound messages. It is only used when the connection method is ("min-lag", 0.0,
// NSPR. PRC_DESC("This represents the time in seconds by which to artificially lag "
const double min_lag = config_distributed.GetDouble("min-lag", 0.0); "inbound messages. It is only used when the connection method is "
const double max_lag = config_distributed.GetDouble("max-lag", 0.0); "NSPR."));
ConfigVariableDouble max_lag
("max-lag", 0.0,
PRC_DESC("This represents the time in seconds by which to artificially lag "
"inbound messages. It is only used when the connection method is "
"NSPR."));
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: init_libdistributed // Function: init_libdistributed

View File

@ -22,12 +22,14 @@
#include "directbase.h" #include "directbase.h"
#include "notifyCategoryProxy.h" #include "notifyCategoryProxy.h"
#include "dconfig.h" #include "dconfig.h"
#include "configVariableInt.h"
#include "configVariableDouble.h"
NotifyCategoryDecl(distributed, EXPCL_DIRECT, EXPTP_DIRECT); NotifyCategoryDecl(distributed, EXPCL_DIRECT, EXPTP_DIRECT);
extern const int game_server_timeout_ms; extern ConfigVariableInt game_server_timeout_ms;
extern const double min_lag; extern ConfigVariableDouble min_lag;
extern const double max_lag; extern ConfigVariableDouble max_lag;
extern EXPCL_DIRECT void init_libdistributed(); extern EXPCL_DIRECT void init_libdistributed();

View File

@ -35,13 +35,16 @@ ConfigureFn(config_interval) {
init_libinterval(); init_libinterval();
} }
// Set this to the default value for set_precision() for each ConfigVariableDouble interval_precision
// CMetaInterval created. ("interval-precision", 1000.0,
const double interval_precision = config_interval.GetDouble("interval-precision", 1000.0); PRC_DESC("Set this to the default value for set_precision() for each "
"CMetaInterval created."));
ConfigVariableBool verify_intervals
("verify-intervals", false,
PRC_DESC("Set this true to generate an assertion failure if interval "
"functions are called out-of-order."));
// Set this true to generate an assertion failure if interval
// functions are called out-of-order.
const bool verify_intervals = config_interval.GetBool("verify-intervals", false);
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: init_libinterval // Function: init_libinterval

View File

@ -22,11 +22,13 @@
#include "directbase.h" #include "directbase.h"
#include "notifyCategoryProxy.h" #include "notifyCategoryProxy.h"
#include "dconfig.h" #include "dconfig.h"
#include "configVariableDouble.h"
#include "configVariableBool.h"
NotifyCategoryDecl(interval, EXPCL_DIRECT, EXPTP_DIRECT); NotifyCategoryDecl(interval, EXPCL_DIRECT, EXPTP_DIRECT);
extern const double interval_precision; extern ConfigVariableDouble interval_precision;
extern const bool verify_intervals; extern ConfigVariableBool verify_intervals;
extern EXPCL_DIRECT void init_libinterval(); extern EXPCL_DIRECT void init_libinterval();