Skip to content

Commit

Permalink
Make it work
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Oct 14, 2024
1 parent 9907d37 commit c22eb58
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions ArchiSteamFarm/Steam/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2098,6 +2098,7 @@ private void Disconnect(bool reconnect = false) {
}

private void DisposeShared() {
ArchiHandler.Dispose();
ArchiWebHandler.Dispose();
BotDatabase.Dispose();
ConnectionSemaphore.Dispose();
Expand Down
24 changes: 23 additions & 1 deletion ArchiSteamFarm/Steam/Integration/ArchiHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@

namespace ArchiSteamFarm.Steam.Integration;

public sealed class ArchiHandler : ClientMsgHandler {
public sealed class ArchiHandler : ClientMsgHandler, IDisposable {
internal const byte MaxGamesPlayedConcurrently = 32; // This is limit introduced by Steam Network

private readonly ArchiLogger ArchiLogger;

private readonly ChatRoomClient ChatRoomClient;
private readonly FriendMessagesClient FriendMessagesClient;

private readonly AccountPrivateApps UnifiedAccountPrivateApps;
private readonly ChatRoom UnifiedChatRoomService;
private readonly ClanChatRooms UnifiedClanChatRoomsService;
Expand Down Expand Up @@ -85,6 +88,25 @@ internal ArchiHandler(ArchiLogger archiLogger, SteamUnifiedMessages steamUnified
UnifiedPlayerService = steamUnifiedMessages.CreateService<Player>();
UnifiedStoreService = steamUnifiedMessages.CreateService<Store>();
UnifiedTwoFactorService = steamUnifiedMessages.CreateService<TwoFactor>();

ChatRoomClient = steamUnifiedMessages.CreateService<ChatRoomClient>();
FriendMessagesClient = steamUnifiedMessages.CreateService<FriendMessagesClient>();
}

public void Dispose() {
ChatRoomClient.Dispose();
FriendMessagesClient.Dispose();
UnifiedAccountPrivateApps.Dispose();
UnifiedChatRoomService.Dispose();
UnifiedClanChatRoomsService.Dispose();
UnifiedCredentialsService.Dispose();
UnifiedEconService.Dispose();
UnifiedFamilyGroups.Dispose();
UnifiedFriendMessagesService.Dispose();
UnifiedLoyaltyRewards.Dispose();
UnifiedPlayerService.Dispose();
UnifiedStoreService.Dispose();
UnifiedTwoFactorService.Dispose();
}

[PublicAPI]
Expand Down

0 comments on commit c22eb58

Please sign in to comment.