definition.h 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. /** Replaces stock bootflow textures that have matching DDS assets embedded in Sunrise. */
  17. bool customBootflowTextures{true};
  18. /**
  19. * Releases the world-transition fade channel at the in-world step.
  20. * The client only releases it on the player spawn, so this covers a spawn that never runs
  21. * and leaves the world black. On by default.
  22. */
  23. bool fadeRelease{true};
  24. /**
  25. * Reports a public region as private to the region transition.
  26. * On, a public region loads solo. Off, it waits for a public activity host, which is the
  27. * route to the citizen join. A forced destination loads solo either way.
  28. */
  29. bool regionPrivate{false};
  30. /**
  31. * Answers the orbit destination hold as released without calling the game's predicate.
  32. * The predicate waits for an armed destination or a starting cinematic, so skipping it
  33. * suppresses the orbit-side entry cinematic.
  34. */
  35. bool skipOrbitCinematicWait{false};
  36. /**
  37. * Forces the peer channel to connect directly instead of through a NAT relay.
  38. * The stock client always relays the gameplay peer channel, which cannot complete against a
  39. * loopback host with no relay server. On by default; a client stand-in for the peer relay.
  40. */
  41. bool suppressPeerRelay{true};
  42. /**
  43. * Pins the participation record to the replicated snapshot at `comp + 496`.
  44. * Off, the record is the local one at `comp + 1256`, whose spawn-gate byte no wire field
  45. * reaches.
  46. */
  47. bool pinReplicatedRecord{true};
  48. /**
  49. * Runs the player spawn after the world-transition fade is armed.
  50. * A spawn before the arm releases nothing, so the screen stays black. Settable because it is
  51. * the only thing that can turn an allowed spawn into a refusal.
  52. */
  53. bool holdSpawn{true};
  54. /** How long the spawn waits for a load. `hold_spawn` decides whether it waits at all. */
  55. std::uint64_t spawnHoldMs{kDefaultSpawnHoldMs};
  56. /**
  57. * Writes the game's decrypted mapped image to `Sunrise\dumps` during activation.
  58. * The packed executable on disk cannot be disassembled, so this is the only way to read the
  59. * code that decodes the activity wire format. Off by default: the file is the whole image and
  60. * writing it costs a second or two of every boot that enables it.
  61. */
  62. bool dumpGameImage{false};
  63. /**
  64. * Stock the client's entity free-slot bitmap when it is left entirely unstocked.
  65. * The client fills that bitmap itself only when a role global reads zero; here it reads 3, so
  66. * the fill never runs and every entity creation fails from the first frame. On, Sunrise writes
  67. * the same bytes the client would have. Off restores the previous behaviour with no rebuild.
  68. */
  69. bool stockEntityPool{true};
  70. /**
  71. * Also refill the entity pool once it has drained, not only when it was never stocked.
  72. * The pool empties from 7935 free to zero inside a minute, and a drained pool makes an
  73. * encounter bubble kick to orbit again. Refilling anyway gets past that, but it re-frees
  74. * indices that are still owned, so one index can reach two entities — that crashed a respawn.
  75. * Off by default: the kick is recoverable, the corruption is not.
  76. */
  77. bool restockDrainedEntityPool{false};
  78. };
  79. } // namespace sunrise::core::settings::client