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
|
.editorconfig
|
||||||
launchSettings.json
|
launchSettings.json
|
||||||
|
|
||||||
|
# macOS Junk
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
# Lighthouse junk
|
# Lighthouse junk
|
||||||
riderModule.iml
|
riderModule.iml
|
||||||
r/
|
r/
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class UserController : ControllerBase
|
||||||
if (update.MehHash != null) user.MehHash = update.MehHash;
|
if (update.MehHash != null) user.MehHash = update.MehHash;
|
||||||
|
|
||||||
if (update.BooHash != null) user.BooHash = update.BooHash;
|
if (update.BooHash != null) user.BooHash = update.BooHash;
|
||||||
|
|
||||||
if (update.Slots != null)
|
if (update.Slots != null)
|
||||||
{
|
{
|
||||||
foreach (UserUpdateSlot? updateSlot in update.Slots)
|
foreach (UserUpdateSlot? updateSlot in update.Slots)
|
||||||
|
@ -131,6 +131,8 @@ public class UserController : ControllerBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (update.PlanetHashLBP2CC != null) user.PlanetHashLBP2CC = update.PlanetHashLBP2CC;
|
||||||
|
|
||||||
if (update.PlanetHash != null)
|
if (update.PlanetHash != null)
|
||||||
{
|
{
|
||||||
switch (token.GameVersion)
|
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]
|
[JsonIgnore]
|
||||||
public string PlanetHashLBP2 { get; set; } = "";
|
public string PlanetHashLBP2 { get; set; } = "";
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public string PlanetHashLBP2CC { get; set; } = "";
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string PlanetHashLBP3 { get; set; } = "";
|
public string PlanetHashLBP3 { get; set; } = "";
|
||||||
|
|
||||||
|
@ -227,7 +230,7 @@ public class User
|
||||||
|
|
||||||
private string serializeEarth(GameVersion gameVersion)
|
private string serializeEarth(GameVersion gameVersion)
|
||||||
{
|
{
|
||||||
return LbpSerializer.StringElement<string>
|
string planets = LbpSerializer.StringElement<string>
|
||||||
(
|
(
|
||||||
"planets",
|
"planets",
|
||||||
gameVersion switch
|
gameVersion switch
|
||||||
|
@ -239,6 +242,10 @@ public class User
|
||||||
},
|
},
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
if (gameVersion == GameVersion.LittleBigPlanet2)
|
||||||
|
planets += LbpSerializer.StringElement("crossControlPlanet", this.PlanetHashLBP2CC);
|
||||||
|
|
||||||
|
return planets;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Slots
|
#region Slots
|
||||||
|
|
|
@ -18,6 +18,9 @@ public class UserUpdate
|
||||||
[XmlElement("planets")]
|
[XmlElement("planets")]
|
||||||
public string? PlanetHash { get; set; }
|
public string? PlanetHash { get; set; }
|
||||||
|
|
||||||
|
[XmlElement("crossControlPlanet")]
|
||||||
|
public string? PlanetHashLBP2CC { get; set; }
|
||||||
|
|
||||||
[XmlArray("slots")]
|
[XmlArray("slots")]
|
||||||
[XmlArrayItem("slot")]
|
[XmlArrayItem("slot")]
|
||||||
public List<UserUpdateSlot>? Slots { get; set; }
|
public List<UserUpdateSlot>? Slots { get; set; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue