Some renaming & formatting changes; Updated Dumps & Dumpers

This commit is contained in:
phoriah
2025-04-11 17:02:24 +02:00
parent 66d0b10dbc
commit 27893b9ef5
6 changed files with 151 additions and 117 deletions

View File

@@ -1,6 +1,7 @@
import requests import requests
import os import os
import re import re
import sys
def array_to_dictionary(table, hybrid_mode=None): def array_to_dictionary(table, hybrid_mode=None):
@@ -24,33 +25,41 @@ datatypes = []
datatypes_set = set() datatypes_set = set()
def api(): def api(version_hash=None):
if version_hash:
# Use the provided version hash
api_dump_url = f"https://setup.rbxcdn.com/{version_hash}-API-Dump.json"
try:
response = requests.get(api_dump_url)
response.raise_for_status()
return response
except requests.RequestException as e:
print(f"Error fetching API dump for {version_hash}: {e}")
sys.exit(1)
else:
# Fall back to the original method of finding the latest version
deploy_history_url = "https://setup.rbxcdn.com/DeployHistory.txt" deploy_history_url = "https://setup.rbxcdn.com/DeployHistory.txt"
deploy_history = requests.get(deploy_history_url).text deploy_history = requests.get(deploy_history_url).text
lines = deploy_history.splitlines() lines = deploy_history.splitlines()
for line in reversed(lines): for line in reversed(lines):
match = re.search(r"(version-[^\s]+)", line) match = re.search(r"(version-[^\s]+)", line)
if match: if match:
version_hash = match.group(1) version_hash = match.group(1)
api_dump_url = (
api_dump_url = f"https://setup.rbxcdn.com/{version_hash}-Full-API-Dump.json" f"https://setup.rbxcdn.com/{version_hash}-Full-API-Dump.json"
)
try: try:
response = requests.get(api_dump_url) response = requests.get(api_dump_url)
response.raise_for_status() response.raise_for_status()
return response return response
except requests.RequestException as e: except requests.RequestException as e:
print(f"Error fetching API dump for {version_hash}: {e}") print(f"Error fetching API dump for {version_hash}: {e}")
def fetch_api(): def fetch_api(version_hash=None):
response = api() response = api(version_hash)
api_classes = response.json()["Classes"] api_classes = response.json()["Classes"]
global datatypes global datatypes
@@ -70,21 +79,25 @@ def fetch_api():
member_tags = array_to_dictionary(member_tags) member_tags = array_to_dictionary(member_tags)
serialization = member["Serialization"] serialization = member["Serialization"]
if serialization["CanLoad"] : if True:
value_type = member["ValueType"] value_type = member["ValueType"]
value_type_name = value_type["Name"] value_type_name = value_type["Name"]
value_type_cat = value_type["Category"] value_type_cat = value_type["Category"]
if value_type_cat == "Enum": if value_type_cat == "Enum":
value_type_name = "Enum" value_type_name = ""
if value_type_cat == "Class": if value_type_cat == "Class":
value_type_name = "Class" value_type_name = ""
if value_type_name not in datatypes_set: if value_type_name not in datatypes_set:
datatypes_set.add(value_type_name) datatypes_set.add(value_type_name)
datatypes.append(value_type_name) datatypes.append(value_type_name)
if __name__ == "__main__":
version_hash = None
if len(sys.argv) > 1:
version_hash = sys.argv[1]
try: try:
fetch_api() fetch_api(version_hash)
datatypes.sort() datatypes.sort()
s = "\n".join(datatypes) + "\n" s = "\n".join(datatypes) + "\n"
print(s) print(s)

View File

@@ -1,16 +1,19 @@
Axes Axes
BinaryString BinaryString
BrickColor BrickColor
CFrame CFrame
Class CSGPropertyData
Color3 Color3
Color3uint8 Color3uint8
ColorSequence ColorSequence
Content Content
ContentId ContentId
Enum DateTime
Faces Faces
FacsReplicationData
Font Font
NetAssetRef
NumberRange NumberRange
NumberSequence NumberSequence
OptionalCoordinateFrame OptionalCoordinateFrame
@@ -21,8 +24,12 @@ QDir
QFont QFont
Ray Ray
Rect Rect
Region3int16
ReplicationPV
SecurityCapabilities SecurityCapabilities
SharedString SharedString
SystemAddress
TweenInfo
UDim UDim
UDim2 UDim2
UniqueId UniqueId

View File

@@ -19,8 +19,6 @@ AnimationStreamTrack
AnimationTrack AnimationTrack
AssetImportSession
AnimationImportData AnimationImportData
FacsImportData FacsImportData
@@ -115,6 +113,10 @@ SelectionLasso
HttpRequest HttpRequest
ImportSession
AssetImportSession
InputObject InputObject
JointInstance JointInstance

View File

@@ -1,7 +1,7 @@
import requests import requests
import os import os
import re import re
import sys
def array_to_dictionary(table, hybrid_mode=None): def array_to_dictionary(table, hybrid_mode=None):
tmp = {} tmp = {}
@@ -22,34 +22,38 @@ def array_to_dictionary(table, hybrid_mode=None):
s = "\n" s = "\n"
def api(version_hash=None):
def api(): if version_hash:
# Use the provided version hash
api_dump_url = f"https://setup.rbxcdn.com/{version_hash}-Full-API-Dump.json"
try:
response = requests.get(api_dump_url)
response.raise_for_status()
return response
except requests.RequestException as e:
print(f"Error fetching API dump for {version_hash}: {e}")
sys.exit(1)
else:
# Fall back to the original method of finding the latest version
deploy_history_url = "https://setup.rbxcdn.com/DeployHistory.txt" deploy_history_url = "https://setup.rbxcdn.com/DeployHistory.txt"
deploy_history = requests.get(deploy_history_url).text deploy_history = requests.get(deploy_history_url).text
lines = deploy_history.splitlines() lines = deploy_history.splitlines()
for line in reversed(lines): for line in reversed(lines):
match = re.search(r"(version-[^\s]+)", line) match = re.search(r"(version-[^\s]+)", line)
if match: if match:
version_hash = match.group(1) version_hash = match.group(1)
api_dump_url = f"https://setup.rbxcdn.com/{version_hash}-Full-API-Dump.json" api_dump_url = f"https://setup.rbxcdn.com/{version_hash}-Full-API-Dump.json"
try: try:
response = requests.get(api_dump_url) response = requests.get(api_dump_url)
response.raise_for_status() response.raise_for_status()
return response return response
except requests.RequestException as e: except requests.RequestException as e:
print(f"Error fetching API dump for {version_hash}: {e}") print(f"Error fetching API dump for {version_hash}: {e}")
def fetch_api(version_hash=None):
def fetch_api(): response = api(version_hash)
response = api()
api_classes = response.json()["Classes"] api_classes = response.json()["Classes"]
global s global s
@@ -93,9 +97,14 @@ def fetch_api():
return class_list return class_list
if __name__ == "__main__":
# Check if version hash was passed as a command line argument
version_hash = None
if len(sys.argv) > 1:
version_hash = sys.argv[1]
try: try:
fetch_api() fetch_api(version_hash)
print(s) print(s)
script_dir = os.path.dirname(os.path.realpath(__file__)) script_dir = os.path.dirname(os.path.realpath(__file__))
output_file_path = os.path.join(script_dir, "Dump") output_file_path = os.path.join(script_dir, "Dump")

View File

@@ -1,9 +1,8 @@
import os import os
import subprocess import subprocess
import sys
def run_python_files_in_directories(directory, script_name, version_hash=None):
def run_python_files_in_directories(directory, script_name):
for root, dirs, files in os.walk(directory): for root, dirs, files in os.walk(directory):
for file in files: for file in files:
if file.endswith(".py"): if file.endswith(".py"):
@@ -13,17 +12,21 @@ def run_python_files_in_directories(directory, script_name):
continue continue
print(f"Found Python file: {file_path}") print(f"Found Python file: {file_path}")
try: try:
if version_hash:
subprocess.run(["python", file_path, version_hash], check=True)
else:
subprocess.run(["python", file_path], check=True) subprocess.run(["python", file_path], check=True)
print(f"Executed: {file_path}") print(f"Executed: {file_path}")
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
print(f"Error running {file_path}: {e}") print(f"Error running {file_path}: {e}")
if __name__ == "__main__":
current_directory = os.path.dirname(os.path.abspath(__file__)) current_directory = os.path.dirname(os.path.abspath(__file__))
script_name = os.path.abspath(__file__) script_name = os.path.abspath(__file__)
# Check if version hash was passed as a command line argument
version_hash = None
if len(sys.argv) > 1:
version_hash = sys.argv[1]
run_python_files_in_directories(current_directory, script_name) run_python_files_in_directories(current_directory, script_name, version_hash)

View File

@@ -11,13 +11,13 @@ local function ArrayToDict(t, hydridMode, valueOverride, typeStrict)
local tmp = {} local tmp = {}
if hydridMode then if hydridMode then
for some1, some2 in t do for any1, any2 in t do
if type(some1) == "number" then if type(any1) == "number" then
tmp[some2] = valueOverride or true tmp[any2] = valueOverride or true
elseif type(some2) == "table" then elseif type(any2) == "table" then
tmp[some1] = ArrayToDict(some2, hydridMode) -- Some1 is Class, Some2 is Name tmp[any1] = ArrayToDict(any2, hydridMode) -- any1 is Class, any2 is Name
else else
tmp[some1] = some2 tmp[any1] = any2
end end
end end
else else
@@ -687,7 +687,7 @@ XML_Descriptors = {
__ENUM = function(raw) __ENUM = function(raw)
return raw.Value, "token" return raw.Value, "token"
end, end,
__EXTREME = function(raw) __NORMALIZE_NUMBER = function(raw)
if raw ~= raw then if raw ~= raw then
return "NAN" return "NAN"
elseif raw == math.huge then elseif raw == math.huge then
@@ -698,7 +698,7 @@ XML_Descriptors = {
return raw return raw
end, end,
__EXTREME_RANGE = function(raw) __NORMALIZE_RANGE = function(raw)
return raw ~= raw and "0" or raw -- Normally we should return "-nan(ind)" instead of "0" but this adds more compatibility return raw ~= raw and "0" or raw -- Normally we should return "-nan(ind)" instead of "0" but this adds more compatibility
end, end,
__MINMAX = function(min, max, descriptor) __MINMAX = function(min, max, descriptor)
@@ -710,14 +710,14 @@ XML_Descriptors = {
__SEQUENCE = function(raw, valueFormatter) __SEQUENCE = function(raw, valueFormatter)
-- The value is the text content, formatted as a space-separated list of floating point numbers. -- The value is the text content, formatted as a space-separated list of floating point numbers.
-- tostring(raw) also works (but way slower rn) -- tostring(raw) also works (but way slower rn)
local __EXTREME_RANGE = XML_Descriptors.__EXTREME_RANGE local __NORMALIZE_RANGE = XML_Descriptors.__NORMALIZE_RANGE
local sequence = "" local sequence = ""
for _, keypoint in raw.Keypoints do for _, keypoint in raw.Keypoints do
local Value = keypoint.Value local Value = keypoint.Value
sequence ..= keypoint.Time .. " " .. (valueFormatter and valueFormatter(Value) or __EXTREME_RANGE(Value) .. " " .. __EXTREME_RANGE( sequence ..= keypoint.Time .. " " .. (valueFormatter and valueFormatter(Value) or __NORMALIZE_RANGE(Value) .. " " .. __NORMALIZE_RANGE(
keypoint.Envelope keypoint.Envelope
) .. " ") -- ? Trailing whitespace is only needed for lune compatibility ) .. " ") -- ? Trailing whitespace is only needed for lune compatibility
end end
@@ -801,13 +801,13 @@ XML_Descriptors = {
-- The value is the text content, formatted as a space-separated list of FLOATing point numbers. -- The value is the text content, formatted as a space-separated list of FLOATing point numbers.
return XML_Descriptors.__SEQUENCE(raw, function(color3) return XML_Descriptors.__SEQUENCE(raw, function(color3)
local __EXTREME_RANGE = XML_Descriptors.__EXTREME_RANGE local __NORMALIZE_RANGE = XML_Descriptors.__NORMALIZE_RANGE
return __EXTREME_RANGE(color3.R) return __NORMALIZE_RANGE(color3.R)
.. " " .. " "
.. __EXTREME_RANGE(color3.G) .. __NORMALIZE_RANGE(color3.G)
.. " " .. " "
.. __EXTREME_RANGE(color3.B) .. __NORMALIZE_RANGE(color3.B)
.. " 0 " .. " 0 "
end) end)
end, end,
@@ -824,7 +824,7 @@ XML_Descriptors = {
CoordinateFrame = function(raw) CoordinateFrame = function(raw)
return "<CFrame>" .. XML_Descriptors.CFrame(raw) .. "</CFrame>" return "<CFrame>" .. XML_Descriptors.CFrame(raw) .. "</CFrame>"
end, end,
-- DateTime = function(raw) return raw.UnixTimestampMillis end, -- TODO -- DateTime = function(raw) return raw.UnixTimestampMillis end, -- ? Not sure
Faces = function(raw) Faces = function(raw)
-- The text of this element is formatted as an integer between 0 and 63 -- The text of this element is formatted as an integer between 0 and 63
return "<faces>" .. __BIT(raw.Right, raw.Top, raw.Back, raw.Left, raw.Bottom, raw.Front) .. "</faces>" return "<faces>" .. __BIT(raw.Right, raw.Top, raw.Back, raw.Left, raw.Bottom, raw.Front) .. "</faces>"
@@ -864,14 +864,14 @@ XML_Descriptors = {
end, end,
NumberRange = function(raw) -- tostring(raw) also works NumberRange = function(raw) -- tostring(raw) also works
-- The value is the text content, formatted as a space-separated list of floating point numbers. -- The value is the text content, formatted as a space-separated list of floating point numbers.
local __EXTREME_RANGE = XML_Descriptors.__EXTREME_RANGE local __NORMALIZE_RANGE = XML_Descriptors.__NORMALIZE_RANGE
return __EXTREME_RANGE(raw.Min) .. " " .. __EXTREME_RANGE(raw.Max) --[[.. " "]] -- ! This might be required for compatibility; __EXTREME_RANGE is not needed here but it fixes the issue where "nan 10" value would reset to "0 0" return __NORMALIZE_RANGE(raw.Min) .. " " .. __NORMALIZE_RANGE(raw.Max) --[[.. " "]] -- ! This might be required for compatibility; __NORMALIZE_RANGE is not needed here but it fixes the issue where "nan 10" value would reset to "0 0"
end, end,
NumberSequence = nil, NumberSequence = nil,
-- NumberSequence = Descriptors.__SEQUENCE, -- NumberSequence = Descriptors.__SEQUENCE,
-- Path2DControlPoint = function(raw) -- Not sure -- Path2DControlPoint = function(raw) -- ? Not sure
-- local udim2 = XML_Descriptors.UDim2 -- local udim2 = XML_Descriptors.UDim2
-- return "<Position>" -- return "<Position>"
-- .. udim2(raw.Position) -- .. udim2(raw.Position)
@@ -967,7 +967,7 @@ XML_Descriptors = {
.. "</YO>" .. "</YO>"
end, end,
-- UniqueId = function(raw) -- UniqueId = function(raw) -- ? Not sure -- ? No idea if this even needs a Descriptor
-- --[[ -- --[[
-- UniqueId properties might be random everytime Studio saves a place file -- UniqueId properties might be random everytime Studio saves a place file
-- and don't have a use right now outside of packages, which SSI doesn't -- and don't have a use right now outside of packages, which SSI doesn't
@@ -975,7 +975,7 @@ XML_Descriptors = {
-- them until we have to. -- them until we have to.
-- ]] -- ]]
-- -- https://github.com/MaximumADHD/Roblox-Client-Tracker/blob/roblox/LuaPackages/Packages/_Index/ApolloClientTesting/ApolloClientTesting/utilities/common/makeUniqueId.lua#L62 -- -- https://github.com/MaximumADHD/Roblox-Client-Tracker/blob/roblox/LuaPackages/Packages/_Index/ApolloClientTesting/ApolloClientTesting/utilities/common/makeUniqueId.lua#L62
-- return "" -- ? No idea if this even needs a Descriptor -- return ""
-- end, -- end,
Vector2 = function(raw) Vector2 = function(raw)
@@ -1013,10 +1013,10 @@ XML_Descriptors = {
-------------------------------------------------------------- --------------------------------------------------------------
-----------%localappdata%/Roblox/GlobalSettings_13.xml-------- -----------%localappdata%/Roblox/GlobalSettings_13.xml--------
-------------------------------------------------------------- --------------------------------------------------------------
-- QDir = function(raw) -- QDir = function(raw) -- ? Not sure
-- return raw -- return raw
-- end, -- end,
-- QFont = function(raw) -- QFont = function(raw) -- ? Not sure
-- return raw -- return raw
-- end, -- end,
} }
@@ -1090,10 +1090,10 @@ for descriptorName, redirectName in
NumberSequence = "__SEQUENCE", NumberSequence = "__SEQUENCE",
Vector2int16 = "Vector2", Vector2int16 = "Vector2",
Vector3int16 = "Vector3", Vector3int16 = "Vector3",
double = "__EXTREME", double = "__NORMALIZE_NUMBER",
float = "__EXTREME", float = "__NORMALIZE_NUMBER",
int = "__EXTREME", int = "__NORMALIZE_NUMBER",
int64 = "__EXTREME", int64 = "__NORMALIZE_NUMBER",
} }
do do
XML_Descriptors[descriptorName] = XML_Descriptors[redirectName] XML_Descriptors[descriptorName] = XML_Descriptors[redirectName]
@@ -1598,7 +1598,7 @@ local GLOBAL_ENV = getgenv and getgenv() or _G or shared
--- @field AntiIdle boolean -- Prevents the 20-minute-Idle Kick. ___Default:___ true --- @field AntiIdle boolean -- Prevents the 20-minute-Idle Kick. ___Default:___ true
--- Anonymous {boolean|table{UserId = string, Name = string}} -- * **RISKY:** Cleans the file of any info related to your account like: Name, UserId. This is useful for some games that might store that info in GUIs or other Instances. Might potentially mess up parts of strings that contain characters that match your Name or parts of numbers that match your UserId. Can also be a table with UserId & Name keys. ___Default:___ false --- Anonymous {boolean|table{UserId = string, Name = string}} -- * **RISKY:** Cleans the file of any info related to your account like: Name, UserId. This is useful for some games that might store that info in GUIs or other Instances. Might potentially mess up parts of strings that contain characters that match your Name or parts of numbers that match your UserId. Can also be a table with UserId & Name keys. ___Default:___ false
--- @field ShowStatus boolean -- ___Default:___ true --- @field ShowStatus boolean -- ___Default:___ true
--- @field Callback boolean -- If set, the serialized data will be sent to the callback function instead of to file. ___Default:___ false --- @field Callback function -- If set, the serialized data will be sent to the callback function instead of to file. ___Default:___ false
--- @field mode string -- Valid modes: full, optimized, scripts. Change this to invalid mode like "invalid" if you only want ExtraInstances. "optimized" mode is **NOT** supported with *@Object* option. ___Default:___ `"optimized"` --- @field mode string -- Valid modes: full, optimized, scripts. Change this to invalid mode like "invalid" if you only want ExtraInstances. "optimized" mode is **NOT** supported with *@Object* option. ___Default:___ `"optimized"`
--- @field noscripts boolean -- ___Aliases:___ `Decompile`. ___Default:___ false --- @field noscripts boolean -- ___Aliases:___ `Decompile`. ___Default:___ false
--- @field scriptcache boolean -- ___Default:___ true --- @field scriptcache boolean -- ___Default:___ true