• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Q_strncat函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Q_strncat函数的典型用法代码示例。如果您正苦于以下问题:C++ Q_strncat函数的具体用法?C++ Q_strncat怎么用?C++ Q_strncat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Q_strncat函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: AddHelp

	void AddHelp( int pane_key, const char *image, const char *desc )
	{
		int index = m_vHelpPanes.Find( pane_key );
		if ( index == m_vHelpPanes.InvalidIndex() )
		{
			Warning( "[ScenarioHelp] Invalid pane id provided to add help to, Pane %i\n", pane_key );
			return;
		}

		sHelpPane *pPane = m_vHelpPanes[ index ];

		if ( pPane->nHelpCount >= 4 )
		{
			Warning( "[ScenarioHelp] No more than 4 help items are allowed per pane, Pane %i\n", pane_key );
			return;
		}

		pPane->nHelpCount++;

		// Restrict string lengths
		char desc_clip[128];
		char image_clip[32];

		Q_strncpy( desc_clip,  (desc && desc[0])  ? desc  : " ", 128 );
		Q_strncpy( image_clip, (image && image[0]) ? image : " ", 32 );

		if ( pPane->szHelpString[0] != '\0' )
			Q_strncat( pPane->szHelpString, ";;;", 1024 );

		// Build and append the string to our help
		char szHelp[256];
		Q_snprintf( szHelp, 256, "%s::%s", desc_clip, image_clip );
		Q_strncat( pPane->szHelpString, szHelp, 1024 );
	}
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:34,代码来源:ge_pygameplay.cpp


示例2: GetDBInfo

// This looks for pDBInfoFilename in the same path as pBaseExeFilename.
// The file has 3 lines: machine name (with database), database name, username
void GetDBInfo( const char *pDBInfoFilename, CDBInfo *pInfo )
{
	char baseExeFilename[512];
	if ( !GetModuleFileName( GetModuleHandle( NULL ), baseExeFilename, sizeof( baseExeFilename ) ) )
		Error( "GetModuleFileName failed." );
	
	// Look for the info file in the same directory as the exe.
	char dbInfoFilename[512];
	Q_strncpy( dbInfoFilename, baseExeFilename, sizeof( dbInfoFilename ) );
	Q_StripFilename( dbInfoFilename );

	if ( dbInfoFilename[0] == 0 )
		Q_strncpy( dbInfoFilename, ".", sizeof( dbInfoFilename ) );

	Q_strncat( dbInfoFilename, "/", sizeof( dbInfoFilename ), COPY_ALL_CHARACTERS );
	Q_strncat( dbInfoFilename, pDBInfoFilename, sizeof( dbInfoFilename ), COPY_ALL_CHARACTERS );

	FILE *fp = fopen( dbInfoFilename, "rt" );
	if ( !fp )
	{
		Error( "Can't open %s for database info.\n", dbInfoFilename );
	}

	if ( !ReadStringFromFile( fp, pInfo->m_HostName, sizeof( pInfo->m_HostName ) ) ||
		 !ReadStringFromFile( fp, pInfo->m_DBName, sizeof( pInfo->m_DBName ) ) || 
		 !ReadStringFromFile( fp, pInfo->m_UserName, sizeof( pInfo->m_UserName ) ) 
		 )
	{
		Error( "%s is not a valid database info file.\n", dbInfoFilename );
	}

	fclose( fp );
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:35,代码来源:mpi_stats.cpp


示例3: Q_strncat

//-----------------------------------------------------------------------------
// Purpose: Helper for spewing verbose sample information
// Input  : flags - 
// Output : char const
//-----------------------------------------------------------------------------
char const *DescribeFlags( int flags )
{
	static char outbuf[ 256 ];

	outbuf[ 0 ] = 0;

	if ( flags & FDEMO_USE_ORIGIN2 )
	{
		Q_strncat( outbuf, "USE_ORIGIN2, ", sizeof( outbuf ), COPY_ALL_CHARACTERS );
	}
	if ( flags & FDEMO_USE_ANGLES2 )
	{
		Q_strncat( outbuf, "USE_ANGLES2, ", sizeof( outbuf ), COPY_ALL_CHARACTERS );
	}
	if ( flags & FDEMO_NOINTERP )
	{
		Q_strncat( outbuf, "NOINTERP, ", sizeof( outbuf ), COPY_ALL_CHARACTERS );
	}

	int len = Q_strlen( outbuf );
	if ( len > 2 )
	{
		outbuf[ len - 2 ] = 0;
	}
	else
	{
		Q_strncpy( outbuf, "N/A", sizeof( outbuf ) );
	}
	return outbuf;
}
开发者ID:chrizonix,项目名称:RCBot2,代码行数:35,代码来源:demoinfo.cpp


示例4: Q_strlen

// Caller is responsible for delete[]'ing the array.
char *CTimer::GetMapFilePath()
{
	const char *pszMapname = (gpGlobals->mapname).ToCStr();
	size_t sz = Q_strlen("maps/") + strlen(pszMapname) + Q_strlen(".bla") + 1;
	char *pszPath = new char[sz];
	Q_strncpy(pszPath, "maps/", sz);
	Q_strncat(pszPath, pszMapname, sz);
	Q_strncat(pszPath, ".bla", sz);
	Q_FixSlashes(pszPath);
	return pszPath;
}
开发者ID:EspyEspurr,项目名称:game,代码行数:12,代码来源:Timer.cpp


示例5: Cmd_Echo_f

/*
===============
Cmd_Echo_f

Just prints the rest of the line to the console
===============
*/
void Cmd_Echo_f( void )
{
	int	i;
	static char buf[1024];
	for( i = 1; i < Cmd_Argc(); i++ )
	{
		Q_strncat( buf, Cmd_Argv( i ), 1024 );
		Q_strncat( buf, " ", 1024 );
	}
	Q_strncat( buf, "\n", 1024 );
	Sys_Print( buf );
}
开发者ID:ShaunNoWay,项目名称:xash3d,代码行数:19,代码来源:cmd.c


示例6: MakeFullPath

void MakeFullPath( const char *pIn, char *pOut, int outLen )
{
	if ( pIn[0] == '/' || pIn[0] == '\\' || pIn[1] == ':' )
	{
		// It's already a full path.
		Q_strncpy( pOut, pIn, outLen );
	}
	else
	{
		_getcwd( pOut, outLen );
		Q_strncat( pOut, "\\", outLen, COPY_ALL_CHARACTERS );
		Q_strncat( pOut, pIn, outLen, COPY_ALL_CHARACTERS );
	}
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:14,代码来源:vrad_launcher.cpp


示例7: Q_strncat

void CRagdollProp::GetAngleOverrideFromCurrentState( char *pOut, int size )
{
	pOut[0] = 0;
	for ( int i = 0; i < m_ragdoll.listCount; i++ )
	{
		if ( i != 0 )
		{
			Q_strncat( pOut, ",", size, COPY_ALL_CHARACTERS );

		}
		CFmtStr str("%d,%.2f %.2f %.2f", i, m_ragAngles[i].x, m_ragAngles[i].y, m_ragAngles[i].z );
		Q_strncat( pOut, str, size, COPY_ALL_CHARACTERS );
	}
}
开发者ID:paralin,项目名称:hl2sdk,代码行数:14,代码来源:physics_prop_ragdoll.cpp


示例8: FileSystem_GetExecutableDir

bool FileSystem_GetExecutableDir( char *exedir, int exeDirLen )
{
	exedir[0] = 0;

	if ( s_bUseVProjectBinDir )
	{
		const char *pProject = GetVProjectCmdLineValue();
		if ( !pProject )
		{
			// Check their registry.
			pProject = getenv( GAMEDIR_TOKEN );
		}
		if ( pProject )
		{
			Q_snprintf( exedir, exeDirLen, "%s%c..%cbin", pProject, CORRECT_PATH_SEPARATOR, CORRECT_PATH_SEPARATOR );
			return true;
		}
		return false;
	}

	if ( !Sys_GetExecutableName( exedir, exeDirLen ) )
		return false;
	Q_StripFilename( exedir );

	if ( IsX360() )
	{
		// The 360 can have its exe and dlls reside on different volumes
		// use the optional basedir as the exe dir
		if ( CommandLine()->FindParm( "-basedir" ) )
		{
			strcpy( exedir, CommandLine()->ParmValue( "-basedir", "" ) );
		}
	}

	Q_FixSlashes( exedir );

	// Return the bin directory as the executable dir if it's not in there
	// because that's really where we're running from...
	char ext[MAX_PATH];
	Q_StrRight( exedir, 4, ext, sizeof( ext ) );
	if ( ext[0] != CORRECT_PATH_SEPARATOR || Q_stricmp( ext+1, "bin" ) != 0 )
	{
		Q_strncat( exedir, CORRECT_PATH_SEPARATOR_S, exeDirLen, COPY_ALL_CHARACTERS );
		Q_strncat( exedir, "bin", exeDirLen, COPY_ALL_CHARACTERS );
		Q_FixSlashes( exedir );
	}
	
	return true;
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:49,代码来源:filesystem_init.cpp


示例9: Q_snprintf

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
int CTeamControlPoint::DrawDebugTextOverlays( void ) 
{
	int text_offset = BaseClass::DrawDebugTextOverlays();

	if (m_debugOverlays & OVERLAY_TEXT_BIT) 
	{
		char tempstr[1024];
		Q_snprintf(tempstr, sizeof(tempstr), "INDEX: (%d)", GetPointIndex() );
		EntityText(text_offset,tempstr,0);
		text_offset++;

		Q_snprintf( tempstr, sizeof(tempstr), "Red Previous Points: ");
		for ( int i = 0; i < MAX_PREVIOUS_POINTS; i++ )
		{
			if ( m_TeamData[2].iszPreviousPoint[i] != NULL_STRING )
			{
				Q_strncat( tempstr, STRING(m_TeamData[2].iszPreviousPoint[i]), 1024, COPY_ALL_CHARACTERS );
				Q_strncat( tempstr, ", ", 1024, COPY_ALL_CHARACTERS );
			}
		}
		EntityText(text_offset,tempstr,0);
		text_offset++;

		Q_snprintf( tempstr, sizeof(tempstr), "Blue Previous Points: " );
		for ( int i = 0; i < MAX_PREVIOUS_POINTS; i++ )
		{
			if ( m_TeamData[3].iszPreviousPoint[i] != NULL_STRING )
			{
				Q_strncat( tempstr, STRING(m_TeamData[3].iszPreviousPoint[i]), 1024, COPY_ALL_CHARACTERS );
				Q_strncat( tempstr, ", ", 1024, COPY_ALL_CHARACTERS );
			}
		}
		EntityText(text_offset,tempstr,0);
		text_offset++;

		for ( int i = 0; i < MAX_CONTROL_POINT_TEAMS; i++ )
		{
			if ( ObjectiveResource()->GetBaseControlPointForTeam(i) == GetPointIndex() )
			{
				Q_snprintf(tempstr, sizeof(tempstr), "Base Control Point for Team %d", i );
				EntityText(text_offset,tempstr,0);
				text_offset++;
			}
		}
	}

	return text_offset;
}
开发者ID:xxauroraxx,项目名称:Source.Python,代码行数:51,代码来源:team_control_point.cpp


示例10: AppendTimer

static void AppendTimer( int idx, char *buf, size_t bufsize, CFastTimer& timer )
{
	char s[ 32 ];
	Q_snprintf( s, sizeof( s ), "%d %6.3f ms", idx, timer.GetDuration().GetMillisecondsF() );

	Q_strncat( buf, s, bufsize );
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:7,代码来源:ai_hint.cpp


示例11: SetPathSettings

void SetPathSettings( )
{
	char pPathBuf[ MAX_PATH*32 ];
	if ( GetVConfigRegistrySetting( "PATH", pPathBuf, sizeof(pPathBuf) ) )
	{
		Q_FixSlashes( pPathBuf );
		const char *pPath = pPathBuf;
		const char *pFound = Q_stristr( pPath, VPROJECT_BIN_PATH );
		int nLen = Q_strlen( VPROJECT_BIN_PATH );
		while ( pFound )
		{
			if ( pFound[nLen] == '\\' )
			{
				++nLen;
			}
			if ( !pFound[nLen] || pFound[nLen] == ';' )
				return;

			pPath += nLen;
			pFound = Q_stristr( pPath, VPROJECT_BIN_PATH );
		}

		Q_strncat( pPathBuf, ";%VPROJECT%\\..\\bin", sizeof(pPathBuf) );
	}
	else
	{
		Q_strncpy( pPathBuf, "%VPROJECT%\\..\\bin", sizeof(pPathBuf) );
	}

	SetVConfigRegistrySetting( "PATH", pPathBuf, false );
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:31,代码来源:main.cpp


示例12: KeyValues

//Called every time a new time is achieved
void CTimer::SaveTime()
{
    const char *szMapName = gpGlobals->mapname.ToCStr();
    KeyValues *timesKV = new KeyValues(szMapName);
    int count = localTimes.Count();

    for (int i = 0; i < count; i++)
    {
        Time t = localTimes[i];
        char timeName[512];
        Q_snprintf(timeName, 512, "%i", t.ticks);
        KeyValues *pSubkey = new KeyValues(timeName);
        pSubkey->SetFloat("rate", t.tickrate);
        pSubkey->SetInt("date", t.date);
        timesKV->AddSubKey(pSubkey);
    }

    char file[MAX_PATH];
    Q_strcpy(file, c_mapDir);
    Q_strcat(file, szMapName, MAX_PATH);
    Q_strncat(file, c_timesExt, MAX_PATH);

    if (timesKV->SaveToFile(filesystem, file, "MOD", true))
    {
        Log("Successfully saved new time!\n");
        IGameEvent *savedEvent = gameeventmanager->CreateEvent("runtime_saved");
        if (savedEvent)
            gameeventmanager->FireEvent(savedEvent);
    }

    timesKV->deleteThis();
}
开发者ID:kirkelifson,项目名称:game,代码行数:33,代码来源:Timer.cpp


示例13: Q_strncpy

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : handle - 
// Output : const char
//-----------------------------------------------------------------------------
bool CUtlFilenameSymbolTable::String( const FileNameHandle_t& handle, char *buf, int buflen )
{
	buf[ 0 ] = 0;

	FileNameHandleInternal_t *internal = ( FileNameHandleInternal_t * )&handle;
	if ( !internal )
	{
		return false;
	}

	m_lock.LockForRead();
	const char *path = m_StringPool.HandleToString(internal->path);
	const char *fn = m_StringPool.HandleToString(internal->file);
	m_lock.UnlockRead();

	if ( !path || !fn )
	{
		return false;
	}

	Q_strncpy( buf, path, buflen );
	Q_strncat( buf, fn, buflen, COPY_ALL_CHARACTERS );

	return true;
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:30,代码来源:utlsymbol.cpp


示例14: FS_Rename

/* <269e8> ../engine/filesystem_internal.cpp:292 */
void FS_Rename(const char *originalName, const char *newName)
{
    char *cut;
    char localPath[512];
    char newPath[512];

    if (FS_GetLocalPath(originalName, localPath, ARRAYSIZE(localPath)))
    {
        Q_strcpy(newPath, localPath);
        cut = Q_strstr(newPath, originalName);

        if (cut)
        {
            *cut = 0;
#ifdef REHLDS_CHECKS
            Q_strncat(newPath, newName, ARRAYSIZE(newPath) - Q_strlen(newPath));
            newPath[ARRAYSIZE(newPath) - 1] = 0;
#else
            Q_strcat(newPath, newName);
#endif

            rename(localPath, newPath);
        }
    }
}
开发者ID:Adidasman1,项目名称:rehlds,代码行数:26,代码来源:filesystem_internal.cpp


示例15: GetSteamCfgPath

FSReturnCode_t GetSteamCfgPath( char *steamCfgPath, int steamCfgPathLen )
{
	steamCfgPath[0] = 0;
	char executablePath[MAX_PATH];
	if ( !FileSystem_GetExecutableDir( executablePath, sizeof( executablePath ) ) )
	{
		return SetupFileSystemError( false, FS_INVALID_PARAMETERS, "FileSystem_GetExecutableDir failed." );
	}
	Q_strncpy( steamCfgPath, executablePath, steamCfgPathLen );
	while ( 1 )
	{
		if ( DoesFileExistIn( steamCfgPath, "steam.cfg" ) )
			break;
	
		if ( !Q_StripLastDir( steamCfgPath, steamCfgPathLen) )
		{
			// the file isnt found, thats ok, its not mandatory
			return FS_OK;
		}			
	}
	Q_AppendSlash( steamCfgPath, steamCfgPathLen );
	Q_strncat( steamCfgPath, "steam.cfg", steamCfgPathLen, COPY_ALL_CHARACTERS );

	return FS_OK;
}
开发者ID:AeroHand,项目名称:dota2-lua-engine,代码行数:25,代码来源:filesystem_init.cpp


示例16: CL_Init

/*
====================
CL_Init
====================
*/
void CL_Init( void )
{
	qboolean loaded;
	if( host.type == HOST_DEDICATED )
		return; // nothing running on the client

	Con_Init();	
	CL_InitLocal();

	R_Init();	// init renderer
	S_Init();	// init sound

	// unreliable buffer. unsed for unreliable commands and voice stream
	BF_Init( &cls.datagram, "cls.datagram", cls.datagram_buf, sizeof( cls.datagram_buf ));

	loaded = CL_LoadProgs( va( "%s/%s" , GI->dll_path, GI->client_lib ));
	if( !loaded )
#if defined (__ANDROID__)
		{
			char clientlib[256];
			Q_strncpy( clientlib, getenv("XASH3D_ENGLIBDIR"), 256 );
			Q_strncat( clientlib, "/" CLIENTDLL, 256 );
			loaded = CL_LoadProgs( clientlib );
		}
#else
		loaded = CL_LoadProgs( CLIENTDLL );
#endif
	if( loaded )
	{
		cls.initialized = true;
		cl.maxclients = 1; // allow to drawing player in menu
		cls.olddemonum = -1;
		cls.demonum = -1;
	}
}
开发者ID:ShaunNoWay,项目名称:xash3d,代码行数:40,代码来源:cl_main.c


示例17: OpenLocalPage

// Path is relative to game folder
void OpenLocalPage( const char *title, const char *path )
{
	if ( webwindowpanel->GetFullPanel()->IsVisible() )
	{
		webwindowpanel->GetFullPanel()->ShowPanel( false );
	}

	// Need to do this to display a local html file
	KeyValues *data = new KeyValues( "WebWindowData" );
	data->SetString( "title", title );

	// it's a local HTML file
	char localURL[ _MAX_PATH + 7 ];
	Q_strncpy( localURL, "file://", sizeof( localURL ) );

	char pPathData[ _MAX_PATH ];
	g_pFullFileSystem->GetLocalPath( path, pPathData, sizeof(pPathData) );
	Q_strncat( localURL, pPathData, sizeof( localURL ), COPY_ALL_CHARACTERS );

	Msg( "%s", localURL );
	data->SetString( "url", localURL );

	webwindowpanel->GetFullPanel()->SetData( data );
		
	webwindowpanel->Show();

	data->deleteThis();
}
开发者ID:hekar,项目名称:luminousforts-2013,代码行数:29,代码来源:GUI_WebWindow.cpp


示例18: GameRules

void CBaseHudChat::MsgFunc_VoiceSubtitle( bf_read &msg )
{
	// Got message during connection
	if ( !g_PR )
		return;

	if ( !cl_showtextmsg.GetInt() )
		return;

	char szString[2048];
	char szPrefix[64];	//(Voice)
	wchar_t szBuf[128];

	int client = msg.ReadByte();
	int iMenu = msg.ReadByte();
	int iItem = msg.ReadByte();

	const char *pszSubtitle = "";

	CGameRules *pGameRules = GameRules();

	CMultiplayRules *pMultiRules = dynamic_cast< CMultiplayRules * >( pGameRules );

	Assert( pMultiRules );

	if ( pMultiRules )
	{
		pszSubtitle = pMultiRules->GetVoiceCommandSubtitle( iMenu, iItem );
	}

	SetVoiceSubtitleState( true );

	const wchar_t *pBuf = g_pVGuiLocalize->Find( pszSubtitle );
	if ( pBuf )
	{
		// Copy pBuf into szBuf[i].
		int nMaxChars = sizeof( szBuf ) / sizeof( wchar_t );
		wcsncpy( szBuf, pBuf, nMaxChars );
		szBuf[nMaxChars-1] = 0;
	}
	else
	{
		g_pVGuiLocalize->ConvertANSIToUnicode( pszSubtitle, szBuf, sizeof(szBuf) );
	}

	int len;
	g_pVGuiLocalize->ConvertUnicodeToANSI( szBuf, szString, sizeof(szString) );
	len = strlen( szString );
	if ( len && szString[len-1] != '\n' && szString[len-1] != '\r' )
	{
		Q_strncat( szString, "\n", sizeof(szString), 1 );
	}

	const wchar_t *pVoicePrefix = g_pVGuiLocalize->Find( "#Voice" );
	g_pVGuiLocalize->ConvertUnicodeToANSI( pVoicePrefix, szPrefix, sizeof(szPrefix) );
	
	ChatPrintf( client, CHAT_FILTER_NONE, "%c(%s) %s%c: %s", COLOR_PLAYERNAME, szPrefix, GetDisplayedSubtitlePlayerName( client ), COLOR_NORMAL, ConvertCRtoNL( szString ) );

	SetVoiceSubtitleState( false );
}
开发者ID:Epic-xx,项目名称:impending,代码行数:60,代码来源:hud_basechat.cpp


示例19: LevelInitPreEntity

	// Precache all wave files referenced in wave or rndwave keys
	virtual void LevelInitPreEntity()
	{
		char mapname[ 256 ];
#if !defined( CLIENT_DLL )
		StartLog();
		Q_snprintf( mapname, sizeof( mapname ), "maps/%s", STRING( gpGlobals->mapname ) );
#else
		Q_strncpy( mapname, engine->GetLevelName(), sizeof( mapname ) );
#endif

		Q_FixSlashes( mapname );
		Q_strlower( mapname );

		// Load in any map specific overrides
		char scriptfile[ 512 ];
		Q_StripExtension( mapname, scriptfile, sizeof( scriptfile ) );
		Q_strncat( scriptfile, "_level_sounds.txt", sizeof( scriptfile ), COPY_ALL_CHARACTERS );

		if ( filesystem->FileExists( scriptfile, "GAME" ) )
		{
			soundemitterbase->AddSoundOverrides( scriptfile );
		}

#if !defined( CLIENT_DLL )
		for ( int i=soundemitterbase->First(); i != soundemitterbase->InvalidIndex(); i=soundemitterbase->Next( i ) )
		{
			CSoundParametersInternal *pParams = soundemitterbase->InternalGetParametersForSound( i );
			if ( pParams->ShouldPreload() )
			{
				InternalPrecacheWaves( i );
			}
		}
#endif
	}
开发者ID:SizzlingStats,项目名称:hl2sdk-ob-valve,代码行数:35,代码来源:SoundEmitterSystem.cpp


示例20: SetSteamAppUser

void SetSteamAppUser( KeyValues *pSteamInfo, const char *steamInstallPath, CSteamEnvVars &steamEnvVars )
{
	// Always inherit the Steam user if it's already set, since it probably means we (or the
	// the app that launched us) were launched from Steam.
	char appUser[MAX_PATH];
	if ( steamEnvVars.m_SteamAppUser.GetValue( appUser, sizeof( appUser ) ) )
		return;

	const char *pTempAppUser = NULL;
	if ( pSteamInfo && (pTempAppUser = pSteamInfo->GetString( "SteamAppUser", NULL )) != NULL )
	{
		Q_strncpy( appUser, pTempAppUser, sizeof( appUser ) );
	}
	else
	{
		// They don't have SteamInfo.txt, or it's missing SteamAppUser. Try to figure out the user
		// by looking in <steam install path>\config\SteamAppData.vdf.
		char fullFilename[MAX_PATH];
		Q_strncpy( fullFilename, steamInstallPath, sizeof( fullFilename ) );
		Q_AppendSlash( fullFilename, sizeof( fullFilename ) );
		Q_strncat( fullFilename, "config\\SteamAppData.vdf", sizeof( fullFilename ), COPY_ALL_CHARACTERS );

		KeyValues *pSteamAppData = ReadKeyValuesFile( fullFilename );
		if ( !pSteamAppData || (pTempAppUser = pSteamAppData->GetString( "AutoLoginUser", NULL )) == NULL )
		{
			Error( "Can't find steam app user info." );
		}
		Q_strncpy( appUser, pTempAppUser, sizeof( appUser ) ); 
		
		pSteamAppData->deleteThis();
	}

	Q_strlower( appUser );
	steamEnvVars.m_SteamAppUser.SetValue( "%s", appUser );
}
开发者ID:AeroHand,项目名称:dota2-lua-engine,代码行数:35,代码来源:filesystem_init.cpp



注:本文中的Q_strncat函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Q_strncatz函数代码示例发布时间:2022-05-30
下一篇:
C++ Q_strncasecmp函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap