Search Results for

    Show / Hide Table of Contents

    Class MirrorExtensions

    A set of extensions for Mirror Networking.

    Inheritance
    System.Object
    MirrorExtensions
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Exiled.API.Extensions
    Assembly: Exiled.API.dll
    Syntax
    public static class MirrorExtensions

    Properties

    | Improve this Doc View Source

    RpcFullNames

    Gets Rpc's FullName System.String corresponding to StringExtensions(format:classname.methodname).

    Declaration
    public static ReadOnlyDictionary<string, string> RpcFullNames { get; }
    Property Value
    Type Description
    System.Collections.ObjectModel.ReadOnlyDictionary<System.String, System.String>
    | Improve this Doc View Source

    SendSpawnMessageMethodInfo

    Gets a NetworkServer.SendSpawnMessage's System.Reflection.MethodInfo.

    Declaration
    public static MethodInfo SendSpawnMessageMethodInfo { get; }
    Property Value
    Type Description
    System.Reflection.MethodInfo
    | Improve this Doc View Source

    SetDirtyBitsMethodInfo

    Gets a Mirror.NetworkBehaviour.SetSyncVarDirtyBit(System.UInt64)'s System.Reflection.MethodInfo.

    Declaration
    public static MethodInfo SetDirtyBitsMethodInfo { get; }
    Property Value
    Type Description
    System.Reflection.MethodInfo
    | Improve this Doc View Source

    SyncVarDirtyBits

    Gets a all DirtyBit System.UInt64 from StringExtensions(format:classname.methodname).

    Declaration
    public static ReadOnlyDictionary<string, ulong> SyncVarDirtyBits { get; }
    Property Value
    Type Description
    System.Collections.ObjectModel.ReadOnlyDictionary<System.String, System.UInt64>
    | Improve this Doc View Source

    WriterExtensions

    Gets System.Reflection.MethodInfo corresponding to System.Type.

    Declaration
    public static ReadOnlyDictionary<Type, MethodInfo> WriterExtensions { get; }
    Property Value
    Type Description
    System.Collections.ObjectModel.ReadOnlyDictionary<System.Type, System.Reflection.MethodInfo>

    Methods

    | Improve this Doc View Source

    ChangeAppearance(Player, RoleTypeId, Boolean, Byte)

    Change Player character model for appearance. It will continue until Player's PlayerRoles.RoleTypeId changes.

    Declaration
    public static void ChangeAppearance(this Player player, RoleTypeId type, bool skipJump = false, byte unitId = 0)
    Parameters
    Type Name Description
    Player player

    Player to change.

    PlayerRoles.RoleTypeId type

    Model type.

    System.Boolean skipJump

    Whether or not to skip the little jump that works around an invisibility issue.

    System.Byte unitId

    The UnitNameId to use for the player's new role, if the player's new role uses unit names. (is NTF).

    | Improve this Doc View Source

    ChangeAppearance(Player, RoleTypeId, IEnumerable<Player>, Boolean, Byte)

    Change Player character model for appearance. It will continue until Player's PlayerRoles.RoleTypeId changes.

    Declaration
    public static void ChangeAppearance(this Player player, RoleTypeId type, IEnumerable<Player> playersToAffect, bool skipJump = false, byte unitId = 0)
    Parameters
    Type Name Description
    Player player

    Player to change.

    PlayerRoles.RoleTypeId type

    Model type.

    System.Collections.Generic.IEnumerable<Player> playersToAffect

    The players who should see the changed appearance.

    System.Boolean skipJump

    Whether or not to skip the little jump that works around an invisibility issue.

    System.Byte unitId

    The UnitNameId to use for the player's new role, if the player's new role uses unit names. (is NTF).

    | Improve this Doc View Source

    EditNetworkObject(NetworkIdentity, Action<NetworkIdentity>)

    Edit Mirror.NetworkIdentity's parameter and sync.

    Declaration
    public static void EditNetworkObject(NetworkIdentity identity, Action<NetworkIdentity> customAction)
    Parameters
    Type Name Description
    Mirror.NetworkIdentity identity

    Target object.

    System.Action<Mirror.NetworkIdentity> customAction

    Edit function.

    | Improve this Doc View Source

    MessageTranslated(Player, String, String, Boolean, Boolean, Boolean)

    Send CASSIE announcement with custom subtitles for translation that only Player can hear and see it.

    Declaration
    public static void MessageTranslated(this Player player, string words, string translation, bool makeHold = false, bool makeNoise = true, bool isSubtitles = true)
    Parameters
    Type Name Description
    Player player

    Target to send.

    System.String words

    The message to be reproduced.

    System.String translation

    The translation should be show in the subtitles.

    System.Boolean makeHold

    Same on MessageTranslated(String, String, Boolean, Boolean, Boolean)'s isHeld.

    System.Boolean makeNoise

    Same on MessageTranslated(String, String, Boolean, Boolean, Boolean)'s isNoisy.

    System.Boolean isSubtitles

    Same on MessageTranslated(String, String, Boolean, Boolean, Boolean)'s isSubtitles.

    | Improve this Doc View Source

    PlayBeepSound(Player)

    Plays a beep sound that only the target player can hear.

    Declaration
    public static void PlayBeepSound(this Player player)
    Parameters
    Type Name Description
    Player player

    Target to play sound to.

    | Improve this Doc View Source

    PlayCassieAnnouncement(Player, String, Boolean, Boolean, Boolean)

    Send CASSIE announcement that only Player can hear.

    Declaration
    public static void PlayCassieAnnouncement(this Player player, string words, bool makeHold = false, bool makeNoise = true, bool isSubtitles = false)
    Parameters
    Type Name Description
    Player player

    Target to send.

    System.String words

    Announcement words.

    System.Boolean makeHold

    Same on Message(String, Boolean, Boolean, Boolean)'s isHeld.

    System.Boolean makeNoise

    Same on Message(String, Boolean, Boolean, Boolean)'s isNoisy.

    System.Boolean isSubtitles

    Same on Message(String, Boolean, Boolean, Boolean)'s isSubtitles.

    | Improve this Doc View Source

    PlayGunSound(Player, Vector3, ItemType, Byte, Byte)

    Plays a gun sound that only the player can hear.

    Declaration
    public static void PlayGunSound(this Player player, Vector3 position, ItemType itemType, byte volume, byte audioClipId = 0)
    Parameters
    Type Name Description
    Player player

    Target to play.

    UnityEngine.Vector3 position

    Position to play on.

    ItemType itemType

    Weapon' sound to play.

    System.Byte volume

    Sound's volume to set.

    System.Byte audioClipId

    GunAudioMessage's audioClipId to set (default = 0).

    | Improve this Doc View Source

    ResyncSyncVar(NetworkIdentity, Type, String)

    Force resync to client's Mirror.SyncVarAttribute.

    Declaration
    public static void ResyncSyncVar(NetworkIdentity behaviorOwner, Type targetType, string propertyName)
    Parameters
    Type Name Description
    Mirror.NetworkIdentity behaviorOwner

    Mirror.NetworkIdentity of object that owns Mirror.NetworkBehaviour.

    System.Type targetType

    Mirror.NetworkBehaviour's type.

    System.String propertyName

    Property name starting with Network.

    | Improve this Doc View Source

    SendFakeSyncObject(Player, NetworkIdentity, Type, Action<NetworkWriter>)

    Send fake values to client's Mirror.SyncObject.

    Declaration
    public static void SendFakeSyncObject(Player target, NetworkIdentity behaviorOwner, Type targetType, Action<NetworkWriter> customAction)
    Parameters
    Type Name Description
    Player target

    Target to send.

    Mirror.NetworkIdentity behaviorOwner

    Mirror.NetworkIdentity of object that owns Mirror.NetworkBehaviour.

    System.Type targetType

    Mirror.NetworkBehaviour's type.

    System.Action<Mirror.NetworkWriter> customAction

    Custom writing action.

    Examples

    EffectOnlySCP207.

     MirrorExtensions.SendCustomSync(player, player.ReferenceHub.networkIdentity, typeof(PlayerEffectsController), (writer) => {
      writer.WriteUInt64(1ul);                                           // DirtyObjectsBit
      writer.WriteUInt32(1);                                             // DirtyIndexCount
      writer.WriteByte((byte)SyncList<byte>.Operation.OP_SET);     // Operations
      writer.WriteUInt32(17);                                            // EditIndex
      writer.WriteByte(1);                                               // Value
     });
    | Improve this Doc View Source

    SendFakeSyncVar(Player, NetworkIdentity, Type, String, Object)

    Send fake values to client's Mirror.SyncVarAttribute.

    Declaration
    public static void SendFakeSyncVar(this Player target, NetworkIdentity behaviorOwner, Type targetType, string propertyName, object value)
    Parameters
    Type Name Description
    Player target

    Target to send.

    Mirror.NetworkIdentity behaviorOwner

    Mirror.NetworkIdentity of object that owns Mirror.NetworkBehaviour.

    System.Type targetType

    Mirror.NetworkBehaviour's type.

    System.String propertyName

    Property name starting with Network.

    System.Object value

    Value of send to target.

    | Improve this Doc View Source

    SendFakeTargetRpc(Player, NetworkIdentity, Type, String, Object[])

    Send fake values to client's Mirror.ClientRpcAttribute.

    Declaration
    public static void SendFakeTargetRpc(Player target, NetworkIdentity behaviorOwner, Type targetType, string rpcName, params object[] values)
    Parameters
    Type Name Description
    Player target

    Target to send.

    Mirror.NetworkIdentity behaviorOwner

    Mirror.NetworkIdentity of object that owns Mirror.NetworkBehaviour.

    System.Type targetType

    Mirror.NetworkBehaviour's type.

    System.String rpcName

    Property name starting with Rpc.

    System.Object[] values

    Values of send to target.

    | Improve this Doc View Source

    SetName(Player, Player, String)

    Sets DisplayNickname of a player that only the target player can see.

    Declaration
    public static void SetName(this Player target, Player player, string name)
    Parameters
    Type Name Description
    Player target

    Only this player can see the name changed.

    Player player

    Player that will desync the CustomName.

    System.String name

    Nickname to set.

    | Improve this Doc View Source

    SetPlayerInfoForTargetOnly(Player, Player, String)

    Set CustomInfo on the target player that only the player can see.

    Declaration
    public static void SetPlayerInfoForTargetOnly(this Player player, Player target, string info)
    Parameters
    Type Name Description
    Player player

    Only this player can see info.

    Player target

    Target to set info.

    System.String info

    Setting info.

    | Improve this Doc View Source

    SetRoomColorForTargetOnly(Room, Player, Color)

    Sets Color of a room that only the target player can see.

    Declaration
    public static void SetRoomColorForTargetOnly(this Room room, Player target, Color color)
    Parameters
    Type Name Description
    Room room

    Room to modify.

    Player target

    Only this player can see room color.

    UnityEngine.Color color

    Color to set.

    | Improve this Doc View Source

    SetRoomLightIntensityForTargetOnly(Room, Player, Single)

    Sets Room of a room that only the target player can see.

    Declaration
    [Obsolete("This features has been remove by NW", true)]
    public static void SetRoomLightIntensityForTargetOnly(this Room room, Player target, float multiplier)
    Parameters
    Type Name Description
    Room room

    Room to modify.

    Player target

    Only this player can see room color.

    System.Single multiplier

    Light intensity multiplier to set.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX