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

This commit is contained in:
Enno Rehling 2015-03-02 23:12:26 +01:00
commit 2175dd4e0e
17 changed files with 86 additions and 18 deletions

View File

@ -70,5 +70,6 @@ add_subdirectory (quicklist)
add_subdirectory (critbit)
add_subdirectory (src eressea)
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.xml")
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.json")
install(DIRECTORY scripts DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.lua")

18
process/cron/crontab Normal file
View File

@ -0,0 +1,18 @@
# Crontab for Eressea on gruenbaer.kn-bremen.de
PATH=/home/eressea/bin:/opt/bin:/usr/local/bin:/usr/bin:/bin
ERESSEA=/home/eressea/eressea
ATLANTIS=/home/eressea/atlantis
ENABLED=yes
PREVIEW=yes
CONFIRM=yes
# m h dom mon dow command
00 00 * * * $HOME/bin/fetchmail.cron
00 22 * * * $HOME/bin/backup-db.sh
15 21 * * Sat [ "$ENABLED" = "yes" ] && $ERESSEA/server/bin/run-eressea.cron 3
25 21 * * Sat [ "$ENABLED" = "yes" ] && $ERESSEA/server/bin/run-eressea.cron 4
35 21 * * Sat [ "$ENABLED" = "yes" ] && $ERESSEA/server/bin/run-eressea.cron 2
39 08 * * Sun [ "$PREVIEW" = "yes" ] && $ERESSEA/server/bin/preview.cron
*/5 * * * * [ "$CONFIRM" = "yes" ] && $ERESSEA/server/bin/orders.cron 2 3 4

16
process/cron/orders.cron Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
## this script processes incoming order files.
# files are delivered into an incoming queue by procmail, then cron runs
# this here script to make a non-blocking syntax check and reject or
# accept the order file.
for GAME in $*
do
if [ "$GAME" == "eressea" ]; then GAME=2 ; fi
if [ "$GAME" == "e3a" ]; then GAME=3 ; fi
if [ -e $HOME/eressea/game-$GAME/orders.queue ]
then
$HOME/bin/orders-process $GAME
fi
done

View File

@ -40,6 +40,6 @@ fi
echo "sending reports for game $GAME, turn $TURN"
$BIN/compress.sh $GAME $TURN
$BIN/sendreports.sh $GAME
$BIN/backup-eressea $GAME $TURN
[ $GAME -lt 4 ] && $BIN/send-summary $GAME
$BIN/backup-eressea $GAME $TURN
rm -f test/execute.lock

View File

@ -4345,6 +4345,14 @@
</string>
</namespace>
<namespace name="spellinfo">
<string name="create_ror">
<text locale="de">Erzeugt einen Ring der Regeneration.</text>
<text locale="en">Creates a ring of regeneration.</text>
</string>
<string name="create_focus">
<text locale="de">Erzeugt einen Aurafokus.</text>
<text locale="en">Creates an aurafocus crystal.</text>
</string>
<string name="acidrain">
<text locale="de">Tötet die Feinde mit Säure.</text>
<text locale="en">Kills enemies with acid.</text>

View File

@ -889,7 +889,7 @@
<arg name="left" type="int"/>
</type>
<text locale="de">"Auf der Einheit $if($eq($left,1),"liegt","liegen") $int($left) Wirkung$if($eq($left,1),"","en") $resource($potion,1)."</text>
<text locale="en">"There are $int($left) use($eq($left,1),"s","") of $resource($potion,1) left."</text>
<text locale="en">"There $if($eq($left,1),"is","are") $int($left) $if($eq($left,1),"use","uses") of $resource($potion,1) left."</text>
</message>
<message name="nr_region_owner" section="nr">
<type>
@ -3156,7 +3156,7 @@
<arg name="regionn" type="region"/>
</type>
<text locale="de">"Der Vulkan in $region($regionv) bricht aus. Die Lavamassen verwüsten $region($regionn)."</text>
<text locale="en">"The volcano in $region($regionv) erupts. The lava devastates $region($region)."</text>
<text locale="en">"The volcano in $region($regionv) erupts. The lava devastates $region($regionn)."</text>
</message>
<message name="volcano_dead" section="events">
<type>
@ -3461,16 +3461,16 @@
<arg name="target" type="unit"/>
<arg name="status" type="string"/>
</type>
<text locale="de">"$unit($spy) gelang es, Informationen über $unit($target) herauszubekommen: Kampfstatus $status."</text>
<text locale="en">"$unit($spy) managed to gather information about $unit($target): combat status ($status)."</text>
<text locale="de">"$unit($spy) gelang es, Informationen über $unit($target) herauszubekommen: Kampfstatus ${status}."</text>
<text locale="en">"$unit($spy) managed to gather information about $unit($target): combat status ${status}."</text>
</message>
<message name="spyreport_mage" section="events">
<type>
<arg name="target" type="unit"/>
<arg name="type" type="string"/>
</type>
<text locale="de">"$unit($target) ist ein $type-Magier."</text>
<text locale="en">"$unit($target) is a $type-magician"</text>
<text locale="de">"$unit($target) ist ein ${type}-Magier."</text>
<text locale="en">"$unit($target) is a ${type}-magician"</text>
</message>
<message name="spyreport_skills" section="events">
<type>

View File

@ -8,6 +8,8 @@ while [ ! -d $ROOT/.git ]; do
fi
done
DEST=$(dirname $ROOT)/server
MACHINE=`uname -m`
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
@ -17,3 +19,10 @@ BIN_DIR="build-$MACHINE-$CC-Debug"
cd $ROOT/$BIN_DIR
make install
[ -d $DEST/bin ] || mkdir -p $DEST/bin
install -v $ROOT/process/cron/*.cron $DEST/bin/
programs="create-orders backup-eressea run-turn"
for prg in ${programs} ; do
install -v $ROOT/process/$prg $DEST/bin/
done
crontab $ROOT/process/cron/crontab

View File

@ -1,3 +1,3 @@
#define VERSION_MAJOR 3
#define VERSION_MINOR 4
#define VERSION_BUILD 0
#define VERSION_BUILD 5

View File

@ -1896,7 +1896,10 @@ int name_cmd(struct unit *u, struct order *ord)
}
if (s != NULL) {
return rename_cmd(u, ord, s, getstrtoken());
const char *name = getstrtoken();
if (name) {
rename_cmd(u, ord, s, name);
}
}
return 0;

View File

@ -919,17 +919,17 @@ static unit *bewegung_blockiert_von(unit * reisender, region * r)
}
if (guard) {
prob += base_prob; /* 30% base chance */
prob = +guard_count*guard_number_prob;
prob += guard_count*guard_number_prob;
if (r->terrain == newterrain(T_GLACIER))
prob = +region_type_prob * 2;
prob += region_type_prob * 2;
if (r->terrain == newterrain(T_SWAMP))
prob = +region_type_prob * 2;
prob += region_type_prob * 2;
if (r->terrain == newterrain(T_MOUNTAIN))
prob = +region_type_prob;
prob += region_type_prob;
if (r->terrain == newterrain(T_VOLCANO))
prob = +region_type_prob;
prob += region_type_prob;
if (r->terrain == newterrain(T_VOLCANO_SMOKING))
prob = +region_type_prob;
prob += region_type_prob;
if (prob > 0 && chance(prob)) {
return guard;

View File

@ -15,6 +15,7 @@
#include <kernel/spellbook.h>
#include <kernel/terrain.h>
#include <kernel/messages.h>
#include <util/bsdstring.h>
#include <util/functions.h>
#include <util/language.h>
#include <util/message.h>
@ -239,22 +240,24 @@ const message_type *register_msg(const char *type, int n_param, ...) {
void assert_messages(struct CuTest * tc, struct mlist *msglist, const message_type **types,
int num_msgs, bool exact_match, ...) {
char buf[100];
va_list args;
int found = 0, argc = 0;
int found = 0, argc = -1;
struct message *msg;
bool match = true;
va_start(args, exact_match);
while (msglist) {
msg = msglist->msg;
if (found >= num_msgs) {
if (exact_match) {
CuFail(tc, "too many messages");
slprintf(buf, sizeof(buf), "too many messages: %s", msg->type->name);
CuFail(tc, buf);
} else {
break;
}
}
msg = msglist->msg;
if (exact_match || match)
argc = va_arg(args, int);
@ -271,3 +274,8 @@ void assert_messages(struct CuTest * tc, struct mlist *msglist, const message_ty
va_end(args);
}
void disabled_test(void *suite, void (*test)(CuTest *), const char *name) {
(void)test;
fprintf(stderr, "%s: SKIP\n", name);
}

View File

@ -47,6 +47,10 @@ extern "C" {
void assert_messages(struct CuTest * tc, struct mlist *msglist, const struct message_type **types,
int num_msgs, bool exact_match, ...);
void disabled_test(void *suite, void (*)(struct CuTest *), const char *name);
#define DISABLE_TEST(SUITE, TEST) disabled_test(SUITE, TEST, #TEST)
#ifdef __cplusplus
}
#endif

View File

@ -263,6 +263,7 @@ void init_translations(const struct locale *lang, int ut, const char * (*string_
assert(maxstrings > 0);
tokens = get_translations(lang, ut);
for (i = 0; i != maxstrings; ++i) {
// TODO: swap the name of s and key
const char * s = string_cb(i);
const char * key = s ? locale_string(lang, s, false) : 0;
key = key ? key : s;