mirror of
https://github.com/GayPizzaSpecifications/foundation.git
synced 2025-08-03 13:31:32 +00:00
Heimdall: Player Names Table, Gjallarhorn: Block State Image Rendering
This commit is contained in:
@ -137,7 +137,14 @@ class FoundationHeimdallPlugin : JavaPlugin(), Listener {
|
||||
@EventHandler
|
||||
fun onEntityDeath(event: EntityDeathEvent) {
|
||||
val killer = event.entity.killer ?: return
|
||||
buffer.push(EntityKill(killer.uniqueId, killer.location, event.entity.uniqueId, event.entityType.key.toString()))
|
||||
buffer.push(
|
||||
EntityKill(
|
||||
killer.uniqueId,
|
||||
killer.location,
|
||||
event.entity.uniqueId,
|
||||
event.entityType.key.toString()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onDisable() {
|
||||
@ -145,7 +152,12 @@ class FoundationHeimdallPlugin : JavaPlugin(), Listener {
|
||||
val endTime = Instant.now()
|
||||
for (playerId in playerJoinTimes.keys().toList()) {
|
||||
val startTime = playerJoinTimes.remove(playerId) ?: continue
|
||||
buffer.push(PlayerSession(playerId, server.getPlayer(playerId)?.name ?: "__unknown__", startTime, endTime))
|
||||
buffer.push(PlayerSession(
|
||||
playerId,
|
||||
server.getPlayer(playerId)?.name ?: "__unknown__",
|
||||
startTime,
|
||||
endTime
|
||||
))
|
||||
}
|
||||
bufferFlushThread.flush()
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
--
|
||||
create extension if not exists "uuid-ossp";
|
||||
--
|
||||
create extension if not exists timescaledb;
|
||||
@ -119,4 +118,22 @@ create table if not exists heimdall.entity_kills (
|
||||
--
|
||||
select create_hypertable('heimdall.entity_kills', 'time', 'player', 4, if_not_exists => TRUE);
|
||||
--
|
||||
create or replace view heimdall.block_changes as select true as break, * from heimdall.block_breaks union all select false as break, * from heimdall.block_places;
|
||||
create or replace view heimdall.block_changes as
|
||||
select true as break, *
|
||||
from heimdall.block_breaks
|
||||
union all
|
||||
select false as break, * from heimdall.block_places;
|
||||
--
|
||||
create or replace view heimdall.player_names as
|
||||
with unique_player_ids as (
|
||||
select distinct player
|
||||
from heimdall.player_sessions
|
||||
)
|
||||
select player, (
|
||||
select name
|
||||
from heimdall.player_sessions
|
||||
where player = unique_player_ids.player
|
||||
order by "end" desc
|
||||
limit 1
|
||||
) as name
|
||||
from unique_player_ids;
|
||||
|
Reference in New Issue
Block a user