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

    Show / Hide Table of Contents
    • LlamaSoftware.Chat
      • AbstractPlayerDatabase<T>
      • AreaTriggeredChannelJoiner
      • BaseNetworkManager
      • ChatSystem
      • ChatSystemConstants
      • InMemoryPlayerDatabase
      • 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
      • InMemoryPlayerLogin
      • 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

    Namespace LlamaSoftware.Chat.Demo

    Classes

    ChatCommandHandler

    Note this is in LlamaSoftware.Chat.Demo namespace so it works in the demo but may require modification to work in your game. Specifically, this one will require more handlers for all the new Chat Commands you would like to provide to your users. If you do not enable Chat Commands on the ChatPanel you do not need to do anything here.

    CreateAccount

    Demo class to create an account in the database. More work is required to make this production-ready for your game. Specifically here you will need to do more robust validation on DoCreateAccount(). What is done here is not safe and the server handler for the account registration also needs additional validation work to be secure. In general it is good practice to validate both on the UI and on the Server. However implementing a full validation framework is not in scope of this asset and C# has many already

    DemoGuildJoiner

    Note this is in LlamaSoftware.Chat.Demo namespace so it works in the demo but may require modification to work in your game. Please do NOT use this in your production code. In an MMOXXX (i.e. MMORPG, MMOFPS, etc...) you will likely have thousands and thousands of Game Objects, and finding Player_Chat objects in that will take a relatively long time and cause visible stutter. Instead it would be much nicer to have your Local Player Id set somewhere and reference it via static class, Singleton, or some other easily accessible way. In the Demo there are very few objects so this is a very fast operation and we are not concerned with the performance of GameObject#FindObjectsOfType

    DemoGuildLeaver

    Note this is in LlamaSoftware.Chat.Demo namespace so it works in the demo but may require modification to work in your game. Please do NOT use this in your production code. In desktop and console games you will likely have up to hundreds of thousands of GameObjects, and finding Player_Chat objects in that will take a relatively long time and cause visible stutter. Instead it would be much nicer to have your Local Player Id set somewhere and reference it via static class, Singleton, or some other easily accessible way. In the Demo there are very few objects so this is a very fast operation and we are not concerned with the performance of GameObject#FindObjectsOfType

    DummyNameGenerator

    Note this is in LlamaSoftware.Chat.Demo namespace so it works in the demo but may require modification to work in your game. This one probably you probably shouldn't use at all since it's a simple random name generator. Players now have to register an account so you don't really need this

    DynamicChatPopup

    Note this is in LlamaSoftware.Chat.Demo namespace so it works in the demo but may require modification to work in your game. However if you only want to be able to Whisper, Add Friend, and Block players, no modifications should be necessary.

    Used in conjunction with ChatPopup to allow clicking on ChatMessages.

    InMemoryPlayerLogin

    This class is used to demonstrate how you can effectively bypass the login mechanism used in the LoginController by default. While Llama Chat expects the user is "authenticated" in some way and each player has a unique id, you do not have to do authentication via your Unity code. The critical pieces here are that at the time of Player GameObject creation you must have:

    1. A unique identifier for each player (GUID or some other id)
    2. An active NetworkConnection for that player. See: "HandleUserLogin" on this class for how we "simulate" login. You can make API calls to authenticate the user, retrieve data about the user such as friends list, and more before creating the player, then hydrate the InMemoryPlayerDatabase if you are running with a database separate from your core game.

    Login

    Demo class to handle logging in. Some enhancements will be needed to be made to have it work for your production game. Specifically here:

    • Passwords are stored in plain text which should NEVER be done.You can instead encrypt the password, and validate the incoming one vs the hashed one.
    • Almost no validation is done on the incoming login request

    LoginController

    Note this is in LlamaSoftware.Chat.Demo namespace so it works in the demo but may require modification to work in your game. Specifically, database management should be much more complex than this. This Controller is meant to provide the concept of what needs to be done, and can be utilized as a base, but does not handle all the nuances that need to be handled in a production application.

    SettingsPanel

    Demo Settings Panel Controller. Shows how you might handle some common chat settings such as ToggleLanguageFilter(Boolean) ToggleAutoHideChat(Boolean), and UpdateFadeDelay(String)

    In This Article
    Back to top Generated by DocFX