squad_override_capacity.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include <cstdint>
  3. namespace sunrise::state::build_data::scenarios {
  4. struct Definition;
  5. struct RosterGroup;
  6. } // namespace sunrise::state::build_data::scenarios
  7. namespace sunrise::server::bap {
  8. struct SquadOverrideLease;
  9. namespace squad_override_capacity {
  10. /**
  11. * Checks the ClientRef manager budget used by one squad admission.
  12. * A state-local request uses its authored target bubble even when the player reports another one;
  13. * a canonical request uses the selected player region instead.
  14. * @param layout Canonical top-level and per-bubble groups published by the destination.
  15. * @param lease Retained generated groups, or null before the first override.
  16. * @param pendingGroup Newly published generated group, or null for an existing group.
  17. * @param stateLocalTarget True when pendingGroup belongs to an authored bubble sub-block.
  18. * @param targetRegion Authored slice-set index for a state-local target.
  19. * @param selectedRegion Slice-set index currently selected for the player.
  20. * @return True when top-level plus the chosen bubble fits 128 registrations and 3,072 records.
  21. */
  22. [[nodiscard]] bool available(const state::build_data::scenarios::Definition& layout,
  23. const SquadOverrideLease* lease,
  24. const state::build_data::scenarios::RosterGroup* pendingGroup,
  25. bool stateLocalTarget,
  26. std::int32_t targetRegion,
  27. std::int32_t selectedRegion) noexcept;
  28. } // namespace squad_override_capacity
  29. } // namespace sunrise::server::bap