Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
magcius committed Aug 14, 2013
1 parent 0e6b5bc commit 92f8d79
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/Core/DolphinWX/Src/NetWindow.cpp
Expand Up @@ -17,6 +17,7 @@
#include <string>

#define NETPLAY_TITLEBAR "Dolphin NetPlay"
#define INITIAL_PAD_BUFFER_SIZE 20

BEGIN_EVENT_TABLE(NetPlayDiag, wxFrame)
EVT_COMMAND(wxID_ANY, wxEVT_THREAD, NetPlayDiag::OnThread)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 92f8d79

Please sign in to comment.