Skip to content

Commit 79312d8

Browse files
committed
Merge upstream/dev into feature/draganddrop
2 parents fa911da + 6694a55 commit 79312d8

66 files changed

Lines changed: 13871 additions & 12580 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ The easiest way to make and test changes is by setting up a development installa
6666

6767
cd PathOfBuilding-PoE2
6868

69-
3. Start Path of Building from the repository by running `./runtime/Path{space}of{space}Building-PoE2.exe`.
70-
71-
* <ins>Note for Linux users:</ins> The executable files should automatically have the correct permissions when cloned fresh. If you still encounter permission issues, run once: `chmod +x ./runtime/Path{space}of{space}Building-PoE2.exe`
69+
3. Start Path of Building from the repository.
70+
* On Windows, run `./runtime/Path{space}of{space}Building-PoE2.exe`
71+
* On Linux, run `wine ./runtime/Path{space}of{space}Building-PoE2.exe`
72+
* <ins>Note for Linux users:</ins> `chmod +x` only fixes the execute bit. The file is still a Windows executable, so Wine is required to run it.
7273

7374
You can now use the shortcut to run the program from the repository. Running the program in this manner automatically enables "Dev Mode", which has some handy debugging feature:
7475
* `F5` restarts the program in-place (this is what usually happens when an update is applied).
@@ -97,7 +98,7 @@ To do so [comment out Line 54 to line 58](./src/Launch.lua#L54-L58) of the [Laun
9798
--end
9899
```
99100

100-
and create a valid manifest.xml file in the ./src directory. Then run the `./runtime/Path{space}of{space}Building.exe` as usual. You should get the typical update popup in the bottom left corner.
101+
and create a valid manifest.xml file in the ./src directory. Then run the `./runtime/Path{space}of{space}Building-PoE2.exe` as usual. You should get the typical update popup in the bottom left corner.
101102

102103
The manifest.xml file deserves its own in depth document, but usually copying from release and editing accordingly works well enough.
103104

@@ -205,7 +206,7 @@ Files in `/Data` `/Export` and `/TreeData` can be massive and cause the EmmyLua
205206

206207
If you're on windows, consider downloading [git for windows](https://git-scm.com/downloads) and installing git bash. Git bash comes with a variety of typical linux tools such as grep that can make navigating the code base much easier.
207208

208-
If you're using linux you can run the ./runtime/Path{space}of{space}Building.exe executable with wine. You will need to provide a valid wine path to the emmy lua debugger directory.
209+
If you're using linux you can run the `./runtime/Path{space}of{space}Building-PoE2.exe` executable with wine. You will need to provide a valid wine path to the emmy lua debugger directory.
209210

210211
```bash
211212
# winepath -w ~/.vscode/extensions/tangzx.emmylua-0.8.20-linux-x64/debugger/emmy/windows/x64/
@@ -266,9 +267,9 @@ as well as some familiarity with build tools such as [CMake](https://cmake.org).
266267

267268
### Set up the exporter
268269
1. Copy `bun_extract_file.exe`, `libbun.dll` and `libooz.dll` to `.\src\Export\ggpk\`.
269-
2. Create a shortcut to `.\runtime\Path{space}of{space}Building.exe` with the path to `.\src\Export\Launch.lua` as the first argument. You should end up with something like:
270+
2. Create a shortcut to `.\runtime\Path{space}of{space}Building-PoE2.exe` with the path to `.\src\Export\Launch.lua` as the first argument. You should end up with something like:
270271

271-
"<path to repo>\runtime\Path{space}of{space}Building.exe" "<path to repo>\src\Export\Launch.lua"
272+
"<path to repo>\runtime\Path{space}of{space}Building-PoE2.exe" "<path to repo>\src\Export\Launch.lua"
272273
3. Run the shortcut. "Dat View", the GGPK data viewer UI, should appear. If you get an error, be sure you're using the latest release of Path of Building Community.
273274
4. Click `Edit Sources...` to display the "New DAT Source" popup. Click `New` and enter a name.
274275
5. Paste the full path to `Content.ggpk` into the "Source from GGPK/Steam PoE path" box and hit `Enter`. For the stand-alone client, the path must include the file-name. (Do not put anything in the "Source from DAT files" box unless you have already manually unpacked the relevant files.)

runtime/lua/socket.lua

Lines changed: 96 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -17,53 +17,56 @@ local _M = socket
1717
-- Exported auxiliar functions
1818
-----------------------------------------------------------------------------
1919
function _M.connect4(address, port, laddress, lport)
20-
return socket.connect(address, port, laddress, lport, "inet")
20+
return socket.connect(address, port, laddress, lport, "inet")
2121
end
2222

2323
function _M.connect6(address, port, laddress, lport)
24-
return socket.connect(address, port, laddress, lport, "inet6")
24+
return socket.connect(address, port, laddress, lport, "inet6")
2525
end
2626

2727
function _M.bind(host, port, backlog)
28-
if host == "*" then host = "0.0.0.0" end
29-
local addrinfo, err = socket.dns.getaddrinfo(host);
30-
if not addrinfo then return nil, err end
31-
local sock, res
32-
err = "no info on address"
33-
for i, alt in base.ipairs(addrinfo) do
34-
if alt.family == "inet" then
35-
sock, err = socket.tcp4()
36-
else
37-
sock, err = socket.tcp6()
38-
end
39-
if not sock then return nil, err end
40-
sock:setoption("reuseaddr", true)
41-
res, err = sock:bind(alt.addr, port)
42-
if not res then
43-
sock:close()
44-
else
45-
res, err = sock:listen(backlog)
46-
if not res then
47-
sock:close()
48-
else
49-
return sock
50-
end
51-
end
52-
end
53-
return nil, err
28+
if host == "*" then host = "0.0.0.0" end
29+
local addrinfo, err = socket.dns.getaddrinfo(host);
30+
if not addrinfo then return nil, err end
31+
local sock, res
32+
err = "no info on address"
33+
for i, alt in base.ipairs(addrinfo) do
34+
if alt.family == "inet" then
35+
sock, err = socket.tcp4()
36+
else
37+
sock, err = socket.tcp6()
38+
end
39+
if not sock then return nil, err end
40+
-- sock:setoption("reuseaddr", true)
41+
res, err = sock:bind(alt.addr, port)
42+
if not res then
43+
sock:close()
44+
else
45+
res, err = sock:listen(backlog)
46+
if not res then
47+
sock:close()
48+
else
49+
return sock
50+
end
51+
end
52+
end
53+
return nil, err
5454
end
5555

5656
_M.try = _M.newtry()
5757

5858
function _M.choose(table)
59-
return function(name, opt1, opt2)
60-
if base.type(name) ~= "string" then
61-
name, opt1, opt2 = "default", name, opt1
62-
end
63-
local f = table[name or "nil"]
64-
if not f then base.error("unknown key (".. base.tostring(name) ..")", 3)
65-
else return f(opt1, opt2) end
66-
end
59+
return function(name, opt1, opt2)
60+
if base.type(name) ~= "string" then
61+
name, opt1, opt2 = "default", name, opt1
62+
end
63+
local f = table[name or "nil"]
64+
if not f then
65+
base.error("unknown key (" .. base.tostring(name) .. ")", 3)
66+
else
67+
return f(opt1, opt2)
68+
end
69+
end
6770
end
6871

6972
-----------------------------------------------------------------------------
@@ -77,68 +80,76 @@ _M.sinkt = sinkt
7780
_M.BLOCKSIZE = 2048
7881

7982
sinkt["close-when-done"] = function(sock)
80-
return base.setmetatable({
81-
getfd = function() return sock:getfd() end,
82-
dirty = function() return sock:dirty() end
83-
}, {
84-
__call = function(self, chunk, err)
85-
if not chunk then
86-
sock:close()
87-
return 1
88-
else return sock:send(chunk) end
89-
end
90-
})
83+
return base.setmetatable({
84+
getfd = function() return sock:getfd() end,
85+
dirty = function() return sock:dirty() end
86+
}, {
87+
__call = function(self, chunk, err)
88+
if not chunk then
89+
sock:close()
90+
return 1
91+
else
92+
return sock:send(chunk)
93+
end
94+
end
95+
})
9196
end
9297

9398
sinkt["keep-open"] = function(sock)
94-
return base.setmetatable({
95-
getfd = function() return sock:getfd() end,
96-
dirty = function() return sock:dirty() end
97-
}, {
98-
__call = function(self, chunk, err)
99-
if chunk then return sock:send(chunk)
100-
else return 1 end
101-
end
102-
})
99+
return base.setmetatable({
100+
getfd = function() return sock:getfd() end,
101+
dirty = function() return sock:dirty() end
102+
}, {
103+
__call = function(self, chunk, err)
104+
if chunk then
105+
return sock:send(chunk)
106+
else
107+
return 1
108+
end
109+
end
110+
})
103111
end
104112

105113
sinkt["default"] = sinkt["keep-open"]
106114

107115
_M.sink = _M.choose(sinkt)
108116

109117
sourcet["by-length"] = function(sock, length)
110-
return base.setmetatable({
111-
getfd = function() return sock:getfd() end,
112-
dirty = function() return sock:dirty() end
113-
}, {
114-
__call = function()
115-
if length <= 0 then return nil end
116-
local size = math.min(socket.BLOCKSIZE, length)
117-
local chunk, err = sock:receive(size)
118-
if err then return nil, err end
119-
length = length - string.len(chunk)
120-
return chunk
121-
end
122-
})
118+
return base.setmetatable({
119+
getfd = function() return sock:getfd() end,
120+
dirty = function() return sock:dirty() end
121+
}, {
122+
__call = function()
123+
if length <= 0 then return nil end
124+
local size = math.min(socket.BLOCKSIZE, length)
125+
local chunk, err = sock:receive(size)
126+
if err then return nil, err end
127+
length = length - string.len(chunk)
128+
return chunk
129+
end
130+
})
123131
end
124132

125133
sourcet["until-closed"] = function(sock)
126-
local done
127-
return base.setmetatable({
128-
getfd = function() return sock:getfd() end,
129-
dirty = function() return sock:dirty() end
130-
}, {
131-
__call = function()
132-
if done then return nil end
133-
local chunk, err, partial = sock:receive(socket.BLOCKSIZE)
134-
if not err then return chunk
135-
elseif err == "closed" then
136-
sock:close()
137-
done = 1
138-
return partial
139-
else return nil, err end
140-
end
141-
})
134+
local done
135+
return base.setmetatable({
136+
getfd = function() return sock:getfd() end,
137+
dirty = function() return sock:dirty() end
138+
}, {
139+
__call = function()
140+
if done then return nil end
141+
local chunk, err, partial = sock:receive(socket.BLOCKSIZE)
142+
if not err then
143+
return chunk
144+
elseif err == "closed" then
145+
sock:close()
146+
done = 1
147+
return partial
148+
else
149+
return nil, err
150+
end
151+
end
152+
})
142153
end
143154

144155

spec/System/TestAilments_spec.lua

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,18 @@ describe("TestAilments", function()
1414
--TODO: Shock not supported currently
1515
--it("bleed is buffed by bleed chance", function()
1616
--end)
17-
end)
17+
18+
it("does not double count chaos damage taken for chaos poison", function()
19+
build.skillsTab:PasteSocketGroup("Chaos Bolt 1/0 1\nPoison I 1/0 1\n")
20+
runCallback("OnFrame")
21+
22+
local baseEffMult = build.calcsTab.mainOutput.PoisonEffMult
23+
assert.True(baseEffMult and baseEffMult > 0)
24+
25+
build.configTab.input.customMods = "Nearby enemies take 10% increased Chaos Damage"
26+
build.configTab:BuildModList()
27+
runCallback("OnFrame")
28+
29+
assert.are.equals(1.1, build.calcsTab.mainOutput.PoisonEffMult)
30+
end)
31+
end)

spec/System/TestItemTools_spec.lua

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,53 @@ describe("TestItemTools", function()
5353
assert.are.equals(0.5, item.rangeLineList[1].range)
5454
assert.are.equals(0, item.baseModList:Sum("BASE", nil, "PowerChargesMax"))
5555
end)
56-
end)
56+
57+
it("uses the displayed item slot for anoint comparison tooltips", function()
58+
if not common.classes.ItemsTab then
59+
LoadModule("Classes/ItemsTab")
60+
end
61+
62+
local function assertAnointUsesSlot(rawItem, expectedSlot)
63+
local item = new("Item", rawItem)
64+
local overrides = { }
65+
local fakeItemsTab = setmetatable({
66+
displayItem = item,
67+
build = {
68+
spec = { allocNodes = { } },
69+
calcsTab = {
70+
GetMiscCalculator = function()
71+
return function(override)
72+
table.insert(overrides, override)
73+
return { }
74+
end
75+
end,
76+
},
77+
AddStatComparesToTooltip = function()
78+
return 1
79+
end,
80+
},
81+
}, common.classes.ItemsTab)
82+
local tooltip = {
83+
AddLine = function() end,
84+
}
85+
86+
fakeItemsTab:AppendAnointTooltip(tooltip, { id = 1, dn = "Abasement" })
87+
88+
assert.are.equals(expectedSlot, overrides[1].repSlotName)
89+
assert.are.equals(expectedSlot, overrides[2].repSlotName)
90+
end
91+
92+
assertAnointUsesSlot([[
93+
Rarity: Rare
94+
Dire Thread
95+
Plate Belt
96+
Can be Anointed
97+
]], "Belt")
98+
assertAnointUsesSlot([[
99+
Rarity: Rare
100+
Spark Loop
101+
Ruby Ring
102+
Can be Anointed
103+
]], "Ring 1")
104+
end)
105+
end)

0 commit comments

Comments
 (0)