NetworkingPeer.OpRaiseEvent C# (CSharp) Method

OpRaiseEvent() public method

public OpRaiseEvent ( byte eventCode, object customEventContent, bool sendReliable, RaiseEventOptions, raiseEventOptions ) : bool
eventCode byte
customEventContent object
sendReliable bool
raiseEventOptions RaiseEventOptions,
return bool
    public override bool OpRaiseEvent(byte eventCode, object customEventContent, bool sendReliable, RaiseEventOptions raiseEventOptions)
    {
        if (PhotonNetwork.offlineMode)
        {
            return false;
        }

        return base.OpRaiseEvent(eventCode, customEventContent, sendReliable, raiseEventOptions);
    }

Usage Example

Exemplo n.º 1
0
    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));
    }
All Usage Examples Of NetworkingPeer::OpRaiseEvent
NetworkingPeer