Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor epasswd stuff #922

Open
wants to merge 55 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
eed5d81
Merge branch 'master' of github.com:eressea/server
ennorehling Aug 3, 2020
2276a2f
fix NOTLOST items lost in battle
stm2 Sep 12, 2018
12ce088
fix tests for parsing single-letter keywords.
ennorehling Jun 16, 2020
b780bf9
remove legacy filereader code
ennorehling Jun 7, 2020
140eebc
Bug 2670 trim   and others from strings.
ennorehling Jun 7, 2020
2286c8d
bug 2673 ignore commands that have fewer than 2 characters.
ennorehling Jun 15, 2020
98c7b2e
update default version number
ennorehling Jun 15, 2020
0032486
install lunitx only once
ennorehling Jun 26, 2020
f3859be
Durch GIB "leer" gewordene Schiffe können nicht sinken.
ennorehling Jun 27, 2020
2a2c731
bug 2674 send message to player, not monsters
ennorehling Jun 27, 2020
13ed69e
bug 2674 fix null-ptr deref
ennorehling Jun 27, 2020
f726176
Lighthouse shows roads in both CR and NR.
ennorehling Jun 27, 2020
08becab
accept some selected changes from stm2's script rewrite.
ennorehling Jun 27, 2020
5a2dc76
delete obsolete scripts, shellcheck the rest
ennorehling Jun 27, 2020
6e3aef4
make coverity understand that there is no buffer overflow here.
ennorehling Jun 27, 2020
513cb40
stop showing unhandled keycodes in status
ennorehling Jun 27, 2020
672a22e
bug 2678: fix trade_needs_castle
ennorehling Jul 4, 2020
5cc9ce6
Bug 2679: Nur Bergwächter bewachen Eisen.
ennorehling Jul 5, 2020
e1a65a8
Bug 2680: shapeshift spell cannot be cast twice.
ennorehling Jul 7, 2020
34e842a
empty convoys cannot be built on.
ennorehling Jul 12, 2020
78f0b28
Bug 2683: fix buildings with size 0
ennorehling Jul 16, 2020
b73d1bc
Bug 2668 Spruchstärke Ritual der Aufnahme
ennorehling Jul 16, 2020
2a093ba
make it impossible to create buildings with size 0
ennorehling Jul 17, 2020
590daf2
fake wormhole in test had negative size
ennorehling Jul 17, 2020
df134e9
Allow alternative names for some spells.
ennorehling Jul 17, 2020
08a4a80
Finish spell renaming, remove wdw leftovers.
ennorehling Jul 18, 2020
31e8df2
Alle Startregionen sind Wälder mit festen Werten.
ennorehling Jul 19, 2020
0fca728
Bug 2684 Astraler Blick
ennorehling Jul 25, 2020
a4837c9
New message for spells that cannot be cast in astral space.
ennorehling Jul 26, 2020
f90e4f5
bug 2684: update sp_showastral and sp_viewreality.
ennorehling Jul 26, 2020
6df7bb2
Bug 2685: magic resistance goblins and insects
ennorehling Jul 26, 2020
27653a4
fix parser crash from turn 1179
ennorehling Jul 26, 2020
ad96016
test for new parser behavior.
ennorehling Jul 26, 2020
ac3060e
bug 2660 delayed canibalism
ennorehling Jul 26, 2020
5615dda
small bug: argument is not const.
ennorehling Jul 26, 2020
df036d8
Bug 2621: Fehlermeldung bei fehlender Anzahl
ennorehling Jul 26, 2020
c0babd4
report 2682: simplify tree growth
ennorehling Jul 29, 2020
a5f457a
tree growth is rounded up.
ennorehling Jul 30, 2020
83ecf39
spotting monsters from lighthouses
ennorehling Aug 4, 2020
dff0364
quick performance improvement for scale_number
ennorehling Aug 4, 2020
5cdabd3
update test for lighthouse visibility
ennorehling Aug 4, 2020
e426da7
Merge pull request #921 from eressea/bug-2688
ennorehling Aug 4, 2020
05f60f5
Merge branch 'develop' of github.com:eressea/server into develop
ennorehling Aug 4, 2020
9999847
Lighthouse: only show large swimming units (more than 10 weight).
ennorehling Aug 5, 2020
4b96046
Reduce weight limit, lighthouses also show all dragons.
ennorehling Aug 5, 2020
aeca118
https://bugs.eressea.de/view.php?id=2689
ennorehling Aug 6, 2020
7251ef5
https://bugs.eressea.de/view.php?id=2658
ennorehling Aug 7, 2020
52a875d
https://bugs.eressea.de/view.php?id=2629
ennorehling Aug 7, 2020
8165673
https://bugs.eressea.de/view.php?id=2676
ennorehling Aug 8, 2020
7f148dc
https://bugs.eressea.de/view.php?id=2638
ennorehling Aug 8, 2020
a618b58
https://bugs.eressea.de/view.php?id=2572
ennorehling Aug 8, 2020
ad4cb9b
Parser fallback to latin1 when detecting invalid utf-8
ennorehling Aug 9, 2020
31c1b07
git pull with rebase
ennorehling Aug 10, 2020
ca5cdd1
refactor epasswd stuff
apexo Aug 10, 2020
f0c1eaf
b/f
apexo Aug 10, 2020
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
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ indent_size = 4

[*.{xml,json}]
charset = utf-8
indent_size = 2

# Tab indentation (no size specified)
[Makefile]
Expand Down
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
# What is this?

This repository contains the source code for the Play-by-Mail strategy game [Eressea](http://www.eressea.de/).
This repository contains the source code for the Play-by-Mail
strategy game [Eressea](http://www.eressea.de/).

# Prerequisites

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:
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 libxml2-dev liblua5.2-dev libtolua-dev libncurses5-dev libsqlite3-dev luarocks
sudo apt-get install git cmake gcc make luarocks libxml2-dev \
liblua5.2-dev libtolua-dev libncurses5-dev libsqlite3-dev

# How to check out and build the Eressea server

This repository relies heavily on the use of submodules, and it pulls in most of the code from those. The build system being used is cmake, which can create Makefiles on Unix, or Visual Studio project files on Windows. Here's how you clone and build the source on Ubuntu:
This repository relies heavily on the use of submodules, and it pulls in
most of the code from those. The build system being used is cmake, which
can create Makefiles on Unix, or Visual Studio project files on Windows.
Here's how you clone and build the source on Linux or macOS:

git clone --recursive git://github.com/eressea/server.git
cd server
./configure
./s/build
git clone --recursive git://github.com/eressea/server.git source
cd source
git submodule update --init
s/build

If you got this far and all went well, you have built a server (it is linked from the `game` subdirectory), and it will have passed some basic functionality tests.
If you got this far and all went well, you have built the server, and
it will have passed some basic functionality 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)
Expand Down
41 changes: 32 additions & 9 deletions conf/e2/locales.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
{
"include": [
"config://res/translations/strings.de.po",
"config://res/translations/strings-e2.de.po",
"config://res/translations/strings.en.po",
"config://res/translations/strings-e2.en.po",
"config://res/translations/messages.de.po",
"config://res/translations/messages.en.po",
"config://res/core/messages.xml"
]
"include": [
"config://res/translations/strings.de.po",
"config://res/translations/strings-e2.de.po",
"config://res/translations/strings.en.po",
"config://res/translations/strings-e2.en.po",
"config://res/translations/messages.de.po",
"config://res/translations/messages.en.po",
"config://res/core/messages.xml"
],
"aliases": {
"de": {
"spell::earthquake": [
"Beschwöre einen Erdelementar",
"Beschwörung eines Erdelementares"
],
"spell::goodwinds": [
"Beschwörung eines Wasserelementares",
"Beschwöre einen Wasserelementar"
],
"spell::stormwinds": [
"Beschwöre einen Sturmelementar",
"Beschwörung eines Sturmelementares"
],
"spell::summonfireelemental": [
"Beschwöre einen Hitzeelementar",
"Beschwörung eines Hitzeelementares"
]
},
"en": {
"spell::migration": "Rit of Acceptance"
}
}
}
2 changes: 0 additions & 2 deletions conf/e2/terrains.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@
}
},
"firewall": {
"size": 100,
"road": 250,
"flags": [ "forbidden" ]
},
"fog": {
Expand Down
18 changes: 9 additions & 9 deletions conf/e3/locales.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"include": [
"config://res/translations/strings.de.po",
"config://res/translations/strings-e3.de.po",
"config://res/translations/messages.de.po",
"config://res/translations/strings.en.po",
"config://res/translations/strings-e3.en.po",
"config://res/translations/messages.en.po",
"config://res/core/messages.xml"
]
"include": [
"config://res/translations/strings.de.po",
"config://res/translations/strings-e3.de.po",
"config://res/translations/messages.de.po",
"config://res/translations/strings.en.po",
"config://res/translations/strings-e3.en.po",
"config://res/translations/messages.en.po",
"config://res/core/messages.xml"
]
}
2 changes: 2 additions & 0 deletions conf/keywords.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"plant": "PLANT",
"grow": [ "GROW", "BREED" ],
"promote": ["PROMOTE", "PROMOTION" ],
"locale": ["LANGUAGE", "LOCALE"],
"combat": [ "COMBAT", "FIGHT" ]
},
"de": {
Expand Down Expand Up @@ -65,6 +66,7 @@
"alliance": "ALLIANZ",
"claim": ["BEANSPRUCHE", "BEANSPRUCHEN"],
"promote": ["BEFÖRDERE", "BEFÖRDERUNG"],
"locale": ["SPRACHE", "LOCALE"],
"pay": ["BEZAHLE", "BEZAHLEN"]
}
}
Expand Down
20 changes: 7 additions & 13 deletions process/checkpasswd.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,14 @@ def log(str):
if mypasswd[0] == '"':
mypasswd = mypasswd.strip('"')

pw_data = EPasswd()
try:
pw_data.load_database(filename)
log("loaded from db " + filename)
except:
pw_data.load_file(filename)
log("loaded from file " + filename)
pw_data = EPasswd.load_any(filename, log=log)
faction = pw_data.get_faction(myfaction)

if pw_data.fac_exists(myfaction):
if pw_data.check(myfaction, mypasswd):
log("password match: " + myfaction)
sys.exit(0)
if not faction:
log("faction missing: " + myfaction)
elif not faction.check_passwd(mypasswd):
log("password mismatch: " + myfaction)
else:
log("faction missing: " + myfaction)

log("password match: " + myfaction)
sys.exit(0)
sys.exit(-1)
2 changes: 1 addition & 1 deletion process/compress.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

addr=%(email)s
[ $# -ge 1 ] && addr=$1
[ -z $addr ] || send-%(compression)s-report $addr '%(gamename)s Report #%(turn)s' %(files)s
[ -z $addr ] || $ERESSEA/server/bin/send-%(compression)s-report $addr '%(gamename)s Report #%(turn)s' %(files)s
"""

turn = argv[1]
Expand Down
6 changes: 4 additions & 2 deletions process/compress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ if [ -z "$ERESSEA" ]; then
exit 2
fi

BINDIR="$ERESSEA/server/bin"

GAME="$ERESSEA/game-$1"
GAME_NAME=$(grep -w name "$GAME/eressea.ini" | sed 's/.*=\s*//')
GAME_NAME=$("$BINDIR/inifile" "$GAME/eressea.ini" get game:name)

TURN=$2
if [ -z "$TURN" ]
Expand All @@ -20,6 +22,6 @@ if [ ! -d "$GAME/reports" ]; then
fi

cd "$GAME/reports" || exit
"$ERESSEA/server/bin/compress.py" "$TURN" "$GAME_NAME"
"$BINDIR/compress.py" "$TURN" "$GAME_NAME"
cd - || exit

14 changes: 11 additions & 3 deletions process/cron/orders.cron
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@
# this here script to make a non-blocking syntax check and reject or
# accept the order file.

if [ "yes" != "$CONFIRM" ] ; then
if [ "no" == "$CONFIRM" ] ; then
exit
fi

for GAME in $*
if [ -z "$ERESSEA" ] ; then
ERESSEA="$HOME/eressea"
echo "The ERESSEA environment variable is not set. Assuming $ERESSEA."
fi

cd "$ERESSEA" || exit

for GAME in "$@"
do
$HOME/eressea/orders-php/check-orders.sh $GAME
orders-php/check-orders.sh "$GAME"
done

2 changes: 1 addition & 1 deletion process/cron/preview.cron
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[ "$PREVIEW" != "yes" ] && exit
[ -z "${ERESSEA}" ] && ERESSEA="$HOME/eressea"

eval $(luarocks path)
eval "$(luarocks path)"
branch="develop"
if [ -e "${ERESSEA}/build/.preview" ]; then
branch=$(cat "${ERESSEA}/build/.preview")
Expand Down
44 changes: 22 additions & 22 deletions process/cron/run-eressea.cron
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
#!/bin/bash

eval $(luarocks path)
eval "$(luarocks path)"
GAME=$1
(
[ "$ENABLED" != "yes" ] && exit
[ -z ${ERESSEA} ] && ERESSEA=$HOME/eressea
[ "$ENABLED" == "no" ] && exit
[ -z "$ERESSEA" ] && ERESSEA="$HOME/eressea"

export ERESSEA
BIN=$ERESSEA/server/bin
TURN=$(cat $ERESSEA/game-$GAME/turn)
if [ ! -e $ERESSEA/game-$GAME/data/$TURN.dat ]; then
BIN="$ERESSEA/server/bin"
TURN=$(cat "$ERESSEA/game-$GAME/turn")
if [ ! -e "$ERESSEA/game-$GAME/data/$TURN.dat" ]; then
echo "data file $TURN is missing, cannot run turn for game $GAME"
exit 1
fi
REPORTS=$ERESSEA/game-$GAME/reports
if [ -d $REPORTS ]; then
rm -rf $REPORTS
REPORTS="$ERESSEA/game-$GAME/reports"
if [ -d "$REPORTS" ]; then
rm -rf "$REPORTS"
fi
mkdir $REPORTS
mkdir "$REPORTS"

cd $ERESSEA/game-$GAME
cd "$ERESSEA/game-$GAME" || exit

if [ -d test ]; then
touch test/execute.lock
fi

$BIN/create-orders $GAME $TURN
if [ ! -s $ERESSEA/game-$GAME/orders.$TURN ]; then
"$BIN/create-orders" "$GAME" "$TURN"
if [ ! -s "$ERESSEA/game-$GAME/orders.$TURN" ]; then
echo "server did not create orders for turn $TURN in game $GAME"
exit 2
fi

$BIN/backup-eressea $GAME $TURN
"$BIN/backup-eressea" "$GAME" "$TURN"
rm -f execute.lock
$BIN/run-turn $GAME $TURN
"$BIN/run-turn" "$GAME" "$TURN"
touch execute.lock

if [ ! -s $REPORTS/reports.txt ]; then
if [ ! -s "$REPORTS/reports.txt" ]; then
echo "server did not create reports.txt in game $GAME"
exit 4
fi
$BIN/backup-eressea $GAME $TURN
"$BIN/backup-eressea" "$GAME" "$TURN"
let TURN=$TURN+1
if [ ! -s $ERESSEA/game-$GAME/data/$TURN.dat ]; then
if [ ! -s "$ERESSEA/game-$GAME/data/$TURN.dat" ]; then
echo "server did not create data for turn $TURN in game $GAME"
exit 3
fi
echo "sending reports for game $GAME, turn $TURN"
$BIN/compress.sh $GAME $TURN
$BIN/sendreports.sh $GAME
$BIN/backup-eressea $GAME $TURN
"$BIN/compress.sh" "$GAME" "$TURN"
"$BIN/sendreports.sh" "$GAME"
"$BIN/backup-eressea" "$GAME" "$TURN"
rm -f test/execute.lock
) | tee -a $HOME/log/eressea.cron.log
) | tee -a "$HOME/log/eressea.cron.log"

Loading