mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-11-06 19:30:18 +00:00
Compare commits
10 Commits
landlock
...
8568fd1c46
| Author | SHA1 | Date | |
|---|---|---|---|
| 8568fd1c46 | |||
| 05a5303522 | |||
| 3365cb53b7 | |||
| 5e92a58134 | |||
| 94064e1865 | |||
| 5e73ff272d | |||
| 197ccad0eb | |||
|
|
68b56e7c25 | ||
|
|
cada1bcfd8 | ||
|
|
ca43a2996a |
4
.github/workflows/check-builds.yaml
vendored
4
.github/workflows/check-builds.yaml
vendored
@@ -29,7 +29,7 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: sudo apt install clang cmake snap -y && sudo snap install powershell --classic
|
run: sudo apt install clang cmake snap libsqlite3-dev -y && sudo snap install powershell --classic
|
||||||
- name: Check compilation
|
- name: Check compilation
|
||||||
run: |
|
run: |
|
||||||
$versions = "104", "728", "1013"
|
$versions = "104", "728", "1013"
|
||||||
@@ -113,7 +113,7 @@ jobs:
|
|||||||
|
|
||||||
copy-artifacts:
|
copy-artifacts:
|
||||||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
|
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
needs: [windows-build, ubuntu-build]
|
needs: [windows-build, ubuntu-build]
|
||||||
env:
|
env:
|
||||||
BOT_SSH_KEY: ${{ secrets.BOT_SSH_KEY }}
|
BOT_SSH_KEY: ${{ secrets.BOT_SSH_KEY }}
|
||||||
|
|||||||
11
.github/workflows/push-docker-image.yml
vendored
11
.github/workflows/push-docker-image.yml
vendored
@@ -11,11 +11,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
platforms:
|
|
||||||
- linux/amd64
|
|
||||||
- linux/arm64
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Retrieve major version
|
- name: Retrieve major version
|
||||||
@@ -31,11 +26,13 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Build and push the Docker image
|
- name: Build and push the Docker image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
platforms: ${{ matrix.platforms }}
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ secrets.DOCKERHUB_REPOSITORY }}:${{ github.ref_name }},${{ secrets.DOCKERHUB_REPOSITORY }}:${{ steps.split.outputs._0 }},${{ secrets.DOCKERHUB_REPOSITORY }}:latest
|
tags: ${{ secrets.DOCKERHUB_REPOSITORY }}:${{ github.ref_name }},${{ secrets.DOCKERHUB_REPOSITORY }}:${{ steps.split.outputs._0 }},${{ secrets.DOCKERHUB_REPOSITORY }}:latest
|
||||||
|
|||||||
10
Dockerfile
10
Dockerfile
@@ -1,5 +1,5 @@
|
|||||||
# build
|
# build
|
||||||
FROM debian:stable-slim as build
|
FROM debian:stable-slim AS build
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ COPY vendor ./vendor
|
|||||||
COPY .git ./.git
|
COPY .git ./.git
|
||||||
COPY Makefile CMakeLists.txt version.h.in ./
|
COPY Makefile CMakeLists.txt version.h.in ./
|
||||||
|
|
||||||
RUN make -j8
|
RUN make nosandbox -j$(nproc)
|
||||||
|
|
||||||
# prod
|
# prod
|
||||||
FROM debian:stable-slim
|
FROM debian:stable-slim
|
||||||
@@ -29,4 +29,8 @@ COPY sql ./sql
|
|||||||
|
|
||||||
CMD ["/bin/fusion"]
|
CMD ["/bin/fusion"]
|
||||||
|
|
||||||
LABEL Name=openfusion Version=0.0.2
|
EXPOSE 23000/tcp
|
||||||
|
EXPOSE 23001/tcp
|
||||||
|
EXPOSE 8001/tcp
|
||||||
|
|
||||||
|
LABEL Name=openfusion Version=1.6.0
|
||||||
|
|||||||
@@ -102,5 +102,8 @@ eventmode=0
|
|||||||
enabled=false
|
enabled=false
|
||||||
# the port to listen for connections on
|
# the port to listen for connections on
|
||||||
port=8003
|
port=8003
|
||||||
|
# The local IP to listen on.
|
||||||
|
# Do not change this unless you know what you're doing.
|
||||||
|
listenip=127.0.0.1
|
||||||
# how often the listeners should be updated (in milliseconds)
|
# how often the listeners should be updated (in milliseconds)
|
||||||
interval=5000
|
interval=5000
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
version: '3.4'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
openfusion:
|
openfusion:
|
||||||
image: openfusion
|
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./Dockerfile
|
dockerfile: ./Dockerfile
|
||||||
|
image: openfusion/openfusion:latest
|
||||||
volumes:
|
volumes:
|
||||||
- ./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
|
||||||
|
|||||||
@@ -478,6 +478,14 @@ void MobAI::deadStep(CombatNPC* npc, time_t currTime) {
|
|||||||
if (self->groupLeader == self->id)
|
if (self->groupLeader == self->id)
|
||||||
roamingStep(self, currTime);
|
roamingStep(self, currTime);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the mob hasn't fully despanwed yet, don't try to respawn it. This protects
|
||||||
|
* against the edge case where mobs with a very short regenTime would try to respawn
|
||||||
|
* before they've faded away; and would respawn even if they were meant to be removed.
|
||||||
|
*/
|
||||||
|
if (!self->despawned)
|
||||||
|
return;
|
||||||
|
|
||||||
if (self->killedTime != 0 && currTime - self->killedTime < self->regenTime * 100)
|
if (self->killedTime != 0 && currTime - self->killedTime < self->regenTime * 100)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -388,8 +388,21 @@ NPCPath* Transport::findApplicablePath(int32_t id, int32_t type, int taskID) {
|
|||||||
|
|
||||||
void Transport::constructPathNPC(int32_t id, NPCPath* path) {
|
void Transport::constructPathNPC(int32_t id, NPCPath* path) {
|
||||||
BaseNPC* npc = NPCManager::NPCs[id];
|
BaseNPC* npc = NPCManager::NPCs[id];
|
||||||
if (npc->kind == EntityKind::MOB)
|
|
||||||
((Mob*)(npc))->staticPath = true;
|
if (npc->kind == EntityKind::MOB) {
|
||||||
|
auto mob = (Mob*)npc;
|
||||||
|
mob->staticPath = true;
|
||||||
|
|
||||||
|
Vec3 firstPoint = path->points.front();
|
||||||
|
|
||||||
|
// Ensure that the first point coincides with the mob's spawn point.
|
||||||
|
if (mob->spawnX != firstPoint.x || mob->spawnY != firstPoint.y) {
|
||||||
|
std::cout << "[FATAL] The first point of the route for mob " << mob->id << " (type " << mob->type
|
||||||
|
<< ") does not correspond with its spawn point." << std::endl;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
npc->loopingPath = path->isLoop;
|
npc->loopingPath = path->isLoop;
|
||||||
|
|
||||||
// Interpolate
|
// Interpolate
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ void CNServer::removePollFD(int fd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CNServer::start() {
|
void CNServer::start() {
|
||||||
std::cout << "Starting server at *:" << port << std::endl;
|
std::cout << "Starting " << serverType << " server at *:" << port << std::endl;
|
||||||
while (active) {
|
while (active) {
|
||||||
// the timeout is to ensure shard timers are ticking
|
// the timeout is to ensure shard timers are ticking
|
||||||
int n = poll(fds.data(), fds.size(), 50);
|
int n = poll(fds.data(), fds.size(), 50);
|
||||||
|
|||||||
@@ -391,7 +391,7 @@ static bool landlock_detect() {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "[INFO] Landlock ABI version: " << abi << std::endl;
|
std::cout << "[INFO] Detected Landlock ABI version: " << abi << std::endl;
|
||||||
|
|
||||||
switch (abi) {
|
switch (abi) {
|
||||||
case 1:
|
case 1:
|
||||||
|
|||||||
@@ -180,9 +180,14 @@ SOCKET Monitor::init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
address.sin_family = AF_INET;
|
address.sin_family = AF_INET;
|
||||||
address.sin_addr.s_addr = INADDR_ANY;
|
|
||||||
address.sin_port = htons(settings::MONITORPORT);
|
address.sin_port = htons(settings::MONITORPORT);
|
||||||
|
|
||||||
|
if (!inet_pton(AF_INET, settings::MONITORLISTENIP.c_str(), &address.sin_addr)) {
|
||||||
|
std::cout << "Failed to set monitor listen address" << std::endl;
|
||||||
|
printSocketError("inet_pton");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
if (SOCKETERROR(bind(listener, (struct sockaddr*)&address, sizeof(address)))) {
|
if (SOCKETERROR(bind(listener, (struct sockaddr*)&address, sizeof(address)))) {
|
||||||
std::cout << "Failed to bind to monitor port" << std::endl;
|
std::cout << "Failed to bind to monitor port" << std::endl;
|
||||||
printSocketError("bind");
|
printSocketError("bind");
|
||||||
@@ -206,7 +211,7 @@ SOCKET Monitor::init() {
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "Monitor listening on *:" << settings::MONITORPORT << std::endl;
|
std::cout << "Monitor listening on " << settings::MONITORLISTENIP << ":" << settings::MONITORPORT << std::endl;
|
||||||
|
|
||||||
REGISTER_SHARD_TIMER(tick, settings::MONITORINTERVAL);
|
REGISTER_SHARD_TIMER(tick, settings::MONITORINTERVAL);
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ bool settings::DISABLEFIRSTUSEFLAG = true;
|
|||||||
// monitor settings
|
// monitor settings
|
||||||
bool settings::MONITORENABLED = false;
|
bool settings::MONITORENABLED = false;
|
||||||
int settings::MONITORPORT = 8003;
|
int settings::MONITORPORT = 8003;
|
||||||
|
std::string settings::MONITORLISTENIP = "127.0.0.1";
|
||||||
int settings::MONITORINTERVAL = 5000;
|
int settings::MONITORINTERVAL = 5000;
|
||||||
|
|
||||||
// event mode settings
|
// event mode settings
|
||||||
@@ -121,5 +122,6 @@ void settings::init() {
|
|||||||
IZRACESCORECAPPED = reader.GetBoolean("shard", "izracescorecapped", IZRACESCORECAPPED);
|
IZRACESCORECAPPED = reader.GetBoolean("shard", "izracescorecapped", IZRACESCORECAPPED);
|
||||||
MONITORENABLED = reader.GetBoolean("monitor", "enabled", MONITORENABLED);
|
MONITORENABLED = reader.GetBoolean("monitor", "enabled", MONITORENABLED);
|
||||||
MONITORPORT = reader.GetInteger("monitor", "port", MONITORPORT);
|
MONITORPORT = reader.GetInteger("monitor", "port", MONITORPORT);
|
||||||
|
MONITORLISTENIP = reader.Get("monitor", "listenip", MONITORLISTENIP);
|
||||||
MONITORINTERVAL = reader.GetInteger("monitor", "interval", MONITORINTERVAL);
|
MONITORINTERVAL = reader.GetInteger("monitor", "interval", MONITORINTERVAL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ namespace settings {
|
|||||||
extern int EVENTMODE;
|
extern int EVENTMODE;
|
||||||
extern bool MONITORENABLED;
|
extern bool MONITORENABLED;
|
||||||
extern int MONITORPORT;
|
extern int MONITORPORT;
|
||||||
|
extern std::string MONITORLISTENIP;
|
||||||
extern int MONITORINTERVAL;
|
extern int MONITORINTERVAL;
|
||||||
extern bool DISABLEFIRSTUSEFLAG;
|
extern bool DISABLEFIRSTUSEFLAG;
|
||||||
extern bool IZRACESCORECAPPED;
|
extern bool IZRACESCORECAPPED;
|
||||||
|
|||||||
Reference in New Issue
Block a user