/////////////////////////////////////////////////////////////////////
| 202 | |
| 203 | ////////////////////////////////////////////////////////////////////////// |
| 204 | bool CDefenceWall::ServerCreateFileProbe( const char *sFilename,SClientCheckContext &ctx,bool bRandomPart ) |
| 205 | { |
| 206 | #if !defined(LINUX) |
| 207 | // Get current language. |
| 208 | ICVar *pLanguage=m_pSystem->GetIConsole()->GetCVar("g_language"); |
| 209 | if (pLanguage && pLanguage->GetString()) |
| 210 | { |
| 211 | // Skip validation of language specific paks. |
| 212 | char fname[_MAX_FNAME]; |
| 213 | _splitpath( sFilename,NULL,NULL,fname,NULL ); |
| 214 | if (strnicmp(fname,pLanguage->GetString(),strlen(pLanguage->GetString())) == 0) |
| 215 | { |
| 216 | // This is language pak... skip checking it. |
| 217 | return false; |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | string file = sFilename; |
| 222 | GetRelativeFilename(file); |
| 223 | |
| 224 | ctx.nRequestCode = DEFWALL_CHECK_PAK; |
| 225 | ctx.bExecutableCode = false; |
| 226 | ctx.probe.sFilename = file; |
| 227 | ctx.nFilenameHash = m_pSystem->GetIDataProbe()->GetHash( file.c_str() ); |
| 228 | if (bRandomPart) |
| 229 | { |
| 230 | ctx.probe.nCodeInfo = rand()%3; |
| 231 | if (!m_pSystem->GetIDataProbe()->GetRandomFileProbe( ctx.probe,true )) |
| 232 | return false; |
| 233 | if (!m_pSystem->GetIDataProbe()->GetCode( ctx.probe )) |
| 234 | return false; |
| 235 | } |
| 236 | else |
| 237 | { |
| 238 | ctx.probe.nCodeInfo = rand()%3; |
| 239 | ctx.probe.nSize = 0xFFFFFFFF; |
| 240 | if (!m_pSystem->GetIDataProbe()->GetCode( ctx.probe )) |
| 241 | return false; |
| 242 | } |
| 243 | #ifdef LOGEVENTS |
| 244 | if (m_bLog) CryLog( "<DefenceWall> CreatedFileProbe[%d] %s %I64x",ctx.nRequestId,ctx.probe.sFilename.c_str(),ctx.probe.nCode ); |
| 245 | #endif |
| 246 | #endif |
| 247 | return true; |
| 248 | } |
| 249 | |
| 250 | ////////////////////////////////////////////////////////////////////////// |
| 251 | void CDefenceWall::FirstTimeClientValidation( ClientInfo *pClientInfo ) |
nothing calls this directly
no test coverage detected