updated asset redirection script

This commit is contained in:
Bitl 2023-01-06 16:21:00 -07:00
parent 8fb827ab05
commit fc4730b721
4 changed files with 12 additions and 10 deletions

View File

@ -1,3 +1,11 @@
1.3 Snapshot v22.8406.29069.1
Enhancements:
- Changed the design of the Console to be more user friendly.
- Further improved web proxy and Console reliability.
Fixes:
- Fixed a bug involving cleraing the Console.
----------------------------------------------------------------------------
1.3 Snapshot v22.8406.21589.1 1.3 Snapshot v22.8406.21589.1
Enhancements: Enhancements:
- Added the following functionality to the Web Proxy: - Added the following functionality to the Web Proxy:

View File

@ -27,7 +27,6 @@ public class Asset : IWebProxyExtension
long id; long id;
if (!long.TryParse(NetFuncs.FindQueryString(query, "id"), out id)) if (!long.TryParse(NetFuncs.FindQueryString(query, "id"), out id))
{ {
Util.ConsolePrint(Name() + ": Redirecting " + query, 3);
e.Redirect("https://assetdelivery.roblox.com/v1/asset/" + query); e.Redirect("https://assetdelivery.roblox.com/v1/asset/" + query);
} }
else else
@ -36,18 +35,13 @@ public class Asset : IWebProxyExtension
if (PathList.Count > 0) if (PathList.Count > 0)
{ {
Util.ConsolePrint(Name() + ": Local assets for " + id.ToString() + " found. Redirecting " + query, 3); Util.ConsolePrint(Name() + ": Local asset for " + id.ToString() + " found. Using local asset.", 3);
string First = PathList[0]; string First = PathList[0];
byte[] numArray = await Task.Run(() => File.ReadAllBytes(First)); byte[] numArray = await Task.Run(() => File.ReadAllBytes(First));
e.Ok(numArray, (IEnumerable<HttpHeader>) new List<HttpHeader>() e.Ok(numArray, NetFuncs.GenerateHeaders(((long) numArray.Length).ToString()));
{
new HttpHeader("Content-Length", ((long) numArray.Length).ToString()),
new HttpHeader("Cache-Control", "no-cache")
});
} }
else else
{ {
Util.ConsolePrint(Name() + ": No local assets for " + id.ToString() + ". Redirecting " + query, 5);
e.Redirect("https://assetdelivery.roblox.com/v1/asset/" + query); e.Redirect("https://assetdelivery.roblox.com/v1/asset/" + query);
} }
} }

View File

@ -1,6 +1,6 @@
@ECHO OFF @ECHO OFF
SET debug=1 SET debug=0
SET basedir=%CD%\scripts SET basedir=%CD%\scripts
SET gamescriptdir=%basedir%\game SET gamescriptdir=%basedir%\game

View File

@ -9,5 +9,5 @@ ExtendedVersionEditChangelog=True
//ExtendedVersionTemplate=%version% v11.2022.%extended-revision%%lite% //ExtendedVersionTemplate=%version% v11.2022.%extended-revision%%lite%
ExtendedVersionTemplate=%version% Snapshot v22.%build%.%revision%.%extended-revision% ExtendedVersionTemplate=%version% Snapshot v22.%build%.%revision%.%extended-revision%
ExtendedVersionRevision=1 ExtendedVersionRevision=1
InitialBootup=True InitialBootup=False
IsLite=False IsLite=False