示例#1
0
bool MSystemTime::Parse(const TCHAR *s, const TCHAR **endptr/* = NULL*/)
{
    MDate d;
    MTime t;

    if (endptr)
        *endptr = NULL;

    if (d.Parse(s, &s))
    {
        while (*s && !MzcIsCharDigit(*s))
            s++;

        if (t.Parse(s, &s))
        {
            SetDate(d);
            SetTimeOfDay(t);
            if (endptr)
                *endptr = s;
        }
        else
        {
            SetDate(d);
            ClearTimeOfDay();
            if (endptr)
                *endptr = s;
        }
        return true;
    }
    return false;
}
示例#2
0
//
// Just to ignore the "wad" field.
//
bool CWorld::KeyValue( const char *szKeyName, const char *szValue )
{
	if ( FStrEq(szKeyName, "skyname") )
	{
		// Sent over net now.
		ConVarRef skyname( "sv_skyname" );
		skyname.SetValue( szValue );
	}
	else if ( FStrEq(szKeyName, "newunit") )
	{
		// Single player only.  Clear save directory if set
		if ( atoi(szValue) )
		{
			extern void Game_SetOneWayTransition();
			Game_SetOneWayTransition();
		}
	}
	else if ( FStrEq(szKeyName, "world_mins") )
	{
		Vector vec;
		sscanf(	szValue, "%f %f %f", &vec.x, &vec.y, &vec.z );
		m_WorldMins = vec;
	}
	else if ( FStrEq(szKeyName, "world_maxs") )
	{
		Vector vec;
		sscanf(	szValue, "%f %f %f", &vec.x, &vec.y, &vec.z ); 
		m_WorldMaxs = vec;
	}
	else if ( FStrEq(szKeyName, "timeofday" ) )
	{
		SetTimeOfDay( atoi( szValue ) );
	}
	else
		return BaseClass::KeyValue( szKeyName, szValue );

	return true;
}