mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-10 04:02:27 +00:00
Organize ProjectLighthouse.Types
This commit is contained in:
parent
283266cd31
commit
bf7bbab467
29 changed files with 62 additions and 39 deletions
|
@ -1,5 +1,6 @@
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Settings;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Tests {
|
namespace ProjectLighthouse.Tests {
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Settings;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Tests {
|
namespace ProjectLighthouse.Tests {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Levels;
|
||||||
|
using ProjectLighthouse.Types.Profiles;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Tests {
|
namespace ProjectLighthouse.Tests {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Settings;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Controllers {
|
namespace ProjectLighthouse.Controllers {
|
||||||
[ApiController]
|
[ApiController]
|
||||||
|
|
|
@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Profiles;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Controllers {
|
namespace ProjectLighthouse.Controllers {
|
||||||
[ApiController]
|
[ApiController]
|
||||||
|
|
|
@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Levels;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Controllers {
|
namespace ProjectLighthouse.Controllers {
|
||||||
[ApiController]
|
[ApiController]
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Levels;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Controllers {
|
namespace ProjectLighthouse.Controllers {
|
||||||
[ApiController]
|
[ApiController]
|
||||||
|
|
|
@ -3,6 +3,7 @@ using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Settings;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Controllers {
|
namespace ProjectLighthouse.Controllers {
|
||||||
[ApiController]
|
[ApiController]
|
||||||
|
|
|
@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using ProjectLighthouse.Helpers;
|
using ProjectLighthouse.Helpers;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Profiles;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Controllers {
|
namespace ProjectLighthouse.Controllers {
|
||||||
[ApiController]
|
[ApiController]
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.News;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Controllers {
|
namespace ProjectLighthouse.Controllers {
|
||||||
[ApiController]
|
[ApiController]
|
||||||
|
|
|
@ -7,6 +7,8 @@ using Microsoft.EntityFrameworkCore;
|
||||||
using ProjectLighthouse.Helpers;
|
using ProjectLighthouse.Helpers;
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Levels;
|
||||||
|
using ProjectLighthouse.Types.Profiles;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Controllers {
|
namespace ProjectLighthouse.Controllers {
|
||||||
[ApiController]
|
[ApiController]
|
||||||
|
|
|
@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Levels;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Controllers {
|
namespace ProjectLighthouse.Controllers {
|
||||||
[ApiController]
|
[ApiController]
|
||||||
|
|
|
@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Levels;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Controllers {
|
namespace ProjectLighthouse.Controllers {
|
||||||
[ApiController]
|
[ApiController]
|
||||||
|
|
|
@ -6,6 +6,7 @@ using System.Xml;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Profiles;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Controllers {
|
namespace ProjectLighthouse.Controllers {
|
||||||
[ApiController]
|
[ApiController]
|
||||||
|
|
|
@ -4,6 +4,9 @@ using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using ProjectLighthouse.Helpers;
|
using ProjectLighthouse.Helpers;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Levels;
|
||||||
|
using ProjectLighthouse.Types.Profiles;
|
||||||
|
using ProjectLighthouse.Types.Settings;
|
||||||
|
|
||||||
namespace ProjectLighthouse {
|
namespace ProjectLighthouse {
|
||||||
public class Database : DbContext {
|
public class Database : DbContext {
|
||||||
|
|
|
@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using ProjectLighthouse.Types;
|
using ProjectLighthouse.Types;
|
||||||
|
using ProjectLighthouse.Types.Settings;
|
||||||
|
|
||||||
namespace ProjectLighthouse {
|
namespace ProjectLighthouse {
|
||||||
public static class Program {
|
public static class Program {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Types {
|
namespace ProjectLighthouse.Types.Levels {
|
||||||
public class HeartedLevel {
|
public class HeartedLevel {
|
||||||
// ReSharper disable once UnusedMember.Global
|
// ReSharper disable once UnusedMember.Global
|
||||||
[Key] public int HeartedLevelId { get; set; }
|
[Key] public int HeartedLevelId { get; set; }
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Types {
|
namespace ProjectLighthouse.Types.Levels {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A series of tags that can be applied to a level
|
/// A series of tags that can be applied to a level
|
||||||
/// </summary>
|
/// </summary>
|
|
@ -1,7 +1,7 @@
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Types {
|
namespace ProjectLighthouse.Types.Levels {
|
||||||
public class QueuedLevel {
|
public class QueuedLevel {
|
||||||
// ReSharper disable once UnusedMember.Global
|
// ReSharper disable once UnusedMember.Global
|
||||||
[Key] public int QueuedLevelId { get; set; }
|
[Key] public int QueuedLevelId { get; set; }
|
|
@ -3,8 +3,9 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
|
using ProjectLighthouse.Types.Profiles;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Types {
|
namespace ProjectLighthouse.Types.Levels {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A LittleBigPlanet level.
|
/// A LittleBigPlanet level.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -90,23 +91,23 @@ namespace ProjectLighthouse.Types {
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Serialize() {
|
public string Serialize() {
|
||||||
string slotData = LbpSerializer.StringElement("name", Name) +
|
string slotData = LbpSerializer.StringElement("name", this.Name) +
|
||||||
LbpSerializer.StringElement("id", SlotId) +
|
LbpSerializer.StringElement("id", this.SlotId) +
|
||||||
LbpSerializer.StringElement("game", 1) +
|
LbpSerializer.StringElement("game", 1) +
|
||||||
LbpSerializer.StringElement("npHandle", Creator.Username) +
|
LbpSerializer.StringElement("npHandle", this.Creator.Username) +
|
||||||
LbpSerializer.StringElement("description", Description) +
|
LbpSerializer.StringElement("description", this.Description) +
|
||||||
LbpSerializer.StringElement("icon", IconHash) +
|
LbpSerializer.StringElement("icon", this.IconHash) +
|
||||||
LbpSerializer.StringElement("rootLevel", RootLevel) +
|
LbpSerializer.StringElement("rootLevel", this.RootLevel) +
|
||||||
this.SerializeResources() +
|
this.SerializeResources() +
|
||||||
LbpSerializer.StringElement("location", Location.Serialize()) +
|
LbpSerializer.StringElement("location", this.Location.Serialize()) +
|
||||||
LbpSerializer.StringElement("initiallyLocked", InitiallyLocked) +
|
LbpSerializer.StringElement("initiallyLocked", this.InitiallyLocked) +
|
||||||
LbpSerializer.StringElement("isSubLevel", SubLevel) +
|
LbpSerializer.StringElement("isSubLevel", this.SubLevel) +
|
||||||
LbpSerializer.StringElement("isLBP1Only", Lbp1Only) +
|
LbpSerializer.StringElement("isLBP1Only", this.Lbp1Only) +
|
||||||
LbpSerializer.StringElement("shareable", Shareable) +
|
LbpSerializer.StringElement("shareable", this.Shareable) +
|
||||||
LbpSerializer.StringElement("background", BackgroundHash) +
|
LbpSerializer.StringElement("background", this.BackgroundHash) +
|
||||||
LbpSerializer.StringElement("minPlayers", MinimumPlayers) +
|
LbpSerializer.StringElement("minPlayers", this.MinimumPlayers) +
|
||||||
LbpSerializer.StringElement("maxPlayers", MaximumPlayers) +
|
LbpSerializer.StringElement("maxPlayers", this.MaximumPlayers) +
|
||||||
LbpSerializer.StringElement("moveRequired", MoveRequired);
|
LbpSerializer.StringElement("moveRequired", this.MoveRequired);
|
||||||
|
|
||||||
return LbpSerializer.TaggedStringElement("slot", slotData, "type", "user");
|
return LbpSerializer.TaggedStringElement("slot", slotData, "type", "user");
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Types {
|
namespace ProjectLighthouse.Types.News {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used on the info moon on LBP1. Broken for unknown reasons
|
/// Used on the info moon on LBP1. Broken for unknown reasons
|
||||||
/// </summary>
|
/// </summary>
|
|
@ -1,6 +1,6 @@
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Types {
|
namespace ProjectLighthouse.Types.News {
|
||||||
public class NewsImage {
|
public class NewsImage {
|
||||||
public string Hash { get; set; }
|
public string Hash { get; set; }
|
||||||
public string Alignment { get; set; }
|
public string Alignment { get; set; }
|
|
@ -1,7 +1,7 @@
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Types {
|
namespace ProjectLighthouse.Types.Profiles {
|
||||||
[Keyless]
|
[Keyless]
|
||||||
public class ClientsConnected {
|
public class ClientsConnected {
|
||||||
public bool Lbp1 { get; set; }
|
public bool Lbp1 { get; set; }
|
||||||
|
@ -12,11 +12,11 @@ namespace ProjectLighthouse.Types {
|
||||||
|
|
||||||
public string Serialize() {
|
public string Serialize() {
|
||||||
return LbpSerializer.StringElement("clientsConnected",
|
return LbpSerializer.StringElement("clientsConnected",
|
||||||
LbpSerializer.StringElement("lbp1", Lbp1) +
|
LbpSerializer.StringElement("lbp1", this.Lbp1) +
|
||||||
LbpSerializer.StringElement("lbp2", Lbp2) +
|
LbpSerializer.StringElement("lbp2", this.Lbp2) +
|
||||||
LbpSerializer.StringElement("lbpme", LbpMe) +
|
LbpSerializer.StringElement("lbpme", this.LbpMe) +
|
||||||
LbpSerializer.StringElement("lbp3ps3", Lbp3Ps3) +
|
LbpSerializer.StringElement("lbp3ps3", this.Lbp3Ps3) +
|
||||||
LbpSerializer.StringElement("lbp3ps4", Lbp3Ps4));
|
LbpSerializer.StringElement("lbp3ps4", this.Lbp3Ps4));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Types {
|
namespace ProjectLighthouse.Types.Profiles {
|
||||||
[XmlRoot("comment"), XmlType("comment")]
|
[XmlRoot("comment"), XmlType("comment")]
|
||||||
public class Comment {
|
public class Comment {
|
||||||
[Key]
|
[Key]
|
||||||
|
@ -28,12 +28,12 @@ namespace ProjectLighthouse.Types {
|
||||||
public int ThumbsDown { get; set; }
|
public int ThumbsDown { get; set; }
|
||||||
|
|
||||||
private string serialize() {
|
private string serialize() {
|
||||||
return LbpSerializer.StringElement("id", CommentId) +
|
return LbpSerializer.StringElement("id", this.CommentId) +
|
||||||
LbpSerializer.StringElement("npHandle", this.Poster.Username) +
|
LbpSerializer.StringElement("npHandle", this.Poster.Username) +
|
||||||
LbpSerializer.StringElement("timestamp", Timestamp) +
|
LbpSerializer.StringElement("timestamp", this.Timestamp) +
|
||||||
LbpSerializer.StringElement("message", Message) +
|
LbpSerializer.StringElement("message", this.Message) +
|
||||||
LbpSerializer.StringElement("thumbsup", ThumbsUp) +
|
LbpSerializer.StringElement("thumbsup", this.ThumbsUp) +
|
||||||
LbpSerializer.StringElement("thumbsdown", ThumbsDown);
|
LbpSerializer.StringElement("thumbsdown", this.ThumbsDown);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Serialize(int yourThumb) {
|
public string Serialize(int yourThumb) {
|
|
@ -1,6 +1,6 @@
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Types {
|
namespace ProjectLighthouse.Types.Profiles {
|
||||||
public class LastMatch {
|
public class LastMatch {
|
||||||
[Key] public int UserId { get; set; }
|
[Key] public int UserId { get; set; }
|
||||||
public long Timestamp { get; set; }
|
public long Timestamp { get; set; }
|
|
@ -1,6 +1,6 @@
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Types {
|
namespace ProjectLighthouse.Types.Profiles {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The location of a slot on a planet.
|
/// The location of a slot on a planet.
|
||||||
/// </summary>
|
/// </summary>
|
|
@ -1,14 +1,14 @@
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Types {
|
namespace ProjectLighthouse.Types.Settings {
|
||||||
public class PrivacySettings {
|
public class PrivacySettings {
|
||||||
public string LevelVisibility { get; set; }
|
public string LevelVisibility { get; set; }
|
||||||
public string ProfileVisibility { get; set; }
|
public string ProfileVisibility { get; set; }
|
||||||
|
|
||||||
public string Serialize() {
|
public string Serialize() {
|
||||||
return LbpSerializer.StringElement("privacySettings",
|
return LbpSerializer.StringElement("privacySettings",
|
||||||
LbpSerializer.StringElement("levelVisibility", LevelVisibility) +
|
LbpSerializer.StringElement("levelVisibility", this.LevelVisibility) +
|
||||||
LbpSerializer.StringElement("profileVisibility", ProfileVisibility)
|
LbpSerializer.StringElement("profileVisibility", this.ProfileVisibility)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
#nullable enable
|
#nullable enable
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Types {
|
namespace ProjectLighthouse.Types.Settings {
|
||||||
public static class ServerSettings {
|
public static class ServerSettings {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum amount of slots allowed on users' earth
|
/// The maximum amount of slots allowed on users' earth
|
|
@ -1,5 +1,7 @@
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
|
using ProjectLighthouse.Types.Profiles;
|
||||||
|
using ProjectLighthouse.Types.Settings;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Types {
|
namespace ProjectLighthouse.Types {
|
||||||
public class User {
|
public class User {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue