From 473e9c8c9385f784853368f90ea4ccda335e5dcc Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 21 Nov 2018 11:05:38 -0600 Subject: [PATCH] new games.json format --- PlayStationDiscord/ConsoleInformation.cs | 1 - PlayStationDiscord/DiscordController.cs | 7 +- PlayStationDiscord/DiscordRPC.cs | 2 + PlayStationDiscord/Logger.cs | 8 +- PlayStationDiscord/Resources/games.json | 212 +---------------------- 5 files changed, 9 insertions(+), 221 deletions(-) diff --git a/PlayStationDiscord/ConsoleInformation.cs b/PlayStationDiscord/ConsoleInformation.cs index 169a76b..ffa6653 100644 --- a/PlayStationDiscord/ConsoleInformation.cs +++ b/PlayStationDiscord/ConsoleInformation.cs @@ -4,7 +4,6 @@ namespace PlayStationDiscord { public class ConsoleInformation { - public string ImageKeyName { get; protected set; } public string Name { get; protected set; } diff --git a/PlayStationDiscord/DiscordController.cs b/PlayStationDiscord/DiscordController.cs index 8a5eab6..6bed039 100644 --- a/PlayStationDiscord/DiscordController.cs +++ b/PlayStationDiscord/DiscordController.cs @@ -29,19 +29,20 @@ public void Initialize(KeyValuePair ap handlers.errorCallback += ErrorCallback; DiscordRpc.Initialize(application.Value.ClientId, ref handlers, true, default(string)); CallbacksCts = new CancellationTokenSource(); - Task.Run(RunCallbacksController); + Task.Run(() => RunCallbacksController()); this.Running = true; } public void Stop() { - DiscordRpc.Shutdown(); CallbacksCts.Cancel(); + DiscordRpc.Shutdown(); this.Running = false; } public void ReadyCallback() { + // } public void DisconnectedCallback(int errorCode, string message) @@ -54,7 +55,7 @@ public void ErrorCallback(int errorCode, string message) Logger.Write($"Error callback fired: {errorCode} - {message}"); } - private static async Task RunCallbacksController() + private static void RunCallbacksController() { while (!CallbacksCts.IsCancellationRequested) { diff --git a/PlayStationDiscord/DiscordRPC.cs b/PlayStationDiscord/DiscordRPC.cs index 9823d43..aeb268a 100644 --- a/PlayStationDiscord/DiscordRPC.cs +++ b/PlayStationDiscord/DiscordRPC.cs @@ -5,6 +5,8 @@ public class DiscordRpc { + // The connectedUser arg breaks callback functionality + // See: https://github.com/discordapp/discord-rpc/issues/220#issuecomment-426458700 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void ReadyCallback(/*ref DiscordUser connectedUser */); diff --git a/PlayStationDiscord/Logger.cs b/PlayStationDiscord/Logger.cs index eae60e9..bc792ce 100644 --- a/PlayStationDiscord/Logger.cs +++ b/PlayStationDiscord/Logger.cs @@ -1,13 +1,9 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace PlayStationDiscord { - class Logger + internal class Logger { private static string LogFile => Config.ApplicationDataDirectory + "/log.txt"; @@ -17,7 +13,7 @@ class Logger /// Acquires a lock on and writes . /// /// String to log. - public static void Write(string line) + internal static void Write(string line) { lock (Mutex) { diff --git a/PlayStationDiscord/Resources/games.json b/PlayStationDiscord/Resources/games.json index 15f52da..3acf5db 100644 --- a/PlayStationDiscord/Resources/games.json +++ b/PlayStationDiscord/Resources/games.json @@ -1,211 +1 @@ -{ - "ps4": [ - "CUSA02299_00", - "CUSA08546_00", - "CUSA12476_00", - "CUSA10940_00", - "CUSA05042_00", - "CUSA01111_00", - "CUSA00419_00", - "CUSA10038_00", - "CUSA09072_00", - "CUSA08006_00", - "CUSA00252_00", - "CUSA07995_00", - "CUSA01671_00", - "CUSA08789_00", - "CUSA04311_00", - "CUSA06536_00", - "CUSA05855_00", - "CUSA05933_00", - "CUSA00341_00", - "CUSA09267_00", - "CUSA01319_00", - "CUSA03220_00", - "CUSA03388_00", - "CUSA05469_00", - "CUSA00343_00", - "CUSA08877_00", - "CUSA00010_00", - "CUSA08791_00", - "CUSA10237_00", - "CUSA00744_00", - "CUSA12611_00", - "CUSA07215_00", - "CUSA00369_00", - "CUSA00663_00", - "CUSA04733_00", - "CUSA01760_00", - "CUSA03506_00", - "CUSA05258_00", - "CUSA01012_00", - "NPUB50360_00", - "CUSA07238_00", - "CUSA07408_00", - "CUSA09084_00", - "CUSA06381_00", - "CUSA01163_00", - "CUSA11587_00", - "CUSA05008_00", - "CUSA01633_00", - "CUSA03507_00", - "CUSA00478_00", - "CUSA12562_00", - "CUSA03167_00", - "CUSA06644_00", - "CUSA04897_00", - "CUSA03856_00", - "CUSA06978_00", - "CUSA10164_00", - "CUSA08537_00", - "CUSA00304_00", - "CUSA09977_00", - "CUSA04521_00", - "CUSA03955_00", - "CUSA03819_00", - "CUSA02629_00", - "CUSA00329_00", - "CUSA06861_00", - "CUSA10631_00", - "CUSA09450_00", - "CUSA09750_00", - "CUSA05350_00", - "CUSA07022_00", - "CUSA11100_00", - "CUSA05969_00", - "CUSA02290_00", - "CUSA04762_00", - "CUSA03522_00", - "CUSA00803_00", - "CUSA00018_00", - "CUSA00552_00", - "CUSA03041_00", - "CUSA00900_00", - "CUSA12057_00", - "CUSA08344_00" - ], - "vita": [ - "PCSE00879_00", - "PCSE00708_00", - "NPUH10187_00", - "PCSE00813_00", - "PCSE00904_00", - "PCSE00743_00", - "PCSE00400_00", - "PCSA00080_00", - "PCSE00384_00", - "PCSE00240_00", - "PCSE00672_00", - "PCSE00814_00", - "ULES00193_00", - "CUSA00487_00", - "PCSE00815_00", - "PCSE00358_00", - "PCSE00941_00", - "PCSE01035_00", - "PCSE00587_00", - "PCSE00634_00", - "PCSE00278_00", - "PCSE00905_00", - "PCSE00445_00", - "PCSE00700_00", - "PCSE00812_00", - "PCSE00677_00", - "NPUH10195_00", - "PCSE00641_00", - "PCSE00097_00", - "NPUH10127_00", - "PCSE00327_00", - "NPUG80224_00", - "PCSE00768_00", - "CUSA06000_00", - "PCSE00655_00", - "ULUS10041_00", - "PCSE00527_00", - "PCSE00568_00", - "PCSE00661_00", - "PCSE00588_00", - "PCSA00108_00", - "PCSE00534_00", - "PCSE00390_00", - "PCSE00078_00", - "ULUS10509_00", - "PCSE00579_00" - ], - "ps3": [ - "NPUB31419_00", - "NPUB31154_00", - "NPUB31093_00", - "NPUB30789_00", - "NPUA80960_00", - "NPUA80918_00", - "NPUB30698_00", - "NPUB31790_00", - "NPUA81353_00", - "NPUB30702_00", - "NPUB30249_00", - "NPUB30575_00", - "NPUB31324_00", - "NPUA81116_00", - "NPUB31502_00", - "NPUB30579_00", - "NPUA80490_00", - "NPUB31457_00", - "NPUB31054_00", - "NPUB30898_00", - "NPUB30403_00", - "NPUA80491_00", - "NPUB31866_00", - "NPUB31126_00", - "NPUB31848_00", - "NPUB31749_00", - "NPUB31582_00", - "NPUB31658_00", - "NPUB31665_00", - "NPUB31708_00", - "NPUB31577_00", - "NPUB31563_00", - "BCUS98282_00", - "NPUA80711_00", - "NPUA81087_00", - "NPUB30700_00", - "NPUB30584_00", - "NPUB31301_00", - "NPUB30787_00", - "NPUA80480_00", - "NPUA80646_00", - "NPUB31861_00", - "NPUB31252_00", - "NPUB30910_00", - "NPUA80657_00", - "NPUB31482_00", - "NPUB31807_00", - "NPUA80677_00", - "NPUB31560_00", - "NPUB31619_00", - "NPUB31643_00", - "NPUB30668_00", - "NPUA80316_00", - "NPUB30715_00", - "NPUB30393_00", - "NPUB31099_00", - "NPUA80637_00", - "NPUA80638_00", - "NPUB50139_00", - "NPUB31864_00", - "NPUB31172_00", - "BCUS98233_00", - "NPUB31254_00", - "NPUB50099_00", - "NPUB31527_00", - "NPUB31778_00", - "NPUA80966_00", - "NPUB31257_00", - "NPUB31075_00", - "NPUB31377_00", - "NPUA80661_00", - "NPUB30581_00", - "NPUB31653_00", - "NPUB31246_00" - ] -} \ No newline at end of file +{"ps4":[{"titleId":"CUSA07022_00","name":"Fortnite"},{"titleId":"CUSA05042_00","name":"Destiny 2"},{"titleId":"CUSA11100_00","name":"Call of Duty®: Black Ops 4"},{"titleId":"CUSA05969_00","name":"Call of Duty®: WWII"},{"titleId":"CUSA04762_00","name":"Call of Duty®: Infinite Warfare"},{"titleId":"CUSA03522_00","name":"Call of Duty®: Modern Warfare® Remastered"},{"titleId":"CUSA02290_00","name":"Call of Duty®: Black Ops III"},{"titleId":"CUSA00803_00","name":"Call of Duty®: Advanced Warfare"},{"titleId":"CUSA00018_00","name":"Call of Duty® Ghosts"},{"titleId":"CUSA02299_00","name":"Marvel's Spider-Man"},{"titleId":"CUSA12476_00","name":"NBA 2K19"},{"titleId":"CUSA08724_00","name":"Battlefield™ V"},{"titleId":"CUSA10038_00","name":"Madden NFL 19"},{"titleId":"CUSA00419_00","name":"Grand Theft Auto V"},{"titleId":"CUSA08006_00","name":"FIFA 18"},{"titleId":"CUSA08546_00","name":"DRAGON QUEST XI: Echoes of an Elusive Age"},{"titleId":"CUSA00252_00","name":"Thief"},{"titleId":"CUSA06536_00","name":"EA SPORTS™ UFC® 3"},{"titleId":"CUSA05933_00","name":"KINGDOM HEARTS - HD 1.5+2.5 ReMIX -"},{"titleId":"CUSA01319_00","name":"Grim Fandango Remastered"},{"titleId":"CUSA08789_00","name":"NARUTO TO BORUTO: SHINOBI STRIKER"},{"titleId":"CUSA05855_00","name":"Assassin's Creed® Origins"},{"titleId":"CUSA00343_00","name":"Murdered: Soul Suspect"},{"titleId":"CUSA00744_00","name":"Minecraft: PlayStation®4 Edition"},{"titleId":"CUSA12611_00","name":"Divinity: Original Sin 2 - Definitive Edition"},{"titleId":"CUSA03041_00","name":"Red Dead Redemption 2"},{"titleId":"CUSA00369_00","name":"Lords of the Fallen"},{"titleId":"CUSA04733_00","name":"The Surge"},{"titleId":"CUSA03506_00","name":"Grand Theft Auto: San Andreas"},{"titleId":"CUSA00010_00","name":"Assassin's Creed® IV Black Flag"},{"titleId":"CUSA10237_00","name":"Horizon Zero Dawn: Complete Edition"},{"titleId":"CUSA09072_00","name":"DRAGON BALL FighterZ"},{"titleId":"CUSA01012_00","name":"Homefront®: The Revolution"},{"titleId":"CUSA01163_00","name":"Rocket League®"},{"titleId":"CUSA11587_00","name":"Slime Rancher"},{"titleId":"CUSA01633_00","name":"FINAL FANTASY XV"},{"titleId":"CUSA03507_00","name":"Bully"},{"titleId":"CUSA00478_00","name":"Valiant Hearts: The Great War"},{"titleId":"CUSA12562_00","name":"Bloodstained: Curse of the Moon"},{"titleId":"CUSA05258_00","name":"Tales of Berseria"},{"titleId":"CUSA06644_00","name":"Full Throttle Remastered"},{"titleId":"CUSA12795_00","name":"HAJWALA"},{"titleId":"CUSA09084_00","name":"L.A. Noire"},{"titleId":"CUSA06978_00","name":"Tokyo Xanadu eX+"},{"titleId":"CUSA05469_00","name":"Digimon World: Next Order"},{"titleId":"CUSA00304_00","name":"Trials Fusion™"},{"titleId":"CUSA04521_00","name":"Catlateral Damage"},{"titleId":"CUSA07215_00","name":"Human Fall Flat"},{"titleId":"CUSA03819_00","name":"Caladrius Blaze"},{"titleId":"CUSA02629_00","name":"Disgaea 5: Alliance of Vengeance"},{"titleId":"CUSA11599_00","name":"FIFA 19"},{"titleId":"CUSA05008_00","name":"Assassin's Creed The Ezio Collection"},{"titleId":"CUSA06861_00","name":"Zero Escape: The Nonary Games"},{"titleId":"CUSA03955_00","name":"ARCADE GAME SERIES: PAC-MAN"},{"titleId":"CUSA09450_00","name":"MLB® The Show™ 18"},{"titleId":"CUSA09750_00","name":"School Girl Zombie Hunter"},{"titleId":"CUSA09977_00","name":"Digimon Story: Cyber Sleuth - Hacker's Memory"},{"titleId":"CUSA09452_00","name":"Bubsy: The Woolies Strike Back"},{"titleId":"CUSA06460_00","name":"Lara Croft GO"},{"titleId":"CUSA00405_00","name":"Tetris® Ultimate"},{"titleId":"CUSA03957_00","name":"ARCADE GAME SERIES: Ms.PAC-MAN"},{"titleId":"CUSA05693_00","name":"The Solus Project"},{"titleId":"CUSA03388_00","name":"DARK SOULS™ III"},{"titleId":"CUSA13762_00","name":"The Golf Club 2019"},{"titleId":"CUSA00552_00","name":"The Last of Us™ Remastered"},{"titleId":"CUSA03082_00","name":"Trine 3: The Artifacts of Power"},{"titleId":"CUSA06977_00","name":"Dead Alliance"},{"titleId":"CUSA03694_00","name":"GRAVITY RUSH™ 2"},{"titleId":"CUSA00794_00","name":"Lara Croft and the Temple of Osiris"},{"titleId":"CUSA01587_00","name":"Shantae: Risky's Revenge - Director's Cut"},{"titleId":"CUSA01800_00","name":"Tom Clancy's Rainbow Six® Siege"},{"titleId":"CUSA04071_00","name":"UNO®"},{"titleId":"CUSA01347_00","name":"Assassin’s Creed® Chronicles: China"},{"titleId":"CUSA03610_00","name":"Crypt of the Necrodancer"},{"titleId":"CUSA10062_00","name":"Donut County"},{"titleId":"CUSA08359_00","name":"Drunkn Barfight"},{"titleId":"CUSA04723_00","name":"Emily Wants To Play"},{"titleId":"CUSA08444_00","name":"Dead by Daylight"},{"titleId":"CUSA11126_00","name":"NHL® 19"},{"titleId":"CUSA06997_00","name":"YAKUZA KIWAMI"},{"titleId":"CUSA07143_00","name":"Bulletstorm: Full Clip Edition"},{"titleId":"CUSA09109_00","name":"Burly Men At Sea"},{"titleId":"CUSA02470_00","name":"Roundabout"},{"titleId":"CUSA03509_00","name":"Grand Theft Auto: Vice City"},{"titleId":"CUSA09058_00","name":"Fe"},{"titleId":"CUSA00192_00","name":"Worms Battlegrounds"},{"titleId":"CUSA04892_00","name":"Saban’s Mighty Morphin Power Rangers: Mega Battle"},{"titleId":"CUSA01232_00","name":"Jetpack Joyride"},{"titleId":"CUSA08523_00","name":"Steven Universe: Save the Light"},{"titleId":"CUSA04897_00","name":"JoJo's Bizarre Adventure: Eyes of Heaven"},{"titleId":"CUSA03223_00","name":"Zotrix"},{"titleId":"CUSA01991_00","name":"Day of the Tentacle Remastered"},{"titleId":"CUSA03525_00","name":"GOD EATER RESURRECTION"},{"titleId":"CUSA09402_00","name":"Hidden Dragon Legend"},{"titleId":"CUSA07640_00","name":"Nidhogg 2"},{"titleId":"CUSA09652_00","name":"Cryptract"},{"titleId":"CUSA12495_00","name":"Warface"},{"titleId":"CUSA09630_00","name":"Defiance 2050"},{"titleId":"CUSA11772_00","name":"Fallout Shelter"},{"titleId":"CUSA07507_00","name":"H1Z1: Battle Royale"},{"titleId":"CUSA10115_00","name":"Starlit Adventures"},{"titleId":"CUSA08921_00","name":"Don't Bite Me Bro!"},{"titleId":"CUSA06412_00","name":"TERA"},{"titleId":"CUSA09700_00","name":"ARMORED WARFARE"},{"titleId":"CUSA10348_00","name":"Knights Of Valour"},{"titleId":"CUSA13637_00","name":"Bendy and the Ink Machine"},{"titleId":"CUSA11598_00","name":"Farming Simulator 19"},{"titleId":"CUSA13600_00","name":"Flashback"},{"titleId":"CUSA12109_00","name":"Distrust"},{"titleId":"CUSA11757_00","name":"THE QUIET MAN"},{"titleId":"CUSA13899_00","name":"Monkey King: Master of the Clouds"},{"titleId":"CUSA12057_00","name":"Fallout 76"},{"titleId":"CUSA12421_00","name":"HITMAN™ 2"},{"titleId":"CUSA12435_00","name":"Knowledge is Power: Decades"},{"titleId":"CUSA12098_00","name":"Runner3"},{"titleId":"CUSA12125_00","name":"Spyro Reignited Trilogy"},{"titleId":"CUSA14127_00","name":"Ticket To Ride"},{"titleId":"CUSA12653_00","name":"WARRIORS OROCHI 4"},{"titleId":"CUSA13594_00","name":"Tetris® Effect"},{"titleId":"CUSA11250_00","name":"GRIP"},{"titleId":"CUSA12297_00","name":"NekoPara Vol.1"},{"titleId":"CUSA07361_00","name":"Omen of Sorrow"},{"titleId":"CUSA13038_00","name":"Road Redemption"},{"titleId":"CUSA10518_00","name":"The Forest"},{"titleId":"CUSA13734_00","name":"The Shapeshifting Detective"},{"titleId":"CUSA10046_00","name":"SkyTime"},{"titleId":"CUSA14158_00","name":"Croc's World"},{"titleId":"CUSA12558_00","name":"Freaky Awesome"},{"titleId":"CUSA12692_00","name":"Shadow of Loot Box"},{"titleId":"CUSA11183_00","name":"Taiko no Tatsujin: Drum Session!"},{"titleId":"CUSA13373_00","name":"Super Volley Blast"},{"titleId":"CUSA12916_00","name":"Death Mark"},{"titleId":"CUSA04730_00","name":"Call of Cthulhu"},{"titleId":"CUSA12928_00","name":"Chronus Arc"},{"titleId":"CUSA12490_00","name":"Dream Daddy"},{"titleId":"CUSA12096_00","name":"Infinite Adventures"},{"titleId":"CUSA13434_00","name":"Castlevania Requiem: Symphony Of The Night & Rondo Of Blood"},{"titleId":"CUSA11668_00","name":"Dakar 18"},{"titleId":"CUSA12048_00","name":"MY HERO ONE’S JUSTICE"},{"titleId":"CUSA11259_00","name":"Overload"},{"titleId":"CUSA12565_00","name":"Just Dance® 2019"},{"titleId":"CUSA13122_00","name":"Neverout"},{"titleId":"CUSA11830_00","name":"Nickelodeon Kart Racers"},{"titleId":"CUSA13976_00","name":"Word Sudoku by POWGI"},{"titleId":"CUSA12205_00","name":"Halloween Forever"},{"titleId":"CUSA11300_00","name":"Onimusha: Warlords"},{"titleId":"CUSA08880_00","name":"Darksiders III"},{"titleId":"CUSA12636_00","name":"Persona 3: Dancing in Moonlight"},{"titleId":"CUSA12380_00","name":"Persona 5: Dancing in Starlight"},{"titleId":"CUSA12680_00","name":"Mutant Year Zero: Road to Eden"},{"titleId":"CUSA13435_00","name":"Override: Mech City Brawl"},{"titleId":"CUSA09254_00","name":"Just Cause 4"},{"titleId":"CUSA14081_00","name":"PLAYERUNKNOWN'S BATTLEGROUNDS"},{"titleId":"CUSA13974_00","name":"Hello Neighbor: Hide And Seek"},{"titleId":"CUSA12535_00","name":"EARTH DEFENSE FORCE 5"}]} \ No newline at end of file