forked from github/server
commit
0e1b61e00e
9 changed files with 48 additions and 39 deletions
|
@ -6,40 +6,35 @@ FILE(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH )
|
|||
endif(WIN32)
|
||||
|
||||
project (eressea-server C)
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/" ${CMAKE_MODULE_PATH})
|
||||
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
||||
|
||||
if (MSVC)
|
||||
include(MSVC)
|
||||
find_package (PDCurses)
|
||||
set (CURSES_FOUND ${PDCURSES_FOUND})
|
||||
set (CURSES_LIBRARIES ${PDCURSES_LIBRARY})
|
||||
set (CURSES_INCLUDE_DIR ${PDCURSES_INCLUDE_DIR})
|
||||
set (HAVE_STRDUP 0)
|
||||
set (HAVE_STRLCAT 0)
|
||||
set (HAVE_LIBBSD 0)
|
||||
set (HAVE_SIGNAL_H 0)
|
||||
set (HAVE_EXECINFO_H 0)
|
||||
include (MSVC)
|
||||
else (MSVC)
|
||||
|
||||
INCLUDE (CheckIncludeFile)
|
||||
find_package (Curses)
|
||||
include (CheckIncludeFile)
|
||||
CHECK_INCLUDE_FILE(signal.h HAVE_SIGNAL_H)
|
||||
CHECK_INCLUDE_FILE(execinfo.h HAVE_EXECINFO_H)
|
||||
CHECK_INCLUDE_FILE(bsd/string.h HAVE_LIBBSD)
|
||||
|
||||
INCLUDE (CheckFunctionExists)
|
||||
include (CheckFunctionExists)
|
||||
CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP)
|
||||
IF (HAVE_LIBBSD)
|
||||
INCLUDE (CheckLibraryExists)
|
||||
if (HAVE_LIBBSD)
|
||||
include (CheckLibraryExists)
|
||||
CHECK_LIBRARY_EXISTS(bsd strlcat "bsd/string.h" HAVE_STRLCAT)
|
||||
ELSE (HAVE_LIBBSD)
|
||||
else (HAVE_LIBBSD)
|
||||
CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT)
|
||||
ENDIF(HAVE_LIBBSD)
|
||||
|
||||
endif (MSVC)
|
||||
|
||||
if (MSVC)
|
||||
find_package (PDCurses)
|
||||
SET(CURSES_FOUND ${PDCURSES_FOUND})
|
||||
SET(CURSES_LIBRARIES ${PDCURSES_LIBRARY})
|
||||
SET(CURSES_INCLUDE_DIR ${PDCURSES_INCLUDE_DIR})
|
||||
else (MSVC)
|
||||
find_package (Curses)
|
||||
endif (HAVE_LIBBSD)
|
||||
endif (MSVC)
|
||||
|
||||
find_package (Readline)
|
||||
|
|
|
@ -58,7 +58,9 @@ elseif(TOLUA_INCLUDE_DIR AND EXISTS "${TOLUA_INCLUDE_DIR}/tolua.h")
|
|||
string(REGEX REPLACE "^#define[\t ]+TOLUA_VERSION[\t ]+\"tolua ([^\"]*)\".*" "\\1"
|
||||
TOLUA_VERSION_STRING "${tolua_version_str}")
|
||||
unset(tolua_version_str)
|
||||
endif()
|
||||
else(PC_TOLUA_VERSION)
|
||||
message(ERROR "TOLUA_VERSION_STRING cannot be determined")
|
||||
endif(PC_TOLUA_VERSION)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set TOLUA_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
|
|
|
@ -31,12 +31,12 @@ function embassy.update()
|
|||
if home==nil then
|
||||
return
|
||||
end
|
||||
eressea.log.debug("updating embassies in " .. tostring(home))
|
||||
eressea.log.info("updating embassies in " .. tostring(home))
|
||||
local u
|
||||
for u in home.units do
|
||||
if u.faction:get_key('mupL')==0 then
|
||||
if (u.faction:add_item('seashell', 1)>0) then
|
||||
eressea.log.debug("new seashell for " .. tostring(u.faction))
|
||||
if not u.faction:get_key('mupL') then
|
||||
if u.faction:add_item('seashell', 1) > 0 then
|
||||
eressea.log.info("new seashell for " .. tostring(u.faction))
|
||||
u.faction:set_key('mupL', get_turn())
|
||||
end
|
||||
end
|
||||
|
|
|
@ -27,11 +27,21 @@ end
|
|||
local function tunnel_action(b, param)
|
||||
local units = tunnel_travelers(b)
|
||||
local rto = get_target(param)
|
||||
eressea.log.info("Tunnel from " .. tostring(b) .. " [" .. param .. "]")
|
||||
if rto and units then
|
||||
eressea.log.debug("Tunnel from " .. tostring(b) .. " [" .. param .. "]")
|
||||
for key, u in pairs(units) do
|
||||
for _, u in pairs(units) do
|
||||
u.region = rto
|
||||
eressea.log.debug("teleported " .. tostring(u) .. " to " .. tostring(rto))
|
||||
eressea.log.info("teleported " .. tostring(u) .. " to " .. tostring(rto))
|
||||
end
|
||||
elseif not units then
|
||||
eressea.log.info("No units in tunnel " .. tostring(b) .. " [" .. param .. "]")
|
||||
elseif not rto then
|
||||
eressea.log.error("No target for tunnel " .. tostring(b) .. " [" .. param .. "]")
|
||||
end
|
||||
-- debug code to find bugs:
|
||||
for u in b.region.units do
|
||||
if u.building == b then
|
||||
eressea.log.error("Did not teleport " .. tostring(u) .. " from tunnel " .. tostring(b))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -848,13 +848,12 @@ void cr_output_unit(stream *out, const faction * f,
|
|||
|
||||
pzTmp = get_racename(u->attribs);
|
||||
if (pzTmp) {
|
||||
const char *pzRace = LOC(lang, mkname("race", pzTmp));
|
||||
pzTmp = pzRace ? pzRace : pzTmp;
|
||||
stream_printf(out, "\"%s\";Typ\n", translate(pzTmp, LOC(lang, pzTmp)));
|
||||
const char *pzRace = locale_string(lang, mkname("race", pzTmp), false);
|
||||
pzTmp = pzRace ? translate(pzRace, LOC(lang, pzRace)) : pzTmp;
|
||||
stream_printf(out, "\"%s\";Typ\n", pzTmp);
|
||||
if (u->faction == f && fval(u_race(u), RCF_SHAPESHIFTANY)) {
|
||||
pzRace = rc_name_s(u_race(u), NAME_PLURAL);
|
||||
stream_printf(out, "\"%s\";wahrerTyp\n",
|
||||
translate(pzRace, LOC(lang, pzRace)));
|
||||
stream_printf(out, "\"%s\";wahrerTyp\n", pzTmp);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -2237,7 +2237,7 @@ static void equip_familiar(unit *fam) {
|
|||
|
||||
snprintf(eqname, sizeof(eqname), "fam_%s", rc->_name);
|
||||
if (!equip_unit(fam, eqname)) {
|
||||
log_info("could not perform initialization for familiar %s.\n", rc->_name);
|
||||
log_debug("could not perform initialization for familiar %s.\n", rc->_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ static const char *logfile = "eressea.log";
|
|||
static const char *luafile = 0;
|
||||
static const char *inifile = "eressea.ini";
|
||||
static int memdebug = 0;
|
||||
static int verbosity = 1;
|
||||
static int verbosity = 2;
|
||||
|
||||
static void load_inifile(void)
|
||||
{
|
||||
|
@ -183,7 +183,7 @@ static int verbosity_to_flags(int verbosity) {
|
|||
static int parse_args(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
int log_stderr, log_flags = 2;
|
||||
int log_stderr, log_flags = 3;
|
||||
|
||||
for (i = 1; i != argc; ++i) {
|
||||
char *argi = argv[i];
|
||||
|
|
|
@ -715,7 +715,7 @@ void bufunit(const faction * f, const unit * u, const faction *fv,
|
|||
|
||||
pzTmp = get_racename(u->attribs);
|
||||
if (pzTmp) {
|
||||
const char *name = LOC(lang, mkname("race", pzTmp));
|
||||
const char *name = locale_string(lang, mkname("race", pzTmp), false);
|
||||
sbs_strcat(sbp, name ? name : pzTmp);
|
||||
if (u->faction == f && fval(u_race(u), RCF_SHAPESHIFTANY)) {
|
||||
sbs_strcat(sbp, " (");
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
@ECHO OFF
|
||||
IF "%WIN32_DEV%" == "" SET WIN32_DEV="C:\Libraries"
|
||||
SET CMAKE_ROOT=%ProgramFiles%\CMake
|
||||
IF "%LUA_DEV%" == "" SET LUA_DEV="%ProgramFiles(x86)%/Lua/5.1"
|
||||
SET VSVERSION=15
|
||||
SET SRCDIR=%CD%
|
||||
CD ..
|
||||
SET ERESSEA=%CD%
|
||||
REM CD ..
|
||||
REM SET ERESSEA=%CD%
|
||||
REM CD %SRCDIR%
|
||||
|
||||
CD %SRCDIR%
|
||||
IF exist build-vs%VSVERSION% goto HAVEDIR
|
||||
mkdir build-vs%VSVERSION%
|
||||
:HAVEDIR
|
||||
cd build-vs%VSVERSION%
|
||||
"%ProgramFiles%\CMake\bin\cmake.exe" -G "Visual Studio %VSVERSION%" -DCMAKE_PREFIX_PATH="%ProgramFiles(x86)%/Lua/5.1;%ERESSEA%/dependencies-win32" -DCMAKE_MODULE_PATH="%SRCDIR%/cmake/Modules" -DCMAKE_SUPPRESS_REGENERATION=TRUE ..
|
||||
"%CMAKE_ROOT%\bin\cmake.exe" -G "Visual Studio %VSVERSION%" -DCMAKE_PREFIX_PATH="%LUA_DEV%;%WIN32_DEV%" -DCMAKE_MODULE_PATH="%SRCDIR%/cmake/Modules" -DCMAKE_SUPPRESS_REGENERATION=TRUE ..
|
||||
PAUSE
|
||||
|
|
Loading…
Add table
Reference in a new issue