MCCTeam / Minecraft-Console-Client

Lightweight console for Minecraft chat and automated scripts
https://mccteam.github.io
Other
1.62k stars 391 forks source link

[BUG] Running several replay captures in parallel #1973

Closed GamingFrazix closed 2 years ago

GamingFrazix commented 2 years ago

Prerequisites

Minecraft Version

1.12.2

Console Client Version

Latest

Expected Behavior

The Replay Recording Should Start As Intended

Actual Behavior

2022-03-11 17:48:00 ### Log started at 2022-03-11 17:48:00 ### 2022-03-11 17:48:00 BotLoad: Got error from MinecraftClient.ChatBots.ReplayCapture: System.IO.IOException: The process cannot access the file 'C:\Users****\Desktop\Code Stuff\MCC\recording_cache\recording.tmcpr' because it is being used by another process. at System.IO.Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) at MinecraftClient.Protocol.ReplayHandler.Initialize(Int32 protocolVersion) at MinecraftClient.Protocol.ReplayHandler..ctor(Int32 protocolVersion) at MinecraftClient.ChatBots.ReplayCapture.Initialize() at MinecraftClient.McClient.<>c.b__100_1(ChatBot bot) at MinecraftClient.McClient.DispatchBotEvent(Action1 action, IEnumerable1 botList) 2022-03-11 17:48:01 Version is supported. Logging in... 2022-03-11 17:48:01 OnNetworkPacket: Got error from MinecraftClient.ChatBots.ReplayCapture: System.NullReferenceException: Object reference not set to an instance of an object. at MinecraftClient.ChatBots.ReplayCapture.OnNetworkPacket(Int32 packetID, List`1 packetData, Boolean isLogin, Boolean isInbound) at MinecraftClient.McClient.<>cDisplayClass142_0.b0(ChatBot bot) at MinecraftClient.McClient.DispatchBotEvent(Action1 action, IEnumerable1 botList) 2022-03-11 17:48:01 OnNetworkPacket: Got error from MinecraftClient.ChatBots.ReplayCapture: System.NullReferenceException: Object reference not set to an instance of an object. at MinecraftClient.ChatBots.ReplayCapture.OnNetworkPacket(Int32 packetID, List`1 packetData, Boolean isLogin, Boolean isInbound) at MinecraftClient.McClient.<>cDisplayClass142_0.b0(ChatBot bot) at MinecraftClient.McClient.DispatchBotEvent(Action1 action, IEnumerable1 botList) 2022-03-11 17:48:03 OnNetworkPacket: Got error from MinecraftClient.ChatBots.ReplayCapture: System.NullReferenceException: Object reference not set to an instance of an object. at MinecraftClient.ChatBots.ReplayCapture.OnNetworkPacket(Int32 packetID, List`1 packetData, Boolean isLogin, Boolean isInbound) at MinecraftClient.McClient.<>cDisplayClass142_0.b__0(ChatBot bot) at MinecraftClient.McClient.DispatchBotEvent(Action1 action, IEnumerable1 botList)

The Client Is Trying To Access A Replay Mod Temp File Which Is Created By The Other Client Or Created By That Account ITSELF And Used By Another Client Open And Its Trying To Use That Temp File

Steps to Reproduce the bug

  1. Open A Client With ReplayMod Bot On In Cracked/Premium Minecraft
  2. Wait For It To Fully Start And Join A Server, Ex: Your Local Hosted Server Or Any Server
  3. Run Another Client With A Different Nick This Time With ReplayMod Bot On
  4. Make It Join A Server Works If Its The Same Server Or Different
  5. You'll Get This Error

Attach screenshot here (If applicable)

No response

Anythings that could help diagnosing the bug

My Config
Cant Upload For Some Reason
My Log
Cant Upload This Too
[Help Me Upload So We Can Help The Devs Im Pretty New To Github

Device

Desktop

Operating System

Windows

Server Address (If applicable)

No response

GamingFrazix commented 2 years ago

I Think A Possible Fix To This Can Be To Make Different Reply Rec Files In Temp Folder And Transfer Them To The Main Folder Located In The MCC Directory So If We Use 2 Accounts Ex: Player_1, Player_2 The Replay Temp File Can Be Named As For Player_1 = Player_1 Recording_cache The Replay Temp File Can Be Named As For Player_2 = Player_2 Recording_cache

ORelio commented 2 years ago

Indeed, a random number or timestamp could be used to avoid conflict in the cache folder when running several records. Putting this on the todo list.

ReinforceZwei commented 2 years ago

There's a same issue #1634 opened and waiting to be fixed.

ORelio commented 2 years ago

Oh, OK. Closing as duplicate.