public UserStatusDTO GetUserStatus() { //Dbop.Close(); int totalCount = Dbop.GetCount(); var banCount = ServerContext.ServerConfig.BoundConfig.UsersBanlist.Count; var onlineCount = ServerContext.Clients.Count(); var restCount = totalCount - banCount - onlineCount; UserStatusDTO dto = new UserStatusDTO { onlineUsersCount = onlineCount, offlineUsersCount = restCount, banUsersCount = banCount }; return(dto); }