public static void Run(string[] args) { ChatContext = new ChatDbContext("db://localhost:3306"); ChatUserController = new ChatUserController(ChatContext.ChatUsers); ChatRoomController = new ChatRoomController(ChatContext.ChatRooms); while (Running) { throw new NotImplementedException(); } }
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 static bool Get(string id, out ChatUserController controller) { lock (_lock) { return(Players.TryGetValue(id, out controller)); } }