Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Фикс субмодуля #56

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Content.Benchmarks/Content.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\RobustToolbox\MSBuild\Robust.Properties.targets" />
<PropertyGroup>
<!-- Work around https://github.com/dotnet/project-system/issues/4314 -->
Expand All @@ -10,6 +10,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>12</LangVersion>
</PropertyGroup>
<Import Project="../Content.Shared/_PrivateShared/LPP_GlobalDefines.props" Condition="Exists('../Content.Shared/_PrivateShared/LPP_GlobalDefines.props')" />
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" />
</ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions Content.Client/.filenesting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"help":"https://go.microsoft.com/fwlink/?linkid=866610"
}
1 change: 1 addition & 0 deletions Content.Client/Content.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<Configurations>Debug;Release;Tools;DebugOpt</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<Import Project="../Content.Shared/_PrivateShared/LPP_GlobalDefines.props" Condition="Exists('../Content.Shared/_PrivateShared/LPP_GlobalDefines.props')" />
<ItemGroup>
<PackageReference Include="Nett" />
<PackageReference Include="JetBrains.Annotations" PrivateAssets="All" />
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Corvax/TTS/TTSSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_TTS_play //комментировать при ошибках
using Content.Shared.Chat;
using Content.Shared.Corvax.CCCVars;
using Content.Shared.Corvax.TTS;
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using Content.Client.Administration.Managers;
using Content.Client.Changelog;
using Content.Client.Chat.Managers;
Expand Down
1 change: 0 additions & 1 deletion Content.Client/IoC/ClientContentIoC.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using Content.Client.Administration.Managers;
using Content.Client.Changelog;
using Content.Client.Chat.Managers;
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Preferences/ClientPreferencesManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using System.Linq;
using System.Numerics;
using Content.Client.Humanoid;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using System.Linq;
using System.Numerics;
using Content.Client.Guidebook;
Expand Down
3 changes: 2 additions & 1 deletion Content.IntegrationTests/Content.IntegrationTests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Work around https://github.com/dotnet/project-system/issues/4314 -->
<TargetFramework>$(TargetFramework)</TargetFramework>
Expand All @@ -7,6 +7,7 @@
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<LangVersion>12</LangVersion>
</PropertyGroup>
<Import Project="../Content.Shared/_PrivateShared/LPP_GlobalDefines.props" Condition="Exists('../Content.Shared/_PrivateShared/LPP_GlobalDefines.props')" />
<ItemGroup>
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using System.Collections.Generic;
using System.Linq;
using Content.Server.Database;
Expand Down
1 change: 1 addition & 0 deletions Content.MapRenderer/Content.MapRenderer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Nullable>enable</Nullable>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<Import Project="../Content.Shared/_PrivateShared/LPP_GlobalDefines.props" Condition="Exists('../Content.Shared/_PrivateShared/LPP_GlobalDefines.props')" />

<ItemGroup>
<ProjectReference Include="..\Content.IntegrationTests\Content.IntegrationTests.csproj" />
Expand Down
1 change: 1 addition & 0 deletions Content.Packaging/Content.Packaging.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<Nullable>enable</Nullable>
<ServerGarbageCollection>True</ServerGarbageCollection>
</PropertyGroup>
<Import Project="../Content.Shared/_PrivateShared/LPP_GlobalDefines.props" Condition="Exists('../Content.Shared/_PrivateShared/LPP_GlobalDefines.props')" />

<ItemGroup>
<ProjectReference Include="..\RobustToolbox\Robust.Packaging\Robust.Packaging.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions Content.Server.Database/Content.Server.Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<NoWarn>RA0003</NoWarn>
</PropertyGroup>

<Import Project="../Content.Shared/_PrivateShared/LPP_GlobalDefines.props" Condition="Exists('../Content.Shared/_PrivateShared/LPP_GlobalDefines.props')" />

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if LPP_Sponsors
using System;
using Microsoft.EntityFrameworkCore.Migrations;

Expand Down Expand Up @@ -42,3 +43,4 @@ protected override void Down(MigrationBuilder migrationBuilder)
}
}
}
#endif

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore.Migrations;
#if LPP_Sponsors
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

Expand All @@ -24,3 +25,4 @@ protected override void Down(MigrationBuilder migrationBuilder)
}
}
}
#endif

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore.Migrations;
#if LPP_Sponsors
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

Expand Down Expand Up @@ -44,3 +45,4 @@ protected override void Down(MigrationBuilder migrationBuilder)
}
}
}
#endif

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if LPP_Sponsors
using System;
using Microsoft.EntityFrameworkCore.Migrations;

Expand Down Expand Up @@ -41,3 +42,4 @@ protected override void Down(MigrationBuilder migrationBuilder)
}
}
}
#endif

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore.Migrations;
#if LPP_Sponsors
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

Expand All @@ -24,3 +25,4 @@ protected override void Down(MigrationBuilder migrationBuilder)
}
}
}
#endif

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore.Migrations;
#if LPP_Sponsors
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

Expand Down Expand Up @@ -45,3 +46,4 @@ protected override void Down(MigrationBuilder migrationBuilder)
}
}
}
#endif
12 changes: 7 additions & 5 deletions Content.Server.Database/Model.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
Expand Down Expand Up @@ -41,7 +40,9 @@ protected ServerDbContext(DbContextOptions options) : base(options)
public DbSet<AdminNote> AdminNotes { get; set; } = null!;
public DbSet<AdminWatchlist> AdminWatchlists { get; set; } = null!;
public DbSet<AdminMessage> AdminMessages { get; set; } = null!;
public DbSet<Sponsor> Sponsors { get; set; } = null!; // _LostParadise-Sponsors
#if LPP_Sponsors // _LostParadise-Sponsors
public DbSet<Sponsor> Sponsors { get; set; } = null!;
#endif

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
Expand All @@ -64,12 +65,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.Entity<Loadout>()
.HasIndex(p => new {HumanoidProfileId = p.ProfileId, p.LoadoutName})
.IsUnique();

#if LPP_Sponsors
modelBuilder.Entity<Sponsor>() // _LostParadise-Sponsors
.HasIndex(p => p.UserId)
.IsUnique();

#if LPP_Sponsors // _LostParadise-Sponsors
modelBuilder.Entity<Donate>()
.HasIndex(p => new { HumanoidProfileId = p.ProfileId, p.DonateName })
.IsUnique();
Expand Down Expand Up @@ -1051,7 +1051,8 @@ public class AdminMessage : IAdminRemarksCommon
public bool Dismissed { get; set; }
}

[Table("sponsors")] // _LostParadise-Sponsors
#if LPP_Sponsors // _LostParadise-Sponsors
[Table("sponsors")]
public class Sponsor
{
[Required, Key] public Guid UserId { get; set; }
Expand All @@ -1063,4 +1064,5 @@ public class Sponsor
public DateTime ExpireDate {get;set;}
public bool AllowJob { get; set; } = false;
}
#endif
}
1 change: 0 additions & 1 deletion Content.Server/Chat/Managers/ChatManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Runtime.InteropServices;
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Connection/ConnectionManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using System.Collections.Immutable;
using System.Runtime.InteropServices;
using System.Text.Json.Nodes;
Expand Down
1 change: 1 addition & 0 deletions Content.Server/Content.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<Nullable>enable</Nullable>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<Import Project="../Content.Shared/_PrivateShared/LPP_GlobalDefines.props" Condition="Exists('../Content.Shared/_PrivateShared/LPP_GlobalDefines.props')" />
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" PrivateAssets="All" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Database/ServerDbBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
Expand Down Expand Up @@ -1601,7 +1600,7 @@ protected abstract class DbGuard : IAsyncDisposable

public abstract ValueTask DisposeAsync();
}

#if LPP_Sponsors
#region Sponsors
public async Task<Sponsor?> GetSponsorInfo(NetUserId userId) // _LostParadise-Sponsors
{
Expand All @@ -1615,5 +1614,6 @@ protected abstract class DbGuard : IAsyncDisposable
return await db.DbContext.Sponsors.AsNoTracking().ToArrayAsync();
}
#endregion
#endif
}
}
5 changes: 4 additions & 1 deletion Content.Server/Database/ServerDbManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,12 @@ Task<int> AddConnectionLogAsync(

#endregion

#if LPP_Sponsors
#region Sponsors
Task<Sponsor?> GetSponsorInfo(NetUserId userId, CancellationToken cancel = default); //_LostParadise-Sponsors
Task<Sponsor[]?> GetSponsorList(CancellationToken cancel = default);
#endregion
#endif
}

public sealed class ServerDbManager : IServerDbManager
Expand Down Expand Up @@ -921,7 +923,7 @@ private IAsyncEnumerable<T> RunDbCommand<T>(Func<IAsyncEnumerable<T>> command)
return enumerable;
}

// _LostParadise-Sponsors
#if LPP_Sponsors // _LostParadise-Sponsors
public async Task<Sponsor?> GetSponsorInfo(NetUserId userId, CancellationToken cancel = default)
{
DbWriteOpsMetric.Inc();
Expand All @@ -933,6 +935,7 @@ private IAsyncEnumerable<T> RunDbCommand<T>(Func<IAsyncEnumerable<T>> command)
DbWriteOpsMetric.Inc();
return await _db.GetSponsorList();
}
#endif

private DbContextOptions<PostgresServerDbContext> CreatePostgresOptions()
{
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using Content.Server.Acz;
using Content.Server.Administration;
using Content.Server.Administration.Logs;
Expand Down
1 change: 0 additions & 1 deletion Content.Server/IoC/ServerContentIoC.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using Content.Server.Administration;
using Content.Server.Administration.Logs;
using Content.Server.Administration.Managers;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading;
Expand Down
1 change: 1 addition & 0 deletions Content.Shared.Database/Content.Shared.Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<Import Project="../Content.Shared/_PrivateShared/LPP_GlobalDefines.props" Condition="Exists('../Content.Shared/_PrivateShared/LPP_GlobalDefines.props')" />

<Import Project="..\RobustToolbox\MSBuild\Robust.Properties.targets" />
</Project>
3 changes: 2 additions & 1 deletion Content.Shared/Content.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Work around https://github.com/dotnet/project-system/issues/4314 -->
<TargetFramework>$(TargetFramework)</TargetFramework>
Expand All @@ -8,6 +8,7 @@
<WarningsAsErrors>nullable</WarningsAsErrors>
<Nullable>enable</Nullable>
</PropertyGroup>
<Import Project="../Content.Shared/_PrivateShared/LPP_GlobalDefines.props" Condition="Exists('../Content.Shared/_PrivateShared/LPP_GlobalDefines.props')" />
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" PrivateAssets="All" />
</ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion Content.Shared/Humanoid/HumanoidCharacterAppearance.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using System.Linq;
using Content.Shared.Humanoid.Markings;
using Content.Shared.Humanoid.Prototypes;
Expand Down
1 change: 0 additions & 1 deletion Content.Shared/Humanoid/Markings/MarkingsSet.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define LPP_Sponsors //комментировать при ошибках
using System.Collections;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
Expand Down
Loading
Loading