# Points the vendor's hardcoded server address at this machine so the client # reaches the local stand-in server instead of the real one. # # The client keeps 185.207.214.85 inside its own code (both the /server-ping # URL and the connect target), so there is no in-game switch for it - the only # way is a hosts entry. Run this once from an elevated prompt. $ErrorActionPreference = 'Stop' $hosts = Join-Path $env:SystemRoot 'System32\drivers\etc\hosts' $marker = '# rsx modloader test server' $line = '127.0.0.1 185.207.214.85' $id = [Security.Principal.WindowsIdentity]::GetCurrent() $isAdmin = (New-Object Security.Principal.WindowsPrincipal($id)).IsInRole( [Security.Principal.WindowsBuiltInRole]::Administrator) if (-not $isAdmin) { Write-Host ' Нужны права администратора: запусти PowerShell от администратора.' -ForegroundColor Red exit 1 } $content = @(Get-Content -LiteralPath $hosts | Where-Object { $_ -notmatch [regex]::Escape($marker) -and $_ -notmatch '^\s*127\.0\.0\.1\s+185\.207\.214\.85' }) Set-Content -LiteralPath $hosts -Encoding ASCII -Value ($content + "$line $marker") Write-Host ' Готово: 185.207.214.85 теперь указывает на 127.0.0.1.' -ForegroundColor Green Write-Host ' Запусти testserver\start.cmd, потом play.cmd -> 1 (с модами).' Write-Host ' Обратно: uninstall-hosts.ps1 (или netsh int ip reset).'