• 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 LobbyLoginController

    This is in the LlamaSoftware.Chat.Demo namespace, indicating this is not a production-ready piece script. Instead it is meant to demonstrate how you may do something. A specialized LoginController to demonstrate how a lobby could work. Instead of automatically joining a lobby, you may want to split the logic here in your game with the login piece so a user can be put into a lobby instead of only having 1 lobby.

    Inheritance
    System.Object
    UnityEngine.Object
    UnityEngine.Component
    UnityEngine.Behaviour
    UnityEngine.MonoBehaviour
    UnityEngine.Networking.NetworkBehaviour
    LoginController
    LobbyLoginController
    Inherited Members
    LoginController.REGISTER_USER_CHANNEL
    LoginController.LOGIN_CHANNEL
    LoginController.PlayerControllerId
    LoginController.LoginDemoUI
    LoginController.InGameUICanvas
    LoginController.PathToDatabase
    LoginController.Connection
    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.OnStartLocalPlayer()
    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.Demo.Lobby
    Assembly: LlamaSoftware.Chat.Demo.dll
    Syntax
    public class LobbyLoginController : LoginController

    Fields

    ChatPanelCanvas

    Declaration
    [SerializeField]
    protected Canvas ChatPanelCanvas
    Field Value
    Type Description
    UnityEngine.Canvas

    GameSceneName

    Declaration
    [SerializeField]
    protected string GameSceneName
    Field Value
    Type Description
    System.String

    LOBBY_PLAYERS_CHANNEL

    Channel to send the Lobby Players network messages on.

    Declaration
    public const short LOBBY_PLAYERS_CHANNEL = 997
    Field Value
    Type Description
    System.Int16

    lobbyController

    Declaration
    [SerializeField]
    protected LobbyController lobbyController
    Field Value
    Type Description
    LobbyController

    LobbyPlayerPrefab

    Declaration
    [SerializeField]
    [Tooltip("Must be registered under Network Manager as a Spawnable Prefab")]
    protected Player_Chat LobbyPlayerPrefab
    Field Value
    Type Description
    Player_Chat

    Players

    Declaration
    protected List<Player> Players
    Field Value
    Type Description
    System.Collections.Generic.List<Player>

    StartGameButton

    Declaration
    [SerializeField]
    protected GameObject StartGameButton
    Field Value
    Type Description
    UnityEngine.GameObject

    Methods

    ClientHandleRegisterUser(NetworkMessage)

    Repsonse handler for new user registration. If the message is not SUCCESS it is assumed to be an error.

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

    Network Message

    Overrides
    LoginController.ClientHandleRegisterUser(NetworkMessage)

    ClientHandleUserLogin(NetworkMessage)

    Handles response from user login. If the message is not SUCCESS it is assumed to be an error message.

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

    Network Message

    ClientUpdateLobbyPlayers(NetworkMessage)

    Response handler for Lobby user updates

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

    Network message

    CreatePlayerFromRow(SqliteDataReader, NetworkMessage, Boolean)

    Manually constructs a network player with Player_Chat player from the LobbyPlayerPrefab and pouplates from the provided Mono.Data.Sqlite.SqliteDataReader row.

    Declaration
    [Server]
    protected override void CreatePlayerFromRow(SqliteDataReader reader, NetworkMessage message, bool isCreateAccount)
    Parameters
    Type Name Description
    Mono.Data.Sqlite.SqliteDataReader reader
    UnityEngine.Networking.NetworkMessage message
    System.Boolean isCreateAccount
    Overrides
    LoginController.CreatePlayerFromRow(SqliteDataReader, NetworkMessage, Boolean)

    HandleRegisterUser(NetworkMessage)

    Performs basic validation on the RegisterPlayerMessage request, if valid then inserts that information into the database and logs the user in. In your production application you would abstract this out to a singleton like AbstractPlayerDatabase<T>.

    Declaration
    [Server]
    protected override void HandleRegisterUser(NetworkMessage message)
    Parameters
    Type Name Description
    UnityEngine.Networking.NetworkMessage message

    Network Message of type RegisterPlayerMessage.

    Overrides
    LoginController.HandleRegisterUser(NetworkMessage)

    HandleUserLogin(NetworkMessage)

    Checks if the login is valid and creates the user. In your production application you would abstract this out to a singleton like AbstractPlayerDatabase<T>.

    Declaration
    [Server]
    protected override void HandleUserLogin(NetworkMessage message)
    Parameters
    Type Name Description
    UnityEngine.Networking.NetworkMessage message

    Network Message of type LoginMessage.

    Overrides
    LoginController.HandleUserLogin(NetworkMessage)

    OnStartClient()

    Set up client network message handlers

    Declaration
    public override void OnStartClient()
    Overrides
    LoginController.OnStartClient()

    OnStartServer()

    Set up server message handlers and Database connection

    Declaration
    public override void OnStartServer()
    Overrides
    LoginController.OnStartServer()

    StartGame()

    Changes the scene on the UnityEngine.Networking.NetworkManager.ServerChangeScene(System.String) to the provided GameSceneName scene.

    Declaration
    [Server]
    public virtual void StartGame()

    UpdatePlayers(IEnumerable<Player>)

    Called by the LobbyNetworkManager when a player disconnects to ensure the list removes players who are no longer connected

    Declaration
    [Server]
    public virtual void UpdatePlayers(IEnumerable<Player> Players)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Player> Players

    Collection of players still in the lobby

    In This Article
    Back to top Generated by DocFX