mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-07-02 17:03:41 -04:00
Fix issues with Journal handling
Implement basic database Handle startup events only send events after the most recent LoadGame
This commit is contained in:
@ -0,0 +1,17 @@
|
||||
namespace Pulsar.Context.Configuration;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Observatory.Framework.Files.Journal.StationServices;
|
||||
|
||||
public class EngineerProgressConfiguration : IEntityTypeConfiguration<EngineerProgress>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<EngineerProgress> builder)
|
||||
{
|
||||
builder.HasKey(x => x.Timestamp);
|
||||
builder.OwnsMany(x => x.Engineers, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
}
|
||||
}
|
13
Pulsar/Context/Configuration/LoadGameConfiguration.cs
Normal file
13
Pulsar/Context/Configuration/LoadGameConfiguration.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace Pulsar.Context.Configuration;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Observatory.Framework.Files.Journal.Startup;
|
||||
|
||||
public class LoadGameConfiguration : IEntityTypeConfiguration<LoadGame>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<LoadGame> builder)
|
||||
{
|
||||
builder.HasKey(j => j.Timestamp);
|
||||
}
|
||||
}
|
25
Pulsar/Context/Configuration/MaterialsConfiguration.cs
Normal file
25
Pulsar/Context/Configuration/MaterialsConfiguration.cs
Normal file
@ -0,0 +1,25 @@
|
||||
namespace Pulsar.Context.Configuration;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Observatory.Framework.Files.Journal.Startup;
|
||||
|
||||
public class MaterialsConfiguration : IEntityTypeConfiguration<Materials>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Materials> builder)
|
||||
{
|
||||
builder.HasKey(x => x.Timestamp);
|
||||
builder.OwnsMany(x => x.Raw, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsMany(x => x.Encoded, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsMany(x => x.Manufactured, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
}
|
||||
}
|
13
Pulsar/Context/Configuration/ProgressConfiguration.cs
Normal file
13
Pulsar/Context/Configuration/ProgressConfiguration.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace Pulsar.Context.Configuration;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Observatory.Framework.Files.Journal.Startup;
|
||||
|
||||
public class ProgressConfiguration : IEntityTypeConfiguration<Progress>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Progress> builder)
|
||||
{
|
||||
builder.Ignore(x => x.AdditionalProperties);
|
||||
}
|
||||
}
|
14
Pulsar/Context/Configuration/RanksConfiguration.cs
Normal file
14
Pulsar/Context/Configuration/RanksConfiguration.cs
Normal file
@ -0,0 +1,14 @@
|
||||
namespace Pulsar.Context.Configuration;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Observatory.Framework.Files.Journal.Startup;
|
||||
|
||||
public class RanksConfiguration : IEntityTypeConfiguration<Rank>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Rank> builder)
|
||||
{
|
||||
builder.Ignore(x => x.AdditionalProperties);
|
||||
builder.HasKey(x => x.Timestamp);
|
||||
}
|
||||
}
|
13
Pulsar/Context/Configuration/ReputationConfiguration.cs
Normal file
13
Pulsar/Context/Configuration/ReputationConfiguration.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace Pulsar.Context.Configuration;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Observatory.Framework.Files.Journal.Startup;
|
||||
|
||||
public class ReputationConfiguration : IEntityTypeConfiguration<Reputation>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Reputation> builder)
|
||||
{
|
||||
builder.HasKey(x => x.Timestamp);
|
||||
}
|
||||
}
|
83
Pulsar/Context/Configuration/StatisticsConfiguration.cs
Normal file
83
Pulsar/Context/Configuration/StatisticsConfiguration.cs
Normal file
@ -0,0 +1,83 @@
|
||||
using Observatory.Framework.Files.ParameterTypes;
|
||||
|
||||
namespace Pulsar.Context.Configuration;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Observatory.Framework.Files.Journal.Startup;
|
||||
|
||||
public class StatisticsConfiguration : IEntityTypeConfiguration<Statistics>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Statistics> builder)
|
||||
{
|
||||
builder.HasKey(x => x.Timestamp);
|
||||
builder.OwnsOne(x => x.BankAccount, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.Combat, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.Crime, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.Smuggling, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.Trading, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.Mining, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.Exploration, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.Passengers, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.SearchAndRescue, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.Crafting, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.Crew, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.Multicrew, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.Thargoid, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.MaterialTrader, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.CQC, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.FleetCarrier, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(x => x.Exobiology, b =>
|
||||
{
|
||||
b.ToJson();
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user