public override bool OpRaiseEvent(byte eventCode, object customEventContent, bool sendReliable, RaiseEventOptions raiseEventOptions) { if (PhotonNetwork.offlineMode) { return false; } return base.OpRaiseEvent(eventCode, customEventContent, sendReliable, raiseEventOptions); }
public static bool CloseConnection(PhotonPlayer kickPlayer) { if (!VerifyCanUseNetwork()) { return(false); } if (!player.IsMasterClient) { Debug.LogError("CloseConnection: Only the masterclient can kick another player."); return(false); } if (kickPlayer == null) { Debug.LogError("CloseConnection: No such player connected!"); return(false); } RaiseEventOptions raiseEventOptions = new RaiseEventOptions { TargetActors = new int[] { kickPlayer.ID } }; return(networkingPeer.OpRaiseEvent(203, null, true, raiseEventOptions)); }