Keep SCUM data parsing plugin-owned
This commit is contained in:
@@ -3,15 +3,19 @@ SELECT
|
||||
account.id AS steamId,
|
||||
CAST(prisoner.id AS TEXT) AS gamePlayerId,
|
||||
COALESCE(NULLIF(profile.name, ''), NULLIF(account.name, ''), account.id) AS displayName,
|
||||
account.last_direct_connection_address AS lastLoginIp,
|
||||
account.creation_time AS registeredAt,
|
||||
CAST(member.squad_id AS TEXT) AS squadId,
|
||||
squad.name AS squadName,
|
||||
profile.fame_points AS famePoints,
|
||||
profile.money_balance AS moneyBalance,
|
||||
MAX(CASE WHEN currency.currency_type = 1 THEN currency.account_balance END) AS normalBalance,
|
||||
MAX(CASE WHEN currency.currency_type = 2 THEN currency.account_balance END) AS goldBalance,
|
||||
entity.location_x AS x,
|
||||
entity.location_y AS y,
|
||||
entity.location_z AS z,
|
||||
profile.last_login_time AS lastLoginTime,
|
||||
profile.last_logout_time AS lastLogoutTime,
|
||||
strftime('%Y-%m-%dT%H:%M:%SZ', prisoner.last_save_time, 'unixepoch') AS lastSaveTime
|
||||
FROM user account
|
||||
LEFT JOIN user_profile profile ON profile.user_id = account.id
|
||||
@@ -25,6 +29,7 @@ LEFT JOIN bank_account_registry_currencies currency ON currency.bank_account_id
|
||||
WHERE (:userProfileId IS NULL OR CAST(profile.id AS TEXT) = :userProfileId)
|
||||
AND (:steamId IS NULL OR account.id = :steamId)
|
||||
AND (:search IS NULL OR COALESCE(NULLIF(profile.name, ''), NULLIF(account.name, ''), account.id) LIKE '%' || :search || '%')
|
||||
AND (:activeWithinSeconds IS NULL OR profile.last_logout_time IS NULL OR profile.last_login_time > profile.last_logout_time OR profile.last_login_time >= strftime('%Y-%m-%dT%H:%M:%fZ', 'now', printf('-%d seconds', :activeWithinSeconds)) OR prisoner.last_save_time >= CAST(strftime('%s', 'now') AS INTEGER) - :activeWithinSeconds)
|
||||
GROUP BY account.id
|
||||
ORDER BY profile.last_login_time DESC
|
||||
LIMIT COALESCE(:limit, 500)
|
||||
|
||||
Reference in New Issue
Block a user