Merge branch 'master' of github.com:ennorehling/eressea

This commit is contained in:
Enno Rehling 2019-07-06 12:09:11 +02:00
commit 3f395541e1
4 changed files with 5 additions and 34 deletions

View file

@ -11,10 +11,5 @@ fi
for GAME in $* for GAME in $*
do do
if [ "$GAME" == "eressea" ]; then GAME=2 ; fi $HOME/eressea/orders-php/check-orders.sh $GAME
if [ "$GAME" == "e3a" ]; then GAME=3 ; fi
if [ -e $HOME/eressea/game-$GAME/orders.queue ]
then
$HOME/bin/orders-process $GAME
fi
done done

View file

@ -3,34 +3,9 @@
from string import split from string import split
from string import strip from string import strip
from string import lower from string import lower
import subprocess
import bcrypt import bcrypt
import sqlite3 import sqlite3
def baseconvert(n, base):
"""convert positive decimal integer n to equivalent in another base (2-36)"""
digits = "0123456789abcdefghijkLmnopqrstuvwxyz"
try:
n = int(n)
base = int(base)
except:
return ""
if n < 0 or base < 2 or base > 36:
return ""
s = ""
while True:
r = n % base
s = digits[r] + s
n = n / base
if n == 0:
break
return s
class EPasswd: class EPasswd:
def __init__(self): def __init__(self):
self.data = {} self.data = {}
@ -47,7 +22,7 @@ class EPasswd:
c = conn.cursor() c = conn.cursor()
for row in c.execute('SELECT `no`, `email`, `password` FROM `faction`'): for row in c.execute('SELECT `no`, `email`, `password` FROM `faction`'):
(no, email, passwd) = row (no, email, passwd) = row
self.set_data(baseconvert(no, 36), email, passwd) self.set_data(no, email, passwd)
conn.close() conn.close()
def load_file(self, file): def load_file(self, file):

View file

@ -2,6 +2,7 @@
# example: orders-accept 2 de < mail.txt # example: orders-accept 2 de < mail.txt
game="$1" game="$1"
lang="$2"
[ -z "$ERESSEA" ] && ERESSEA="$HOME/eressea" [ -z "$ERESSEA" ] && ERESSEA="$HOME/eressea"
SCRIPT=$(readlink -f "$0") SCRIPT=$(readlink -f "$0")
@ -21,5 +22,5 @@ filename=$(basename "$ACCEPT_FILE")
email="$ACCEPT_MAIL" email="$ACCEPT_MAIL"
if [ -d "$ERESSEA/orders-php" ] if [ -d "$ERESSEA/orders-php" ]
then then
php "$ERESSEA/orders-php/cli.php" insert "$filename" "$email" php "$ERESSEA/orders-php/cli.php" insert "$filename" "$lang" "$email"
fi fi

View file

@ -161,7 +161,7 @@ void autostudy_run(scholar scholars[], int nscholars)
} }
} }
#define MAXSCHOLARS 512 #define MAXSCHOLARS 1024
void do_autostudy(region *r) void do_autostudy(region *r)
{ {