Compare commits

...

5 Commits

Author SHA1 Message Date
lizzie 40e4a3f0a3 windowed death 2026-08-14 03:35:58 +00:00
lizzie 8b58a4f438 eatshi 2026-08-14 00:32:50 +00:00
lizzie 10b8a1b3c7 no way 2026-08-14 00:11:57 +00:00
lizzie a01fcd51cb ra 2026-08-13 23:35:40 +00:00
lizzie 5d05c88d9b g 2026-08-13 22:51:38 +00:00
4 changed files with 17 additions and 10 deletions
+1
View File
@@ -133,6 +133,7 @@ add_library(
typed_address.h
uint128.h
unique_function.h
program_args.cpp
program_args.h
random.cpp
random.h
+10 -8
View File
@@ -6,8 +6,16 @@
#include "common/program_args.h"
#include "common/logging.h"
#include "common/scm_rev.h"
#include "common/string_util.h"
#include "network/room.h"
#ifdef _WIN32
// windows.h needs to be included before shellapi.h
#include <windows.h>
#include <shellapi.h>
#include "common/windows/timer_resolution.h"
#endif
#undef _UNICODE
#include <getopt.h>
#ifndef _MSC_VER
@@ -34,7 +42,6 @@ static void PrintHelp(const char* argv0) {
"Shared options:\n"
"-l, --log-file The file for storing the room log\n"
"-H, --headless Force headless mode (no GUI). Currently only used for rooms\n"
#ifdef YUZU_ROOM
"Room options:\n"
"-N, --name The name of the room\n"
"-D, --description The room description\n"
@@ -48,7 +55,6 @@ static void PrintHelp(const char* argv0) {
"-T, --token The token used for announce\n"
"-A, --web-api-url yuzu Web API url\n"
"-B, --ban-list-file The file for storing the room ban list\n"
#endif
"Misc. options:\n"
"-h, --help Display this help and exit\n"
"-v, --version Output version information and exit\n",
@@ -66,7 +72,7 @@ int ParseArguments(ProgramArguments& args, int argc, char *argv[]) {
auto argv_w = CommandLineToArgvW(GetCommandLineW(), &argc_w);
if (argv_w == nullptr) {
LOG_CRITICAL(Frontend, "Failed to get command line arguments");
return SDL_APP_FAILURE;
return -1;
}
#endif
@@ -88,7 +94,6 @@ int ParseArguments(ProgramArguments& args, int argc, char *argv[]) {
{"log-file", required_argument, 0, 'l'},
{"headless", required_argument, 0, 'H'},
#ifdef YUZU_ROOM
{"room-name", required_argument, 0, 'N'},
{"room-description", required_argument, 0, 'D'},
{"bind-address", required_argument, 0, 'S'},
@@ -103,7 +108,6 @@ int ParseArguments(ProgramArguments& args, int argc, char *argv[]) {
{"ban-list-file", required_argument, 0, 'B'},
// Entry option
{"room", no_argument, 0, 0},
#endif
{"hlaunch", no_argument, 0, 500},
{"qlaunch", no_argument, 0, 'q'},
{"setup", no_argument, 0, 502},
@@ -126,7 +130,7 @@ int ParseArguments(ProgramArguments& args, int argc, char *argv[]) {
}
// Preserves drag and drop functionality (i.e ./eden <game path>)
char *endarg = nullptr;
[[maybe_unused]] char *endarg = nullptr;
while (optind < argc) {
int arg = getopt_long(argc, argv, "g:fhvcip::c:u:d:", long_options, &option_index);
if (arg != -1) {
@@ -209,7 +213,6 @@ int ParseArguments(ProgramArguments& args, int argc, char *argv[]) {
args.headless.emplace(true);
break;
// room
#ifdef YUZU_ROOM
case 'N':
args.room_name.assign(optarg);
break;
@@ -258,7 +261,6 @@ int ParseArguments(ProgramArguments& args, int argc, char *argv[]) {
case 'B':
args.ban_list_file.assign(optarg);
break;
#endif
}
} else {
#ifdef _WIN32
-2
View File
@@ -1155,7 +1155,6 @@ void Room::Destroy() {
room_impl->room_information.name.clear();
}
#ifdef YUZU_ROOM
/// The magic text at the beginning of a yuzu-room ban list file.
static constexpr char BAN_LIST_MAGIC[] = "YuzuRoom-BanList-1";
static constexpr char TOKEN_DELIMITER{':'};
@@ -1350,6 +1349,5 @@ int LaunchRoomLoopWithArguments(Common::ProgramArguments& args) {
Network::Shutdown();
return 0;
}
#endif
} // namespace Network
+6
View File
@@ -3,6 +3,7 @@
#include <QApplication>
#include "common/program_args.h"
#include "network/room.h"
#include "startup_checks.h"
#ifdef __unix__
@@ -185,6 +186,11 @@ int main(int argc, char* argv[]) {
Common::ProgramArguments args{};
Common::ParseArguments(args, argc, argv);
if (!args.room_name.empty() || !args.room_description.empty()) {
LOG_INFO(Frontend, "Assuming (headless) room mode");
Network::LaunchRoomLoopWithArguments(args);
return -1;
}
MainWindow main_window{std::move(args), has_broken_vulkan};
// After settings have been loaded by GMainWindow, apply the filter