Skip to content

Commit 02895fd

Browse files
authored
Remove Realm entirely (#824)
Poof. 💨
2 parents 92cafe5 + 764c773 commit 02895fd

80 files changed

Lines changed: 181 additions & 1914 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docker.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ jobs:
2929
dockerfile: PresenceServer.Dockerfile
3030
container_id: refresh-presenceserver
3131
build_args: ""
32-
- name: GameServer (DebugPostgres)
33-
dockerfile: Dockerfile
34-
container_id: refresh-postgres-beta
35-
build_args: |
36-
BUILD_CONFIGURATION=DebugPostgres
3732
steps:
3833
- name: Checkout repository
3934
uses: actions/checkout@v4

.github/workflows/postgres.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

Refresh.Core/Importing/ImageImporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void ImportFromDataStore(GameDatabaseContext context, IDataStore dataStor
2929

3030
ConcurrentQueue<GameAsset> assetQueue = new();
3131
foreach (GameAsset asset in assets)
32-
assetQueue.Enqueue((GameAsset)asset.Clone(false));
32+
assetQueue.Enqueue(asset);
3333

3434
this.Info("Cloned Realm objects");
3535

Refresh.Core/Refresh.Core.csproj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@
66
<Nullable>enable</Nullable>
77
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
88
<WarningsNotAsErrors>612,618</WarningsNotAsErrors>
9-
<Configurations>Debug;Release;DebugPostgres</Configurations>
10-
</PropertyGroup>
11-
12-
<PropertyGroup Condition=" '$(Configuration)' == 'DebugPostgres' ">
13-
<DefineConstants>TRACE;DEBUG;POSTGRES</DefineConstants>
14-
<DebugSymbols>true</DebugSymbols>
9+
<Configurations>Debug;Release</Configurations>
10+
<Platforms>AnyCPU</Platforms>
1511
</PropertyGroup>
1612

1713
<ItemGroup>

Refresh.Core/Storage/DryArchiveConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ protected override void Migrate(int oldVer, dynamic oldConfig)
1616
public string Location { get; set; } = "/var/dry/";
1717
public bool UseFolderNames { get; set; } = true;
1818

19-
#if DEBUG && POSTGRES
19+
#if DEBUG
2020
// ReSharper disable once InconsistentNaming
2121
public bool TemporaryWillBeRemoved_UseProductionRefreshData { get; set; } = false;
2222
#endif
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#if POSTGRES
2-
3-
using JetBrains.Annotations;
1+
using JetBrains.Annotations;
42
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
53
using MongoDB.Bson;
64

@@ -13,6 +11,4 @@ public ObjectIdConverter() : base(
1311
v => v.ToString(),
1412
v => ObjectId.Parse(v))
1513
{}
16-
}
17-
18-
#endif
14+
}

Refresh.Database/Compatibility/RealmPostgresPolyfills.cs

Lines changed: 0 additions & 55 deletions
This file was deleted.

Refresh.Database/Configuration/EmptyDatabaseConfig.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
public class EmptyDatabaseConfig : IDatabaseConfig
44
{
5-
#if POSTGRES
65
public string ConnectionString => new Npgsql.NpgsqlConnectionStringBuilder
76
{
87
Database = "refresh",
@@ -11,9 +10,6 @@ public class EmptyDatabaseConfig : IDatabaseConfig
1110
Host = "localhost",
1211
Port = 5432,
1312
}.ToString();
14-
#else
15-
public string ConnectionString => string.Empty;
16-
#endif
1713

1814
public bool PreferConnectionStringEnvironmentVariable => false;
1915
}

Refresh.Database/Extensions/DbSetExtensions.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if POSTGRES
2-
namespace Refresh.Database.Extensions;
1+
namespace Refresh.Database.Extensions;
32

43
public static class DbSetExtensions
54
{
@@ -15,6 +14,4 @@ public static void AddRange<TClass>(this DbSet<TClass> set, IEnumerable<TClass>
1514
else
1615
set.UpdateRange(range);
1716
}
18-
}
19-
20-
#endif
17+
}
Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,7 @@
1-
using System.Linq.Expressions;
2-
3-
namespace Refresh.Database.Extensions;
1+
namespace Refresh.Database.Extensions;
42

53
public static class QueryableExtensions
64
{
7-
#if !POSTGRES
8-
public static IQueryable<T> Include<T>(this IQueryable<T> queryable, Func<T, object?> func)
9-
{
10-
_ = func;
11-
return queryable;
12-
}
13-
14-
public static IEnumerable<T> AsEnumerableIfRealm<T>(this IQueryable<T> queryable)
15-
{
16-
return queryable.AsEnumerable();
17-
}
18-
19-
public static IEnumerable<T> AsEnumerableIfRealm<T>(this IEnumerable<T> queryable)
20-
{
21-
return queryable.AsEnumerable();
22-
}
23-
24-
public static IEnumerable<T> ToArrayIfPostgres<T>(this IQueryable<T> queryable)
25-
{
26-
return queryable;
27-
}
28-
29-
public static IEnumerable<T> ToArrayIfPostgres<T>(this IEnumerable<T> queryable)
30-
{
31-
return queryable;
32-
}
33-
#else
345
public static IQueryable<T> AsEnumerableIfRealm<T>(this IQueryable<T> queryable)
356
{
367
return queryable;
@@ -50,5 +21,4 @@ public static IEnumerable<T> ToArrayIfPostgres<T>(this IEnumerable<T> queryable)
5021
{
5122
return queryable.ToArray();
5223
}
53-
#endif
5424
}

0 commit comments

Comments
 (0)