mirror of
https://github.com/ZuneDev/ZuneModdingHelper.git
synced 2026-07-27 13:12:21 -07:00
Community Webservices: Don't assume the previous host was zune.net
This commit is contained in:
@@ -154,9 +154,19 @@ public class WebservicesMod(ModMetadata metadata) : Mod(metadata), IAsyncInit
|
||||
return $"Failed to reach \"{newHost}\". Ping status: {ping.Status}";
|
||||
}
|
||||
|
||||
// Patch ZuneServices.dll to use the new host instead of zune.net
|
||||
// Read URL block as string
|
||||
zsDllReader.BaseStream.Position = ZUNESERVICES_ENDPOINTS_BLOCK_OFFSET;
|
||||
string endpointBlock = System.Text.Encoding.Unicode.GetString(zsDllReader.ReadBytes(ZUNESERVICES_ENDPOINTS_BLOCK_LENGTH));
|
||||
|
||||
// Try to determine previous host
|
||||
try
|
||||
{
|
||||
var firstUrl = endpointBlock[..endpointBlock.IndexOf('\0')];
|
||||
oldHost = firstUrl.Substring(11, oldHost.Length);
|
||||
}
|
||||
catch { }
|
||||
|
||||
// Patch ZuneServices.dll to use the new host instead of zune.net
|
||||
endpointBlock = endpointBlock.Replace("resources." + oldHost, "www.zuneupdate.com"); // Use zuneupdate.com until resources.zunes.me is online
|
||||
endpointBlock = endpointBlock.Replace(oldHost, newHost);
|
||||
byte[] endpointBytes = System.Text.Encoding.Unicode.GetBytes(endpointBlock);
|
||||
|
||||
Reference in New Issue
Block a user