Skip to content

fix(1.0.0-pre.3): Photon Transport connect event id assignment #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ public void OnJoinedRoom()
// any client (except host/server) need to know about their own join event
if (!m_IsHostOrServer)
{
var senderId = GetMlapiClientId(m_Client.LocalPlayer.ActorNumber, false);

NetworkEvent netEvent = NetworkEvent.Connect;
InvokeTransportEvent(netEvent, senderId);
InvokeTransportEvent(netEvent, GetMlapiClientId(m_originalRoomMasterClient, false));
}
}

Expand All @@ -60,10 +58,8 @@ public void OnLeftRoom()
// any client (except host/server) need to know about their own leave event
if (!this.m_IsHostOrServer)
{
var senderId = GetMlapiClientId(m_Client.LocalPlayer.ActorNumber, false);

NetworkEvent netEvent = NetworkEvent.Connect;
InvokeTransportEvent(netEvent, senderId);
InvokeTransportEvent(netEvent, GetMlapiClientId(m_originalRoomMasterClient, false));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,19 @@ public void OnPlayerLeftRoom(Player otherPlayer)
// server/host gets any player's leave.
// all clients disconnect when the server/host leaves.

if (m_IsHostOrServer || otherPlayer.ActorNumber == m_originalRoomMasterClient)
if (m_IsHostOrServer)
{
var senderId = GetMlapiClientId(otherPlayer.ActorNumber, false);
//Debug.Log("Host got OnPlayerLeftRoom() with senderId: "+senderId);

NetworkEvent netEvent = NetworkEvent.Disconnect;
InvokeTransportEvent(netEvent, senderId);
}
else if (otherPlayer.ActorNumber == m_originalRoomMasterClient)
{
NetworkEvent netEvent = NetworkEvent.Disconnect;
InvokeTransportEvent(netEvent, GetMlapiClientId(m_originalRoomMasterClient, false));
}
}

public void OnPlayerPropertiesUpdate(Player targetPlayer, ExitGames.Client.Photon.Hashtable changedProps)
Expand Down