- Home /
Steamworks SetLobbyMemberData not triggering LobbyDataUpdate_t
I may be misunderstanding how this is supposed to work, but according to the steam documentation SetLobbyMemberData should trigger a LobbyDataUpdate_t callback:
Each user in the lobby will be receive notification of the lobby data change via a LobbyDataUpdate_t callback, and any new users joining will receive any existing data.
I am only seeing this happen on the user that is setting their lobby member data. Example below:
public void OnLobbyEntered(LobbyEnter_t callback)
{
if (SteamMatchmaking.GetNumLobbyMembers(lobbyId) % 2 == 0)
{
SteamMatchmaking.SetLobbyMemberData(lobbyId, Team.lobbyKey.ToString(), Team.Red.ToString());
}
else
{
SteamMatchmaking.SetLobbyMemberData(lobbyId, Team.lobbyKey.ToString(), Team.Blue.ToString());
}
}
When a user enters a lobby I set the lobby member data to the team they will be on. If I manually check the member lobby data via RequestLobbyData or RequestMemberLobbyData it appears correct. However the following callback is only triggered for the user setting the member lobby data:
public void OnLobbyDataUpdated(LobbyDataUpdate_t callback)
{
CSteamID lobbyId = new CSteamID(callback.m_ulSteamIDLobby);
int numPlayers = SteamMatchmaking.GetNumLobbyMembers(lobbyId);
Debug.Log(numPlayers); // never even making it this far on other clients
if (numPlayers >= networkManager.maxConnections)
{
MatchFoundPanel.GetComponent<Animator>().Play("Modal Window In");
}
}
Is there something I'm missing here? Any help would be much appreciated. Thanks.
Your answer
