Fix claims.
Use OID instead of email for microsoft identifier. Fix PlayerCount route. Add created date to user table. Create spectator icon.
This commit is contained in:
@@ -1,13 +1,31 @@
|
||||
CREATE PROCEDURE [session].[ReadSessionPlayerCount]
|
||||
@PlayerName [user].UserName
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
DECLARE @PlayerId as BIGINT;
|
||||
SELECT @PlayerId = Id
|
||||
FROM [user].[User]
|
||||
WHERE [Name] = @PlayerName;
|
||||
|
||||
-- Result set of sessions which @PlayerName participates in.
|
||||
SELECT
|
||||
[Name],
|
||||
CASE
|
||||
WHEN Player2Id IS NULL THEN 1
|
||||
ELSE 2
|
||||
END AS PlayerCount
|
||||
FROM [session].[Session];
|
||||
FROM [session].[Session]
|
||||
WHERE Player1Id = @PlayerId OR Player2Id = @PlayerId;
|
||||
|
||||
-- Result set of sessions which @PlayerName does not participate in.
|
||||
SELECT
|
||||
[Name],
|
||||
CASE
|
||||
WHEN Player2Id IS NULL THEN 1
|
||||
ELSE 2
|
||||
END AS PlayerCount
|
||||
FROM [session].[Session]
|
||||
WHERE Player1Id <> @PlayerId AND ISNULL(Player2Id, 0) <> @PlayerId;
|
||||
END
|
||||
@@ -4,6 +4,7 @@
|
||||
[Name] [user].[UserName] NOT NULL UNIQUE,
|
||||
[DisplayName] NVARCHAR(100) NOT NULL,
|
||||
[Platform] NVARCHAR(20) NOT NULL,
|
||||
[CreatedDate] DATETIMEOFFSET DEFAULT SYSDATETIMEOFFSET()
|
||||
|
||||
CONSTRAINT User_Platform FOREIGN KEY ([Platform]) References [user].[LoginPlatform] ([Platform])
|
||||
ON DELETE CASCADE
|
||||
|
||||
Reference in New Issue
Block a user