Ejemplo n.º 1
0
/*static*/ bool CAutoTester::SaveToValidXmlFile( const XmlNodeRef &xmlToSave, const char *fileName)
{
#ifdef WIN32
	CrySetFileAttributes( fileName,0x00000080 ); // FILE_ATTRIBUTE_NORMAL
#endif //WIN32
	XmlString xmlStr = xmlToSave->getXML();
	CDebugAllowFileAccess allowFileAccess;
	FILE *file = gEnv->pCryPak->FOpen( fileName,"wt" );
	allowFileAccess.End();
	if (file)
	{
		const char *sxml = (const char*)xmlStr;
		char xmlHeader[] = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
		gEnv->pCryPak->FWrite(xmlHeader, strlen(xmlHeader), file);
		gEnv->pCryPak->FWrite( sxml,xmlStr.length(),file );
		gEnv->pCryPak->FClose(file);
		return true;
	}
	return false;
}
void CGameQueryListener::OnReceiveGameState( const char * fromAddress, XmlNodeRef xmlData )
{
	CRY_ASSERT( m_pNetListener );
	CryLogAlways( "Game running at: %s", fromAddress );
	CryLogAlways( xmlData->getXML().c_str() );
}