Skip to content

Commit

Permalink
V2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
faliny committed Sep 25, 2023
1 parent d9d000e commit 159f89c
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 62 deletions.
44 changes: 18 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ github地址:https://github.com/faliny/D2R-fast-launcher

# 工具介绍
这是一款基于PowerShell脚本编写的暗黑2重置版游戏快捷登录器,旨在帮助更多热爱暗黑2的游戏玩家一键多开,创造更好的游戏体验:
* 登录器会绕过战网程序直接启动并登录暗黑2游戏
* 登录器会绕过战网程序直接启动并登录暗黑2重置版
* 登录器里可以分别对各个账号做启动配置;
* 多开时登录器会自动杀掉暴雪的防多开进程,实现一键多开;
* 通过登录器,能针对录入账号分别生成单号启动的快捷方式,也能生成一键全部启动的快捷方式
* files目录下的handle64.exe是微软官方的多开必要工具,若微软发布了新的程序版本,可自行下载更新,地址:https://docs.microsoft.com/en-us/sysinternals/downloads/handle
* 多开时登录器会使用微软官方的工具杀掉暴雪的防多开进程,实现一键多开;
* 通过登录器,能针对录入账号分别生成单号启动快捷方式,也能生成一键全部启动快捷方式,不限制账号个数
* 登录器的原理不涉及作弊,理论上没有封号风险。

这是本人第一次接触PowerShell,部分基础功能借鉴了Chobotz的源码(github地址:https://github.com/Chobotz/D2R-multiclient-tools)
若发现bug或有改进建议,请留言交流。
Expand All @@ -21,11 +21,18 @@ github地址:https://github.com/faliny/D2R-fast-launcher
# 使用方法
1. 将files目录下所有文件复制到暗黑2游戏的主目录下
2. 双击打开登录管理器,根据提示将账号信息依次录入
3. 创建登录快捷方式到桌面,打开对应快捷方式启动游戏
3. 在登录管理器里选择创建登录快捷方式到桌面,打开对应快捷方式启动游戏

# 下载方式
打开[工具下载页面](https://github.com/faliny/D2R-fast-launcher/releases)
,选择要下载的版本,展开Assets,随便选择一个Source code下载即可。

![下载界面](screenshot/download.png)

# 注意:
```diff
- 不要在登录战网的情况下通过启动器启动游戏,若需使用,请先关闭战网程序。
- 不要在登录战网的情况下通过启动器启动游戏,若需使用,请先关闭战网程序;
- 文件中的登录管理器本身也是一个快捷方式,不能直接复制到桌面,可在游戏目录下打开登录管理器后选择创建快捷方式到桌面;
```

# 工具截图
Expand All @@ -37,36 +44,21 @@ github地址:https://github.com/faliny/D2R-fast-launcher

![添加账号配置](screenshot/add.png)

3、查看账号配置

![查看账号配置](screenshot/overview.png)

4、创建启动单个账号快捷方式到桌面

![创建单个快捷方式到桌面](screenshot/addLink1.png)
3、创建启动单个账号快捷方式到桌面

5、创建一键全部启动快捷方式到桌面
![创建单个快捷方式到桌面](screenshot/addLink.png)

![创建一键启动快捷方式到桌面](screenshot/addLink2.png)

6、创建一键修改服区快捷方式到桌面

![创建一键修改服区快捷方式到桌面](screenshot/addLink3.png)

7、桌面快捷方式
4、桌面快捷方式

![桌面快捷方式](screenshot/link.png)

8、本地用户配置文件
5、本地用户配置文件

![本地用户配置文件](screenshot/config.png)

# 发布说明
* [历史版本](https://github.com/faliny/D2R-fast-launcher/releases)

# 申明
非盈利性质工具,任何风险请自行承担

# 常见/已知问题:
* 如果遇到重复的验证码验证循环,将C:\Users\User\AppData\Local\Battle.net\Cache目录下的所有内容删除后重试
* 如果遇到无法登录的情况,请使用正常方式通过战网登录该账号,进行客户端更新或身份验证,后续可继续使用登录器进行快捷登录
* 如果遇到无法登录的情况,请使用正常方式通过战网登录该账号,进行客户端更新或身份验证,完成后便可继续使用快捷登录器登录
69 changes: 33 additions & 36 deletions files/Launcher/D2R launcher.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Add-Type -Namespace System.Text -Name WinApi -MemberDefinition @"

clear

$script:d2rRoot = $PSScriptRoot.Substring(0, $PSScriptRoot.LastIndexOf('\'))
$script:d2rRoot = $PSScriptRoot.Substring(0,$PSScriptRoot.LastIndexOf('\'))
$script:userInfoFilePath = $PSScriptRoot + "\user_info.ini"
$script:defaultRegion = "kr"
$script:userList = New-Object System.Collections.ArrayList
Expand Down Expand Up @@ -353,10 +353,11 @@ function main($op, $p1, $p2)
"7" = @("createStartRef", "创建单个账号启动快捷方式到桌面")
"8" = @("createAllStartRef", "创建一键启动全部账号快捷方式到桌面")
"9" = @("createUpdateAllRegionRef", "创建一键修改全部账号服区快捷方式到桌面")
"0" = @("help", "帮助")
"0" = @("createLoginManagerRef", "创建登录管理器快捷方式到桌面")
"H" = @("help", "帮助")
}

Write-Host "`n请选择一个操作,输入对应的序号`n"
Write-Host "`n请选择一个操作,输入对应的编号`n"
$mainOps.GetEnumerator() | ForEach-Object {
$message = " [{0}] {1}" -f $_.key, $_.value[1]
Write-Host "$message"
Expand All @@ -365,7 +366,8 @@ function main($op, $p1, $p2)

Do
{
$opIndex = Read-Host '请输入操作对应的序号'
$opIndex = Read-Host '请输入操作对应的编号,大小写均可'
$null = $opIndex.ToUpper()
}
while ( !$mainOps.Contains($opIndex))
$op = $mainOps[$opIndex][0]
Expand Down Expand Up @@ -698,6 +700,19 @@ function delete($userNames)
main
}

function createRefToDesktop($refName, $iconPath, $params)
{
$wshShell = New-Object -comObject WScript.Shell
$desktop = [System.Environment]::GetFolderPath('Desktop')
$shortcut = $wshShell.CreateShortcut("$desktop\$refName.lnk")
$targetPath = "C:\Windows\System32\cmd.exe"
$batchPath = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File `"" + $PSCommandPath + "`" $params"
$shortcut.Arguments = "/c $batchPath"
$shortcut.TargetPath = $targetPath
$shortcut.IconLocation = "$iconPath"
$shortcut.Save()
}

function createStartRef($userNames)
{
if ($script:userList.Count -gt 0)
Expand Down Expand Up @@ -728,18 +743,9 @@ function createStartRef($userNames)

foreach ($userName in $userNames)
{
$userName = $userName.trim()
$wshShell = New-Object -comObject WScript.Shell
$desktop = [System.Environment]::GetFolderPath('Desktop')
$shortcut = $wshShell.CreateShortcut("$desktop\$userName.lnk")
$targetPath = "C:\Windows\System32\cmd.exe"
$batchPath = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File `"" + $PSCommandPath + "`" startBatch $userName"
$shortcut.Arguments = "/c $batchPath"
$shortcut.TargetPath = $targetPath
$shortcut.IconLocation = "$script:d2rRoot\D2R.exe"
$shortcut.Save()
createRefToDesktop "$userName" "$script:d2rRoot\D2R.exe" "startBatch $userName"
}
Write-Host "`n创建快捷方式完成"
Write-Host "`n创建单个账号快速启动快捷方式完成"
}
else
{
Expand All @@ -754,16 +760,7 @@ function createAllStartRef()
{
if ($script:userList.Count -gt 0)
{
$wshShell = New-Object -comObject WScript.Shell
$desktop = [System.Environment]::GetFolderPath('Desktop')
$shortcut = $wshShell.CreateShortcut("$desktop\一键全部启动.lnk")
$targetPath = "C:\Windows\System32\cmd.exe"
$batchPath = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File `"" + $PSCommandPath + "`" startAll"
$shortcut.Arguments = "/c $batchPath"
$shortcut.TargetPath = $targetPath
$shortcut.IconLocation = "$script:d2rRoot\D2R.exe"
$shortcut.Save()

createRefToDesktop "一键全部启动" "$script:d2rRoot\D2R.exe" "startAll"
Write-Host "`n创建一键全部启动快捷方式完成"
}
else
Expand All @@ -779,16 +776,7 @@ function createUpdateAllRegionRef()
{
if ($script:userList.Count -gt 0)
{
$wshShell = New-Object -comObject WScript.Shell
$desktop = [System.Environment]::GetFolderPath('Desktop')
$shortcut = $wshShell.CreateShortcut("$desktop\一键修改服区.lnk")
$targetPath = "C:\Windows\System32\cmd.exe"
$batchPath = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File `"" + $PSCommandPath + "`" updateRegion `$0"
$shortcut.Arguments = "/c $batchPath"
$shortcut.TargetPath = $targetPath
$shortcut.IconLocation = "$script:d2rRoot\D2R.exe"
$shortcut.Save()

createRefToDesktop "一键修改服区" "$script:d2rRoot\D2R.exe" "updateRegion `$0"
Write-Host "`n创建一键修改服区快捷方式完成"
}
else
Expand All @@ -800,6 +788,15 @@ function createUpdateAllRegionRef()
main
}

function createLoginManagerRef()
{
createRefToDesktop "登录管理器" "$script:d2rRoot\Diablo II Resurrected Launcher.exe"

Write-Host "`n创建登录管理器快捷方式完成"
Read-host "点击回车继续..."
main
}

function showAllUser
{
if ($script:userList.Count -gt 0)
Expand All @@ -825,7 +822,7 @@ function help
Write-Host " [3] 对于新建快捷方式到桌面,可以选择把所有账号各建一个快捷方式,也可以建一个一键启动所有账号的快捷方式;"
Write-Host " [4] 新建的启动单个账号快捷方式不会被后续添加/修改账号配置所影响,只要账号不删除就可以一直使用;"
Write-Host " [5] 新建的一键全部启动快捷方式不会被后续所有的账号操作所影响,录入过几个账号就会启动几个;"
Write-Host " [6] 本启动器的原理不涉及作弊,理论上没有封号风险。"
Write-Host " [6] 登录器的原理不涉及作弊,理论上没有封号风险。"

Write-Host "`n"
Write-Host " 非盈利性质工具,任何风险请自行承担"
Expand Down
Binary file modified files/登录管理器.lnk
Binary file not shown.
Binary file modified screenshot/add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot/addLink.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed screenshot/addLink1.png
Binary file not shown.
Binary file removed screenshot/addLink2.png
Binary file not shown.
Binary file removed screenshot/addLink3.png
Binary file not shown.
Binary file added screenshot/download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed screenshot/overview.png
Binary file not shown.

0 comments on commit 159f89c

Please sign in to comment.