Skip to content

Commit 0b2c505

Browse files
committed
fix(core): IDatabaseService disposable
1 parent 16ad5a4 commit 0b2c505

9 files changed

Lines changed: 9 additions & 19 deletions

File tree

RSession.Aliases/RSession.Aliases.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace RSession.Aliases;
2323

2424
[PluginMetadata(
2525
Id = "RSession.Aliases",
26-
Version = "1.1.3",
26+
Version = "1.1.4",
2727
Name = "RSession.Aliases",
2828
Website = "https://github.com/oscar-wos/RSession",
2929
Author = "oscar-wos"

RSession.Messages/RSession.Messages.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace RSession.Messages;
2525

2626
[PluginMetadata(
2727
Id = "RSession.Messages",
28-
Version = "1.1.3",
28+
Version = "1.1.4",
2929
Name = "RSession.Messages",
3030
Website = "https://github.com/oscar-wos/RSession",
3131
Author = "oscar-wos"

RSession.Played/RSession.Played.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace RSession.Played;
2424

2525
[PluginMetadata(
2626
Id = "RSession.Played",
27-
Version = "1.1.3",
27+
Version = "1.1.4",
2828
Name = "RSession.Played",
2929
Website = "https://github.com/oscar-wos/RSession",
3030
Author = "oscar-wos"

RSession.Rotation/RSession.Rotation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace RSession.Rotation;
2424

2525
[PluginMetadata(
2626
Id = "RSession.Rotation",
27-
Version = "1.1.3",
27+
Version = "1.1.4",
2828
Name = "RSession.Rotation",
2929
Website = "https://github.com/oscar-wos/RSession",
3030
Author = "oscar-wos"

src/Contracts/Database/IDatabaseService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
namespace RSession.Contracts.Database;
1818

19-
internal interface IDatabaseService : ISessionDatabaseService, IAsyncDisposable
19+
internal interface IDatabaseService : ISessionDatabaseService, IDisposable
2020
{
2121
Task CreateTablesAsync();
2222
Task<short> GetMapAsync(string mapName, long? workshopId);

src/RSession.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace RSession;
3030

3131
[PluginMetadata(
3232
Id = "RSession",
33-
Version = "1.1.3",
33+
Version = "1.1.4",
3434
Name = "RSession",
3535
Website = "https://github.com/oscar-wos/RSession",
3636
Author = "oscar-wos"
@@ -119,10 +119,6 @@ public override void Load(bool hotReload)
119119
public override async void Unload()
120120
{
121121
_eventService?.InvokeDispose();
122-
123-
if (_serviceProvider is IAsyncDisposable asyncDisposable)
124-
{
125-
await asyncDisposable.DisposeAsync().ConfigureAwait(false);
126-
}
122+
(_serviceProvider as IDisposable)?.Dispose();
127123
}
128124
}

src/Services/Database/PostgresService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,5 +220,5 @@ private string BuildConnectionString(ConnectionConfig config)
220220
return builder.ConnectionString;
221221
}
222222

223-
public async ValueTask DisposeAsync() => await _dataSource.DisposeAsync().ConfigureAwait(false);
223+
public void Dispose() => _dataSource.Dispose();
224224
}

src/Services/Database/SqlService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,5 +220,5 @@ private string BuildConnectionString(ConnectionConfig config)
220220
return builder.ConnectionString;
221221
}
222222

223-
public async ValueTask DisposeAsync() => await _dataSource.DisposeAsync().ConfigureAwait(false);
223+
public void Dispose() => _dataSource.Dispose();
224224
}

src/Services/Event/OnClientDisconnectedService.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
using RSession.Contracts.Log;
1919
using SwiftlyS2.Shared;
2020
using SwiftlyS2.Shared.Events;
21-
using SwiftlyS2.Shared.ProtobufDefinitions;
2221

2322
namespace RSession.Services.Event;
2423

@@ -43,11 +42,6 @@ public void Subscribe()
4342

4443
private void OnClientDisconnected(IOnClientDisconnectedEvent @event)
4544
{
46-
if (@event.Reason == ENetworkDisconnectionReason.NETWORK_DISCONNECT_SHUTDOWN)
47-
{
48-
return;
49-
}
50-
5145
int playerId = @event.PlayerId;
5246

5347
if (_core.PlayerManager.GetPlayer(playerId) is not { } player)

0 commit comments

Comments
 (0)