mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-17 17:27:19 +02:00
### Overview Hey! This PR adds an optional native DirectX 12 graphical interface to the dedicated server (`ReSkateServer.exe`), making it easier to monitor and manage a server without having to rely solely on the raw terminal. ### What's included: - **DirectX 12 / ImGui Management GUI**: - Live console with color coding and command input. - Connected players list with real-time ping, position coordinates (click to copy), and kick/ban controls. - Live map switcher and world layer manager. - Ban list & admin manager. - Real-time tick rate / latency graph and live telemetry table. - Server configuration & release update checker in Settings. - **In-Game Badges & Roles**: Synced with official nametags/role badges (`DEVELOPER`, `CREATOR`, `HOMIE`, etc.) just like in-game HUDs. - **Headless CLI Support**: Kept full compatibility for headless/VPS setups — running with `--headless`, `--cli`, or `--no-gui` (or on Linux) runs standard terminal mode as usual. - **Thread Safety & Performance**: The GUI runs on the main Win32/DX12 thread while server host/networking ticks run asynchronously on worker threads so tick rate is never blocked. Tested on Windows Server 2022 with Release x64 builds against local and Steam SDR sessions. Let me know if you'd like any adjustments!
62 lines
1.2 KiB
C++
62 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#ifndef WIN32_LEAN_AND_MEAN
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#endif
|
|
#ifndef NOMINMAX
|
|
#define NOMINMAX
|
|
#endif
|
|
#include <Windows.h>
|
|
#include <d3d12.h>
|
|
#include <dxgi1_4.h>
|
|
#include <wrl/client.h>
|
|
#include <imgui.h>
|
|
#ifdef small
|
|
#undef small
|
|
#endif
|
|
|
|
#include <array>
|
|
#include <vector>
|
|
|
|
namespace dingosdk::server_gui {
|
|
|
|
using Microsoft::WRL::ComPtr;
|
|
|
|
constexpr UINT frame_count = 2;
|
|
|
|
class Renderer {
|
|
public:
|
|
bool init(HWND window);
|
|
void render();
|
|
void resize(UINT width, UINT height);
|
|
void shutdown();
|
|
|
|
private:
|
|
struct Frame {
|
|
ComPtr<ID3D12CommandAllocator> allocator;
|
|
UINT64 fence_value{};
|
|
};
|
|
struct Target {
|
|
ComPtr<ID3D12Resource> resource;
|
|
D3D12_CPU_DESCRIPTOR_HANDLE handle{};
|
|
};
|
|
|
|
ComPtr<ID3D12Device> device_;
|
|
ComPtr<ID3D12DescriptorHeap> rtv_heap_, srv_heap_;
|
|
ComPtr<ID3D12CommandQueue> queue_;
|
|
ComPtr<ID3D12GraphicsCommandList> list_;
|
|
ComPtr<ID3D12Fence> fence_;
|
|
ComPtr<IDXGISwapChain3> swap_;
|
|
std::array<Frame, frame_count> frames_;
|
|
std::array<Target, frame_count> targets_;
|
|
HANDLE fence_event_{};
|
|
HANDLE waitable_{};
|
|
UINT64 fence_value_{};
|
|
UINT64 frame_index_{};
|
|
|
|
void wait(UINT64 value);
|
|
};
|
|
|
|
} // namespace dingosdk::server_gui
|
|
|