Trader tool PoB1 improvement ports and PoE2 specific fixes#1801
Trader tool PoB1 improvement ports and PoE2 specific fixes#1801vaisest wants to merge 30 commits intoPathOfBuildingCommunity:devfrom
Conversation
9811d7c to
0d2a6a9
Compare
…currency rates
…ate limiting waits if possible
…lems, and to show it on non-429 rate limit. (429 issue solved on GGG's side)
…earch tries to add results to controls
| @@ -553,7 +553,10 @@ Highest Weight - Displays the order retrieved from trade]] | |||
| main:ClosePopup() | |||
| -- there's a case where if you have a socket(s) allocated, open TradeQuery, close it, dealloc, then open TradeQuery again | |||
There was a problem hiding this comment.
I don't know what this is exactly referring to, but its fix causes another crash
88aca9f to
ddb73c8
Compare
| end | ||
| if not sock then return nil, err end | ||
| sock:setoption("reuseaddr", true) | ||
| -- sock:setoption("reuseaddr", true) |
There was a problem hiding this comment.
This seemed to make PoB think it's listening on the first port when another program was already listening, which meant the key goes to the wrong program
There was a problem hiding this comment.
Hmm, I thought I tested this specifically since it's a security issue, but I can check again. Regardless, the right fix for this would likely be to use the option in LaunchServer.lua instead: server:setoption(option [, value]) from https://lunarmodules.github.io/luasocket/tcp.html
There was a problem hiding this comment.
I've figured out the root issues here:
- We're only allowed to redirect users to
http://localhostfrom GGG's server due to their implementation restrictions - Binding to port 0.0.0.0 (or
*) with LuaSocket will still connect because that address is not conflicting with 127.0.0.1 (apparently) - Binding with the default method will choose an IPv6 address if the IPv4 one is busy, but with the same port
So in this case:
- Start a server with
python3 -m http.server -b 127.0.0.1 49082 - LuaSocket connects to
::as IPv6 - Redirect to
http://localhostreaches the python server instead because localhost resolves to the IPv4 address and server
Forcing IPv4 revealed the other issue, where 0.0.0.0 doesn't conflict with 127.0.0.1 when binding to the port (at least on Windows). This picture reveals some of the results. Port 49083 was the only one that works properly.

Here's the fix to go into LaunchServer.lua:
local luaSocket = require("socket")
local server = luaSocket.tcp4()
local function bindSocket()
local res, err
server:setoption("reuseaddr", true)
res, err = server:bind("localhost", 49082) or server:bind("localhost", 49083) or server:bind("localhost", 49084)
if not res then
server:close()
else
res, err = server:listen(1)
if not res then
server:close()
else
return server
end
end
return nil, err
end
assert(bindSocket())
Fixes:
#469 might be related
Description of the problem being solved:
Most of these changes could probably be ported to pob1 for consistency.
Steps taken to verify a working solution:
Possible issues
I had problems with 429 rate limiting. I'm not sure if that's because of me mashing f5 to test changes, or a real issue.Issue was caused by Cloudflare, fixed by GGG.
Radius jewels don't generate a weight for the mod that increases the radius. I'm not sure how this should be generated as its value depends purely on the other mods on the jewel. This only affects the weighted sum, though.
Link to a build that showcases this PR:
Nothing specific, but:
Before screenshot:
(not sure why the previous version doesn't work at all)

body:

amulet:

After screenshot:
body:

amulet:

In search results it should also be clear that more mods are generated. For example a lot essence mods and local-only mods were previously missing which made results very bad.
Depends on #1798.