- Added CVARINFO lump support. This is a lump for defining mod-specific cvars and takes entries

of the form:
    <scope> [noarchive] <type> <name> [= <defaultvalue>];
  Where <scope> is one of:
  * server: This cvar is shared by all players, and in network games, only select players can
    change it.
  * user: Each player has their own copy of this cvar, which they can change independently.
  To prevent the cvar from being written to the config file, add noarchive to its definition.
  <Type> is one of:
  * int: An integral value. Defaults to 0.
  * float: A value that can include a fraction. Defaults to 0.0.
  * color: A color value. Default to black ("00 00 00").
  * bool: A boolean value that can hold either true or false. Defaults to false.
  * string: A string value. It's not too useful for mods but is included for completeness. Defaults to "".
  <Name> is the cvar's name and must begin with a letter and may only include alphanumeric
  characters and the underscore character.
  If you wish a non-standard default add an = character after the cvar's name followed by the
  default value you want to use. Example:
    server int mymod_coolness = 10;
- Fixed: FStringCVar::SetGenericRepDefault() did not make a copy of the input string.

SVN r4280 (trunk)
This commit is contained in:
Randy Heit 2013-05-25 16:34:23 +00:00
commit 787b84ef91
8 changed files with 214 additions and 40 deletions

View file

@ -92,22 +92,6 @@ enum
const char *GenderNames[3] = { "male", "female", "other" };
static const char *UserInfoStrings[] =
{
"name",
"autoaim",
"color",
"skin",
"team",
"gender",
"neverswitchonpickup",
"movebob",
"stillbob",
"playerclass",
"colorset",
NULL
};
// Replace \ with %/ and % with %%
FString D_EscapeUserInfo (const char *str)
{
@ -394,7 +378,7 @@ void D_SetupUserInfo ()
for (FBaseCVar *cvar = CVars; cvar != NULL; cvar = cvar->GetNext())
{
if (cvar->GetFlags() & CVAR_USERINFO)
if ((cvar->GetFlags() & (CVAR_USERINFO|CVAR_NOSEND)) == CVAR_USERINFO)
{
FBaseCVar **newcvar;
FName cvarname(cvar->GetName());
@ -432,7 +416,7 @@ void userinfo_t::Reset()
// Create userinfo vars for this player, initialized to their defaults.
for (FBaseCVar *cvar = CVars; cvar != NULL; cvar = cvar->GetNext())
{
if (cvar->GetFlags() & CVAR_USERINFO)
if ((cvar->GetFlags() & (CVAR_USERINFO|CVAR_NOSEND)) == CVAR_USERINFO)
{
ECVarType type;
FName cvarname(cvar->GetName());