Skip to content

Commit 18a12df

Browse files
committed
Further along pad buffer implementation, Dolphin servers don't like it though
1 parent 9e8dcf5 commit 18a12df

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

Source/Core/Core/NetPlayClient.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
#include "UICommon/GameFile.h"
8080
#include "VideoCommon/OnScreenDisplay.h"
8181
#include "VideoCommon/VideoConfig.h"
82+
#include "NetPlayServer.h"
8283

8384
namespace NetPlay
8485
{
@@ -334,14 +335,19 @@ void NetPlayClient::AdjustPlayerPadBufferSize(u32 buffer)
334335
m_local_player->buffer = buffer;
335336
if (m_local_player->buffer < m_minimum_buffer_size)
336337
m_local_player->buffer = m_minimum_buffer_size;
337-
338-
// need to rewrite this area
339-
340-
/* auto spac = std::make_unique<sf::Packet>();
341-
*spac << static_cast <MessageID>(OnPadBufferPlayer);
342-
*spac << local_player->buffer;
343-
SendAsync(std::move(spac)); */
344338

339+
340+
// not needed on clients with host input authority
341+
if (!m_host_input_authority)
342+
{
343+
// tell clients to change buffer size
344+
sf::Packet spac;
345+
spac << MessageID::PadBufferPlayer;
346+
spac << m_local_player->buffer;
347+
348+
SendAsync(std::move(spac));
349+
}
350+
345351
m_dialog->OnPlayerPadBufferChanged(m_local_player->buffer);
346352
}
347353

Source/Core/Core/NetPlayServer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,9 @@ ConnectionError NetPlayServer::OnConnect(ENetPeer* incoming_connection, sf::Pack
499499

500500
SendResponseToPlayer(new_player, MessageID::GameStatus, existing_player.pid,
501501
static_cast<u8>(existing_player.game_status));
502+
503+
SendResponseToPlayer(new_player, MessageID::PadBufferPlayer, existing_player.pid,
504+
static_cast<u8>(existing_player.m_player_buffer_size));
502505
}
503506

504507
if (Config::Get(Config::NETPLAY_ENABLE_QOS))

0 commit comments

Comments
 (0)