Diablo2RLoader icon indicating copy to clipboard operation
Diablo2RLoader copied to clipboard

"Check for Other Instances" Handle was NOT closed

Open Zoxjib opened this issue 9 months ago • 21 comments

Not sure what it means or why it happens to some of my loaders. I just click any key to continue, load the client normally and everything works fine. It just requires a few extra clicks in the terminal

Zoxjib avatar Mar 15 '25 16:03 Zoxjib

For reference I am using TinyMod on all my loaders, but the error only appears on a couple of them.

Zoxjib avatar Mar 15 '25 16:03 Zoxjib

What OS are you running? Guessing Windows 11 x64?

Does it come up with this error consistently or just sometimes?

shupershuff avatar Mar 16 '25 21:03 shupershuff

Win 11 x64 yeah. I get it consistently 2 or 3 times when launching a total of 8 accounts. Sometimes it happens twice in a row, other times there's a gap in between.

Zoxjib avatar Mar 16 '25 21:03 Zoxjib

Are your games installed on an SSD or a harddrive?

shupershuff avatar Mar 16 '25 22:03 shupershuff

On line 3645 of d2loader.ps1 (open the file in a text editor), change:

Start-Sleep -milliseconds 1500 #give D2r a bit of a chance to start up before trying to kill handle to Start-Sleep -milliseconds 3000 #give D2r a bit of a chance to start up before trying to kill handle

and see if that makes much of a difference.

shupershuff avatar Mar 16 '25 22:03 shupershuff

My game's on NVME SSD and I have all data extracted with CascViewer, using -direct -txt with the main client and -mod tiny -txt with the 7 loaders.

I raised it from 1500 to 2500 and the issue resolved, but a different (minor) issue appeared instead.

Now the subsequent game clients load up in the background, so I have to manually switch to them in order to click-through to connect and allow the script to load the next client.

Zoxjib avatar Mar 16 '25 22:03 Zoxjib

Yea that's the drawback to using tokens unfortunately. You have to get to character select screen before you can start the next instance due to how the game read/writes the token from the registry.

As I don't want the script to be sending any clicks/keypresses to the game, I won't automate clicks to skip videos and get to char screen.

I would recommend having a look at the RememberWindowsLocations feature.

shupershuff avatar Mar 17 '25 00:03 shupershuff

Yeah I discovered that my accounts were made in EU don't like letting me login with Parameter when I'm not in EU. Luckily the token method seems to work great so far.

Zoxjib avatar Mar 17 '25 00:03 Zoxjib

I have one account like that. You can have it so the script connects with parameters by default except when connecting to NA or Asia: Change your auth method to parameter in accounts.csv and change this option in config.xml Image

shupershuff avatar Mar 17 '25 01:03 shupershuff

All my accounts were created in EU and still listed as in EU, I'm too scared contacting Blizzard to ask support to manually update the region... I use all of them with token now.

Zoxjib avatar Mar 17 '25 22:03 Zoxjib

How do you mean "still listed as in EU"?

shupershuff avatar Mar 18 '25 00:03 shupershuff

If you login to the account on the battle.net website and check it's settings, it'll have whatever country you used to register as. Blizzard doesn't let you change your country without manually contacting them (it affects which currency is used in the store and probably they need it for metrics/taxes).

I'd have to contact them 8 different times.... :)

Zoxjib avatar Mar 18 '25 00:03 Zoxjib

Oh so this screen

Image.

I don't think it has anything to do with settings on this page to be honest. I think it's some kind of infrastructure (database and/or trust) issue. The issue has only been happening to people since around December 2023.

shupershuff avatar Mar 18 '25 00:03 shupershuff

Oh, I'm completely assuming what the issue might be....

It's just a coincidence that my 8 EU accounts worked fine while I was logging into them from EU and now that I'm in a different location (after December 2023...), the same accounts are requiring the token login method.

I'm glad the token method exists although it does seem like a sort of place-holder that they might get rid of at any moment.

Zoxjib avatar Mar 18 '25 01:03 Zoxjib

The token method is actually what the Blizzard launcher uses, albeit we're using a token that doesn't appear to expire (tokens issued via the bnet client don't last very long).

For the issue that was raised, I've made a couple tweaks to the bit that calls the killhandle function so that instead of throwing an error it will wait for half a second and try up to 3 times before erroring out. It will be in the next release.

The total delay will be 2500ms (1000ms initial delay + 3x 500ms delays for each attempt), suggest you change the edit you made from 3000 to 2500 and ensure it works fine. If not let me know :)

shupershuff avatar Mar 18 '25 01:03 shupershuff

Yeah I've set it to 2500 like you suggested before the edit. It worked out perfect.

Zoxjib avatar Mar 18 '25 01:03 Zoxjib

If you don't mind, would I be able to use you for testing the next release to make sure this part works for you?

shupershuff avatar Mar 18 '25 02:03 shupershuff

Sure. I can test logging in with my 8 accounts, but as I mentioned in one of the Discussion threads, I can't really play much because it causes my PC to freeze.

Zoxjib avatar Mar 18 '25 02:03 Zoxjib

Hi there,

Can you please give this a bit of a test for me and let me know if it's all good?

https://github.com/shupershuff/Diablo2RLoader/blob/testing/D2Loader.ps1

Download this, copy it to where D2Loader.ps1 currently sits to overwrite it.

shupershuff avatar Apr 01 '25 21:04 shupershuff

Works great so far. Anything specific you'd like me to try?

Zoxjib avatar Apr 01 '25 23:04 Zoxjib

Mainly wanted to see that the killhandle changes are all good at your end.

shupershuff avatar Apr 02 '25 00:04 shupershuff