forked from github/server
Merge branch 'master' into develop
This commit is contained in:
commit
fbdd3c2fee
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import sys, re
|
||||||
|
from epasswd import EPasswd
|
||||||
|
|
||||||
|
if len(sys.argv)<3:
|
||||||
|
sys.exit(-2)
|
||||||
|
|
||||||
|
filename=sys.argv[1]
|
||||||
|
myfaction=sys.argv[2]
|
||||||
|
quiet=len(sys.argv)<=3
|
||||||
|
|
||||||
|
def log(str):
|
||||||
|
if not quiet:
|
||||||
|
print(str)
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
if pw_data.fac_exists(myfaction):
|
||||||
|
print(pw_data.get_email(myfaction))
|
||||||
|
log("faction found: " + myfaction)
|
||||||
|
sys.exit(0)
|
||||||
|
else:
|
||||||
|
log("faction missing: " + myfaction)
|
||||||
|
|
||||||
|
sys.exit(-1)
|
|
@ -1 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
grep -hiw ERESSEA orders.dir/turn-* | cut -d\ -f2 | sort -u
|
grep -hiw ERESSEA orders.dir/turn-* | cut -d\ -f2 | sort -u
|
||||||
|
|
|
@ -30,11 +30,12 @@ LOCKFILE="$ERESSEA/.report.lock"
|
||||||
echo "$(date):report:$GAME:$EMAIL:$FACTION:$PASSWD" >> "$ERESSEA/request.log"
|
echo "$(date):report:$GAME:$EMAIL:$FACTION:$PASSWD" >> "$ERESSEA/request.log"
|
||||||
|
|
||||||
cd "$ERESSEA" || exit
|
cd "$ERESSEA" || exit
|
||||||
|
BIN="$ERESSEA/server/bin"
|
||||||
PWFILE="game-$GAME/eressea.db"
|
PWFILE="game-$GAME/eressea.db"
|
||||||
if [ ! -e "$PWFILE" ]; then
|
if [ ! -e "$PWFILE" ]; then
|
||||||
PWFILE="game-$GAME/passwd"
|
PWFILE="game-$GAME/passwd"
|
||||||
fi
|
fi
|
||||||
checkpasswd.py "$PWFILE" "$FACTION" "$PASSWD" || reply "Das Passwort fuer die Partei $FACTION ist ungueltig"
|
"$BIN/checkpasswd.py" "$PWFILE" "$FACTION" "$PASSWD" || reply "Das Passwort fuer die Partei $FACTION ist ungueltig"
|
||||||
|
|
||||||
cd "$ERESSEA/game-$GAME/reports" || exit
|
cd "$ERESSEA/game-$GAME/reports" || exit
|
||||||
if [ ! -e "${FACTION}.sh" ]; then
|
if [ ! -e "${FACTION}.sh" ]; then
|
||||||
|
@ -45,7 +46,7 @@ fi
|
||||||
|
|
||||||
bash "${FACTION}.sh" "$EMAIL" || reply "Unbekannte Partei $FACTION"
|
bash "${FACTION}.sh" "$EMAIL" || reply "Unbekannte Partei $FACTION"
|
||||||
|
|
||||||
OWNER=$(getfaction.py "$PWFILE" "$FACTION")
|
OWNER=$("$BIN/getfaction.py" "$PWFILE" "$FACTION")
|
||||||
if [ ! -z "$OWNER" ]; then
|
if [ ! -z "$OWNER" ]; then
|
||||||
echo "Der Report Deiner Partei wurde an ${EMAIL} gesandt." \
|
echo "Der Report Deiner Partei wurde an ${EMAIL} gesandt." \
|
||||||
| mutt -s "Reportnachforderung Partei ${FACTION}" "$OWNER"
|
| mutt -s "Reportnachforderung Partei ${FACTION}" "$OWNER"
|
||||||
|
|
|
@ -921,7 +921,8 @@ void cr_output_unit(stream *out, const faction * f,
|
||||||
if (fval(u, UFL_HUNGER) && (u->faction == f)) {
|
if (fval(u, UFL_HUNGER) && (u->faction == f)) {
|
||||||
stream_printf(out, "1;hunger\n");
|
stream_printf(out, "1;hunger\n");
|
||||||
}
|
}
|
||||||
if (is_mage(u)) {
|
mage = get_mage(u);
|
||||||
|
if (mage) {
|
||||||
stream_printf(out, "%d;Aura\n", get_spellpoints(u));
|
stream_printf(out, "%d;Aura\n", get_spellpoints(u));
|
||||||
stream_printf(out, "%d;Auramax\n", max_spellpoints_depr(u->region, u));
|
stream_printf(out, "%d;Auramax\n", max_spellpoints_depr(u->region, u));
|
||||||
}
|
}
|
||||||
|
@ -963,7 +964,6 @@ void cr_output_unit(stream *out, const faction * f,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* spells that this unit can cast */
|
/* spells that this unit can cast */
|
||||||
mage = get_mage(u);
|
|
||||||
if (mage) {
|
if (mage) {
|
||||||
int maxlevel = effskill(u, SK_MAGIC, 0);
|
int maxlevel = effskill(u, SK_MAGIC, 0);
|
||||||
cr_output_spells(out, u, maxlevel);
|
cr_output_spells(out, u, maxlevel);
|
||||||
|
|
Loading…
Reference in New Issue