Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add -p/--slippi-port cmd line option for spectate server port #421

Merged
merged 5 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Source/Core/DolphinWX/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ bool DolphinApp::OnInit()

if (m_select_video_backend && !m_video_backend_name.empty())
SConfig::GetInstance().m_strVideoBackend = WxStrToStr(m_video_backend_name);
if (m_select_slippi_port && m_slippi_port > 0 && m_slippi_port < 65536)
SConfig::GetInstance().m_spectator_local_port = m_slippi_port;

#ifdef IS_PLAYBACK
// Fallback to a default config file path if the user fails to provide one
Expand Down Expand Up @@ -320,6 +322,8 @@ void DolphinApp::OnInitCmdLine(wxCmdLineParser &parser)
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL},
{wxCMD_LINE_OPTION, "a", "audio_emulation", "Low level (LLE) or high level (HLE) audio", wxCMD_LINE_VAL_STRING,
wxCMD_LINE_PARAM_OPTIONAL},
{wxCMD_LINE_OPTION, "p", "slippi-port", "Port to use for the Slippi spectate server (default: 51441)",
wxCMD_LINE_VAL_NUMBER, wxCMD_LINE_PARAM_OPTIONAL},
#ifdef IS_PLAYBACK
{wxCMD_LINE_OPTION, "i", "slippi-input", "Path to Slippi replay config file (default: Slippi/playback.txt)",
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL},
Expand Down Expand Up @@ -389,6 +393,7 @@ bool DolphinApp::OnCmdLineParsed(wxCmdLineParser &parser)
m_confirm_stop = parser.Found("confirm", &m_confirm_setting);
m_select_video_backend = parser.Found("video_backend", &m_video_backend_name);
m_select_audio_emulation = parser.Found("audio_emulation", &m_audio_emulation_name);
m_select_slippi_port = parser.Found("slippi-port", &m_slippi_port);
#ifdef IS_PLAYBACK
m_select_slippi_input = parser.Found("slippi-input", &m_slippi_input_name);
m_hide_seekbar = parser.Found("hide-seekbar");
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/DolphinWX/Main.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class DolphinApp : public wxApp
bool m_show_version = false;
bool m_select_video_backend = false;
bool m_select_slippi_input = false;
bool m_select_slippi_port = false;
bool m_select_output_directory = false;
bool m_select_output_filename_base = false;
bool m_select_audio_emulation = false;
Expand All @@ -59,6 +60,7 @@ class DolphinApp : public wxApp
wxString m_video_backend_name;
wxString m_audio_emulation_name;
wxString m_slippi_input_name;
long m_slippi_port;
wxString m_output_directory;
wxString m_output_filename_base;
wxString m_user_path;
Expand Down
Loading