mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-18 17:27:50 -05:00
feat(account): web item giver with colour pickers, den variants, tints and previews
/account/items, linked from the account page and using its sign-in, gives items to the account signed in: - clothing: the item's own colours, or four colours of your own as a picker, #RRGGBB, or AJ's numbers (palette places, or the whole item's colour id signed or unsigned), converted as you type; hex colours not in the palette become an exact custom colour - den items: the variants their art has (lib/den-variants.json, made by tools/den-variants.sh) and a whole-item tint with a strength, kept in the item's version above the variant and drawn by DenItemHelper (build 83) - a preview of each: clothing icons coloured on the page as the game colours them, den items played by Ruffle in a sandboxed frame through public/item-preview.swf (tools/preview-host) a give with a custom colour id that does not exist is refused.
This commit is contained in:
1 parent
44af83f1c5
commit
7cfef493fa
18 files changed
+1958
-7
No files matched your search
@@ -0,0 +1,139 @@
|
||||
"use strict";
|
||||
|
||||
// the variants (colours) each den item's art has, into lib/den-variants.json,
|
||||
// which the item giver offers (lib/admin.js). the art says so itself, in
|
||||
// ActionScript: getVersions() returns them, and setVersion(n) shows one.
|
||||
// the server cannot run that, so tools/den-variants.sh reads it once:
|
||||
//
|
||||
// node tools/den-variants.js fetch <folder> every den item's art, as SWFs
|
||||
// (ffdec decompiles <folder>/swf into <folder>/out)
|
||||
// node tools/den-variants.js index <folder> reads <folder>/out
|
||||
//
|
||||
// most items with variants draw each as a frame of their own; some colour
|
||||
// parts of themselves from a table instead (colArray, one row of RGB values
|
||||
// per variant), and for those the table's colours are kept too, as a
|
||||
// preview. items with no variants are left out.
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const amf3 = require("../lib/amf3.js");
|
||||
const cdn = require("../lib/cdn.js");
|
||||
const defpacks = require("../lib/defpacks.js");
|
||||
|
||||
const OUT = path.join(__dirname, "..", "lib", "den-variants.json");
|
||||
const AT_ONCE = 16;
|
||||
const MAX_VARIANTS = 64;
|
||||
const PREVIEW_COLOURS = 4;
|
||||
|
||||
// DenItem.getIconId: which of an item's pictures the den shows, by its sort category.
|
||||
const iconId = sortCat => ([0, 99, 6, 5].includes(sortCat) ? 1 : sortCat === 1 ? 2 : [2, 3, 4].includes(sortCat) ? 3 : sortCat + 1);
|
||||
|
||||
const fetchAll = async folder => {
|
||||
await defpacks.init();
|
||||
fs.mkdirSync(path.join(folder, "swf"), {recursive: true});
|
||||
const ids = defpacks.denItemIds();
|
||||
let next = 0;
|
||||
let written = 0;
|
||||
const work = async () => {
|
||||
while (next < ids.length) {
|
||||
const id = ids[next++];
|
||||
const def = defpacks.denItemDef(id);
|
||||
const file = await cdn.get(cdn.hashedPath(`items/${((id << 16) | iconId(Number(def.sortCat))) >>> 0}`));
|
||||
try {
|
||||
const wrapped = file && amf3.decode(file);
|
||||
if (wrapped && wrapped.ba) {
|
||||
fs.writeFileSync(path.join(folder, "swf", `${id}.swf`), Buffer.from(wrapped.ba));
|
||||
written++;
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
// not art this can read: left out.
|
||||
}
|
||||
}
|
||||
};
|
||||
await Promise.all(Array.from({length: AT_ONCE}, work));
|
||||
console.log(`${written} of ${ids.length} den items' art written`);
|
||||
};
|
||||
|
||||
const hex = ([r, g, b]) => ((r << 16) | (g << 8) | b).toString(16).padStart(6, "0");
|
||||
|
||||
// one item's decompiled scripts: its variants, and the colour table's first
|
||||
// colours for each when it has one.
|
||||
const readItem = scripts => {
|
||||
let versions = null;
|
||||
for (const text of scripts) {
|
||||
const literal = /function getVersions\(\)\s*:\s*Array\s*\{\s*return \[([\d,\s]*)\];/.exec(text);
|
||||
if (literal) {
|
||||
const list = literal[1].split(",").map(value => Number(value.trim())).filter(Number.isInteger);
|
||||
if (!versions || list.length > versions.length) {
|
||||
versions = list;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!versions || versions.length < 2) {
|
||||
return null;
|
||||
}
|
||||
const entry = {versions: versions.slice(0, MAX_VARIANTS)};
|
||||
const rows = {};
|
||||
for (const text of scripts) {
|
||||
for (const match of text.matchAll(/colArray\[(\d+)\] = (\[\[[\d,\s[\]]*\]\]);/g)) {
|
||||
try {
|
||||
rows[match[1]] = JSON.parse(match[2]).slice(0, PREVIEW_COLOURS).map(hex);
|
||||
}
|
||||
catch (err) {
|
||||
// not a plain table
|
||||
}
|
||||
}
|
||||
}
|
||||
if (entry.versions.every(version => rows[version])) {
|
||||
entry.colours = entry.versions.map(version => rows[version]);
|
||||
}
|
||||
return entry;
|
||||
};
|
||||
|
||||
const scriptsIn = folder => {
|
||||
const found = [];
|
||||
const walk = dir => {
|
||||
for (const name of fs.readdirSync(dir, {withFileTypes: true})) {
|
||||
const full = path.join(dir, name.name);
|
||||
if (name.isDirectory()) {
|
||||
walk(full);
|
||||
}
|
||||
else if (name.name.endsWith(".as")) {
|
||||
found.push(fs.readFileSync(full, "utf8"));
|
||||
}
|
||||
}
|
||||
};
|
||||
walk(folder);
|
||||
return found;
|
||||
};
|
||||
|
||||
const index = folder => {
|
||||
const out = path.join(folder, "out");
|
||||
const result = {};
|
||||
for (const name of fs.readdirSync(out)) {
|
||||
const id = /^(\d+)\.swf$/.exec(name);
|
||||
const entry = id && readItem(scriptsIn(path.join(out, name)));
|
||||
if (entry) {
|
||||
result[id[1]] = entry;
|
||||
}
|
||||
}
|
||||
const sorted = Object.fromEntries(Object.entries(result).sort((a, b) => Number(a[0]) - Number(b[0])));
|
||||
fs.writeFileSync(OUT, `${JSON.stringify(sorted)}\n`);
|
||||
console.log(`${Object.keys(sorted).length} den items with variants, ${Object.values(sorted).filter(entry => entry.colours).length} with colour previews: ${OUT}`);
|
||||
};
|
||||
|
||||
const [command, folder] = process.argv.slice(2);
|
||||
if (command === "fetch" && folder) {
|
||||
fetchAll(folder).then(() => process.exit(0), err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
else if (command === "index" && folder) {
|
||||
index(folder);
|
||||
}
|
||||
else {
|
||||
console.error("node tools/den-variants.js fetch|index <folder>");
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# rebuilds lib/den-variants.json: every den item's art fetched (into cache/
|
||||
# too), decompiled by JPEXS (tools/ffdec, needs Java) and read for its
|
||||
# variants. see tools/den-variants.js.
|
||||
#
|
||||
# tools/den-variants.sh [work folder] (default: a new temporary one)
|
||||
set -e
|
||||
cd "$(dirname "$(readlink -f "$0")")/.."
|
||||
work=${1:-$(mktemp -d)}
|
||||
node tools/den-variants.js fetch "$work"
|
||||
java -jar tools/ffdec/ffdec-cli.jar -export script "$work/out" "$work/swf" > "$work/ffdec.log" 2>&1
|
||||
node tools/den-variants.js index "$work"
|
||||
@@ -0,0 +1,93 @@
|
||||
package
|
||||
{
|
||||
import flash.display.Loader;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
import flash.events.IOErrorEvent;
|
||||
import flash.filters.ColorMatrixFilter;
|
||||
import flash.geom.Rectangle;
|
||||
import flash.net.URLRequest;
|
||||
import flash.system.ApplicationDomain;
|
||||
import flash.system.LoaderContext;
|
||||
|
||||
// the web item giver's den item preview (public/item-preview.html): one
|
||||
// den item's art, as a den shows it. flashvars: art (its address),
|
||||
// version (the variant) and tint ("rrggbb") with strength (1 to 100), as
|
||||
// DenItemHelper gives them.
|
||||
public class PreviewHost extends MovieClip
|
||||
{
|
||||
private static const MARGIN:Number = 10;
|
||||
|
||||
private var _loader:Loader;
|
||||
|
||||
public function PreviewHost()
|
||||
{
|
||||
super();
|
||||
stage.scaleMode = "noScale";
|
||||
stage.align = "TL";
|
||||
_loader = new Loader();
|
||||
_loader.contentLoaderInfo.addEventListener("complete",onLoaded);
|
||||
_loader.contentLoaderInfo.addEventListener("ioError",onFailed);
|
||||
addChild(_loader);
|
||||
var _loc1_:String = loaderInfo.parameters.art;
|
||||
if(_loc1_)
|
||||
{
|
||||
_loader.load(new URLRequest(_loc1_),new LoaderContext(false,new ApplicationDomain()));
|
||||
}
|
||||
}
|
||||
|
||||
private function onLoaded(param1:Event) : void
|
||||
{
|
||||
var _loc2_:Object = _loader.content;
|
||||
var _loc3_:int = int(loaderInfo.parameters.version);
|
||||
if(_loc2_.hasOwnProperty("setVersion"))
|
||||
{
|
||||
_loc2_.setVersion(_loc3_);
|
||||
}
|
||||
var _loc4_:String = loaderInfo.parameters.tint;
|
||||
if(_loc4_)
|
||||
{
|
||||
_loader.filters = [new ColorMatrixFilter(tintMatrix(uint(parseInt(_loc4_,16)),Math.max(1,Math.min(100,Number(loaderInfo.parameters.strength) || 100)) / 100))];
|
||||
}
|
||||
addEventListener("enterFrame",fit);
|
||||
}
|
||||
|
||||
private function onFailed(param1:IOErrorEvent) : void
|
||||
{
|
||||
}
|
||||
|
||||
// fitted to the stage, centred: kept on as an item may grow as it plays.
|
||||
private function fit(param1:Event) : void
|
||||
{
|
||||
_loader.scaleX = _loader.scaleY = 1;
|
||||
_loader.x = _loader.y = 0;
|
||||
var _loc2_:Rectangle = _loader.getBounds(this);
|
||||
if(_loc2_.width <= 0 || _loc2_.height <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var _loc3_:Number = Math.min((stage.stageWidth - MARGIN * 2) / _loc2_.width,(stage.stageHeight - MARGIN * 2) / _loc2_.height);
|
||||
_loader.scaleX = _loader.scaleY = _loc3_;
|
||||
_loader.x = (stage.stageWidth - _loc2_.width * _loc3_) / 2 - _loc2_.x * _loc3_;
|
||||
_loader.y = (stage.stageHeight - _loc2_.height * _loc3_) / 2 - _loc2_.y * _loc3_;
|
||||
}
|
||||
|
||||
// DenItemHelper.tintMatrix's
|
||||
private static function tintMatrix(param1:uint, param2:Number) : Array
|
||||
{
|
||||
var _loc3_:Array = [(param1 >> 16 & 0xFF) / 255,(param1 >> 8 & 0xFF) / 255,(param1 & 0xFF) / 255];
|
||||
var _loc4_:Number = 0.299 * _loc3_[0] + 0.587 * _loc3_[1] + 0.114 * _loc3_[2];
|
||||
var _loc5_:Number = Math.min(2,1 / Math.max(0.001,_loc4_));
|
||||
var _loc6_:Array = [];
|
||||
var _loc7_:int = 0;
|
||||
while(_loc7_ < 3)
|
||||
{
|
||||
var _loc8_:Number = _loc3_[_loc7_] * _loc5_ * param2;
|
||||
_loc6_.push(0.299 * _loc8_ + (_loc7_ == 0 ? 1 - param2 : 0),0.587 * _loc8_ + (_loc7_ == 1 ? 1 - param2 : 0),0.114 * _loc8_ + (_loc7_ == 2 ? 1 - param2 : 0),0,0);
|
||||
_loc7_++;
|
||||
}
|
||||
_loc6_.push(0,0,0,1,0);
|
||||
return _loc6_;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,450 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!--
|
||||
WARNING: The structure of this XML is not final.
|
||||
In later versions of FFDec it can be changed.
|
||||
Make sure you use compatible reader/writer based on _xmlExportMajor/_xmlExportMinor keys.
|
||||
--><swf _xmlExportMajor="2" _xmlExportMinor="2" _generator="JPEXS Free Flash Decompiler v.26.3.0" type="SWF" charset="UTF-8" compression="ZLIB" encrypted="false" frameCount="1" frameRate="24.0" gfx="false" hasEndTag="true" version="10">
|
||||
<displayRect type="RECT" Xmax="4000" Xmin="0" Ymax="4000" Ymin="0" nbits="13"/>
|
||||
<tags>
|
||||
<item type="FileAttributesTag" actionScript3="true" forceWriteAsLong="false" hasMetadata="false" noCrossDomainCache="false" reservedA="false" reservedB="0" swfRelativeUrls="false" useDirectBlit="false" useGPU="false" useNetwork="true"/>
|
||||
<item type="SetBackgroundColorTag" forceWriteAsLong="false">
|
||||
<backgroundColor type="RGB" blue="255" green="255" red="255"/>
|
||||
</item>
|
||||
<item type="DoABC2Tag" flags="1" forceWriteAsLong="true" name="">
|
||||
<abc type="ABC">
|
||||
<version type="ABCVersion" major="46" minor="16"/>
|
||||
<constants type="AVM2ConstantPool">
|
||||
<constant_int>
|
||||
<item isNull="true"/>
|
||||
<item>4</item>
|
||||
</constant_int>
|
||||
<constant_uint/>
|
||||
<constant_double>
|
||||
<item isNull="true"/>
|
||||
<item>0.299</item>
|
||||
<item>0.587</item>
|
||||
<item>0.114</item>
|
||||
<item>0.001</item>
|
||||
</constant_double>
|
||||
<constant_decimal/>
|
||||
<constant_float/>
|
||||
<constant_float4/>
|
||||
<constant_string>
|
||||
<item isNull="true"/>
|
||||
<item/>
|
||||
<item>Array</item>
|
||||
<item>void</item>
|
||||
<item>flash.display</item>
|
||||
<item>MovieClip</item>
|
||||
<item>setVersion</item>
|
||||
<item>http://adobe.com/AS3/2006/builtin</item>
|
||||
<item>flash.events</item>
|
||||
<item>flash.filters</item>
|
||||
<item>flash.geom</item>
|
||||
<item>flash.net</item>
|
||||
<item>flash.system</item>
|
||||
<item>flash.display:MovieClip</item>
|
||||
<item>flash.display:Sprite</item>
|
||||
<item>flash.display:DisplayObjectContainer</item>
|
||||
<item>flash.display:InteractiveObject</item>
|
||||
<item>flash.display:DisplayObject</item>
|
||||
<item>flash.events:EventDispatcher</item>
|
||||
<item>Object</item>
|
||||
<item>EventDispatcher</item>
|
||||
<item>DisplayObject</item>
|
||||
<item>InteractiveObject</item>
|
||||
<item>DisplayObjectContainer</item>
|
||||
<item>Sprite</item>
|
||||
<item>PreviewHost</item>
|
||||
<item>_loader</item>
|
||||
<item>onLoaded</item>
|
||||
<item>onFailed</item>
|
||||
<item>fit</item>
|
||||
<item>MARGIN</item>
|
||||
<item>tintMatrix</item>
|
||||
<item>Loader</item>
|
||||
<item>PreviewHost/private/onLoaded</item>
|
||||
<item>Event</item>
|
||||
<item>PreviewHost/private/onFailed</item>
|
||||
<item>IOErrorEvent</item>
|
||||
<item>PreviewHost/private/fit</item>
|
||||
<item>loaderInfo</item>
|
||||
<item>uint</item>
|
||||
<item>parseInt</item>
|
||||
<item>Math</item>
|
||||
<item>Number</item>
|
||||
<item>addEventListener</item>
|
||||
<item>content</item>
|
||||
<item>parameters</item>
|
||||
<item>version</item>
|
||||
<item>hasOwnProperty</item>
|
||||
<item>tint</item>
|
||||
<item>filters</item>
|
||||
<item>ColorMatrixFilter</item>
|
||||
<item>max</item>
|
||||
<item>min</item>
|
||||
<item>strength</item>
|
||||
<item>enterFrame</item>
|
||||
<item>param1</item>
|
||||
<item>_loc2_</item>
|
||||
<item>_loc3_</item>
|
||||
<item>_loc4_</item>
|
||||
<item>stage</item>
|
||||
<item>scaleX</item>
|
||||
<item>scaleY</item>
|
||||
<item>x</item>
|
||||
<item>y</item>
|
||||
<item>Rectangle</item>
|
||||
<item>getBounds</item>
|
||||
<item>width</item>
|
||||
<item>height</item>
|
||||
<item>stageWidth</item>
|
||||
<item>stageHeight</item>
|
||||
<item>PreviewHost/private/tintMatrix</item>
|
||||
<item>push</item>
|
||||
<item>param2</item>
|
||||
<item>_loc5_</item>
|
||||
<item>_loc6_</item>
|
||||
<item>_loc7_</item>
|
||||
<item>_loc8_</item>
|
||||
<item>PreviewHost/PreviewHost</item>
|
||||
<item>addChild</item>
|
||||
<item>scaleMode</item>
|
||||
<item>noScale</item>
|
||||
<item>align</item>
|
||||
<item>TL</item>
|
||||
<item>contentLoaderInfo</item>
|
||||
<item>complete</item>
|
||||
<item>ioError</item>
|
||||
<item>art</item>
|
||||
<item>load</item>
|
||||
<item>URLRequest</item>
|
||||
<item>LoaderContext</item>
|
||||
<item>ApplicationDomain</item>
|
||||
<item>_loc1_</item>
|
||||
<item>PreviewUnused</item>
|
||||
<item>PreviewHost.as$0</item>
|
||||
</constant_string>
|
||||
<constant_namespace>
|
||||
<item isNull="true"/>
|
||||
<item type="Namespace" kind="22" name_index="1"/>
|
||||
<item type="Namespace" kind="22" name_index="4"/>
|
||||
<item type="Namespace" kind="8" name_index="7"/>
|
||||
<item type="Namespace" kind="22" name_index="8"/>
|
||||
<item type="Namespace" kind="22" name_index="9"/>
|
||||
<item type="Namespace" kind="22" name_index="10"/>
|
||||
<item type="Namespace" kind="22" name_index="11"/>
|
||||
<item type="Namespace" kind="22" name_index="12"/>
|
||||
<item type="Namespace" kind="26" name_index="13"/>
|
||||
<item type="Namespace" kind="26" name_index="14"/>
|
||||
<item type="Namespace" kind="26" name_index="15"/>
|
||||
<item type="Namespace" kind="26" name_index="16"/>
|
||||
<item type="Namespace" kind="26" name_index="17"/>
|
||||
<item type="Namespace" kind="26" name_index="18"/>
|
||||
<item type="Namespace" kind="23" name_index="1"/>
|
||||
<item type="Namespace" kind="5" name_index="25"/>
|
||||
<item type="Namespace" kind="24" name_index="25"/>
|
||||
<item type="Namespace" kind="26" name_index="25"/>
|
||||
<item type="Namespace" kind="24" name_index="92"/>
|
||||
<item type="Namespace" kind="5" name_index="93"/>
|
||||
</constant_namespace>
|
||||
<constant_namespace_set>
|
||||
<item isNull="true"/>
|
||||
<item type="NamespaceSet">
|
||||
<namespaces>
|
||||
<item>1</item>
|
||||
</namespaces>
|
||||
</item>
|
||||
<item type="NamespaceSet">
|
||||
<namespaces>
|
||||
<item>1</item>
|
||||
<item>3</item>
|
||||
<item>15</item>
|
||||
<item>9</item>
|
||||
<item>10</item>
|
||||
<item>11</item>
|
||||
<item>12</item>
|
||||
<item>13</item>
|
||||
<item>14</item>
|
||||
<item>16</item>
|
||||
<item>17</item>
|
||||
<item>18</item>
|
||||
<item>20</item>
|
||||
</namespaces>
|
||||
</item>
|
||||
</constant_namespace_set>
|
||||
<constant_multiname>
|
||||
<item isNull="true"/>
|
||||
<item type="Multiname" kind="7" name_index="2" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="3" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="5" namespace_index="2" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="19" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="20" namespace_index="4" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="21" namespace_index="2" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="22" namespace_index="2" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="23" namespace_index="2" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="24" namespace_index="2" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="25" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="26" namespace_index="16" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="27" namespace_index="16" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="28" namespace_index="16" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="29" namespace_index="16" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="30" namespace_index="16" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="31" namespace_index="16" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="32" namespace_index="2" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="34" namespace_index="4" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="36" namespace_index="4" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="38" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="39" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="40" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="41" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="42" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="43" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="44" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="45" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="47" namespace_index="3" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="49" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="50" namespace_index="5" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="51" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="52" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="59" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="60" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="61" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="62" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="63" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="64" namespace_index="6" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="65" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="66" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="67" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="68" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="69" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="71" namespace_index="3" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="78" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="79" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="81" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="83" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="87" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="88" namespace_index="7" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="89" namespace_index="8" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="90" namespace_index="8" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="7" name_index="92" namespace_index="1" namespace_set_index="0" qname_index="0"/>
|
||||
<item type="Multiname" kind="9" name_index="92" namespace_index="0" namespace_set_index="1" qname_index="0"/>
|
||||
<item type="Multiname" kind="9" name_index="46" namespace_index="0" namespace_set_index="2" qname_index="0"/>
|
||||
<item type="Multiname" kind="9" name_index="6" namespace_index="0" namespace_set_index="2" qname_index="0"/>
|
||||
<item type="Multiname" kind="9" name_index="48" namespace_index="0" namespace_set_index="2" qname_index="0"/>
|
||||
<item type="Multiname" kind="9" name_index="53" namespace_index="0" namespace_set_index="2" qname_index="0"/>
|
||||
<item type="Multiname" kind="27" name_index="0" namespace_index="0" namespace_set_index="2" qname_index="0"/>
|
||||
<item type="Multiname" kind="9" name_index="86" namespace_index="0" namespace_set_index="2" qname_index="0"/>
|
||||
</constant_multiname>
|
||||
</constants>
|
||||
<method_info>
|
||||
<item type="MethodInfo" flags="0" name_index="1" ret_type="0">
|
||||
<param_types/>
|
||||
<optional/>
|
||||
<paramNames/>
|
||||
</item>
|
||||
<item type="MethodInfo" flags="0" name_index="33" ret_type="2">
|
||||
<param_types>
|
||||
<item>18</item>
|
||||
</param_types>
|
||||
<optional/>
|
||||
<paramNames>
|
||||
<item>0</item>
|
||||
</paramNames>
|
||||
</item>
|
||||
<item type="MethodInfo" flags="0" name_index="35" ret_type="2">
|
||||
<param_types>
|
||||
<item>19</item>
|
||||
</param_types>
|
||||
<optional/>
|
||||
<paramNames>
|
||||
<item>0</item>
|
||||
</paramNames>
|
||||
</item>
|
||||
<item type="MethodInfo" flags="0" name_index="37" ret_type="2">
|
||||
<param_types>
|
||||
<item>18</item>
|
||||
</param_types>
|
||||
<optional/>
|
||||
<paramNames>
|
||||
<item>0</item>
|
||||
</paramNames>
|
||||
</item>
|
||||
<item type="MethodInfo" flags="0" name_index="70" ret_type="1">
|
||||
<param_types>
|
||||
<item>21</item>
|
||||
<item>24</item>
|
||||
</param_types>
|
||||
<optional/>
|
||||
<paramNames>
|
||||
<item>0</item>
|
||||
<item>0</item>
|
||||
</paramNames>
|
||||
</item>
|
||||
<item type="MethodInfo" flags="0" name_index="77" ret_type="0">
|
||||
<param_types/>
|
||||
<optional/>
|
||||
<paramNames/>
|
||||
</item>
|
||||
<item type="MethodInfo" flags="0" name_index="1" ret_type="0">
|
||||
<param_types/>
|
||||
<optional/>
|
||||
<paramNames/>
|
||||
</item>
|
||||
<item type="MethodInfo" flags="0" name_index="1" ret_type="0">
|
||||
<param_types/>
|
||||
<optional/>
|
||||
<paramNames/>
|
||||
</item>
|
||||
<item type="MethodInfo" flags="0" name_index="0" ret_type="0">
|
||||
<param_types/>
|
||||
<optional/>
|
||||
<paramNames/>
|
||||
</item>
|
||||
<item type="MethodInfo" flags="0" name_index="1" ret_type="0">
|
||||
<param_types/>
|
||||
<optional/>
|
||||
<paramNames/>
|
||||
</item>
|
||||
</method_info>
|
||||
<metadata_info/>
|
||||
<instance_info>
|
||||
<item type="InstanceInfo" flags="9" iinit_index="5" name_index="10" protectedNS="17" super_index="3">
|
||||
<interfaces/>
|
||||
<instance_traits type="Traits">
|
||||
<traits>
|
||||
<item type="TraitSlotConst" bytes="0b00001100" deleted="false" fileOffset="1461" kindFlags="0" kindType="0" name_index="11" slot_id="0" type_index="17" value_index="0" value_kind="0">
|
||||
<metadata/>
|
||||
</item>
|
||||
<item type="TraitMethodGetterSetter" bytes="0c010001" deleted="false" disp_id="0" fileOffset="1466" kindFlags="0" kindType="1" method_info="1" name_index="12">
|
||||
<metadata/>
|
||||
</item>
|
||||
<item type="TraitMethodGetterSetter" bytes="0d010002" deleted="false" disp_id="0" fileOffset="1470" kindFlags="0" kindType="1" method_info="2" name_index="13">
|
||||
<metadata/>
|
||||
</item>
|
||||
<item type="TraitMethodGetterSetter" bytes="0e010003" deleted="false" disp_id="0" fileOffset="1474" kindFlags="0" kindType="1" method_info="3" name_index="14">
|
||||
<metadata/>
|
||||
</item>
|
||||
</traits>
|
||||
</instance_traits>
|
||||
</item>
|
||||
<item type="InstanceInfo" flags="9" iinit_index="8" name_index="53" protectedNS="19" super_index="4">
|
||||
<interfaces/>
|
||||
<instance_traits type="Traits">
|
||||
<traits/>
|
||||
</instance_traits>
|
||||
</item>
|
||||
</instance_info>
|
||||
<class_info>
|
||||
<item type="ClassInfo" cinit_index="6">
|
||||
<static_traits type="Traits">
|
||||
<traits>
|
||||
<item type="TraitSlotConst" bytes="0f0601180103" deleted="false" fileOffset="1487" kindFlags="0" kindType="6" name_index="15" slot_id="1" type_index="24" value_index="1" value_kind="3">
|
||||
<metadata/>
|
||||
</item>
|
||||
<item type="TraitMethodGetterSetter" bytes="10110304" deleted="false" disp_id="3" fileOffset="1493" kindFlags="1" kindType="1" method_info="4" name_index="16">
|
||||
<metadata/>
|
||||
</item>
|
||||
</traits>
|
||||
</static_traits>
|
||||
</item>
|
||||
<item type="ClassInfo" cinit_index="9">
|
||||
<static_traits type="Traits">
|
||||
<traits/>
|
||||
</static_traits>
|
||||
</item>
|
||||
</class_info>
|
||||
<script_info>
|
||||
<item type="ScriptInfo" init_index="0">
|
||||
<traits type="Traits">
|
||||
<traits>
|
||||
<item type="TraitClass" bytes="0a040100" class_info="0" deleted="false" fileOffset="1502" kindFlags="0" kindType="4" name_index="10" slot_id="1">
|
||||
<metadata/>
|
||||
</item>
|
||||
</traits>
|
||||
</traits>
|
||||
</item>
|
||||
<item type="ScriptInfo" init_index="7">
|
||||
<traits type="Traits">
|
||||
<traits>
|
||||
<item type="TraitClass" bytes="35040101" class_info="1" deleted="false" fileOffset="1508" kindFlags="0" kindType="4" name_index="53" slot_id="1">
|
||||
<metadata/>
|
||||
</item>
|
||||
</traits>
|
||||
</traits>
|
||||
</item>
|
||||
</script_info>
|
||||
<bodies>
|
||||
<item type="MethodBody" codeBytes="d0306500600430600530600630600730600830600930600330600358001d1d1d1d1d1d1d680a47" init_scope_depth="1" max_regs="1" max_scope_depth="9" max_stack="2" method_info="0">
|
||||
<exceptions/>
|
||||
<traits type="Traits">
|
||||
<traits/>
|
||||
</traits>
|
||||
</item>
|
||||
<item type="MethodBody" codeBytes="d030ef01370000ef01380129ef0139022aef013a032f600b661a8004d66014661b66377373d7d22c06461c0112050000d2d34f38016014661b66398563046204123d0000600b5d1e5d105d16620424104616027460172401601724646014661b663a75752a761104000029246475462002461f022464a34610024a1e015601611d5d192c36600e4f190247" init_scope_depth="10" max_regs="5" max_scope_depth="11" max_stack="10" method_info="1">
|
||||
<exceptions/>
|
||||
<traits type="Traits">
|
||||
<traits/>
|
||||
</traits>
|
||||
</item>
|
||||
<item type="MethodBody" codeBytes="d030ef0137000047" init_scope_depth="10" max_regs="2" max_scope_depth="11" max_stack="1" method_info="2">
|
||||
<exceptions/>
|
||||
<traits type="Traits">
|
||||
<traits/>
|
||||
</traits>
|
||||
</item>
|
||||
<item type="MethodBody" codeBytes="d030ef01370000ef01380140ef01390245600b600b24012a63046123620408046122600b600b24002a63046125620408046124600bd04627018026d6d266282400ae2a1107000029d266292400ae120100004760176021662a600f2402a2a1d26628a36021662b600f2402a2a1d26629a346200275d7600b600bd32a63046123620408046122600b6021662ad26628d3a2a12402a3d26624d3a2a16124600b6021662bd26629d3a2a12402a3d26625d3a2a1612547" init_scope_depth="10" max_regs="5" max_scope_depth="11" max_stack="5" method_info="3">
|
||||
<exceptions/>
|
||||
<traits type="Traits">
|
||||
<traits/>
|
||||
</traits>
|
||||
</item>
|
||||
<item type="MethodBody" codeBytes="d030ef01370000ef01480100ef0139024eef013a034fef01490450ef014a0551ef014b0652ef014c0755d12410a625ff01a825ff01a3d12408a625ff01a825ff01a3d125ff01a825ff01a356038001d72f01d32400663ba22f02d32401663ba2a02f03d32402663ba2a075630460172402240160172f046204461f02a346200275630556008001630624007363071061000009d36207663b6205a2d2a275630862062f016208a262072400140800002401d2a1100200002400a02f026208a262072401140800002401d2a1100200002400a02f036208a262072402140800002401d2a1100200002400a0240024004f2c05c207620724031597ffff6206240024002400240124004f2c05620648" init_scope_depth="9" max_regs="9" max_scope_depth="10" max_stack="6" method_info="4">
|
||||
<exceptions/>
|
||||
<traits type="Traits">
|
||||
<traits/>
|
||||
</traits>
|
||||
</item>
|
||||
<item type="MethodBody" codeBytes="d030ef015b0020d0490060212c50612e60212c52612f5e0b5d114a1100610b600b66302c54600c4f1902600b66302c55600d4f19025d2d600b4f2d016014661b663c85d5d112160000600b5d32d14a32015d33275d344a34004a33024f310247" init_scope_depth="10" max_regs="2" max_scope_depth="11" max_stack="5" method_info="5">
|
||||
<exceptions/>
|
||||
<traits type="Traits">
|
||||
<traits/>
|
||||
</traits>
|
||||
</item>
|
||||
<item type="MethodBody" codeBytes="d0305e0f2404680f47" init_scope_depth="9" max_regs="1" max_scope_depth="10" max_stack="2" method_info="6">
|
||||
<exceptions/>
|
||||
<traits type="Traits">
|
||||
<traits/>
|
||||
</traits>
|
||||
</item>
|
||||
<item type="MethodBody" codeBytes="d0305d36600430600458011d683547" init_scope_depth="1" max_regs="1" max_scope_depth="3" max_stack="2" method_info="7">
|
||||
<exceptions/>
|
||||
<traits type="Traits">
|
||||
<traits/>
|
||||
</traits>
|
||||
</item>
|
||||
<item type="MethodBody" codeBytes="d030d0490047" init_scope_depth="4" max_regs="1" max_scope_depth="5" max_stack="1" method_info="8">
|
||||
<exceptions/>
|
||||
<traits type="Traits">
|
||||
<traits/>
|
||||
</traits>
|
||||
</item>
|
||||
<item type="MethodBody" codeBytes="d03047" init_scope_depth="3" max_regs="1" max_scope_depth="4" max_stack="1" method_info="9">
|
||||
<exceptions/>
|
||||
<traits type="Traits">
|
||||
<traits/>
|
||||
</traits>
|
||||
</item>
|
||||
</bodies>
|
||||
</abc>
|
||||
</item>
|
||||
<item type="SymbolClassTag" forceWriteAsLong="true">
|
||||
<tags>
|
||||
<item>0</item>
|
||||
</tags>
|
||||
<names>
|
||||
<item>PreviewHost</item>
|
||||
</names>
|
||||
</item>
|
||||
<item type="ShowFrameTag" forceWriteAsLong="false"/>
|
||||
</tags>
|
||||
</swf>
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
# rebuilds public/item-preview.swf, the web item giver's den item preview
|
||||
# (public/item-preview.html plays it with Ruffle): PreviewHost.as compiled by
|
||||
# JPEXS (tools/ffdec, needs Java) into base.xml, a SWF of one frame holding
|
||||
# only code. JPEXS can only compile a class over one already there, so
|
||||
# base.xml has a PreviewHost (and an empty PreviewUnused, left from making it).
|
||||
#
|
||||
# tools/preview-host/build.sh [output.swf] (default: public/item-preview.swf)
|
||||
set -e
|
||||
cd "$(dirname "$(readlink -f "$0")")/../.."
|
||||
out=${1:-public/item-preview.swf}
|
||||
work=$(mktemp -d)
|
||||
trap 'rm -rf "$work"' EXIT
|
||||
ffdec="java -jar tools/ffdec/ffdec-cli.jar"
|
||||
mkdir "$work/src"
|
||||
cp tools/preview-host/PreviewHost.as "$work/src/"
|
||||
$ffdec -xml2swf tools/preview-host/base.xml "$work/base.swf" > "$work/log" 2>&1
|
||||
$ffdec -importScript "$work/base.swf" "$work/host.swf" "$work/src" >> "$work/log" 2>&1
|
||||
$ffdec -abcclean "$work/host.swf" "$out" >> "$work/log" 2>&1 || { cat "$work/log"; exit 1; }
|
||||
echo "$out: $(wc -c < "$out") bytes"
|
||||
Reference in new issue
Block a user