definition.h 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #pragma once
  2. #include <cstdint>
  3. #include "../../ui/runtime/settings.h"
  4. #include "external/definition.h"
  5. namespace sunrise::core::settings::client {
  6. /** A load this long has stopped making progress, so the spawn stops waiting for it. */
  7. inline constexpr std::uint64_t kDefaultSpawnHoldMs = 30'000;
  8. /** A load past this is a hang, not a slow machine, and holding the spawn would never end. */
  9. inline constexpr std::uint64_t kMaximumSpawnHoldMs = 600'000;
  10. /** Read-only Client settings parsed by Core. */
  11. struct Settings {
  12. /** In-game UI visibility and input policy. */
  13. ui::runtime::Settings userInterface;
  14. /** Points the Client at a server outside this process. Off answers everything in process. */
  15. external::Settings externalServer;
  16. /**
  17. * Releases the world-transition fade channel at the in-world step.
  18. * The client only releases it on the player spawn, so this covers a spawn that never runs
  19. * and leaves the world black. On by default.
  20. */
  21. bool fadeRelease{true};
  22. /**
  23. * Skips the one-time profile setup bootflow screens.
  24. * Off by default: the server-authored account completion byte should drive normal behavior.
  25. * Keep this only as a fallback for incomplete profile-state implementations.
  26. */
  27. bool skipProfileSetup{false};
  28. /**
  29. * Reports a public region as private to the region transition.
  30. * On, a public region loads solo. Off, it waits for a public activity host, which is the
  31. * route to the citizen join. A forced destination loads solo either way.
  32. */
  33. bool regionPrivate{false};
  34. /**
  35. * Answers the orbit destination hold as released without calling the game's predicate.
  36. * The predicate waits for an armed destination or a starting cinematic, so skipping it
  37. * suppresses the orbit-side entry cinematic.
  38. */
  39. bool skipOrbitCinematicWait{false};
  40. /**
  41. * Forces the peer channel to connect directly instead of through a NAT relay.
  42. * The stock client always relays the gameplay peer channel, which cannot complete against a
  43. * loopback host with no relay server. On by default; a client stand-in for the peer relay.
  44. */
  45. bool suppressPeerRelay{true};
  46. /**
  47. * Pins the participation record to the replicated snapshot at `comp + 496`.
  48. * Off, the record is the local one at `comp + 1256`, whose spawn-gate byte no wire field
  49. * reaches.
  50. */
  51. bool pinReplicatedRecord{true};
  52. /**
  53. * Runs the player spawn after the world-transition fade is armed.
  54. * A spawn before the arm releases nothing, so the screen stays black. Settable because it is
  55. * the only thing that can turn an allowed spawn into a refusal.
  56. */
  57. bool holdSpawn{true};
  58. /** How long the spawn waits for a load. `hold_spawn` decides whether it waits at all. */
  59. std::uint64_t spawnHoldMs{kDefaultSpawnHoldMs};
  60. /**
  61. * Writes the game's decrypted mapped image to `Sunrise\dumps` during activation.
  62. * The packed executable on disk cannot be disassembled, so this is the only way to read the
  63. * code that decodes the activity wire format. Off by default: the file is the whole image and
  64. * writing it costs a second or two of every boot that enables it.
  65. */
  66. bool dumpGameImage{false};
  67. /**
  68. * Stock the client's entity free-slot bitmap when it is left entirely unstocked.
  69. * The client fills that bitmap itself only when a role global reads zero; here it reads 3, so
  70. * the fill never runs and every entity creation fails from the first frame. On, Sunrise writes
  71. * the same bytes the client would have. Off restores the previous behaviour with no rebuild.
  72. */
  73. bool stockEntityPool{true};
  74. /**
  75. * Also refill the entity pool once it has drained, not only when it was never stocked.
  76. * The pool empties from 7935 free to zero inside a minute, and a drained pool makes an
  77. * encounter bubble kick to orbit again. Refilling anyway gets past that, but it re-frees
  78. * indices that are still owned, so one index can reach two entities — that crashed a respawn.
  79. * Off by default: the kick is recoverable, the corruption is not.
  80. */
  81. bool restockDrainedEntityPool{false};
  82. };
  83. } // namespace sunrise::core::settings::client