• Home
  • Documentation
  • Guides
  • FAQ
  • Get Llama Chat
Search Results for

    Show / Hide Table of Contents
    • LlamaSoftware.Chat
      • AbstractPlayerDatabase<T>
      • AreaTriggeredChannelJoiner
      • BaseNetworkManager
      • ChatSystem
      • ChatSystemConstants
      • LlamaChatSettings
      • LlamaChatSettingsProvider
      • Player_Chat
      • SQLitePlayerDatabase
    • LlamaSoftware.Chat.CustomEditors
      • ChatPanelEditor
      • ChatPopupEditor
      • ChatSystemEditor
      • LlamaChatSettingsCreator
      • Player_ChatEditor
      • SocialUIPopupEditor
      • Utilities
    • LlamaSoftware.Chat.Demo
      • ChatCommandHandler
      • CreateAccount
      • DemoGuildJoiner
      • DemoGuildLeaver
      • DummyNameGenerator
      • DynamicChatPopup
      • Login
      • LoginController
      • SettingsPanel
    • LlamaSoftware.Chat.Demo.Lobby
      • LobbyController
      • LobbyLoginController
      • LobbyNetworkManager
      • LobbyPlayer
      • StressTestSender
    • LlamaSoftware.Chat.Demo.Model
      • LobbyPlayerListMessage
      • LoginMessage
      • LoginResponseMessage
      • RegisterPlayerMessage
      • RegisterUserResponseMessage
    • LlamaSoftware.Chat.Model
      • AddRemoveFriendMessage
      • BlockListMessage
      • BlockUnblockPlayerMessage
      • ChatChannel
      • ChatChannel.ChatType
      • ChatEntry
      • ChatMessage
      • FriendsListMessage
      • FriendUpdateMessage
      • Player
      • PlayerToSocialPlayerConverter
      • ServerBroadcastMessage
      • SocialPlayer
      • SubscribeToChannelsMessage
    • LlamaSoftware.Chat.UI
      • BlockedPlayer
      • ChatChannelClickHandler
      • ChatPanel
      • ChatPanel.DirectChatPlayer
      • ChatPanel.UIChatChannel
      • ChatPopup
      • ChatPopupClickHandler
      • Command
      • DynamicChatItem
      • DynamicChatItemEvent
      • Friend
      • Friend.Status
      • LinkType
      • SocialClickHandler
      • SocialUI
      • SocialUIClickHandler
      • SocialUIPopup
      • UIChatMessage
      • WordFilter

    Class Player_Chat

    Local Player identifying script. Manages registering UnityEngine.Networking.NetworkClient.RegisterHandler(System.Int16,UnityEngine.Networking.NetworkMessageDelegate) handlers, setting up scene references, overhead text, and the SocialUI if provided.

    This should be attached to your root Player object in your game.

    Inheritance
    System.Object
    UnityEngine.Object
    UnityEngine.Component
    UnityEngine.Behaviour
    UnityEngine.MonoBehaviour
    UnityEngine.Networking.NetworkBehaviour
    Player_Chat
    Inherited Members
    UnityEngine.Networking.NetworkBehaviour.SetDirtyBit(System.UInt32)
    UnityEngine.Networking.NetworkBehaviour.ClearAllDirtyBits()
    UnityEngine.Networking.NetworkBehaviour.OnSerialize(UnityEngine.Networking.NetworkWriter, System.Boolean)
    UnityEngine.Networking.NetworkBehaviour.OnDeserialize(UnityEngine.Networking.NetworkReader, System.Boolean)
    UnityEngine.Networking.NetworkBehaviour.OnNetworkDestroy()
    UnityEngine.Networking.NetworkBehaviour.OnStartClient()
    UnityEngine.Networking.NetworkBehaviour.OnStartAuthority()
    UnityEngine.Networking.NetworkBehaviour.OnStopAuthority()
    UnityEngine.Networking.NetworkBehaviour.OnRebuildObservers(System.Collections.Generic.HashSet<UnityEngine.Networking.NetworkConnection>, System.Boolean)
    UnityEngine.Networking.NetworkBehaviour.OnSetLocalVisibility(System.Boolean)
    UnityEngine.Networking.NetworkBehaviour.OnCheckObserver(UnityEngine.Networking.NetworkConnection)
    UnityEngine.Networking.NetworkBehaviour.GetNetworkChannel()
    UnityEngine.Networking.NetworkBehaviour.GetNetworkSendInterval()
    UnityEngine.Networking.NetworkBehaviour.localPlayerAuthority
    UnityEngine.Networking.NetworkBehaviour.isServer
    UnityEngine.Networking.NetworkBehaviour.isClient
    UnityEngine.Networking.NetworkBehaviour.isLocalPlayer
    UnityEngine.Networking.NetworkBehaviour.hasAuthority
    UnityEngine.Networking.NetworkBehaviour.netId
    UnityEngine.Networking.NetworkBehaviour.connectionToServer
    UnityEngine.Networking.NetworkBehaviour.connectionToClient
    UnityEngine.Networking.NetworkBehaviour.playerControllerId
    UnityEngine.Networking.NetworkBehaviour.syncVarDirtyBits
    UnityEngine.Networking.NetworkBehaviour.syncVarHookGuard
    UnityEngine.MonoBehaviour.IsInvoking()
    UnityEngine.MonoBehaviour.CancelInvoke()
    UnityEngine.MonoBehaviour.Invoke(System.String, System.Single)
    UnityEngine.MonoBehaviour.InvokeRepeating(System.String, System.Single, System.Single)
    UnityEngine.MonoBehaviour.CancelInvoke(System.String)
    UnityEngine.MonoBehaviour.IsInvoking(System.String)
    UnityEngine.MonoBehaviour.StartCoroutine(System.String)
    UnityEngine.MonoBehaviour.StartCoroutine(System.String, System.Object)
    UnityEngine.MonoBehaviour.StartCoroutine(System.Collections.IEnumerator)
    UnityEngine.MonoBehaviour.StartCoroutine_Auto(System.Collections.IEnumerator)
    UnityEngine.MonoBehaviour.StopCoroutine(System.Collections.IEnumerator)
    UnityEngine.MonoBehaviour.StopCoroutine(UnityEngine.Coroutine)
    UnityEngine.MonoBehaviour.StopCoroutine(System.String)
    UnityEngine.MonoBehaviour.StopAllCoroutines()
    UnityEngine.MonoBehaviour.print(System.Object)
    UnityEngine.MonoBehaviour.useGUILayout
    UnityEngine.MonoBehaviour.runInEditMode
    UnityEngine.Behaviour.enabled
    UnityEngine.Behaviour.isActiveAndEnabled
    UnityEngine.Component.GetComponent(System.Type)
    UnityEngine.Component.GetComponent<T>()
    UnityEngine.Component.GetComponent(System.String)
    UnityEngine.Component.GetComponentInChildren(System.Type, System.Boolean)
    UnityEngine.Component.GetComponentInChildren(System.Type)
    UnityEngine.Component.GetComponentInChildren<T>(System.Boolean)
    UnityEngine.Component.GetComponentInChildren<T>()
    UnityEngine.Component.GetComponentsInChildren(System.Type, System.Boolean)
    UnityEngine.Component.GetComponentsInChildren(System.Type)
    UnityEngine.Component.GetComponentsInChildren<T>(System.Boolean)
    UnityEngine.Component.GetComponentsInChildren<T>(System.Boolean, System.Collections.Generic.List<T>)
    UnityEngine.Component.GetComponentsInChildren<T>()
    UnityEngine.Component.GetComponentsInChildren<T>(System.Collections.Generic.List<T>)
    UnityEngine.Component.GetComponentInParent(System.Type)
    UnityEngine.Component.GetComponentInParent<T>()
    UnityEngine.Component.GetComponentsInParent(System.Type, System.Boolean)
    UnityEngine.Component.GetComponentsInParent(System.Type)
    UnityEngine.Component.GetComponentsInParent<T>(System.Boolean)
    UnityEngine.Component.GetComponentsInParent<T>(System.Boolean, System.Collections.Generic.List<T>)
    UnityEngine.Component.GetComponentsInParent<T>()
    UnityEngine.Component.GetComponents(System.Type)
    UnityEngine.Component.GetComponents(System.Type, System.Collections.Generic.List<UnityEngine.Component>)
    UnityEngine.Component.GetComponents<T>(System.Collections.Generic.List<T>)
    UnityEngine.Component.GetComponents<T>()
    UnityEngine.Component.CompareTag(System.String)
    UnityEngine.Component.SendMessageUpwards(System.String, System.Object, UnityEngine.SendMessageOptions)
    UnityEngine.Component.SendMessageUpwards(System.String, System.Object)
    UnityEngine.Component.SendMessageUpwards(System.String)
    UnityEngine.Component.SendMessageUpwards(System.String, UnityEngine.SendMessageOptions)
    UnityEngine.Component.SendMessage(System.String, System.Object)
    UnityEngine.Component.SendMessage(System.String)
    UnityEngine.Component.SendMessage(System.String, System.Object, UnityEngine.SendMessageOptions)
    UnityEngine.Component.SendMessage(System.String, UnityEngine.SendMessageOptions)
    UnityEngine.Component.BroadcastMessage(System.String, System.Object, UnityEngine.SendMessageOptions)
    UnityEngine.Component.BroadcastMessage(System.String, System.Object)
    UnityEngine.Component.BroadcastMessage(System.String)
    UnityEngine.Component.BroadcastMessage(System.String, UnityEngine.SendMessageOptions)
    UnityEngine.Component.transform
    UnityEngine.Component.gameObject
    UnityEngine.Component.tag
    UnityEngine.Object.GetInstanceID()
    UnityEngine.Object.GetHashCode()
    UnityEngine.Object.Equals(System.Object)
    UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion)
    UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
    UnityEngine.Object.Instantiate(UnityEngine.Object)
    UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform)
    UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform, System.Boolean)
    UnityEngine.Object.Instantiate<T>(T)
    UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion)
    UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
    UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform)
    UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform, System.Boolean)
    UnityEngine.Object.Destroy(UnityEngine.Object, System.Single)
    UnityEngine.Object.Destroy(UnityEngine.Object)
    UnityEngine.Object.DestroyImmediate(UnityEngine.Object, System.Boolean)
    UnityEngine.Object.DestroyImmediate(UnityEngine.Object)
    UnityEngine.Object.FindObjectsOfType(System.Type)
    UnityEngine.Object.DontDestroyOnLoad(UnityEngine.Object)
    UnityEngine.Object.DestroyObject(UnityEngine.Object, System.Single)
    UnityEngine.Object.DestroyObject(UnityEngine.Object)
    UnityEngine.Object.FindSceneObjectsOfType(System.Type)
    UnityEngine.Object.FindObjectsOfTypeIncludingAssets(System.Type)
    UnityEngine.Object.FindObjectsOfType<T>()
    UnityEngine.Object.FindObjectOfType<T>()
    UnityEngine.Object.FindObjectsOfTypeAll(System.Type)
    UnityEngine.Object.FindObjectOfType(System.Type)
    UnityEngine.Object.ToString()
    UnityEngine.Object.name
    UnityEngine.Object.hideFlags
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: LlamaSoftware.Chat
    Assembly: LlamaSoftware.Chat.dll
    Syntax
    public class Player_Chat : NetworkBehaviour

    Fields

    chatPanel

    Reference to the ChatPanel in the current active scene. Set up in OnStartLocalPlayer().

    Declaration
    public ChatPanel chatPanel
    Field Value
    Type Description
    ChatPanel

    DefaultChannels

    Default Chat Channels the player should be subscribed to. Every player will default to be inside these channels on object construction. Any dynamic channels should not be included here. See AreaTriggeredChannelJoiner for setting up dynamic channels.

    Declaration
    public List<ChatChannel> DefaultChannels
    Field Value
    Type Description
    System.Collections.Generic.List<ChatChannel>

    DelayBeforeFadingWorldChat

    Delay before calling UnityEngine.Animator.SetTrigger(System.String) with FADE_OUT after the text is first displayed.

    Declaration
    public float DelayBeforeFadingWorldChat
    Field Value
    Type Description
    System.Single

    FADE_OUT_WORLD_SPACE_CHAT_METHOD_NAME

    Cached name of FadeOutWorldSpaceChat()

    Declaration
    protected const string FADE_OUT_WORLD_SPACE_CHAT_METHOD_NAME = "FadeOutWorldSpaceChat"
    Field Value
    Type Description
    System.String

    Id

    Unique ID for this player. Should be the same as PlayerId.

    Declaration
    [SyncVar]
    public string Id
    Field Value
    Type Description
    System.String

    LocalChatRadiusOnReceiveMessage

    Radius to use with UnityEngine.Physics.OverlapSphere(UnityEngine.Vector3,System.Single) to check if a message should show as overhead chat.

    Declaration
    public float LocalChatRadiusOnReceiveMessage
    Field Value
    Type Description
    System.Single

    Name

    Display name for this player. Should be the same as Name.

    Declaration
    [SyncVar]
    public string Name
    Field Value
    Type Description
    System.String

    NO_PARSE_TEXT

    String format for OverheadText to prevent users from using TextMeshPro tags in their messages.

    Declaration
    protected const string NO_PARSE_TEXT = "<noparse>{0}</noparse>"
    Field Value
    Type Description
    System.String

    OverheadText

    TextMeshPro instance to set text for world space chat on.

    Declaration
    public TextMeshPro OverheadText
    Field Value
    Type Description
    TMPro.TextMeshPro

    OverheadTextAnimator

    Animator for Overhead Text / World Space Chat. The active UnityEngine.RuntimeAnimatorController must accept triggers FADE_IN, and FADE_OUT to function properly.

    Declaration
    public Animator OverheadTextAnimator
    Field Value
    Type Description
    UnityEngine.Animator

    socialUI

    Reference to the SocialUI in the current active scene. Set up in OnStartLocalPlayer().

    Declaration
    public SocialUI socialUI
    Field Value
    Type Description
    SocialUI

    SubscribedChannels

    Dictionary of ChatChannels the player is currently subscribed to. Keyed by Channel.

    Declaration
    public Dictionary<uint, ChatChannel> SubscribedChannels
    Field Value
    Type Description
    System.Collections.Generic.Dictionary<System.UInt32, ChatChannel>

    Methods

    Awake()

    Sets up Overhead Text. Warns if missing components.

    Declaration
    protected virtual void Awake()

    ClientBlockedListUpdated(NetworkMessage)

    Client handler for updating a player's block list. Calls .

    Declaration
    [Client]
    protected virtual void ClientBlockedListUpdated(NetworkMessage message)
    Parameters
    Type Name Description
    UnityEngine.Networking.NetworkMessage message

    Network Message from the UnityEngine.Networking.NetworkServer.SendToClient(System.Int32,System.Int16,UnityEngine.Networking.MessageBase). Specifically must be BlockListMessage

    ClientFriendsListUpdated(NetworkMessage)

    Client handler for updating player's friends list. Calls .

    Declaration
    [Client]
    protected virtual void ClientFriendsListUpdated(NetworkMessage message)
    Parameters
    Type Name Description
    UnityEngine.Networking.NetworkMessage message

    Network Message from the UnityEngine.Networking.NetworkServer.SendToClient(System.Int32,System.Int16,UnityEngine.Networking.MessageBase). Specifically must be FriendsListMessage

    ClientFriendUpdated(NetworkMessage)

    Client handler for Friend status update. Calls

    Declaration
    [Client]
    protected virtual void ClientFriendUpdated(NetworkMessage message)
    Parameters
    Type Name Description
    UnityEngine.Networking.NetworkMessage message

    Network Message from the UnityEngine.Networking.NetworkServer.SendToClient(System.Int32,System.Int16,UnityEngine.Networking.MessageBase). Specifically must be FriendUpdateMessage

    FadeOutWorldSpaceChat()

    Calls UnityEngine.Animator.SetTrigger(System.String) on OverheadTextAnimator with FADE_OUT.

    Declaration
    protected virtual void FadeOutWorldSpaceChat()

    GetFriendsAndBlockedPlayers(Int32, Player)

    Sends Friends List and Block list to the client.

    Declaration
    [Server]
    protected virtual void GetFriendsAndBlockedPlayers(int ConnectionId, Player player)
    Parameters
    Type Name Description
    System.Int32 ConnectionId

    Connection id to send the friends/block list to.

    Player player

    Player with friends/block list.

    HandleFindingChatPanel()

    Finds ChatPanel in the scene if not assigned, otherwise does nothing.

    Declaration
    protected virtual void HandleFindingChatPanel()

    NameUpdated(String)

    UnityEngine.Networking.SyncVarAttribute hook when the name of the player changes.

    Declaration
    [Client]
    protected virtual void NameUpdated(string newName)
    Parameters
    Type Name Description
    System.String newName

    New Player name

    OnStartLocalPlayer()

    Sets up scene references to ChatPanel and SocialUI. Binds this Player_Chat instance to those. Also does all UnityEngine.Networking.NetworkClient.RegisterHandler(System.Int16,UnityEngine.Networking.NetworkMessageDelegate) calls to handle incoming messages from the server.

    Declaration
    [Client]
    public override void OnStartLocalPlayer()
    Overrides
    UnityEngine.Networking.NetworkBehaviour.OnStartLocalPlayer()

    OnStartServer()

    Finds player by connection id from FindPlayerByConnectionId(Int32) and sets up Name and Id.

    Declaration
    [Server]
    public override void OnStartServer()
    Overrides
    UnityEngine.Networking.NetworkBehaviour.OnStartServer()

    ReceivedMessage(NetworkMessage)

    Client handler for chat messages. Calls ReceivedMessage(ChatMessage). Also handles Worldspace chat.

    Declaration
    [Client]
    protected virtual void ReceivedMessage(NetworkMessage message)
    Parameters
    Type Name Description
    UnityEngine.Networking.NetworkMessage message

    Network Message from the UnityEngine.Networking.NetworkServer.SendToClient(System.Int32,System.Int16,UnityEngine.Networking.MessageBase). Must be ChatMessage

    ReceivedPrivateMessage(NetworkMessage)

    Client handler for direct/private messages. Calls ReceivedPrivateMessage(ChatMessage).

    Declaration
    [Client]
    protected virtual void ReceivedPrivateMessage(NetworkMessage message)
    Parameters
    Type Name Description
    UnityEngine.Networking.NetworkMessage message

    Network Message from the UnityEngine.Networking.NetworkServer.SendToClient(System.Int32,System.Int16,UnityEngine.Networking.MessageBase). Specifically must be ChatMessage

    ReceivedServerMessage(NetworkMessage)

    Client handler for server broadcast messages. Calls ReceivedServerBroadcastMessage(String).

    Declaration
    [Client]
    protected virtual void ReceivedServerMessage(NetworkMessage message)
    Parameters
    Type Name Description
    UnityEngine.Networking.NetworkMessage message

    Network Message from the UnityEngine.Networking.NetworkServer.SendToClient(System.Int32,System.Int16,UnityEngine.Networking.MessageBase). Must be ServerBroadcastMessage

    SetupInitialSubscriptions()

    Makes a SubscribeToChannelsMessage request to retrieve list of subscribed channels from the server. See SubscriptionUpdated(NetworkMessage) (UNET) / (Mirror) for how response is handled. Also calls GetFriendsAndBlockedPlayers(Int32, Player)

    Declaration
    [Server]
    protected virtual void SetupInitialSubscriptions()

    ShowOverheadChat(ChatMessage)

    Calls UnityEngine.Animator.SetTrigger(System.String) on OverheadTextAnimator with FADE_IN. Invokes FadeOutWorldSpaceChat() after DelayBeforeFadingWorldChat.

    Declaration
    public virtual void ShowOverheadChat(ChatMessage chatMessage)
    Parameters
    Type Name Description
    ChatMessage chatMessage

    Start()

    Calls SetupInitialSubscriptions() on the server. Moving to OnStartServer(), which sounds better since this only runs on the server, was unstable.

    Declaration
    protected virtual void Start()

    SubscriptionUpdated(NetworkMessage)

    Client handler for Chat Channel subscription changes.

    Declaration
    [Client]
    protected virtual void SubscriptionUpdated(NetworkMessage message)
    Parameters
    Type Name Description
    UnityEngine.Networking.NetworkMessage message

    Network Message from the UnityEngine.Networking.NetworkServer.SendToClient(System.Int32,System.Int16,UnityEngine.Networking.MessageBase). Specifically must be SubscribeToChannelsMessage

    Update()

    Makes the OverheadTextAnimator always face the UnityEngine.Camera.main camera.

    Declaration
    protected virtual void Update()
    In This Article
    Back to top Generated by DocFX