mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-09-11 01:00:02 +00:00
Compare commits
7 Commits
ecc3e7731c
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9e5ec2fd6 | ||
|
|
0639bf2ae8 | ||
|
|
ed3bf6a952 | ||
|
|
c7bccd62c6 | ||
|
574d3111bc
|
|||
|
424f83ed94
|
|||
|
cd7caafec7
|
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
**/*.o
|
||||||
9
.github/workflows/check-builds.yaml
vendored
9
.github/workflows/check-builds.yaml
vendored
@@ -84,11 +84,8 @@ jobs:
|
|||||||
Invoke-Expression "vcpkg integrate install"
|
Invoke-Expression "vcpkg integrate install"
|
||||||
|
|
||||||
foreach ($version in $versions) {
|
foreach ($version in $versions) {
|
||||||
if (Test-Path -LiteralPath "build") {
|
$buildDir = "build-$version"
|
||||||
Remove-Item "build" -Recurse
|
Invoke-Expression "cmake -B $buildDir -DPROTOCOL_VERSION=$version -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||||
Write-Output "Deleted existing build folder"
|
|
||||||
}
|
|
||||||
Invoke-Expression "cmake -B build -DPROTOCOL_VERSION=$version -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
|
||||||
if ($LASTEXITCODE -ne "0") {
|
if ($LASTEXITCODE -ne "0") {
|
||||||
Write-Error "cmake generation failed for version $version" -ErrorAction Stop
|
Write-Error "cmake generation failed for version $version" -ErrorAction Stop
|
||||||
}
|
}
|
||||||
@@ -96,7 +93,7 @@ jobs:
|
|||||||
|
|
||||||
foreach ($configuration in $configurations) {
|
foreach ($configuration in $configurations) {
|
||||||
Write-Output "Building version $version $configuration"
|
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") {
|
if ($LASTEXITCODE -ne "0") {
|
||||||
Write-Error "msbuild build failed for version $version" -ErrorAction Stop
|
Write-Error "msbuild build failed for version $version" -ErrorAction Stop
|
||||||
}
|
}
|
||||||
|
|||||||
26
Dockerfile
26
Dockerfile
@@ -1,36 +1,34 @@
|
|||||||
# build
|
# build
|
||||||
FROM alpine:3 as build
|
FROM debian:trixie-slim as build
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
RUN apk update && apk upgrade && apk add \
|
RUN apt update && apt upgrade -y && apt install -y \
|
||||||
linux-headers \
|
|
||||||
git \
|
git \
|
||||||
clang18 \
|
clang \
|
||||||
make \
|
build-essential \
|
||||||
sqlite-dev
|
libsqlite3-dev
|
||||||
|
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
COPY vendor ./vendor
|
COPY vendor ./vendor
|
||||||
COPY .git ./.git
|
COPY .git ./.git
|
||||||
COPY Makefile CMakeLists.txt version.h.in ./
|
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)
|
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
|
# prod
|
||||||
FROM alpine:3
|
FROM debian:trixie-slim
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
RUN apk update && apk upgrade && apk add \
|
RUN apt update && apt upgrade -y && apt install -y \
|
||||||
libstdc++ \
|
libsqlite3-dev
|
||||||
sqlite-dev
|
|
||||||
|
|
||||||
COPY --from=build /usr/src/app/bin/fusion /bin/fusion
|
COPY --from=build /usr/src/app/bin/fusion /bin/fusion
|
||||||
COPY sql ./sql
|
|
||||||
|
|
||||||
CMD ["/bin/fusion"]
|
CMD ["/bin/fusion"]
|
||||||
|
|
||||||
|
|||||||
1
build_docker.sh
Executable file
1
build_docker.sh
Executable file
@@ -0,0 +1 @@
|
|||||||
|
docker build --target=export --output=./bin .
|
||||||
@@ -8,6 +8,7 @@ services:
|
|||||||
- ./config.ini:/usr/src/app/config.ini
|
- ./config.ini:/usr/src/app/config.ini
|
||||||
- ./database.db:/usr/src/app/database.db
|
- ./database.db:/usr/src/app/database.db
|
||||||
- ./tdata:/usr/src/app/tdata
|
- ./tdata:/usr/src/app/tdata
|
||||||
|
- ./sql:/usr/src/app/sql
|
||||||
ports:
|
ports:
|
||||||
- "23000:23000"
|
- "23000:23000"
|
||||||
- "23001:23001"
|
- "23001:23001"
|
||||||
|
|||||||
@@ -595,30 +595,33 @@ void Missions::mobKilled(CNSocket *sock, int mobid, std::map<int, int>& rolls) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// drop quest item
|
// drop quest item
|
||||||
if (task["m_iCSUItemNumNeeded"][j] != 0 && !isQuestItemFull(sock, task["m_iCSUItemID"][j], task["m_iCSUItemNumNeeded"][j]) ) {
|
if (task["m_iCSUItemNumNeeded"][j] != 0) {
|
||||||
bool drop = rolls[plr->tasks[i]] % 100 < task["m_iSTItemDropRate"][j];
|
if (!isQuestItemFull(sock, task["m_iCSUItemID"][j], task["m_iCSUItemNumNeeded"][j])) {
|
||||||
if (drop) {
|
bool drop = rolls[plr->tasks[i]] % 100 < task["m_iSTItemDropRate"][j];
|
||||||
dropQuestItem(sock, plr->tasks[i], 1, task["m_iCSUItemID"][j], mobid);
|
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);
|
|
||||||
}
|
}
|
||||||
} else {
|
else {
|
||||||
// fail to drop (itemID == 0)
|
// fail to drop (itemID == 0)
|
||||||
dropQuestItem(sock, plr->tasks[i], 1, 0, mobid);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user