mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-18 00:27:06 +02:00
Skater slot, menu and throwdown fixes; MY MODS rework; lobby parties Saved skaters (Extension/Customization, Extension/Skater) - The selected slot, and slots before it, came up as the standard skater after a start or map change. The game asks for a slot's saved outfit once per level, and that happened before the cosmetics catalog could be read. The first selection now waits for the catalog (60 s at most), and later map changes check against the catalog already read. - The retry fromabdda77is removed: the record it wrote to is a temporary on the game's stack, so it could never work. Pause menu (Extension/UI/NativeMenu) - ReSkate's entries stopped working after enough map changes: each level change took new slots in a fixed table of 1024 for the same buttons. A button now keeps its slot, and a full table hands out the slot that has gone longest unused. Throwdowns (Extension/Throwdowns, Runtime/runtime_init.cpp) - Multiplayer crashed when someone placed a throwdown after a map change. The event types are freed with the level but were cached for the process. They are now cleared when a level is left, checked before use, and looked for again in each level. MY MODS (Launcher/gui_mods.cpp, gui.cpp) - Search, a filter and an order; a switch per mod; a menu per row. - Multi-select with tick boxes, Shift-click and Ctrl+A, and a bar to enable, disable, move, update or uninstall everything ticked. Lobby parties (Extension/Multiplayer/Session) - A lobby is no longer one party. Its host keeps parties the way a dedicated server does: invite, accept, join, leave, kick, promote, open and close, with "/p" party chat. The "Lobby party" switch is gone. Protocol version unchanged (38). Mod merge (Engine/Vfs), follow-ups toe715b9b- Files rewritten into the merged patch are tracked by position, so another mod's added assets no longer shift the lookup. - Two mods adding different assets under one name is now noted, with whose copy the maps get. - mod_merge_unshift_tests compiles with the launcher tests on.
89 lines
6.1 KiB
C++
89 lines
6.1 KiB
C++
#pragma once
|
|
#include <array>
|
|
#include <cstdint>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <vector>
|
|
|
|
// Research tools for multiplayer throwdowns (analysis/throwdowns-native-mp.md §8):
|
|
// inject the events that put a player id with no native player into the local
|
|
// throwdown (AddAIParticipantToCommunityEvent), spawn a queue hosted by such an id
|
|
// (DebugSpawnThrowdownWithParams), start or destroy it, and log every participant
|
|
// change in both realms. Console: `throwdown <verb> ...`.
|
|
namespace dingosdk::multiplayer {
|
|
// Called once by initialize_native_throwdowns after its own hooks are installed.
|
|
void initialize_throwdown_lab(std::uintptr_t base) noexcept;
|
|
// Called after every authored expression (vm = the expression that just ran); sends
|
|
// queued events from the client realm and reads results off server graphs.
|
|
void pump_throwdown_lab(std::uintptr_t vm) noexcept;
|
|
// Before the game changes level state to `next`: forgets the event types found in a level that
|
|
// is being left, which are freed with it.
|
|
void throwdown_lab_before_level_transition(unsigned next) noexcept;
|
|
// Called by the SendNetworkedEvent hook for every event the local client sends.
|
|
void observe_throwdown_send(std::uint32_t hash, std::uintptr_t type, std::uintptr_t payload) noexcept;
|
|
// True for ids the lab put into a throwdown; the UI player lookups answer them with
|
|
// the local player's record so rows and host lookups resolve.
|
|
bool throwdown_lab_player(std::uint32_t player_id) noexcept;
|
|
// `skater` is the local skater's position when known (spawn without a recorded placement).
|
|
std::string throwdown_lab_command(std::string_view arguments, std::optional<std::array<float, 3>> skater);
|
|
// Coop challenge research (analysis/coop-challenges-mp.md): `challenge virtual <n>` gives the
|
|
// next challenge start n virtual participants and makes it coop; `challenge attempt [id]`
|
|
// replays the local player's last finished attempt as that player. Console: `challenge ...`.
|
|
std::string challenge_lab_command(std::string_view arguments);
|
|
|
|
// Injection for the throwdown relay (throwdown_relay.cpp); game thread, in a world.
|
|
// Each queues one event that the local client sends to its own server from the next
|
|
// client-realm expression. False when the event types cannot be found.
|
|
// Finds the event types once per process by a heap scan on a worker thread: false until it
|
|
// has, true from then on. Poll it; it never blocks.
|
|
bool prepare_throwdown_injection() noexcept;
|
|
// DebugSpawnThrowdownWithParams hosted by `host`; the queue's MMID comes back through
|
|
// throwdown_relay_spawned(token, ...).
|
|
bool queue_throwdown_spawn(std::uint64_t token, std::uint32_t host, const std::string &series,
|
|
const std::vector<std::uint8_t> &placement, const std::vector<std::uint8_t> &settings) noexcept;
|
|
bool queue_throwdown_add(std::uint32_t player, const std::string &series, std::uint32_t mmid) noexcept;
|
|
bool queue_throwdown_remove(std::uint32_t player) noexcept; // RemoveParticipantFromCommunityEvent as `player`
|
|
bool queue_throwdown_start(const std::string &series, std::uint32_t mmid) noexcept;
|
|
bool queue_throwdown_destroy(std::uint32_t mmid) noexcept;
|
|
// `player`'s total in the running throwdown: its leaderboard row and the server's own
|
|
// score list. False until the local client has opened this throwdown's leaderboard.
|
|
bool queue_throwdown_score(std::uint32_t player, std::int32_t score) noexcept;
|
|
// One leaderboard write as `player`'s own client made it: board index in the event's
|
|
// leaderboard manager, added or set. False until this throwdown's leaderboard exists.
|
|
bool queue_throwdown_row(std::uint32_t player, std::uint8_t board, bool add, std::int32_t value) noexcept;
|
|
// RequestTurnEnd as `player` (ends that player's turn if it is theirs). False while the
|
|
// running event's handle is unknown.
|
|
bool queue_throwdown_end_turn(std::uint32_t player) noexcept;
|
|
// ForceDestroyCurrentEvent as `player`: ends the event on the local server that `player` is in
|
|
// (one the local player quit keeps running here with only relayed players otherwise).
|
|
bool queue_throwdown_destroy_event(std::uint32_t player) noexcept;
|
|
// Coop challenges (throwdown_relay.cpp; analysis/coop-challenges-mp.md). Game thread.
|
|
// The local client's own solo start request for challenge `id` of `series`, as its Start button
|
|
// sends it; the relay's StartChallenge plan makes it the linked coop copy.
|
|
bool queue_challenge_start(const std::string &series, const std::string &id, bool contest) noexcept;
|
|
// AttemptFinishedForCriteria as `player`, with its owner's arrays bit-exact.
|
|
bool queue_challenge_attempt(std::uint32_t player, std::vector<std::uint8_t> criteria,
|
|
std::vector<std::uint8_t> indexes) noexcept;
|
|
// SlamObjectHitNetworked {identifier, the local copy's EventHandle} as `player`. False while the
|
|
// local copy's handle is unknown (it is read when the local client finishes the onboarding).
|
|
bool queue_challenge_slam(std::uint32_t player, std::int32_t identifier) noexcept;
|
|
// LeaveInProgressRequested as `player`: the local copy lets that player go.
|
|
bool queue_challenge_leave(std::uint32_t player) noexcept;
|
|
// Party beacons: MoveSpawnedEntityForPlayer {location, BEACON} as `player` puts that player's
|
|
// beacon there (replacing one already standing); DespawnEntityForPlayer removes it. False while
|
|
// the event types are not found yet (they are looked for in the background: call again).
|
|
bool queue_beacon_move(std::uint32_t player, const std::array<float, 16> &location) noexcept;
|
|
bool queue_beacon_remove(std::uint32_t player) noexcept;
|
|
// The local coop celebration's spots since the last call: PlayerLocation then Player2..4, each the
|
|
// 12 floats of the event's Transform, as CoopChallengeCelebrationRuleData.Activate built them.
|
|
struct ChallengeCelebration {
|
|
std::array<std::array<float, 12>, 4> spots{};
|
|
std::uint32_t count{};
|
|
};
|
|
std::optional<ChallengeCelebration> take_challenge_celebration() noexcept;
|
|
// Skate_SubmitAttempt as `player` (their client's own verdict and trick record, bit-exact).
|
|
// False while the running event's handle is unknown.
|
|
bool queue_throwdown_attempt(std::uint32_t player, bool landed, const std::array<std::uint8_t, 28> &trick) noexcept;
|
|
}
|