private Set ( string value, bool force, bool fromServer ) : void | ||
value | string | |
force | bool | |
fromServer | bool | |
return | void |
internal void Set(string value, bool force, bool fromServer)
{
idConsole.Warning("TODO: network cvar");
/*if ( session && session->IsMultiplayer() && !fromServer ) {
#ifndef ID_TYPEINFO
if ( ( flags & CVAR_NETWORKSYNC ) && idAsyncNetwork::client.IsActive() ) {
common->Printf( "%s is a synced over the network and cannot be changed on a multiplayer client.\n", nameString.c_str() );
#if ID_ALLOW_CHEATS
common->Printf( "ID_ALLOW_CHEATS override!\n" );
#else
return;
#endif
}
#endif
if ( ( flags & CVAR_CHEAT ) && !cvarSystem->GetCVarBool( "net_allowCheats" ) ) {
common->Printf( "%s cannot be changed in multiplayer.\n", nameString.c_str() );
#if ID_ALLOW_CHEATS
common->Printf( "ID_ALLOW_CHEATS override!\n" );
#else
return;
#endif
}
}*/
if(value == string.Empty)
{
value = _resetString;
}
if(force == false)
{
if((_flags & CvarFlags.ReadOnly) == CvarFlags.ReadOnly)
{
idConsole.WriteLine("{0} is read only.", _nameString);
return;
}
if((_flags & CvarFlags.Init) == CvarFlags.Init)
{
idConsole.WriteLine("{0} is write protected.", _nameString);
return;
}
}
if(_valueString.ToLower() == value.ToLower())
{
return;
}
_valueString = value;
_value = _valueString;
UpdateValue();
this.IsModified = true;
idE.CvarSystem.ModifiedFlags = _flags;
}
#endregion
/// <summary> /// Called by the command system when a command is unrecognized. /// </summary> /// <param name="args"></param> /// <returns></returns> public bool Command(idCmdArgs args) { idInternalCvar intern = FindInternal(args.Get(0)); if (intern == null) { return(false); } if (args.Length == 1) { // print the variable idConsole.WriteLine("\"{0}\" is: \"{1}\" {2} default: \"{3}\"", intern.Name, intern.ToString(), idColorString.White, intern.ResetString); if (intern.Description.Length > 0) { idConsole.WriteLine("{0}{1}", idColorString.White, intern.Description); } } else { // set the value intern.Set(args.ToString(), false, false); } return(true); }