| 415 | case AllDone: |
| 416 | return true; |
| 417 | } |
| 418 | return false; |
| 419 | } |
| 420 | |
| 421 | void 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 | |
| 436 | bool 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 | { |
nothing calls this directly
no test coverage detected