public void Rpc_OnClientDisconnected(ENetworkID networkID) { MirrorBEventDispatcher mirrorBEventDispatcher = (MirrorBEventDispatcher)BEventManager.Instance.BEventDispatcher; if (mirrorBEventDispatcher) { mirrorBEventDispatcher.OnClientDisconnected(networkID); } }
private void OnDestroy() { if (BEventManager.IsInstanceSet) { MirrorBEventDispatcher mirrorBEventDispatcher = (MirrorBEventDispatcher)BEventManager.Instance.BEventDispatcher; if (mirrorBEventDispatcher) { mirrorBEventDispatcher.OnMirrorPlayerLeft(this, NetworkID); } } }
private void Rpc_OnBroadcastEvent(string serializedBEHandle, ENetworkID callingNetworkID) { //Debug.Log("Rpc_OnBroadcastEvent : " + callingNetworkID); MirrorBEventDispatcher mirrorBEventDispatcher = (MirrorBEventDispatcher)BEventManager.Instance.BEventDispatcher; if ((mirrorBEventDispatcher) && (mirrorBEventDispatcher.LocalNetworkID != callingNetworkID)) { BEventManager.Instance.OnBEventReplicated(serializedBEHandle); } }
private void Server_RequestServerNetworkID() { //Debug.Log("Server_RequestServerNetworkID"); MirrorBEventDispatcher mirrorBEventDispatcher = (MirrorBEventDispatcher)BEventManager.Instance.BEventDispatcher; if (mirrorBEventDispatcher) { Debug.Log("Assigned Network ID : " + NetworkID); /*networkID = */ mirrorBEventDispatcher.Server_OnHostStarted(this); //mirrorBEventDispatcher.LocalNetworkID = NetworkID; } }
private void Rpc_OnRefreshAssignedNetworkID(ENetworkID assignedNetworkID) { //Debug.Log("Rpc_OnRefreshAssignedNetworkID : " + assignedNetworkID); networkID = assignedNetworkID; // Connect network if not connected yet MirrorBEventDispatcher mirrorBEventDispatcher = (MirrorBEventDispatcher)BEventManager.Instance.BEventDispatcher; if (mirrorBEventDispatcher) { mirrorBEventDispatcher.OnRefreshConnectedNetworkIDs(assignedNetworkID); } }
private void Target_OnAssignedNetworkID(NetworkConnection networkConnection, ENetworkID assignedNetworkID) { //Debug.Log("Target_OnAssignedNetworkID : " + assignedNetworkID); networkID = assignedNetworkID; // Set up MirrorBEventDispatcher MirrorBEventDispatcher mirrorBEventDispatcher = (MirrorBEventDispatcher)BEventManager.Instance.BEventDispatcher; if (mirrorBEventDispatcher) { //mirrorBEventDispatcher.LocalNetworkID = NetworkID; //mirrorBEventDispatcher.LocalMirrorPlayerBEventListener = this; mirrorBEventDispatcher.Target_OnConnectedToHost(networkID, this); } }
private void Cmd_OnRequestNetworkID(NetworkIdentity networkIdentity) { //Debug.Log("Cmd_OnRequestNetworkID : " + networkIdentity.connectionToClient.ToString()); MirrorBEventDispatcher mirrorBEventDispatcher = (MirrorBEventDispatcher)BEventManager.Instance.BEventDispatcher; if (mirrorBEventDispatcher) { ENetworkID newNetworkID = mirrorBEventDispatcher.Server_OnNewMirrorPlayerJoined(this); if (newNetworkID != ENetworkID.NONE) { Debug.Log("Assigned network ID : " + newNetworkID); Target_OnAssignedNetworkID(networkIdentity.connectionToClient, newNetworkID); } } }
private void Target_OnBroadcastEvent(NetworkConnection networkConnection, string serializedBEHandle, ENetworkID callingNetworkID, ENetworkID targetNetworkID) { //Debug.Log("Target_OnBroadcastEvent : " + callingNetworkID); MirrorBEventDispatcher mirrorBEventDispatcher = (MirrorBEventDispatcher)BEventManager.Instance.BEventDispatcher; if ((mirrorBEventDispatcher) && (mirrorBEventDispatcher.LocalNetworkID != callingNetworkID)) { if (targetNetworkID != BEventManager.Instance.LocalNetworkID) { Debug.LogError("Recieved a target rpc but the local networkID is not the same. Target : " + targetNetworkID + " - Local : " + BEventManager.Instance.LocalNetworkID); } BEventManager.Instance.OnBEventReplicated(serializedBEHandle); } }
private void Server_OnBroadcastEvent(string serializedBEHandle, BEventReplicationType eventInvocationType, ENetworkID callingNetworkID, ENetworkID targetNetworkID) { //Debug.Log("Server_OnBroadcastEvent : " + callingNetworkID + " - " + eventInvocationType); if (eventInvocationType == BEventReplicationType.TO_TARGET) { MirrorBEventDispatcher mirrorBEventDispatcher = (MirrorBEventDispatcher)BEventManager.Instance.BEventDispatcher; if (mirrorBEventDispatcher) { NetworkIdentity targetNetworkIdentity = mirrorBEventDispatcher.GetNetworkIdentity(targetNetworkID); Target_OnBroadcastEvent(targetNetworkIdentity.connectionToClient, serializedBEHandle, callingNetworkID, targetNetworkID); } } else // ALL or ALL_OTHERS { Rpc_OnBroadcastEvent(serializedBEHandle, callingNetworkID); } }