MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / DoProcessXML

Method DoProcessXML

engine/Poseidon/Network/NetworkMisc.cpp:417–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415 case AllDone:
416 return true;
417 }
418 return false;
419}
420
421void CheckSquadObject::ProcessXML()
422{
423 _logoUrl = RString();
424 _logoFile = RString();
425 if (DoProcessXML())
426 {
427 _identity.squad = _squad;
428 }
429 else
430 {
431 _squad = nullptr;
432 _identity.squadId = "";
433 }
434}
435
436bool CheckSquadObject::DoProcessXML()
437{
438 NET_ERROR(_identity.squadId.GetLength() > 0);
439
440 if (!_squadXMLData || _squadXMLSize <= 0)
441 {
442 LOG_WARN(Network, "[squad] XML empty for '{}'", (const char*)_identity.squadId);
443 return false;
444 }
445
446 SquadParser parser(&_identity, _squad);
447 QIStream in(_squadXMLData, _squadXMLSize);
448
449 if (!parser.Parse(in))
450 {
451 LOG_WARN(Network, "[squad] XML parse failed for '{}'", (const char*)_identity.squadId);
452 return false;
453 }
454 _squadXMLData.Free();
455
456 if (!parser.Found())
457 {
458 LOG_WARN(Network, "[squad] XML has no matching member for '{}' id={}", (const char*)_identity.name,
459 (const char*)_identity.id);
460 return false;
461 }
462
463 if (_newSquad && _squad->picture.GetLength() > 0)
464 {
465 const RString relative = Poseidon::BuildNetworkSquadPictureRelativePath(_squad->nick, _squad->picture);
466 if (relative.GetLength() == 0)
467 {
468 _squad->picture = RString();
469 return true;
470 }
471
472 _logoUrl = Poseidon::BuildNetworkSquadPictureDownloadUrl(_squad->id, _squad->picture);
473 if (_logoUrl.GetLength() == 0)
474 {

Callers

nothing calls this directly

Calls 7

GetServerTmpDirFunction · 0.85
CreatePathFunction · 0.85
FoundMethod · 0.80
RStringClass · 0.50
GetLengthMethod · 0.45
ParseMethod · 0.45
FreeMethod · 0.45

Tested by

no test coverage detected