Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
entry_handler.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <atomic>
9#include <optional>
10#include <string>
11#include <string_view>
12
13// local includes
14#include "thread_pool.h"
15#include "thread_safe.h"
16
26std::string get_launch_ui_url(const std::optional<std::string> &path = std::nullopt);
27
32void launch_ui(const std::optional<std::string> &path = std::nullopt);
33
37namespace args {
49 int creds(const char *name, int argc, char *argv[]);
50
60 int help(const char *name);
61
70 int version();
71
72#ifdef _WIN32
85#endif
86} // namespace args
87
91namespace lifetime {
92 extern char **argv;
93 extern std::atomic_int desired_exit_code;
94
100 void exit_sunshine(int exit_code, bool async);
101
105 void debug_trap();
106
112 char **get_argv();
113} // namespace lifetime
114
118void log_publisher_data();
119
120#ifdef _WIN32
126
130namespace service_ctrl {
139 bool is_service_running();
140
149 bool start_service();
150
159 bool wait_for_ui_ready();
160} // namespace service_ctrl
161#endif
void launch_ui(const std::optional< std::string > &path)
Launch the Web UI.
Definition entry_handler.cpp:37
bool is_gamestream_enabled()
Check if NVIDIA's GameStream software is running.
Definition entry_handler.cpp:112
void log_publisher_data()
Log the publisher metadata provided from CMake.
Definition entry_handler.cpp:105
std::string get_launch_ui_url(const std::optional< std::string > &path)
Build the URL used to launch the Web UI.
Definition entry_handler.cpp:29
Functions for handling command line arguments.
Definition entry_handler.cpp:41
int creds(const char *name, int argc, char *argv[])
Reset the user credentials.
Definition entry_handler.cpp:42
int version()
Print the version to stdout, then exit.
Definition entry_handler.cpp:57
int restore_nvprefs_undo()
Restore global NVIDIA control panel settings. If Sunshine was improperly terminated,...
Definition entry_handler.cpp:63
int help(const char *name)
Print help to stdout, then exit.
Definition entry_handler.cpp:52
Functions for handling the lifetime of Sunshine.
Definition entry_handler.cpp:73
std::atomic_int desired_exit_code
Desired exit code.
Definition entry_handler.cpp:75
void debug_trap()
Breaks into the debugger or terminates Sunshine if no debugger is attached.
Definition entry_handler.cpp:92
void exit_sunshine(int exit_code, bool async)
Terminates Sunshine gracefully with the provided exit code.
Definition entry_handler.cpp:77
char ** argv
Command-line argument vector.
Definition entry_handler.cpp:74
char ** get_argv()
Get the argv array passed to main().
Definition entry_handler.cpp:100
Namespace for controlling the Sunshine service model on Windows.
Definition entry_handler.cpp:127
bool wait_for_ui_ready()
Wait for the UI to be ready after Sunshine startup.
Definition entry_handler.cpp:246
bool start_service()
Start the service and wait for startup to complete.
Definition entry_handler.cpp:221
bool is_service_running()
Check if the service is running.
Definition entry_handler.cpp:210
Declarations for the thread pool system.
Declarations for thread-safe data structures.