Skip to content

Commit

Permalink
Stop using lobby data to store host's Steam ID
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-weiland committed Nov 28, 2023
1 parent e020d61 commit 82543f4
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ private void OnLobbyCreated(LobbyCreated_t callback)
}

lobbyId = new CSteamID(callback.m_ulSteamIDLobby);
SteamMatchmaking.SetLobbyData(lobbyId, HostAddressKey, SteamUser.GetSteamID().ToString());
UIManager.Singleton.LobbyCreationSucceeded(callback.m_ulSteamIDLobby);

NetworkManager.Singleton.Server.Start(0, 5, NetworkManager.PlayerHostedDemoMessageHandlerGroupId);
Expand All @@ -83,9 +82,9 @@ private void OnLobbyEnter(LobbyEnter_t callback)
return;

lobbyId = new CSteamID(callback.m_ulSteamIDLobby);
string hostAddress = SteamMatchmaking.GetLobbyData(lobbyId, HostAddressKey);
CSteamID hostId = SteamMatchmaking.GetLobbyOwner(lobbyId);

NetworkManager.Singleton.Client.Connect(hostAddress, messageHandlerGroupId: NetworkManager.PlayerHostedDemoMessageHandlerGroupId);
NetworkManager.Singleton.Client.Connect(hostId.ToString(), messageHandlerGroupId: NetworkManager.PlayerHostedDemoMessageHandlerGroupId);
UIManager.Singleton.LobbyEntered();
}

Expand Down

0 comments on commit 82543f4

Please sign in to comment.