forked from github/server
* Letzte Zugabgabe wird gepatched
* Header include Reihenfolge sollte immer egal sein.
This commit is contained in:
parent
86bb30e253
commit
46db739776
|
@ -70,6 +70,7 @@
|
|||
#include <base36.h>
|
||||
#include <goodies.h>
|
||||
#include <rand.h>
|
||||
#include <sql.h>
|
||||
#include <util/message.h>
|
||||
|
||||
#ifdef AT_OPTION
|
||||
|
@ -239,6 +240,8 @@ restart(unit *u, const race * rc)
|
|||
unit * nu = f->units;
|
||||
strlist ** o=&u->orders;
|
||||
|
||||
fprintf(sqlstream, "UPDATE subscriptions set faction='%s' where faction"
|
||||
"='%s' and game=%d;", itoa36(u->faction->no), itoa36(f->no), GAME_ID);
|
||||
f->magiegebiet = u->faction->magiegebiet;
|
||||
f->options = u->faction->options;
|
||||
freestrlist(nu->orders);
|
||||
|
@ -266,7 +269,7 @@ checkorders(void)
|
|||
|
||||
puts(" - Warne späte Spieler...");
|
||||
for (f = factions; f; f = f->next)
|
||||
if (f->no!=MONSTER_FACTION && turn - f->lastorders == ORDERGAP - 1)
|
||||
if (f->no!=MONSTER_FACTION && turn - f->lastorders == NMRTIMEOUT - 1)
|
||||
addstrlist(&f->mistakes,
|
||||
"Bitte sende die Befehle nächste Runde ein, "
|
||||
"wenn du weiterspielen möchtest.");
|
||||
|
@ -1194,19 +1197,24 @@ quit(void)
|
|||
|
||||
remove("inactive");
|
||||
|
||||
for (f = factions; f; f = f->next) if(!fval(f, FL_NOIDLEOUT)) {
|
||||
#if REMOVENMRTIMEOUT == 1
|
||||
if (turn - f->lastorders >= ORDERGAP) {
|
||||
for (f = factions; f; f = f->next) {
|
||||
if(fval(f, FL_NOIDLEOUT)) f->lastorders = turn;
|
||||
#if NMRTIMEOUT
|
||||
if (turn - f->lastorders >= NMRTIMEOUT) {
|
||||
destroyfaction(f);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (turn - f->lastorders >= (ORDERGAP - 1)) {
|
||||
fprintf(sqlstream,
|
||||
"UPDATE subscriptions SET lastturn=%d WHERE game=%d AND faction='%s';",
|
||||
f->lastorders, GAME_ID, itoa36(f->no));
|
||||
|
||||
if (turn - f->lastorders >= (NMRTIMEOUT - 1)) {
|
||||
inactivefaction(f);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#if REMOVENMRNEWBIE == 1
|
||||
#if NMRTIMEOUT
|
||||
puts(" - beseitige Spieler, die sich nach der Anmeldung nicht "
|
||||
"gemeldet haben...");
|
||||
|
||||
|
@ -2722,6 +2730,9 @@ renumber_factions(void)
|
|||
}
|
||||
}
|
||||
if (updatelog) fprintf(updatelog, "renum %s %s\n", itoa36(rp->faction->no), itoa36(rp->want));
|
||||
fprintf(sqlstream, "UPDATE subscriptions set faction='%s' where "
|
||||
"faction='%s' and game=%d;", itoa36(rp->want),
|
||||
itoa36(rp->faction->no), GAME_ID);
|
||||
rp->faction->no = rp->want;
|
||||
register_faction_id(rp->want);
|
||||
fset(rp->faction, FF_NEWID);
|
||||
|
|
|
@ -3338,7 +3338,7 @@ report_summary(summary * s, summary * o, boolean full)
|
|||
FILE * F = NULL;
|
||||
int i, newplayers = 0;
|
||||
faction * f;
|
||||
int nmrs[ORDERGAP+1];
|
||||
int nmrs[NMRTIMEOUT+1];
|
||||
|
||||
{
|
||||
char zText[MAX_PATH];
|
||||
|
@ -3430,7 +3430,7 @@ report_summary(summary * s, summary * o, boolean full)
|
|||
|
||||
fprintf(F, "\n\n");
|
||||
|
||||
for (i = 0; i != ORDERGAP+1; ++i) {
|
||||
for (i = 0; i != NMRTIMEOUT+1; ++i) {
|
||||
nmrs[i] = 0;
|
||||
}
|
||||
|
||||
|
@ -3438,12 +3438,12 @@ report_summary(summary * s, summary * o, boolean full)
|
|||
if (f->age <= 1 && turn - f->lastorders == 1) {
|
||||
newplayers++;
|
||||
} else if (f->no != MONSTER_FACTION) {
|
||||
nmrs[min(ORDERGAP,turn-f->lastorders)]++;
|
||||
nmrs[min(NMRTIMEOUT,turn-f->lastorders)]++;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i != ORDERGAP+1; ++i) {
|
||||
if(i == ORDERGAP) {
|
||||
for (i = 0; i != NMRTIMEOUT+1; ++i) {
|
||||
if(i == NMRTIMEOUT) {
|
||||
fprintf(F, "+ NMRs:\t\t %d\n", nmrs[i]);
|
||||
} else {
|
||||
fprintf(F, "%d %s:\t\t %d\n", i,
|
||||
|
@ -3467,11 +3467,11 @@ report_summary(summary * s, summary * o, boolean full)
|
|||
out_faction(F, f);
|
||||
}
|
||||
|
||||
if(full) {
|
||||
if (full && NMRTIMEOUT) {
|
||||
fprintf(F, "\n\nFactions with NMRs:\n");
|
||||
for (i = ORDERGAP; i > 0; --i) {
|
||||
for (i = NMRTIMEOUT; i > 0; --i) {
|
||||
for(f=factions; f; f=f->next) {
|
||||
if(i == ORDERGAP) {
|
||||
if(i == NMRTIMEOUT) {
|
||||
if(turn - f->lastorders >= i) {
|
||||
out_faction(F, f);
|
||||
}
|
||||
|
|
|
@ -2407,6 +2407,8 @@ remove_empty_factions(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
fprintf(sqlstream, "UPDATE subscriptions set status='DEAD' where "
|
||||
"faction='%s' and game=%d;", itoa36(f->no), GAME_ID);
|
||||
stripfaction(f);
|
||||
*fp = f->next;
|
||||
free(f);
|
||||
|
|
|
@ -353,7 +353,6 @@ extern void plagues(struct region * r, boolean ismagic);
|
|||
* von struct unitname, regionid, etc. zurückgegeben werden. ohne die 0 */
|
||||
#define CMDSIZE (DISPLAYSIZE*2+1)
|
||||
#define STARTMONEY 5000
|
||||
#define ORDERGAP 4
|
||||
|
||||
#define PRODUCEEXP 10
|
||||
#define MAINTENANCE 10
|
||||
|
|
|
@ -8,12 +8,12 @@ CFG=kernel - Win32 Profile
|
|||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "kernel-6.mak".
|
||||
!MESSAGE NMAKE /f "kernel.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "kernel-6.mak" CFG="kernel - Win32 Profile"
|
||||
!MESSAGE NMAKE /f "kernel.mak" CFG="kernel - Win32 Profile"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
|
@ -73,7 +73,7 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"Debug\kernel.lib"
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "kernel - Win32 Profile"
|
||||
|
||||
|
@ -162,10 +162,6 @@ SOURCE=.\karma.h
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\laws.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\magic.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
|
@ -1044,13 +1044,15 @@ travel(region * first, unit * u, region * next, int flucht)
|
|||
/* r2 -> Zielregion, r3 -> Momentane Region */
|
||||
if (move_blocked(u, current, reldirection(current, next))
|
||||
|| is_spell_active(current, C_FOGTRAP))
|
||||
add_message(&u->faction->msgs, new_message(u->faction,
|
||||
"leavefail%u:unit%r:region", u, next));
|
||||
{
|
||||
ADDMSG(&u->faction->msgs, msg_message("leavefail",
|
||||
"unit region", u, next));
|
||||
}
|
||||
if ((wache = bewegung_blockiert_von(u, current)) != (unit *) NULL
|
||||
&& gereist != 0)
|
||||
{
|
||||
add_message(&u->faction->msgs, new_message(u->faction,
|
||||
"moveblockedbyguard%u:unit%r:region%u:guard", u, current,
|
||||
ADDMSG(&u->faction->msgs, msg_message("moveblockedbyguard",
|
||||
"unit region guard", u, current,
|
||||
wache));
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1023,12 +1023,14 @@ readgame(boolean backup)
|
|||
addlist2(fp, f);
|
||||
|
||||
if (f->age==1) {
|
||||
fprintf(sqlstream, "INSERT INTO users (id, email) VALUES (%d, '%s');\n",
|
||||
f->unique_id, f->email);
|
||||
fprintf(sqlstream, "INSERT INTO factions (id, user, name, password, race, locale, lastorders, banner, email) "
|
||||
"VALUES ('%s', %d, '%s', '%s', '%s', '%s', %u, '%s', '%s');\n",
|
||||
itoa36(f->no), f->unique_id, sqlquote(f->name), sqlquote(f->passw), f->race->_name[0],
|
||||
locale_name(f->locale), f->lastorders, sqlquote(f->banner), f->email);
|
||||
/*
|
||||
* fprintf(sqlstream, "INSERT INTO users (id, email) VALUES (%d, '%s');\n",
|
||||
* f->unique_id, f->email);
|
||||
* fprintf(sqlstream, "INSERT INTO subscriptions (id, user, name, race) "
|
||||
* "VALUES ('%s', %d, '%s', '%s', '%s', '%s', %u, '%s', '%s');\n",
|
||||
* itoa36(f->no), f->unique_id, sqlquote(f->name), sqlquote(f->passw), f->race->_name[0],
|
||||
* locale_name(f->locale), f->lastorders, sqlquote(f->banner), f->email);
|
||||
*/
|
||||
}
|
||||
}
|
||||
*fp = 0;
|
||||
|
|
|
@ -19,6 +19,7 @@ struct fighter;
|
|||
struct spell;
|
||||
struct border_type;
|
||||
struct attrib_type;
|
||||
struct curse_type;
|
||||
struct castorder;
|
||||
|
||||
/* Sprüche. Neue NUR hinten anfügen, oder das Datenfile geht kaputt */
|
||||
|
|
|
@ -14,12 +14,13 @@
|
|||
* Contains defines for the "free" game (Eressea) .
|
||||
* Include this file from settings.h to make eressea work.
|
||||
*/
|
||||
#define GAME_ID 0
|
||||
#define RESOURCE_CONVERSION 1
|
||||
#define NEW_RESOURCEGROWTH 1
|
||||
#define LARGE_CASTLES 1
|
||||
#define GROWING_TREES 1
|
||||
#define REMOVENMRNEWBIE 1
|
||||
#define REMOVENMRTIMEOUT 1
|
||||
#define NMRTIMEOUT 4
|
||||
#define HUNGER_DISABLES_LONGORDERS 1
|
||||
#define REDUCED_PEASANTGROWTH 1
|
||||
#define RACE_ADJUSTMENTS 1
|
||||
|
|
|
@ -14,13 +14,18 @@
|
|||
* Contains defines for the "classic" game (Vinyambar I) .
|
||||
* Include this file from settings.h to make eressea work.
|
||||
*/
|
||||
#define GAME_ID 1
|
||||
#define RESOURCE_CONVERSION 0
|
||||
#define NEW_RESOURCEGROWTH 0
|
||||
#define LARGE_CASTLES 0
|
||||
#define GROWING_TREES 0
|
||||
#define REMOVENMRNEWBIE 0
|
||||
#define REMOVENMRTIMEOUT 0
|
||||
#define NMRTIMEOUT 5
|
||||
#define HUNGER_DISABLES_LONGORDERS 1
|
||||
#define REDUCED_PEASANTGROWTH 0
|
||||
#define RACE_ADJUSTMENTS 0
|
||||
|
||||
#define SKILLPOINTS 1
|
||||
#define TEACHDIFFERENCE 1
|
||||
|
||||
#define PEASANT_ADJUSTMENT 0
|
||||
|
|
|
@ -14,13 +14,19 @@
|
|||
* Contains defines for the "modern" vinyambar game.
|
||||
* Include this file from settings.h to make eressea work.
|
||||
*/
|
||||
#define GAME_ID 2
|
||||
#define RESOURCE_CONVERSION 1
|
||||
#define NEW_RESOURCEGROWTH 1
|
||||
#define LARGE_CASTLES 1
|
||||
#define GROWING_TREES 1
|
||||
#define REMOVENMRNEWBIE 0
|
||||
#define REMOVENMRTIMEOUT 0
|
||||
#define NMRTIMEOUT 5
|
||||
#define HUNGER_DISABLES_LONGORDERS 0
|
||||
#define REDUCED_PEASANTGROWTH 0
|
||||
#define RACE_ADJUSTMENTS 0
|
||||
|
||||
#define SKILLPOINTS 1
|
||||
#define TEACHDIFFERENCE 1
|
||||
|
||||
#define PEASANT_ADJUSTMENT 0
|
||||
|
||||
|
|
Loading…
Reference in New Issue