Open Nerahikada opened 2 years ago
This output is just not possible according to the code logic here. https://github.com/SOF3/Capital/blob/d7006e951b63bc423b997d372a58e43eedeefd61/src/SOFe/Capital/Analytics/Top/DatabaseUtils.php#L111
Can you provide further steps to reproduce the issue, e.g. a database dump?
Configurations:
schema:
type: currency
currencies:
money:
default: 100
min: 0
max: 100000000
import-from: ~
money2:
default: 100
min: 0
max: 100000000
import-from: ~
term: currency
default-currency: money
analytics:
player-infos:
money:
of: account
selector:
currency: money
metric: balance-sum
update-freuqency: 5
info-commands:
checkmoney:
description: Check money of yourself or another player
self-requires-op: false
other-requires-op: true
format: '{name} has ${money}.'
top-player-commands:
richest:
command:
description: Displays the richest player
requires-op: false
selector:
currency: money
ordering: desc
metric: balance-sum
refresh:
batch-size: 200
batch-frequency: 10
recompute-frequency: 1
pagination:
per-page: 5
limit: 5
messages:
header: Showing page {page} of {totalPages}
entry: '#{rank} {name}: ${value}'
footer: ""
transfer:
payment-commands:
pay:
description: Pays another player
requires-op: false
selector:
default-currency: money
allowed-currencies: ~
rate: 1
minimum-amount: 0
maximum-amount: ~
fee: 0
transaction-labels:
payment: ""
messages:
player-only-command: '{red}Only players may use this command.'
notify-sender-success: '{green}You have sent ${sentAmount} to {target}. You now have ${sender money} left.'
notify-recipient-success: '{green}You have received ${receivedAmount} from {sender}. You now have ${target money} left.'
underflow: '{red}You do not have ${sentAmount}.'
overflow: '{red}The accounts of {target} are full. They cannot fit in ${sentAmount} more.'
internal-error: '{red}An internal error occurred. Please try again.'
add-money-commands:
addmoney:
description: Add money to a player
requires-op: true
minimum-amount: 0
maximum-amount: ~
transaction-labels:
operator: ""
messages:
player-only-command: '{red}Only players may use this command.'
notify-sender-success: '{green}{target} has received ${receivedAmount}. They now have ${target money} left.'
notify-recipient-success: '{green}You have received ${receivedAmount}. You now have ${target money} left.'
underflow: '{red}An internal error occurred.'
overflow: '{red}{target} cannot fit ${receivedAmount} more money.'
internal-error: '{red}An internal error occurred. Please try again.'
take-money-commands:
takemoney:
description: Remove money from a player
requires-op: true
minimum-amount: 0
maximum-amount: ~
transaction-labels:
operator: ""
messages:
player-only-command: '{red}Only players may use this command.'
notify-sender-success: '{green}You have taken ${receivedAmount} from {target}. They now have ${target money} left.'
notify-recipient-success: '{green}An admin took ${sentAmount} from you. You now have ${target money} left.'
underflow: '{red}{target} does not have ${sentAmount}.'
overflow: '{red}An internal error occurred.'
internal-error: '{red}An internal error occurred. Please try again.'
migration:
enabled: false
Commands executed:
addmoney Nerahikada 1 money
addmoney Nerahikada 1 money2
richest
/richest
outputs:
[00:07:49.553] [Server thread/INFO]: Showing page 1 of 1
[00:07:49.553] [Server thread/INFO]: #2 nerahikada: $101
[00:07:49.555] [Server thread/INFO]:
database:
mysql> select * from capital_acc;
+--------------------------------------+-------+---------------------+
| id | value | touch |
+--------------------------------------+-------+---------------------+
| 27e12b19-6d27-4cec-b591-0839e0522439 | -2 | 2022-10-25 00:06:21 |
| bb8680cf-9717-4376-91c0-29594a2fb261 | 101 | 2022-10-25 00:06:43 |
| d87c8767-ae46-4df3-aa7d-5a86f6e583db | 101 | 2022-10-25 00:06:46 |
+--------------------------------------+-------+---------------------+
3 rows in set (0.01 sec)
mysql> select * from capital_acc_label;
+--------------------------------------+----------------------+--------------------------------------+
| id | name | value |
+--------------------------------------+----------------------+--------------------------------------+
| bb8680cf-9717-4376-91c0-29594a2fb261 | capital/coreValueMax | 100000000 |
| d87c8767-ae46-4df3-aa7d-5a86f6e583db | capital/coreValueMax | 100000000 |
| bb8680cf-9717-4376-91c0-29594a2fb261 | capital/coreValueMin | 0 |
| d87c8767-ae46-4df3-aa7d-5a86f6e583db | capital/coreValueMin | 0 |
| bb8680cf-9717-4376-91c0-29594a2fb261 | capital/currency | money |
| d87c8767-ae46-4df3-aa7d-5a86f6e583db | capital/currency | money2 |
| 27e12b19-6d27-4cec-b591-0839e0522439 | capital/oracle | capital/transfer |
| bb8680cf-9717-4376-91c0-29594a2fb261 | capital/playerName | nerahikada |
| d87c8767-ae46-4df3-aa7d-5a86f6e583db | capital/playerName | nerahikada |
| bb8680cf-9717-4376-91c0-29594a2fb261 | capital/playerUuid | 5d80a4e4-5f6f-37dc-a180-7d9b4755dbe1 |
| d87c8767-ae46-4df3-aa7d-5a86f6e583db | capital/playerUuid | 5d80a4e4-5f6f-37dc-a180-7d9b4755dbe1 |
+--------------------------------------+----------------------+--------------------------------------+
11 rows in set (0.00 sec)
mysql> select * from capital_analytics_top_cache;
+----------------------------------+--------------------------------------+--------+---------------------+----------------------------------+
| query | group_value | metric | last_updated | last_updated_with |
+----------------------------------+--------------------------------------+--------+---------------------+----------------------------------+
| 54c2e6f2efb1745fe2604cb6e12eed87 | 5d80a4e4-5f6f-37dc-a180-7d9b4755dbe1 | 101 | 2022-10-25 00:08:36 | b8a67da93df8f0db874b055e54cd17bb |
+----------------------------------+--------------------------------------+--------+---------------------+----------------------------------+
1 row in set (0.00 sec)
mysql> select * from capital_tran;
+--------------------------------------+--------------------------------------+--------------------------------------+-------+---------------------+
| id | src | dest | value | created |
+--------------------------------------+--------------------------------------+--------------------------------------+-------+---------------------+
| 5682c750-6d7a-4a82-bb4c-13e12b90a1ee | 27e12b19-6d27-4cec-b591-0839e0522439 | bb8680cf-9717-4376-91c0-29594a2fb261 | 1 | 2022-10-25 00:06:43 |
| 8fd9ae56-3e2e-4d4d-8a5f-59f04c3410a5 | 27e12b19-6d27-4cec-b591-0839e0522439 | d87c8767-ae46-4df3-aa7d-5a86f6e583db | 1 | 2022-10-25 00:06:46 |
+--------------------------------------+--------------------------------------+--------------------------------------+-------+---------------------+
2 rows in set (0.00 sec)
mysql> select * from capital_tran_label;
+--------------------------------------+----------+-------+
| id | name | value |
+--------------------------------------+----------+-------+
| 5682c750-6d7a-4a82-bb4c-13e12b90a1ee | operator | |
| 8fd9ae56-3e2e-4d4d-8a5f-59f04c3410a5 | operator | |
+--------------------------------------+----------+-------+
2 rows in set (0.00 sec)
database dump: capital.txt
The query executed when the command execution and its result
SELECT group_value,
metric,
(SELECT t0.value
FROM capital_acc_label AS t0
WHERE grouping_label.id = t0.id
AND t0.name = "capital/playerName"
LIMIT 1) AS display_0
FROM capital_analytics_top_cache
INNER JOIN capital_acc_label AS grouping_label
ON capital_analytics_top_cache.group_value = grouping_label.value
WHERE query = "54c2e6f2efb1745fe2604cb6e12eed87"
AND grouping_label.name = "capital/playerUuid"
ORDER BY metric DESC
LIMIT 0, 5
+--------------------------------------+--------+------------+
| group_value | metric | display_0 |
+--------------------------------------+--------+------------+
| 5d80a4e4-5f6f-37dc-a180-7d9b4755dbe1 | 101 | nerahikada |
| 5d80a4e4-5f6f-37dc-a180-7d9b4755dbe1 | 101 | nerahikada |
+--------------------------------------+--------+------------+
2 rows in set (0.00 sec)
When using the currency schema to set up multiple currencies and using the
/richest
command, the rank numbers are not correct.