Twi5TeD/PlayTime

Issue with /playtime top

Opened this issue · 5 comments

Server Version: 1.19.4
Plugin Version: 3.6

When executing /playtime top there is no data. Yet there is data.
Screenshot 2023-06-21 at 6 30 54 pm
Screenshot 2023-06-21 at 6 32 39 pm

Config

placeholder:
  top:
    name: none
    time: '-'
time:
  second:
    enabled: true
    prefix: s
  minute:
    enabled: true
    prefix: m
  hour:
    enabled: true
    prefix: h
  day:
    enabled: true
    prefix: d
  week:
    enabled: false
    prefix: w
messages:
  no_permission:
  - '&4[&6Playtime&4] &cYou do not have permission.'
  doesnt_exist:
  - '&4[&6Playtime&4] &cPlayer %offlineplayer% has not joined before!'
  player:
  - '&4[&6Playtime&4]'
  - '&6%playtime_player%''s stats'
  - '&6PlayTime: &a%playtime_time%'
  - '&6Times Joined: &a%playtime_timesjoined%'
  offline_players:
  - '&4[&6Playtime&4]'
  - '&6%offlineplayer%''s stats'
  - '&6PlayTime: &a%offlinetime%'
  - '&6Times Joined: &a%offlinetimesjoined%'
  other_players:
  - '&4[&6Playtime&4]'
  - '&6%playtime_player%''s stats'
  - '&6PlayTime: &a%playtime_time%'
  - '&6Times Joined: &a%playtime_timesjoined%'
  playtimetop:
    header:
    - '&bTop &e10 &bplayers playtime:'
    - ''
    message:
    - '&a%position%. &b%player%: &e%playtime%'
    footer:
    - ''
  server_uptime:
  - '&4[&6Playtime&4] &6Server''s total uptime is &a%playtime_serveruptime%'
  reload_config:
  - '&4[&6Playtime&4] &bYou have successfully reloaded the config.'

there should be a userdata.json file if not stop server and restart and rejoin

Screenshot 2023-06-22 at 10 38 38 am
There is a userdata file but with nothing in it. Server has restarted many times

Stop server and delete it and start it again

Is there not a way to order the top 10 by the /playtime stats? Id assume deleting it and starting again will show the wrong values?

Maybe you could have something that checks if there is no file and if not go though every player and add them to the file? Not sure if you do that already