squad_entity_retirement.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #pragma once
  2. #include "../../state/activity/runtime.h"
  3. #include "../../state/gameplay/external/squad_entity_retirement.h"
  4. namespace sunrise::server::gameplay::entity_identities {
  5. class PublicationLease;
  6. }
  7. namespace sunrise::server::activity::host {
  8. struct PendingScriptableOverride;
  9. }
  10. namespace sunrise::state::activity_sdk {
  11. struct BoundView;
  12. }
  13. namespace sunrise::state::build_data::scriptables {
  14. struct Snapshot;
  15. }
  16. namespace sunrise::server::gameplay::squad_entity_retirement {
  17. using RetirementPlan = state::gameplay::squad_entity_retirement::RetirementPlan;
  18. enum class TransitionStatus : std::uint8_t { refused, pending, ready };
  19. /** A prop reset must finish publication before its script can move to the next state. */
  20. [[nodiscard]] TransitionStatus
  21. begin_placed_transition(const state::activity_sdk::BoundView&,
  22. const state::build_data::scriptables::Snapshot&,
  23. std::uint64_t transition,
  24. std::int32_t fromRegion,
  25. std::int32_t toRegion) noexcept;
  26. /** A pending host-owned prop lifetime change owes a retirement publication. */
  27. [[nodiscard]] bool placed_transition_pending(const state::activity::SessionBinding&,
  28. std::uint64_t generation) noexcept;
  29. /** Cancelling a mission withdraws only its pending prop lifetime decision. */
  30. void cancel_placed_transition(const state::activity::SessionBinding&,
  31. std::uint64_t generation,
  32. std::uint64_t transition = 0) noexcept;
  33. /** The authenticated abdication freezes exact identities before a later renewal can retire them. */
  34. void observe_abdication(const state::activity::SessionBinding&,
  35. std::uint64_t generation,
  36. std::uint8_t bubble,
  37. const state::activity::bubble_authority::EntitySlotMask&) noexcept;
  38. /** Returned slots cannot remain eligible for an earlier release. */
  39. void returned_slots(const state::activity::SessionBinding&,
  40. std::uint64_t generation,
  41. const state::activity::bubble_authority::EntitySlotMask&) noexcept;
  42. /** Renewal preparation never consumes retained entities. */
  43. [[nodiscard]] bool prepare_retirement(const state::activity::SessionBinding&,
  44. std::uint64_t generation,
  45. std::uint8_t bubble,
  46. RetirementPlan&) noexcept;
  47. /** Publication must revalidate the exact staged source, mask, and revision. */
  48. [[nodiscard]] bool validate_retirement(const state::activity::SessionBinding&,
  49. std::uint64_t generation,
  50. const RetirementPlan&) noexcept;
  51. /** Pins exact identity state through transport publication after the last policy validation. */
  52. [[nodiscard]] bool begin_retirement_publication(const state::activity::SessionBinding&,
  53. std::uint64_t generation,
  54. const RetirementPlan&,
  55. entity_identities::PublicationLease&) noexcept;
  56. /** Commits only after the complete carrying transport publication succeeds. */
  57. void commit_retirement(const RetirementPlan&) noexcept;
  58. /** Authored opt-in becomes eligible only after its positive Auth body was delivered. */
  59. void record_delivered_target(const state::activity::SessionBinding&,
  60. std::uint64_t generation,
  61. const activity::host::PendingScriptableOverride&) noexcept;
  62. void reset() noexcept;
  63. } // namespace sunrise::server::gameplay::squad_entity_retirement