forked from github/server
do not run tolua inside MSVC
The cmake rules for this do not work.
This commit is contained in:
parent
e9bc92608c
commit
e8b28725e1
3 changed files with 73 additions and 73 deletions
38
README.md
38
README.md
|
@ -1,20 +1,20 @@
|
||||||
# What is this?
|
# What is this?
|
||||||
|
|
||||||
This repository contains an the source code for the Play-by-Mail strategy game [Eressea](http://www.eressea.de/).
|
This repository contains an the source code for the Play-by-Mail strategy game [Eressea](http://www.eressea.de/).
|
||||||
|
|
||||||
# Prerequisites
|
# Prerequisites
|
||||||
|
|
||||||
Eressea depends on a number of external libraries. On a recent Debian-based Linux system, this is the apt-get command to install all of them:
|
Eressea depends on a number of external libraries. On a recent Debian-based Linux system, this is the apt-get command to install all of them:
|
||||||
|
|
||||||
sudo apt-get install git cmake gcc make libxml2-dev liblua5.2-dev libtolua-dev libncurses5-dev libsqlite3-dev
|
sudo apt-get install git cmake gcc make libxml2-dev liblua5.2-dev libtolua-dev libncurses5-dev libsqlite3-dev
|
||||||
|
|
||||||
# How to check out and build the Eressea server
|
# How to check out and build the Eressea server
|
||||||
|
|
||||||
This repository relies heavily on the use of submodules, and it pulls in most of the code from those. The build system being used is cmake, which can create Makefiles on Unix, or Visual Studio project files on Windows. Here's how you clone and build the source on Ubuntu:
|
This repository relies heavily on the use of submodules, and it pulls in most of the code from those. The build system being used is cmake, which can create Makefiles on Unix, or Visual Studio project files on Windows. Here's how you clone and build the source on Ubuntu:
|
||||||
|
|
||||||
git clone git://github.com/eressea/server.git
|
git clone git://github.com/eressea/server.git
|
||||||
cd server
|
cd server
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
./configure
|
./configure
|
||||||
|
|
||||||
If you got this far and all went well, you have built a server (it is linked from the `game` subdirectory), and it will have passed some basic functionality tests.
|
If you got this far and all went well, you have built a server (it is linked from the `game` subdirectory), and it will have passed some basic functionality tests.
|
|
@ -1,52 +1,52 @@
|
||||||
module('frost', package.seeall)
|
module('frost', package.seeall)
|
||||||
|
|
||||||
local function is_winter(turn)
|
local function is_winter(turn)
|
||||||
local season = get_season(turn)
|
local season = get_season(turn)
|
||||||
return season == "calendar::winter"
|
return season == "calendar::winter"
|
||||||
end
|
end
|
||||||
|
|
||||||
local function is_spring(turn)
|
local function is_spring(turn)
|
||||||
local season = get_season(turn)
|
local season = get_season(turn)
|
||||||
return season == "calendar::spring"
|
return season == "calendar::spring"
|
||||||
end
|
end
|
||||||
|
|
||||||
local function freeze(r, chance)
|
local function freeze(r, chance)
|
||||||
for i, rn in ipairs(r.adj) do
|
for i, rn in ipairs(r.adj) do
|
||||||
-- each region has a chance to freeze
|
-- each region has a chance to freeze
|
||||||
if rn.terrain=="ocean" and (chance>=100 or math.fmod(rng_int(), 100)<chance) then
|
if rn.terrain=="ocean" and (chance>=100 or math.fmod(rng_int(), 100)<chance) then
|
||||||
rn.terrain = "packice"
|
rn.terrain = "packice"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function thaw(r, chance)
|
local function thaw(r, chance)
|
||||||
if chance>=100 or math.fmod(rng_int(), 100)<chance then
|
if chance>=100 or math.fmod(rng_int(), 100)<chance then
|
||||||
r.terrain = "ocean"
|
r.terrain = "ocean"
|
||||||
for s in r.ships do
|
for s in r.ships do
|
||||||
s.coast = nil
|
s.coast = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function update()
|
function update()
|
||||||
local turn = get_turn()
|
local turn = get_turn()
|
||||||
if is_winter(turn) then
|
if is_winter(turn) then
|
||||||
for r in regions() do
|
for r in regions() do
|
||||||
if r.terrain=="glacier" then
|
if r.terrain=="glacier" then
|
||||||
freeze(r, 20)
|
freeze(r, 20)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif is_spring(turn) then
|
elseif is_spring(turn) then
|
||||||
for r in regions() do
|
for r in regions() do
|
||||||
if r.terrain=="packice" then
|
if r.terrain=="packice" then
|
||||||
thaw(r, 20)
|
thaw(r, 20)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif is_spring(turn-1) then
|
elseif is_spring(turn-1) then
|
||||||
for r in regions() do
|
for r in regions() do
|
||||||
if r.terrain=="packice" then
|
if r.terrain=="packice" then
|
||||||
thaw(r, 100)
|
thaw(r, 100)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -43,7 +43,6 @@ MACRO(ADD_LUA_MODULE MODULE_NAME FILES)
|
||||||
)
|
)
|
||||||
ENDMACRO(ADD_LUA_MODULE)
|
ENDMACRO(ADD_LUA_MODULE)
|
||||||
|
|
||||||
IF(TOLUA_FOUND)
|
|
||||||
MACRO(TOLUA_BINDING PKGFILE FILES)
|
MACRO(TOLUA_BINDING PKGFILE FILES)
|
||||||
ADD_CUSTOM_COMMAND(
|
ADD_CUSTOM_COMMAND(
|
||||||
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${PKGFILE}.c
|
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${PKGFILE}.c
|
||||||
|
@ -54,10 +53,11 @@ MACRO(TOLUA_BINDING PKGFILE FILES)
|
||||||
)
|
)
|
||||||
ENDMACRO(TOLUA_BINDING)
|
ENDMACRO(TOLUA_BINDING)
|
||||||
|
|
||||||
|
IF(NOT MSVC)
|
||||||
TOLUA_BINDING(process.pkg bind_process.h)
|
TOLUA_BINDING(process.pkg bind_process.h)
|
||||||
TOLUA_BINDING(eressea.pkg bind_eressea.h)
|
TOLUA_BINDING(eressea.pkg bind_eressea.h)
|
||||||
TOLUA_BINDING(settings.pkg bind_settings.h)
|
TOLUA_BINDING(settings.pkg bind_settings.h)
|
||||||
ENDIF(TOLUA_FOUND)
|
ENDIF()
|
||||||
|
|
||||||
set(TESTS
|
set(TESTS
|
||||||
laws_test.c
|
laws_test.c
|
||||||
|
|
Loading…
Reference in a new issue