Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more sidebar info #15

Open
leijurv opened this issue Jul 2, 2020 · 1 comment
Open

more sidebar info #15

leijurv opened this issue Jul 2, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@leijurv
Copy link

leijurv commented Jul 2, 2020

when u click on a cluster it should show more info than just associations

e.g.

number of shulkers, number of chests, most recent online time, first hit timestamp, has legacy, etc

example query that outputs number of shulkers (obv just replace %shulker% with %chest% to get chests):

WITH RECURSIVE
    tmp AS (
        SELECT id, disjoint_rank
        FROM dbscan
        WHERE id = 38916757
    ),
    clusters AS (
        SELECT *
        FROM tmp
        UNION
        SELECT dbscan.id, dbscan.disjoint_rank
        FROM dbscan
                 INNER JOIN clusters ON dbscan.cluster_parent = clusters.id
        WHERE clusters.disjoint_rank > 0
    ),
    shulkers AS MATERIALIZED (
        SELECT block_state
        FROM block_states
        WHERE name LIKE '%shulker%'
    )
SELECT SUM(num_shulkers)
FROM (
         SELECT (
                    SELECT COUNT(*)
                    FROM (
                             SELECT block_state,
                                    ROW_NUMBER() OVER (PARTITION BY x, y, z ORDER BY created_at DESC) AS age
                             FROM blocks
                             WHERE blocks.x >> 4 = dbscan.x
                               AND blocks.z >> 4 = dbscan.z
                         ) tmp
                    WHERE block_state IN (SELECT * FROM shulkers)
                      AND age = 1
                ) AS num_shulkers,
                dbscan.x,
                dbscan.z
         FROM clusters
                  INNER JOIN dbscan ON dbscan.id = clusters.id
     ) tmp;

also do it for signs. in this case, we still want to use the blocks table not signs since signs doesnt keep track of overwrites, so just replace the block scan with sign

@fr1kin fr1kin added the enhancement New feature or request label Jul 4, 2020
@fr1kin
Copy link
Member

fr1kin commented Jul 6, 2020

Sidebar shows if players are online or offline now. If you hover over the indicator it will show the time they joined or the time they were last seen

538b547

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants