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); } }
public ChatUserController(AccountChatView accountChatView) { _logger = GameContext.Logger; Account = accountChatView ?? throw _logger.LogError(new ArgumentNullException(nameof(accountChatView))); GlobalUsername = $"69_{Account.Username}"; }