|
4 | 4 | VERSION_MANIFEST = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json" |
5 | 5 | BUNGEECORD_DOWNLOAD_URL = "https://ci.md-5.net/job/BungeeCord/lastStableBuild/artifact/bootstrap/target/BungeeCord.jar" |
6 | 6 | APP_VERSION = 1#The API Version. |
7 | | -APP_UF_VERSION = "1.50.6" |
| 7 | +APP_UF_VERSION = "1.51" |
8 | 8 | #The semver version |
9 | 9 | UPDATEINSTALLED = False |
10 | 10 | DOCFILE = "https://github.com/Enderbyte-Programs/CraftServerSetup/raw/main/doc/craftserversetup.epdoc" |
|
81 | 81 | from cursesplus import CheckBoxItem |
82 | 82 | import requests #Networking Utilities |
83 | 83 | import urllib.request |
84 | | -import urllib.error |
85 | 84 | import yaml #Parse YML Files |
86 | 85 | from epadvertisements import * #Advertisements library (BY ME) |
87 | 86 | import epdoc #Documentations library (BY ME) |
@@ -3461,27 +3460,47 @@ def sanalytics(stdscr,serverdir): |
3461 | 3460 |
|
3462 | 3461 | cursesplus.bargraph(stdscr,gd,"Popularity Results",unit,False,False) |
3463 | 3462 | elif wtd == 10: |
3464 | | - plcheck = crssinput(stdscr,"What player do you want to search for").lower() |
3465 | | - lastseen:datetime.datetime = datetime.datetime(2000,1,1,1,1,1)#Placeholder |
| 3463 | + plf = 0 |
| 3464 | + cursesplus.displaymsg(stdscr,["Analyzing data",f"{plf} players found"],False) |
| 3465 | + sortop = crss_custom_ad_menu(stdscr,["Alphabetically","Recent -> Old"],"Choose search option") |
| 3466 | + fjblock:dict[str,datetime.datetime] = {} |
3466 | 3467 | for line in reversed(list(workingdata.values())): |
3467 | | - if plcheck in line.onlineplayers: |
3468 | | - lastseen = get_datetime_from_minute_id(line.minuteid) |
3469 | | - break |
3470 | | - if lastseen.year == 2000: |
3471 | | - cursesplus.messagebox.showinfo(stdscr,["This player could not be found"]) |
3472 | | - return |
3473 | | - cursesplus.messagebox.showinfo(stdscr,[f"{plcheck} was last seen",str(lastseen)]) |
| 3468 | + for pl in line.onlineplayers: |
| 3469 | + if not pl in fjblock.keys(): |
| 3470 | + fjblock[pl] = get_datetime_from_minute_id(line.minuteid) |
| 3471 | + plf += 1 |
| 3472 | + cursesplus.displaymsg(stdscr,["Analyzing data",f"{plf} players found"],False) |
| 3473 | + |
| 3474 | + if sortop == 0: |
| 3475 | + fjblock = dict(sorted(fjblock))#Sort A-Z |
| 3476 | + |
| 3477 | + #Assemble text |
| 3478 | + finals = "PLAYER NAME".ljust(16)+" "+"LAST SEEN"+"\n" |
| 3479 | + for blk in fjblock.items(): |
| 3480 | + finals += blk[0].ljust(16) + " " + strip_datetime(blk[1]) + "\n" |
| 3481 | + |
| 3482 | + cursesplus.textview(stdscr,text=finals,message="Results") |
3474 | 3483 | elif wtd == 11: |
3475 | | - plcheck = crssinput(stdscr,"What player do you want to search for").lower() |
3476 | | - lastseen:datetime.datetime = datetime.datetime(2000,1,1,1,1,1)#Placeholder |
| 3484 | + plf = 0 |
| 3485 | + cursesplus.displaymsg(stdscr,["Analyzing data",f"{plf} players found"],False) |
| 3486 | + sortop = crss_custom_ad_menu(stdscr,["Alphabetically","Oldest to newest"],"Choose search option") |
| 3487 | + fjblock:dict[str,datetime.datetime] = {} |
3477 | 3488 | for line in list(workingdata.values()): |
3478 | | - if plcheck in line.onlineplayers: |
3479 | | - lastseen = get_datetime_from_minute_id(line.minuteid) |
3480 | | - break |
3481 | | - if lastseen.year == 2000: |
3482 | | - cursesplus.messagebox.showinfo(stdscr,["This player could not be found"]) |
3483 | | - return |
3484 | | - cursesplus.messagebox.showinfo(stdscr,[f"{plcheck} was first seen",str(lastseen)]) |
| 3489 | + for pl in line.onlineplayers: |
| 3490 | + if not pl in fjblock.keys(): |
| 3491 | + fjblock[pl] = get_datetime_from_minute_id(line.minuteid) |
| 3492 | + plf += 1 |
| 3493 | + cursesplus.displaymsg(stdscr,["Analyzing data",f"{plf} players found"],False) |
| 3494 | + |
| 3495 | + if sortop == 0: |
| 3496 | + fjblock = dict(sorted(fjblock))#Sort A-Z |
| 3497 | + |
| 3498 | + #Assemble text |
| 3499 | + finals = "PLAYER NAME".ljust(16)+" "+"JOIN DATE"+"\n" |
| 3500 | + for blk in fjblock.items(): |
| 3501 | + finals += blk[0].ljust(16) + " " + strip_datetime(blk[1]) + "\n" |
| 3502 | + |
| 3503 | + cursesplus.textview(stdscr,text=finals,message="Results") |
3485 | 3504 |
|
3486 | 3505 | elif wtd == 12: |
3487 | 3506 | os.remove(analytics_file_path) |
|
0 commit comments