Open FrancoisMentec opened 4 years ago
Inflate
and Deflate
are decompression/compression routines for files compressed with the Deflate algorithm, loaded from lzip.dll
in the C environment the Lua runtime is embedded in.
As the comments indicate, if you want to run PoB headless in a different environment, you will need to implement this functionality yourself.
So I have do decompress/Inflate
a code generated by pob so it can be loaded? Any idea how I could do the rest (like instantiating the build from a generated code, getting the stats, ...)?
I'm trying to run pob in a browser using fengari. I don't need all the functionalities, all I need is to be able to get the statistics (dps, life, ...) from a code generated by pob and calculate the impact an item would have on the build.
I've been looking into Classes/ImportTab.lua how I could import a build and found two lines:
local xmlText = Inflate(common.base64.decode(buf:gsub("-","+"):gsub("_","/")))
and
self.build:Init(false, "Imported build", self.importCodeXML)
.I suppose
buf
is the code, butInflate
that is found in HeadlessWrapper.lua return an empty string:Also, I'm not sure what is
self.build
. it is passed as a parameter toImportTabClass
, but I couldn't find any instantiation of this class. I suppose it'sbuildMode
that is defined in Modules/Build.lua.So far I failed to load a build.
Is there someone that could provide me with a minimalistic case of how to load a build from a code generated by pob and get its statistics and the impact of an item.
Example:
I don't need any kind of user interface or way to save the build, items or modifications.
Any help would be highly appreciated.