From 92f8d795749e4284de2ce4219e5f6a729a12bdfa Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 14 Aug 2013 17:05:11 -0400 Subject: [PATCH] NetPlay: Set the pad buffer size on server creation If we don't do this, then when the game starts we'll send out the buffer size to clients being a super large value of junk, and they'll hang forever trying to accumulate an input buffer a size that they'll never ever reach in a million years. This never manifested in release builds for some reason. --- Source/Core/DolphinWX/Src/NetWindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/Src/NetWindow.cpp b/Source/Core/DolphinWX/Src/NetWindow.cpp index e4bc377f37..064e852028 100644 --- a/Source/Core/DolphinWX/Src/NetWindow.cpp +++ b/Source/Core/DolphinWX/Src/NetWindow.cpp @@ -17,6 +17,7 @@ #include #define NETPLAY_TITLEBAR "Dolphin NetPlay" +#define INITIAL_PAD_BUFFER_SIZE 20 BEGIN_EVENT_TABLE(NetPlayDiag, wxFrame) EVT_COMMAND(wxID_ANY, wxEVT_THREAD, NetPlayDiag::OnThread) @@ -246,6 +247,7 @@ void NetPlaySetupDiag::OnHost(wxCommandEvent&) m_host_port_text->GetValue().ToULong(&port); netplay_server = new NetPlayServer(u16(port)); netplay_server->ChangeGame(game); + netplay_server->AdjustPadBufferSize(INITIAL_PAD_BUFFER_SIZE); if (netplay_server->is_connected) { #ifdef USE_UPNP @@ -346,7 +348,7 @@ NetPlayDiag::NetPlayDiag(wxWindow* const parent, const CGameListCtrl* const game bottom_szr->Add(stop_btn); bottom_szr->Add(new wxStaticText(panel, wxID_ANY, _("Buffer:")), 0, wxLEFT | wxCENTER, 5 ); wxSpinCtrl* const padbuf_spin = new wxSpinCtrl(panel, wxID_ANY, wxT("20") - , wxDefaultPosition, wxSize(64, -1), wxSP_ARROW_KEYS, 0, 200, 20); + , wxDefaultPosition, wxSize(64, -1), wxSP_ARROW_KEYS, 0, 200, INITIAL_PAD_BUFFER_SIZE); padbuf_spin->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &NetPlayDiag::OnAdjustBuffer, this); bottom_szr->Add(padbuf_spin, 0, wxCENTER); }