コード例 #1
0
        public static void Attach(string id, ChatConnectionHandler client, AccountChatView account)
        {
            ChatUserController controller = null;

            lock (_lock) {
                if (!Players.TryGetValue(id, out controller))
                {
                    Players[id] = controller = new ChatUserController(account);
                }

                client.Controller = controller;
            }

            if (controller != null)
            {
                controller.Initialize(client);
            }
        }
コード例 #2
0
 public ChatUserController(AccountChatView accountChatView)
 {
     _logger        = GameContext.Logger;
     Account        = accountChatView ?? throw _logger.LogError(new ArgumentNullException(nameof(accountChatView)));
     GlobalUsername = $"69_{Account.Username}";
 }