JavaScript is required to use Bungie.net

Forums

Edited by Phuzakie: 12/11/2014 10:54:40 PM
12
So to put to rest how complicated it would be to select a different playlist dependent upon a users platform and highest level of content pack purchased, I offer the following code. This is a rough cut that is not optimized for speed, it is to dispel the notion that this would be hard to maintain going forward. [u]The assumption for The Dark Below and House of Wolves is what a player who bought the DLC would see the week that content went live.[/u] [b]And oh yeah, it mixes the PlayStation exclusives into the rotation as well.[/b] [u]The Table[/u] [spoiler] CREATE TABLE [dbo].[StrikePlaylist]( [Platform] [nvarchar](50) NOT NULL, [ContentPack] [nvarchar](50) NOT NULL, [Strike] [nvarchar](50) NOT NULL, [LastPlayed] [datetime] NULL, [/spoiler] [u]The Data (38 Rows including House of Wolves future strike)[/u] [spoiler] PlayStation Destiny Cerberus Vae III 2014-09-29 00:00:00.000 PlayStation Destiny Dust Palace 2014-10-06 00:00:00.000 PlayStation Destiny The Devils' Lair 2014-09-01 00:00:00.000 PlayStation Destiny The Nexus 2014-09-15 00:00:00.000 PlayStation Destiny The Summoning Pits 2014-09-08 00:00:00.000 PlayStation Destiny Winter's Run 2014-09-22 00:00:00.000 PlayStation House of Wolves Cerberus Vae III 2014-09-29 00:00:00.000 PlayStation House of Wolves Dust Palace 2014-10-06 00:00:00.000 PlayStation House of Wolves Moon Strike NULL PlayStation House of Wolves The Devils' Lair 2014-09-01 00:00:00.000 PlayStation House of Wolves The Nexus 2014-09-15 00:00:00.000 PlayStation House of Wolves The Summoning Pits 2014-09-08 00:00:00.000 PlayStation House of Wolves Will of Crota 2014-12-09 00:00:00.000 PlayStation House of Wolves Winter's Run 2014-09-22 00:00:00.000 PlayStation The Dark Below Cerberus Vae III 2014-09-29 00:00:00.000 PlayStation The Dark Below Dust Palace 2014-10-06 00:00:00.000 PlayStation The Dark Below The Devils' Lair 2014-09-01 00:00:00.000 PlayStation The Dark Below The Nexus 2014-09-15 00:00:00.000 PlayStation The Dark Below The Summoning Pits 2014-09-08 00:00:00.000 PlayStation The Dark Below Will of Crota NULL PlayStation The Dark Below Winter's Run 2014-09-22 00:00:00.000 XBox Destiny Cerberus Vae III 2014-09-29 00:00:00.000 XBox Destiny The Devils' Lair 2014-10-06 00:00:00.000 XBox Destiny The Nexus 2014-09-15 00:00:00.000 XBox Destiny The Summoning Pits 2014-09-08 00:00:00.000 XBox Destiny Winter's Run 2014-09-22 00:00:00.000 XBox House of Wolves Cerberus Vae III 2014-09-29 00:00:00.000 XBox House of Wolves Moon Strike NULL XBox House of Wolves The Devils' Lair 2014-09-01 00:00:00.000 XBox House of Wolves The Nexus 2014-09-15 00:00:00.000 XBox House of Wolves The Summoning Pits 2014-09-08 00:00:00.000 XBox House of Wolves Will of Crota 2014-12-09 00:00:00.000 XBox House of Wolves Winter's Run 2014-09-22 00:00:00.000 XBox The Dark Below The Devils' Lair 2014-09-01 00:00:00.000 XBox The Dark Below The Nexus 2014-09-15 00:00:00.000 XBox The Dark Below The Summoning Pits 2014-09-08 00:00:00.000 XBox The Dark Below Will of Crota NULL XBox The Dark Below Winter's Run 2014-09-22 00:00:00.000 [/spoiler] [u]The Query[/u] [spoiler] SELECT TOP 1 * FROM [dbo].[StrikePlaylist] WHERE Platform = '[b]PLATFORM OF USER[/b]' AND ContentPack = '[b]MOST INCLUSIVE CONTENT PACK USER OWNS[/b]' ORDER BY (CASE WHEN [LastPlayed] IS NULL THEN 1 ELSE 0 END) DESC, LastPlayed [/spoiler] [u]Results[/u] [quote] An XBox player with no DLC packs would get: The Summoning Pits An XBox player with The Dark Below would get: Will of Crota An XBox player with House of Wolves would get: Moon Strike A PlayStation player with no DLC packs would get: The Devils' Lair A PlayStation player with The Dark Below would get: Will of Crota A PlayStation player with House of Wolves would get: Moon Strike [/quote]
English

Posting in language:

 

Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

You are not allowed to view this content.
;
preload icon
preload icon
preload icon