Files
ReSkate/Engine/Game/Multiplayer/session_tools.h
T
waguandClaude Opus 5.5 67e8e439f7 Server: lock ollies for a player
A lock tool like noclip and boosts. The player's game enforces it: the roster
carries guest_ollies (protocol 53), and the jump hook gives a locked ollie no
upward speed. Plugins get player.permissions.ollies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 09:53:31 -04:00

28 lines
1.7 KiB
C++

#pragma once
#include <atomic>
namespace dingosdk {
// Noclip (and teleporting), No Bail, the forward / up boosts and ollies as the session's host lets
// the local player use them. All are allowed outside a session, and always for the host
// itself and a dedicated server's admins.
namespace session_tools_detail {
inline std::atomic<bool> noclip{true}, no_bail{true}, boosts{true}, ollies{true};
inline std::atomic<bool> session{};
}
inline bool session_noclip_allowed() noexcept { return session_tools_detail::noclip.load(std::memory_order_acquire); }
inline bool session_no_bail_allowed() noexcept { return session_tools_detail::no_bail.load(std::memory_order_acquire); }
inline bool session_boosts_allowed() noexcept { return session_tools_detail::boosts.load(std::memory_order_acquire); }
inline bool session_ollies_allowed() noexcept { return session_tools_detail::ollies.load(std::memory_order_acquire); }
// Hosting or joined to a multiplayer session (set by the session every tick). Any thread.
inline bool multiplayer_session_active() noexcept { return session_tools_detail::session.load(std::memory_order_acquire); }
inline void set_multiplayer_session_active(bool active) noexcept {
session_tools_detail::session.store(active, std::memory_order_release);
}
inline void set_session_tools_allowed(bool noclip, bool no_bail, bool boosts, bool ollies) noexcept {
session_tools_detail::noclip.store(noclip, std::memory_order_release);
session_tools_detail::no_bail.store(no_bail, std::memory_order_release);
session_tools_detail::boosts.store(boosts, std::memory_order_release);
session_tools_detail::ollies.store(ollies, std::memory_order_release);
}
} // namespace dingosdk