Skip to content
Open
Changes from all commits
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: 3 additions & 2 deletions Source/Core/Core/NetPlayServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ ConnectionError NetPlayServer::OnConnect(ENetPeer* incoming_connection, sf::Pack
if (netplay_version != Common::GetScmRevGitStr())
return ConnectionError::VersionMismatch;

if (m_is_running || m_start_pending)
if (m_start_pending)
return ConnectionError::GameRunning;

if (m_players.size() >= 255)
Expand All @@ -468,7 +468,8 @@ ConnectionError NetPlayServer::OnConnect(ENetPeer* incoming_connection, sf::Pack
// force a ping on first netplay loop
m_update_pings = true;

AssignNewUserAPad(new_player);
if (!m_is_running)
AssignNewUserAPad(new_player);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second look of the existing NetPlay code, I don't think this is really enough to properly let a player join without them being part of the game session.

The main issue I see right now is that the odd player is still going to receive all the pad data reports, with NetPlayClient::OnPadData causing forever growing buffers.

There may be other problems too. The NetPlay code has become hard to maintain and it wasn't really designed to do what you are are trying to do here.

I have plans to rewrite the whole thing at some point.


// tell other players a new player joined
SendResponseToAllPlayers(MessageID::PlayerJoin, new_player.pid, new_player.name,
Expand Down