mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-16 22:52:27 +00:00
Add support for Cross Controller Planets (#562)
* Add support for Cross Controller Planets * Clean
This commit is contained in:
parent
74c70115b8
commit
ca317d3afc
5 changed files with 47 additions and 2 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -16,6 +16,9 @@ ProjectLighthouse/.vscode/launch.json
|
|||
.editorconfig
|
||||
launchSettings.json
|
||||
|
||||
# macOS Junk
|
||||
.DS_Store
|
||||
|
||||
# Lighthouse junk
|
||||
riderModule.iml
|
||||
r/
|
||||
|
|
|
@ -131,6 +131,8 @@ public class UserController : ControllerBase
|
|||
}
|
||||
}
|
||||
|
||||
if (update.PlanetHashLBP2CC != null) user.PlanetHashLBP2CC = update.PlanetHashLBP2CC;
|
||||
|
||||
if (update.PlanetHash != null)
|
||||
{
|
||||
switch (token.GameVersion)
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
using LBPUnion.ProjectLighthouse;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ProjectLighthouse.Migrations
|
||||
{
|
||||
[DbContext(typeof(Database))]
|
||||
[Migration("20221117165700_AddCrossControlPlanet")]
|
||||
public partial class AddCrossControlPlanet : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "PlanetHashLBP2CC",
|
||||
table: "Users",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PlanetHashLBP2CC",
|
||||
table: "Users");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -130,6 +130,9 @@ public class User
|
|||
[JsonIgnore]
|
||||
public string PlanetHashLBP2 { get; set; } = "";
|
||||
|
||||
[JsonIgnore]
|
||||
public string PlanetHashLBP2CC { get; set; } = "";
|
||||
|
||||
[JsonIgnore]
|
||||
public string PlanetHashLBP3 { get; set; } = "";
|
||||
|
||||
|
@ -227,7 +230,7 @@ public class User
|
|||
|
||||
private string serializeEarth(GameVersion gameVersion)
|
||||
{
|
||||
return LbpSerializer.StringElement<string>
|
||||
string planets = LbpSerializer.StringElement<string>
|
||||
(
|
||||
"planets",
|
||||
gameVersion switch
|
||||
|
@ -239,6 +242,10 @@ public class User
|
|||
},
|
||||
true
|
||||
);
|
||||
if (gameVersion == GameVersion.LittleBigPlanet2)
|
||||
planets += LbpSerializer.StringElement("crossControlPlanet", this.PlanetHashLBP2CC);
|
||||
|
||||
return planets;
|
||||
}
|
||||
|
||||
#region Slots
|
||||
|
|
|
@ -18,6 +18,9 @@ public class UserUpdate
|
|||
[XmlElement("planets")]
|
||||
public string? PlanetHash { get; set; }
|
||||
|
||||
[XmlElement("crossControlPlanet")]
|
||||
public string? PlanetHashLBP2CC { get; set; }
|
||||
|
||||
[XmlArray("slots")]
|
||||
[XmlArrayItem("slot")]
|
||||
public List<UserUpdateSlot>? Slots { get; set; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue