mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-19 11:41:30 +00:00
Fix publishing, default to LBP1 on connect, fix LBP1 not connecting
This commit is contained in:
parent
582d2e2de0
commit
fd6367feca
5 changed files with 12 additions and 6 deletions
|
@ -89,6 +89,7 @@
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=brun/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=brun/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=ezoiar/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=ezoiar/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=farc/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=farc/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=friendscores/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Kettu/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Kettu/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=lbpme/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=lbpme/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=LBPU/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=LBPU/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
|
|
@ -22,8 +22,10 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IActionResult> Login([FromQuery] string titleId)
|
public async Task<IActionResult> Login([FromQuery] string? titleId)
|
||||||
{
|
{
|
||||||
|
titleId ??= "";
|
||||||
|
|
||||||
string body = await new StreamReader(this.Request.Body).ReadToEndAsync();
|
string body = await new StreamReader(this.Request.Body).ReadToEndAsync();
|
||||||
|
|
||||||
LoginData? loginData;
|
LoginData? loginData;
|
||||||
|
|
|
@ -60,7 +60,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
||||||
// User user = await this.database.UserFromRequest(this.Request);
|
// User user = await this.database.UserFromRequest(this.Request);
|
||||||
(User, Token)? userAndToken = await this.database.UserAndTokenFromRequest(this.Request);
|
(User, Token)? userAndToken = await this.database.UserAndTokenFromRequest(this.Request);
|
||||||
|
|
||||||
if (userAndToken != null) return this.StatusCode(403, "");
|
if (userAndToken == null) return this.StatusCode(403, "");
|
||||||
|
|
||||||
// ReSharper disable once PossibleInvalidOperationException
|
// ReSharper disable once PossibleInvalidOperationException
|
||||||
User user = userAndToken.Value.Item1;
|
User user = userAndToken.Value.Item1;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#nullable enable
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
@ -30,7 +31,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
||||||
string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync();
|
string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync();
|
||||||
|
|
||||||
XmlSerializer serializer = new(typeof(Score));
|
XmlSerializer serializer = new(typeof(Score));
|
||||||
Score score = (Score)serializer.Deserialize(new StringReader(bodyString));
|
Score? score = (Score?)serializer.Deserialize(new StringReader(bodyString));
|
||||||
if (score == null) return this.BadRequest();
|
if (score == null) return this.BadRequest();
|
||||||
|
|
||||||
score.SlotId = id;
|
score.SlotId = id;
|
||||||
|
@ -58,7 +59,9 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
||||||
public async Task<IActionResult> TopScores(int slotId, int type, [FromQuery] int pageStart, [FromQuery] int pageSize)
|
public async Task<IActionResult> TopScores(int slotId, int type, [FromQuery] int pageStart, [FromQuery] int pageSize)
|
||||||
{
|
{
|
||||||
// Get username
|
// Get username
|
||||||
User user = await this.database.UserFromRequest(this.Request);
|
User? user = await this.database.UserFromRequest(this.Request);
|
||||||
|
|
||||||
|
if (user == null) return this.StatusCode(403, "");
|
||||||
|
|
||||||
// This is hella ugly but it technically assigns the proper rank to a score
|
// This is hella ugly but it technically assigns the proper rank to a score
|
||||||
// var needed for Anonymous type returned from SELECT
|
// var needed for Anonymous type returned from SELECT
|
||||||
|
@ -67,7 +70,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
||||||
.ToList()
|
.ToList()
|
||||||
.Select
|
.Select
|
||||||
(
|
(
|
||||||
(Score s, int rank) => new
|
(s, rank) => new
|
||||||
{
|
{
|
||||||
Score = s,
|
Score = s,
|
||||||
Rank = rank + 1,
|
Rank = rank + 1,
|
||||||
|
|
|
@ -82,7 +82,7 @@ namespace LBPUnion.ProjectLighthouse.Helpers
|
||||||
if (LittleBigPlanet2TitleIds.Contains(titleId)) return GameVersion.LittleBigPlanet2;
|
if (LittleBigPlanet2TitleIds.Contains(titleId)) return GameVersion.LittleBigPlanet2;
|
||||||
if (LittleBigPlanet3TitleIds.Contains(titleId)) return GameVersion.LittleBigPlanet3;
|
if (LittleBigPlanet3TitleIds.Contains(titleId)) return GameVersion.LittleBigPlanet3;
|
||||||
|
|
||||||
return GameVersion.Unknown;
|
return GameVersion.LittleBigPlanet1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue