Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
3fa70bd
update copyright date, version, changelog
ennorehling Apr 6, 2026
86b26fb
Docker build container (#1137)
ennorehling Apr 11, 2026
b8ff005
adding a lua binding for eressea's c side rng_init function as rng.se…
oddluminari Apr 16, 2026
ef7caa4
Custom config and rules (#1139)
ennorehling Apr 18, 2026
ce97830
prevent crash in sp_stun
ennorehling Apr 19, 2026
1f12295
simplify and add lightness
ennorehling Apr 19, 2026
fb2071a
fix CI build
ennorehling Apr 19, 2026
1d15bdd
no need to take address here.
ennorehling Apr 23, 2026
c5bbc95
setting config.install is not optional
ennorehling Apr 25, 2026
4be0589
docker sets the install directory in env
ennorehling Apr 25, 2026
af59bb1
Default UID and GID
ennorehling Apr 25, 2026
d40e427
avoid password changes for new factions.
ennorehling Apr 25, 2026
d393821
solve initial password confusion
ennorehling Apr 25, 2026
70db00e
typo in comment
ennorehling Apr 25, 2026
10bc585
remove junk from start-container script
ennorehling Apr 25, 2026
be664a0
if script is missing, try falling back to built-ins
ennorehling Apr 25, 2026
a9e8e22
start-container sets ERESSEA_INSTALL
ennorehling Apr 25, 2026
067314a
fix LUA_PATH for tests
ennorehling Apr 25, 2026
d2e580d
set LUA_PATH for cmake tests
ennorehling Apr 25, 2026
f69501a
debug the lua tests, fix CTest environment
ennorehling Apr 26, 2026
544025d
upgrade actions/checkout
ennorehling Apr 26, 2026
1641c6a
Setting LUA_PATH in cron jobs
ennorehling Apr 26, 2026
f6943a6
include ?/init.lua in LUA_PATH
ennorehling Apr 26, 2026
d4d70a0
set LUA_PATH in the preview script
ennorehling Apr 26, 2026
da940c0
use @example.com for sample emails
ennorehling Apr 28, 2026
9a587a7
gitignore clangd cache directory
oddluminari Apr 29, 2026
f204c16
additional tests for sp_break_curse.
ennorehling May 1, 2026
796c6cf
Merge pull request #1141 from oddluminari/compat/clangd-cache-gitignore
ennorehling May 1, 2026
2791fac
bug 3098: remove charm effect when it is dispelled
ennorehling May 2, 2026
c4e12fb
Additional testing for ct_firewall
ennorehling May 2, 2026
1077547
Merge pull request #1143 from eressea/break_curse
ennorehling May 2, 2026
85f63fa
make autoseed deal with different kinds of whitespace
ennorehling May 7, 2026
384a1eb
vscode devcontainer
ennorehling May 7, 2026
f6614ad
let autoseed rules be set externally
ennorehling May 7, 2026
8eff826
sample game
ennorehling May 7, 2026
5bfe394
devcontainer file didn't work
ennorehling May 7, 2026
d5e11d8
README: add luarocks+lunit instructions
ennorehling May 7, 2026
672bbff
Merge branch 'master' into develop
ennorehling May 17, 2026
92e438c
Merge branch 'master' into develop
ennorehling May 22, 2026
cc22bbd
log more errors
ennorehling May 22, 2026
c7eebbc
Bug 3105: Partei fehlt in CR und Adressliste (#1144)
ennorehling May 25, 2026
cbe7c33
prepare a release 3.1
ennorehling Aug 25, 2026
14d5061
Merge branch 'master' into release
ennorehling Aug 25, 2026
dda9b0a
license change, AI policy
ennorehling Aug 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git

8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## local user and group ids
WWWGROUP=1337
WWWUSER=1337

LOCALE=en_US

## cmake build flags
CMAKE_BUILD_TYPE=Release
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ tests/config.lua
*.mo
/.vs
/.idea/
.env
.env*
/tests/data/test.dat
.cache/clangd
20 changes: 20 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
AI must not be used to generate code for contributions to this project.

"AI" in this case means a Large Language Model ("LLM"), such as ChatGPT,
Claude, Copilot, Grok, etc.

AI-generated code is based upon sources of unknown origins and may not be
compatible with the Zlib license, or may introduce conflicting license terms
if they include code from other projects.

AI can be used to identify issues with contributions to this project, but the
solutions to those issues should be authored by humans.

We have found that AI will frequently hallucinate issues that are not actually
problems in practice, report incorrect information, and describe problems that
are actually not issues at all. If AI identifies a problem with this codebase,
please make sure you understand what it is saying and have independently
confirmed that the issue exists before submitting a bug report or pull request.

Any pull request to this project will ask you to confirm that you are the
author and that you are contributing your changes under the Zlib license.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 31.0
- Es wurde ein Bug gefixt, der bei Orks das Lernen von
Kampftalenten verlangsamt hat, nicht nur das von allen
anderen.
- Wenn in einem Kampf zwei Heere gleich gute Taktiker haben,
dann ist die Chance, von einem Kämpfer aus dem jeweils
anderen Heer getroffen zu werden nach der neuen Taktikregel
Null. Das hat allerdings nur für Angriffe mit einer Waffe
gegolten, und z.B. nicht für magische Attacken.
- Die Schneekugel macht aus Feuerwänden keine Vulkane mehr.
- Fehler im Gesang der Versklavung, der bei besonders großen
Ziel-Einheiten deren Magieresistenz ausgeschaltet hat.

# 30.4.1
- Verzauberungen, die eigene Daten speichern, müssen Speicher
reservieren, in den sie sie laden (null-pointer crash).
Expand Down
22 changes: 22 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
AI must not be used to generate code for contributions to this project.

"AI" in this case means a Large Language Model ("LLM"), such as ChatGPT,
Claude, Copilot, Grok, etc.

AI-generated code is based upon sources of unknown origins and may not be
compatible with the Zlib license, or may introduce conflicting license terms
if they include code from other projects.

AI can be used to identify issues with contributions to this project, but the
solutions to those issues should be authored by humans.

We have found that AI will frequently hallucinate issues that are not actually
problems in practice, report incorrect information, and describe problems that
are actually not issues at all. If AI identifies a problem with this codebase,
please make sure you understand what it is saying and have independently
confirmed that the issue exists before submitting a bug report or pull request.

Any pull request to this project will ask you to confirm that you are the
author and that you are contributing your changes under the Zlib license.


157 changes: 157 additions & 0 deletions DOCKER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# Overview

At this point, the container can mount a game directory from the host, and run the server with a given script like so:
```bash
docker run -v $HOME/eressea/game:/data eressea/server:v1 myscript.lua
```

This mounts the host's `game` directory as a data volume in the container, and the server operated on the files in there, i.e. game data and reports go here.
The script can either be on the data volume, or one of the pre-made scripts in the scripts directory, like newgame.lua, reports.lua, or run-turn.lua. These get copied to /usr/local/share/eressea/scripts during the build process.

## Official Image

If you don't want to build the image yourself, use the latest official image from
the container registry:

```bash
docker pull ghcr.io/eressea/server:latest
```

# Installation (using Docker)

If you want to build the image yourself, because you're planning to make
changes to the source code, follow these steps.

## Install Docker (with compose plugin)

* Debian users, follow https://linuxize.com/post/how-to-install-docker-on-debian-13/
* Ubuntu users, follow https://linuxiac.com/how-to-install-docker-on-ubuntu-24-04-lts/

## Building the image from source

### Clone the Repository

```bash
$ git clone -b develop https://github.com/eressea/server.git ~/eressea/source
$ cd ~/eressea/source
$ git submodule update --init
```

### Configuration

Copy .env.example to .env and modify it. The most importent bit here is using the
same uid and gid as your local user on the host, so files can be shared easily. Use
the id command to find your own values:

```sh
$ id
uid=1000(enno) gid=1000(enno) groups=1000(enno),4(adm),27(sudo),100(users),107(netdev),989(docker)
```

I am enno, my uid is 1000, and my default gid is also 1000. The eressea user in the
container uses 1337 by default, but if I want it to use 1000, that can be achieved
by changing the .env file like this:

```ini
## local user and group ids
WWWGROUP=1000
WWWUSER=1000

LOCALE=en_US

## cmake build flags
CMAKE_BUILD_TYPE=Release
```

You can also change the locale, which will give you system errors in a different language.

### Building the image

Before we can run a container, we need to first build the image. Use
the command `docker compose build` to do that. When you're done,
`docker image ls` should contain the eressea/server:v1 image.


## Create a game directory and a tiny world.

The following steps assume you're using the official image.
If you built your oen image, I recommend that you tag it to
follow along:

```bash
docker image tag eressea/server:v1 eressea/server:latest
```

Create a directory for your first game:

```bash
cd ~/eressea
mkdir game
# for convenience, alias the "docker run" command
alias eressea='docker run -ti -e TERM -v $HOME/eressea/game:/data eressea/server:v1'
eressea newgame.lua
```

After this, your ~/eressea/game directory contains some new files:

`data/0.dat` is a game file that contains a single-hex island with some ocean around it. There are no players in this world (yet).

`eressea.ini` contains a game configuration with sensible defaults for
a game with the E2 ruleset. Modify this with your own email address and
a different ruleset, if you want to. The only built-in rulesets you can choose from are e2 and e3.

## Let's Play
Now let's add a faction to our world and write initial reports.

in the game directory, add a short Lua program named start.lua:
```lua
require 'config'
eressea.read_game('0.dat')
r = get_region(0, 0)
f = faction.create('orc', 'orcs@example.com', 'de')
u = unit.create(f, r)
init_reports()
write_reports()
eressea.write_game(get_turn() .. '.dat')
```

Execute this program:
```
eressea start.lua
```
You should now have reports for your initial faction in the game/reports
directory!

If you would like to use the GM Mapper, you can start that with the built-in map.lua program, just run `eressea map.lua`.

## Custom Rulesets

You can choose to make your own rules, too! Just make the following modifications to your eressea.ini :
```ini
[lua]
;rules = e2
config = rules.json
```
This will instruct the game to not use the e2 ruleset, but a rules.json
file from your game directory. This file could look like this:
```json
{
"settings": {
"game.name": "Discworld",
"game.start": 0
},
"include": [
"config://conf/keywords.json",
"config://conf/calendar.json",
"config://conf/e2/locales.json",
"config://conf/e2/terrains.json",
"config://conf/e2/items.json",
"config://res/eressea/races.xml",
"config://custom/terrains.json",
"config://custom/strings.de.po"
]
}
```
Here, we are instructing the game to borrow some rules from the core game,
like the names of keywords, the calendar, and the races. We also borrow the translations, terrains and items from E2. In addition, we include our own terrains and translations from the game/custom directoory. For their strucuture, refer to the original files and make your own changes!

66 changes: 66 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
FROM ubuntu:24.04 AS build

RUN apt update && \
apt install --no-install-recommends -y \
software-properties-common build-essential gcc cmake \
liblua5.2-dev libtolua-dev libncurses5-dev libsqlite3-dev \
libcjson-dev libiniparser-dev libexpat1-dev libutf8proc-dev

WORKDIR /workspace

COPY CMakeLists.txt eressea/
COPY cmake/ eressea/cmake/
COPY src/ eressea/src/
COPY include/ eressea/include/
COPY storage/ eressea/storage/
COPY clibs/ eressea/clibs/
COPY crpat/ eressea/crpat/
COPY tools/ eressea/tools/
COPY process/CMakeLists.txt eressea/process/

ENV CMAKE_MODULE_PATH=/workspace/eressea/cmake/Modules

RUN cd eressea && ls --recursive /workspace
RUN cd eressea && mkdir -p build
RUN cd eressea/build && cmake ..
RUN cd eressea/build && make

FROM ubuntu:24.04

ARG WWWGROUP=1337
ARG WWWUSER=1337
ARG LOCALE=en_US

ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && apt install --no-install-recommends -y \
locales libcjson1 \
liblua5.2-0 libsqlite3-0 \
libiniparser1 libexpat1 libutf8proc3
RUN echo "$LOCALE.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen

ENV LC_ALL=$LOCALE.UTF-8
ENV LANG=$LOCALE.UTF-8
ENV LANGUAGE=$LOCALE:en
ENV ERESSEA_INSTALL=/usr/local/share/eressea

RUN userdel -r ubuntu
RUN groupadd --force -g $WWWGROUP eressea
RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u $WWWUSER eressea

COPY --from=build /workspace/eressea/build/eressea /usr/local/bin/
COPY scripts/ /usr/local/share/eressea/scripts/
COPY conf/ /usr/local/share/eressea/conf/
COPY res/ /usr/local/share/eressea/res/
RUN chmod -R g+rx,o+rx /usr/local/share/eressea

COPY docker/start-container /usr/local/bin/start-container
RUN chmod 755 /usr/local/bin/start-container

USER $WWWUSER:$WWWGROUP

WORKDIR /data

VOLUME ["/data"]

ENTRYPOINT ["/usr/local/bin/start-container"]
20 changes: 16 additions & 4 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
Copyright (c) 1998-2022, Enno Rehling <enno@eressea.de>
Copyright (c) 1998-2026, Enno Rehling <enno@eressea.de> and others.

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Eressea is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

* [![License Text](https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png)](http://creativecommons.org/licenses/by-nc-sa/4.0/)
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Eressea depends on a number of external libraries. On a recent
Debian-based Linux system, this is the apt-get command to
install all of them:

sudo apt-get install git cmake gcc make luarocks \
sudo apt-get install git cmake gcc make \
liblua5.2-dev libtolua-dev libncurses5-dev libsqlite3-dev \
libcjson-dev libiniparser-dev libexpat1-dev libutf8proc-dev

Expand All @@ -34,6 +34,21 @@ Here's how you clone and build the source on Linux or macOS:
If you got this far and all went well, you have built the server, and
it will have passed some basic functionality tests.

### Testing

If you plan to do any development, there is also a whole suite of Lua tests
that require the [lunit](https://github.com/dcurrie/lunit) unit testing framework.
This is best installed using the luarocks package manager:
```
sudo apt-get install lua5.2 luarocks
luarocks config lua_version 5.2
luarocks config variables.LUA_INCDIR /usr/include/lua5.2
luarocks install --local lunitx
```

You should now be able to run the `s/runtests` script, which will execute
all the tests.

* [![Static Analysis](https://scan.coverity.com/projects/6742/badge.svg?flat=1)](https://scan.coverity.com/projects/6742/)
* [![Build Status](https://api.travis-ci.org/eressea/server.svg?branch=develop)](https://travis-ci.org/eressea/server)
* [![License: CC BY-NC-SA 4.0](https://licensebuttons.net/l/by-nc-sa/4.0/80x15.png)](http://creativecommons.org/licenses/by-nc-sa/4.0/)
Expand Down Expand Up @@ -78,7 +93,7 @@ in "args". On my own computer, the configuration looks like this:
"currentDir": "${env.ERESSEA_ROOT}",
"env": {
"ERESSEA_ROOT": "${workspaceRoot}",
"LUA_PATH": "${workspaceRoot}\\scripts\\?.lua;${env.LUA_PATH}"
"LUA_PATH": "${workspaceRoot}\\scripts\\?.lua;${workspaceRoot}\\scripts\\?\\init.lua;${env.LUA_PATH}"
},
"name": "eressea.exe"
},
Expand All @@ -95,6 +110,6 @@ in "args". On my own computer, the configuration looks like this:
Note that I have an environment variable for my game directory called ERESSEA_ROOT. My LUA_PATH also contains the luarocks installation.

```
LUA_PATH=C:\Users\Enno\AppData\Roaming\Luarocks\share\lua\5.4\?.lua
LUA_PATH=C:\Users\Enno\AppData\Roaming\Luarocks\share\lua\5.4\?.lua;C:\Users\Enno\AppData\Roaming\Luarocks\share\lua\5.4\?\init.lua
ERESSEA_ROOT C:\Users\Enno\Documents\Eressea\test
```
16 changes: 16 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:
server:
build:
context: .
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP:-1337}'
WWWUSER: '${WWWUSER:-1337}'
CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE:-Release}'
LOCALE: '${LOCALE:-en_US}'
image: eressea/server
hostname: eressea
environment:
WWWUSER: '${WWWUSER:-1337}'
WWWGROUP: '${WWWGROUP:-1337}'
CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE:-Release}'
Loading