7 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
e9e5ec2fd6 Avoid windows build-dir lock by using per-version build folders 2026-07-29 22:25:29 +00:00
copilot-swe-agent[bot]
0639bf2ae8 Fix windows build lock by disabling MSBuild node reuse 2026-07-29 22:18:45 +00:00
copilot-swe-agent[bot]
ed3bf6a952 Initial plan 2026-07-29 22:16:24 +00:00
Filip Georgiev
c7bccd62c6 Fix swampfire nano mission by by refactoring Mission.cpp (#322) 2026-07-29 15:12:40 -07:00
574d3111bc Switch to debian:trixie-slim image 2026-05-23 23:16:05 -07:00
424f83ed94 Add script to build in Docker 2026-05-23 23:09:18 -07:00
cd7caafec7 Docker fixes 2026-05-23 22:56:11 -07:00
6 changed files with 71 additions and 70 deletions

1
.dockerignore Normal file
View File

@@ -0,0 +1 @@
**/*.o

View File

@@ -84,11 +84,8 @@ jobs:
Invoke-Expression "vcpkg integrate install"
foreach ($version in $versions) {
if (Test-Path -LiteralPath "build") {
Remove-Item "build" -Recurse
Write-Output "Deleted existing build folder"
}
Invoke-Expression "cmake -B build -DPROTOCOL_VERSION=$version -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
$buildDir = "build-$version"
Invoke-Expression "cmake -B $buildDir -DPROTOCOL_VERSION=$version -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
if ($LASTEXITCODE -ne "0") {
Write-Error "cmake generation failed for version $version" -ErrorAction Stop
}
@@ -96,7 +93,7 @@ jobs:
foreach ($configuration in $configurations) {
Write-Output "Building version $version $configuration"
Invoke-Expression "msbuild build\OpenFusion.sln /maxcpucount:8 /p:BuildInParallel=true /p:CL_MPCount=8 /p:UseMultiToolTask=true /p:Configuration=$configuration"
Invoke-Expression "msbuild $buildDir\OpenFusion.sln /maxcpucount:8 /nodeReuse:false /p:BuildInParallel=true /p:CL_MPCount=8 /p:UseMultiToolTask=true /p:Configuration=$configuration"
if ($LASTEXITCODE -ne "0") {
Write-Error "msbuild build failed for version $version" -ErrorAction Stop
}

View File

@@ -1,36 +1,34 @@
# build
FROM alpine:3 as build
FROM debian:trixie-slim as build
WORKDIR /usr/src/app
RUN apk update && apk upgrade && apk add \
linux-headers \
RUN apt update && apt upgrade -y && apt install -y \
git \
clang18 \
make \
sqlite-dev
clang \
build-essential \
libsqlite3-dev
COPY src ./src
COPY vendor ./vendor
COPY .git ./.git
COPY Makefile CMakeLists.txt version.h.in ./
RUN sed -i 's/^CC=clang$/&-18/' Makefile
RUN sed -i 's/^CXX=clang++$/&-18/' Makefile
RUN make nosandbox -j$(nproc)
# export-only stage: `docker build --target=export --output=./bin .`
FROM scratch AS export
COPY --from=build /usr/src/app/bin/fusion /fusion
# prod
FROM alpine:3
FROM debian:trixie-slim
WORKDIR /usr/src/app
RUN apk update && apk upgrade && apk add \
libstdc++ \
sqlite-dev
RUN apt update && apt upgrade -y && apt install -y \
libsqlite3-dev
COPY --from=build /usr/src/app/bin/fusion /bin/fusion
COPY sql ./sql
CMD ["/bin/fusion"]

1
build_docker.sh Executable file
View File

@@ -0,0 +1 @@
docker build --target=export --output=./bin .

View File

@@ -8,6 +8,7 @@ services:
- ./config.ini:/usr/src/app/config.ini
- ./database.db:/usr/src/app/database.db
- ./tdata:/usr/src/app/tdata
- ./sql:/usr/src/app/sql
ports:
- "23000:23000"
- "23001:23001"

View File

@@ -595,30 +595,33 @@ void Missions::mobKilled(CNSocket *sock, int mobid, std::map<int, int>& rolls) {
}
// drop quest item
if (task["m_iCSUItemNumNeeded"][j] != 0 && !isQuestItemFull(sock, task["m_iCSUItemID"][j], task["m_iCSUItemNumNeeded"][j]) ) {
bool drop = rolls[plr->tasks[i]] % 100 < task["m_iSTItemDropRate"][j];
if (drop) {
dropQuestItem(sock, plr->tasks[i], 1, task["m_iCSUItemID"][j], mobid);
/*
* Workaround: The client has a bug where it only sends a TASK_END request
* for the first task of multiple that met their quest item requirements
* at the same time. We deal with this by sending TASK_END response packets
* proactively and then silently ignoring the extra TASK_END requests it
* sends afterwards.
*/
if (isQuestItemFull(sock, task["m_iCSUItemID"][j], task["m_iCSUItemNumNeeded"][j])) {
INITSTRUCT(sP_FE2CL_REP_PC_TASK_END_SUCC, end);
end.iTaskNum = plr->tasks[i];
if (!endTask(sock, plr->tasks[i]))
continue;
sock->sendPacket(end, P_FE2CL_REP_PC_TASK_END_SUCC);
if (task["m_iCSUItemNumNeeded"][j] != 0) {
if (!isQuestItemFull(sock, task["m_iCSUItemID"][j], task["m_iCSUItemNumNeeded"][j])) {
bool drop = rolls[plr->tasks[i]] % 100 < task["m_iSTItemDropRate"][j];
if (drop) {
dropQuestItem(sock, plr->tasks[i], 1, task["m_iCSUItemID"][j], mobid);
}
} else {
// fail to drop (itemID == 0)
dropQuestItem(sock, plr->tasks[i], 1, 0, mobid);
else {
// fail to drop (itemID == 0)
dropQuestItem(sock, plr->tasks[i], 1, 0, mobid);
}
}
/*
* Workaround: The client has a bug where it only sends a TASK_END request
* for the first task of multiple that met their quest item requirements
* at the same time. We deal with this by sending TASK_END response packets
* proactively and then silently ignoring the extra TASK_END requests it
* sends afterwards.
*/
if (isQuestItemFull(sock, task["m_iCSUItemID"][j], task["m_iCSUItemNumNeeded"][j])) {
INITSTRUCT(sP_FE2CL_REP_PC_TASK_END_SUCC, end);
end.iTaskNum = plr->tasks[i];
if (!endTask(sock, plr->tasks[i]))
continue;
sock->sendPacket(end, P_FE2CL_REP_PC_TASK_END_SUCC);
}
}
}