void RecurseClientTable( RecvTable *pTable, int &spacing ) { RecvTable *pRecvTable = pTable; if (pRecvTable == NULL){ spacing--; return; } char TableName[128]; int size = sizeof(TableName); memset( TableName, 0, size ); for (int i = 0; i < spacing; i++) V_strcat( TableName, " |", size ); V_strcat( TableName, pRecvTable->GetName(), size ); Msg( "%s\n", TableName ); spacing++; int num = pRecvTable->GetNumProps(); for (int i = 0; i < num; i++) { RecvProp *pProp = pRecvTable->GetProp(i); memset( TableName, 0, sizeof(TableName) ); for (int j = 0; j < spacing; j++) V_strcat( TableName, " |", size ); V_strcat( TableName, pProp->GetName(), size ); Msg( "%s\n", TableName ); RecurseClientTable( pProp->GetDataTable(), ++spacing ); } spacing-=2; }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- bool C_SceneEntity::GetHWMorphSceneFileName( const char *pFilename, char *pHWMFilename ) { // Are we even using hardware morph? if ( !UseHWMorphVCDs() ) return false; // Multi-player only! if ( !m_bMultiplayer ) return false; // Do we have a valid filename? if ( !( pFilename && pFilename[0] ) ) return false; // Check to see if we already have an player/hwm/* filename. if ( ( V_strstr( pFilename, "/high" ) != NULL ) || ( V_strstr( pFilename, "\\high" ) != NULL ) ) { V_strcpy( pHWMFilename, pFilename ); return true; } // Find the hardware morph scene name and pass that along as well. char szScene[MAX_PATH]; V_strcpy( szScene, pFilename ); char szSceneHWM[MAX_PATH]; szSceneHWM[0] = '\0'; char *pszToken = strtok( szScene, "/\\" ); while ( pszToken != NULL ) { if ( !V_stricmp( pszToken, "low" ) ) { V_strcat( szSceneHWM, "high", sizeof( szSceneHWM ) ); } else { V_strcat( szSceneHWM, pszToken, sizeof( szSceneHWM ) ); } pszToken = strtok( NULL, "/\\" ); if ( pszToken != NULL ) { V_strcat( szSceneHWM, "\\", sizeof( szSceneHWM ) ); } } V_strcpy( pHWMFilename, szSceneHWM ); return true; }
void Log(const LoggingContext_t *pContext, const tchar *pMessage) { if (g_ServerCommandBuffer) { V_strcat(g_ServerCommandBuffer, pMessage, g_ServerCommandBufferLength); } }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- boost::python::list PyFS_ListDir( const char *pPath, const char *pPathID, const char *pWildCard, bool appendslashdir ) { if( !pPath || !pWildCard ) return boost::python::list(); const char *pFileName; char wildcard[MAX_PATH]; FileFindHandle_t fh; boost::python::list result; // Construct the wildcard V_strncpy( wildcard, pPath, sizeof( wildcard ) ); if( V_strlen( wildcard ) == 0 ) V_strncpy( wildcard, "./", sizeof( wildcard ) ); if( appendslashdir && filesystem->IsDirectory( pPath ) ) V_AppendSlash( wildcard, sizeof( wildcard ) ); V_strcat( wildcard, pWildCard, sizeof( wildcard ) ); pFileName = filesystem->FindFirstEx( wildcard, pPathID, &fh ); while( pFileName ) { result.append( boost::python::object( boost::python::handle<>( PyUnicode_DecodeUTF8( pFileName, V_strlen( pFileName ), "ignore" ) ) ) ); pFileName = filesystem->FindNext( fh ); } filesystem->FindClose( fh ); return result; }
SpewRetval_t SourcemodSpewOutputFunc(SpewType_t spewType, tchar const *pMsg) { if (g_ServerCommandBuffer) { V_strcat(g_ServerCommandBuffer, pMsg, g_ServerCommandBufferLength); } if (g_OriginalSpewOutputFunc) { return g_OriginalSpewOutputFunc(spewType, pMsg); } else { return SPEW_CONTINUE; } }
CefRefPtr<CefResourceHandler> LocalSchemeHandlerFactory::Create(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& scheme_name, CefRefPtr<CefRequest> request) { CefRefPtr<CefResourceHandler> pResourceHandler = NULL; CefURLParts parts; CefParseURL(request->GetURL(), parts); if( CefString(&parts.path).size() < 2 ) { return NULL; } char path[MAX_PATH]; V_strncpy( path, CefString(&parts.path).ToString().c_str() + 1, sizeof(path) ); V_FixupPathName( path, sizeof( path ), path ); if( filesystem->IsDirectory( path ) ) { V_AppendSlash( path, sizeof( path ) ); V_strcat( path, "index.html", sizeof(path) ); } if( filesystem->FileExists( path, NULL ) ) { const char *pExtension = V_GetFileExtension( path ); if( cef_scheme_debug_local_handler.GetBool() ) { Msg( "Local scheme request => Path: %s, Extension: %s, Mime Type: %s, modified path: %s, exists: %d, resource type: %d\n", CefString(&parts.path).ToString().c_str(), pExtension, CefGetMimeType(pExtension).ToString().c_str(), path, filesystem->FileExists( path ), request->GetResourceType() ); } CUtlBuffer buf( 0, filesystem->Size( path, NULL ) ); if( filesystem->ReadFile( path, NULL, buf ) ) { CefRefPtr<CefStreamReader> stream = CefStreamReader::CreateForData( buf.Base(), buf.TellPut() ); if( stream != NULL ) { pResourceHandler = new CefStreamResourceHandler( CefGetMimeType(pExtension), stream ); } } } return pResourceHandler; }