update the arda server to use submodules and new cmake layout

This commit is contained in:
Enno Rehling 2012-06-07 12:44:25 -07:00
parent bc8ae48cc9
commit bff66773cf
23 changed files with 85 additions and 562 deletions

27
.gitmodules vendored Normal file
View File

@ -0,0 +1,27 @@
[submodule "lunit"]
path = lunit
url = git@github.com:eressea/lunit.git
[submodule "crypto"]
path = crypto
url = git@github.com:eressea/crypto.git
[submodule "cmake"]
path = cmake
url = git@github.com:eressea/cmake.git
[submodule "eressea"]
path = eressea
url = git@github.com:eressea/core.git
[submodule "quicklist"]
path = quicklist
url = git@github.com:badgerman/quicklist.git
[submodule "critbit"]
path = critbit
url = git@github.com:badgerman/critbit.git
[submodule "dlmalloc"]
path = dlmalloc
url = git@github.com:badgerman/dlmalloc.git
[submodule "cutest"]
path = cutest
url = git@github.com:badgerman/cutest.git
[submodule "iniparser"]
path = iniparser
url = git@github.com:badgerman/iniparser.git

View File

@ -1,9 +1,12 @@
cmake_minimum_required(VERSION 2.6)
project (server C)
project (e4-server C)
enable_testing()
add_subdirectory (../dependencies "${CMAKE_CURRENT_BINARY_DIR}/dependencies")
add_subdirectory (../core/src "${CMAKE_CURRENT_BINARY_DIR}/core")
add_subdirectory(src server)
add_subdirectory (crypto)
add_subdirectory (quicklist)
add_subdirectory (iniparser)
add_subdirectory (cutest)
add_subdirectory (critbit)
add_subdirectory (eressea/src eressea)
add_subdirectory (src server)

View File

@ -1,16 +0,0 @@
all: tests
tests: bin/server
@bin/server -l/dev/null --tests
bin:
@mkdir bin
bin/server: bin/Makefile
cd bin ; make
bin/Makefile: CMakeLists.txt | bin
cd bin ; cmake ..
clean:
rm -rf bin

1
cmake Submodule

@ -0,0 +1 @@
Subproject commit 8cbbeef52b5807bdec52369322cbc9f21d5ed621

1
critbit Submodule

@ -0,0 +1 @@
Subproject commit ab655aa6167f8d7cfc323a4af803470857156041

1
crypto Submodule

@ -0,0 +1 @@
Subproject commit c19c4011ebf1c391a50d0afe89849135f39b6086

1
cutest Submodule

@ -0,0 +1 @@
Subproject commit b5910573d0b7da7f46c3efbaeb85cb2eaf269980

1
dlmalloc Submodule

@ -0,0 +1 @@
Subproject commit 4292cd5e81395d09a7457ab93659ea3b7784e958

1
eressea Submodule

@ -0,0 +1 @@
Subproject commit 457c111da2ffda54ac1ff3e7758f5ba0ccc5bc26

View File

@ -1,47 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kernel", "..\shared\src\kernel.vcxproj", "{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gamecode", "..\shared\src\gamecode.vcxproj", "{1E8BFF9E-3044-0742-992F-C5765B80FE65}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util", "..\shared\src\util.vcxproj", "{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua-bindings", "..\shared\src\lua-bindings.vcxproj", "{75501170-51C2-E641-BA8B-EDC008184192}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "external", "..\external\external.vcxproj", "{F9AE4586-8F65-486B-9666-744839E40A54}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "amalgamation-example", "src\example.vcxproj", "{4A17DAEE-2261-4E2C-96F6-BA4132A09551}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}.Debug|Win32.ActiveCfg = Debug|Win32
{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}.Release|Win32.ActiveCfg = Release|Win32
{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}.Release|Win32.Build.0 = Release|Win32
{1E8BFF9E-3044-0742-992F-C5765B80FE65}.Debug|Win32.ActiveCfg = Debug|Win32
{1E8BFF9E-3044-0742-992F-C5765B80FE65}.Release|Win32.ActiveCfg = Release|Win32
{1E8BFF9E-3044-0742-992F-C5765B80FE65}.Release|Win32.Build.0 = Release|Win32
{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}.Debug|Win32.ActiveCfg = Debug|Win32
{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}.Release|Win32.ActiveCfg = Release|Win32
{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}.Release|Win32.Build.0 = Release|Win32
{75501170-51C2-E641-BA8B-EDC008184192}.Debug|Win32.ActiveCfg = Debug|Win32
{75501170-51C2-E641-BA8B-EDC008184192}.Release|Win32.ActiveCfg = Release|Win32
{75501170-51C2-E641-BA8B-EDC008184192}.Release|Win32.Build.0 = Release|Win32
{F9AE4586-8F65-486B-9666-744839E40A54}.Debug|Win32.ActiveCfg = Debug|Win32
{F9AE4586-8F65-486B-9666-744839E40A54}.Release|Win32.ActiveCfg = Release|Win32
{F9AE4586-8F65-486B-9666-744839E40A54}.Release|Win32.Build.0 = Release|Win32
{4A17DAEE-2261-4E2C-96F6-BA4132A09551}.Debug|Win32.ActiveCfg = Debug|Win32
{4A17DAEE-2261-4E2C-96F6-BA4132A09551}.Debug|Win32.Build.0 = Debug|Win32
{4A17DAEE-2261-4E2C-96F6-BA4132A09551}.Release|Win32.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(SubversionScc) = preSolution
Svn-Managed = True
Manager = AnkhSVN - Subversion Support for Visual Studio
EndGlobalSection
EndGlobal

View File

@ -10,7 +10,7 @@ locales = de,en
[config]
game = arda
source_dir = ../..
source_dir = ..
maxnmrs = 10
[editor]

View File

@ -1,9 +1,9 @@
local srcpath = config.source_dir
local respath = srcpath .. '/server/res'
local respath = srcpath .. '/res'
local paths = {
'server/scripts/?.lua',
'core/scripts/?.lua',
'dependencies/lunit/?.lua'
'scripts/?.lua',
'eressea/scripts/?.lua',
'lunit/?.lua'
}
for idx, path in pairs(paths) do

1
iniparser Submodule

@ -0,0 +1 @@
Subproject commit f412ae545c1465e4128075790dfda79f3c3de604

1
lunit Submodule

@ -0,0 +1 @@
Subproject commit 155c96594435413b4f704eb17558ea0b70631bad

1
quicklist Submodule

@ -0,0 +1 @@
Subproject commit 9426da89690972fea3d594c7843a8f172c75c7ca

View File

@ -6,5 +6,5 @@
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<rewriteURI
uriStartString="eressea:///core/"
rewritePrefix="../../core/res/" />
rewritePrefix="../eressea/res/" />
</catalog>

View File

@ -3,8 +3,10 @@ require "arda.rules"
local srcpath = config.source_dir
tests = {
srcpath .. '/core/scripts/tests/spells.lua',
srcpath .. '/core/scripts/tests/common.lua',
srcpath .. '/core/scripts/tests/bson.lua',
srcpath .. '/server/scripts/tests/rules.lua',
-- srcpath .. '/eressea/scripts/tests/bson.lua',
srcpath .. '/eressea/scripts/tests/spells.lua',
srcpath .. '/eressea/scripts/tests/common.lua',
srcpath .. '/eressea/scripts/tests/orders.lua',
srcpath .. '/eressea/scripts/tests/bindings.lua',
srcpath .. '/scripts/tests/rules.lua',
}

View File

@ -3,10 +3,10 @@ require "lunit"
module("tests.rules", package.seeall, lunit.testcase)
function setup()
free_game()
settings.set("nmr.removenewbie", "0")
settings.set("nmr.timeout", "0")
settings.set("NewbieImmunity", "0")
eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0")
end
function test_landing1()

View File

@ -3,11 +3,11 @@ project (server C)
find_package (Lua51 REQUIRED)
find_package (LibXml2 REQUIRED)
find_package (Sqlite3 REQUIRED)
find_package (SQLite3 REQUIRED)
find_package (ToLua REQUIRED)
find_package (Curses REQUIRED)
include_directories (${CORE_INCLUDE_DIR})
include_directories (${ERESSEA_INCLUDE_DIR})
include_directories (${CRITBIT_INCLUDE_DIR})
include_directories (${CRYPTO_INCLUDE_DIR})
include_directories (${QUICKLIST_INCLUDE_DIR})
@ -18,18 +18,9 @@ include_directories (${BSON_INCLUDE_DIR})
include_directories (${INIPARSER_INCLUDE_DIR})
add_executable(server main.c)
target_link_libraries(server eressea)
target_link_libraries(server ${QUICKLIST_LIBRARIES})
target_link_libraries(server ${CRITBIT_LIBRARIES})
target_link_libraries(server ${BSON_LIBRARIES})
target_link_libraries(server ${CRYPTO_LIBRARIES})
target_link_libraries(server ${INIPARSER_LIBRARIES})
target_link_libraries(server ${CUTEST_LIBRARIES})
target_link_libraries(server ${CURSES_LIBRARIES})
target_link_libraries(server ${LUA_LIBRARIES})
target_link_libraries(server ${TOLUA_LIBRARIES})
target_link_libraries(server ${LIBXML2_LIBRARIES})
target_link_libraries(server ${SQLITE3_LIBRARIES})
add_test (server server --tests)
target_link_libraries(server
${ERESSEA_LIBRARY}
${BINDINGS_LIBRARY}
${TOLUA_LIBRARIES}
${SQLITE3_LIBRARIES}
)

View File

@ -1,274 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="example"
ProjectGUID="{4A17DAEE-2261-4E2C-96F6-BA4132A09551}"
RootNamespace="build"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ProjectDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/MP"
Optimization="0"
AdditionalIncludeDirectories="..\..\shared\src;..\..\external;..\..\external\lua\src;..\..\external\tolua\include;..\..\external\libxml2\include;..\..\external\pdcurses"
PreprocessorDefinitions="LIBXML_STATIC;WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
WarningLevel="4"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ws2_32.lib libxml2.lib pdcurses.lib lua.lib tolua.lib"
OutputFile="$(OutDir)\eressea.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\external\$(ConfigurationName)"
GenerateDebugInformation="true"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ProjectDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\shared\src;..\..\external;..\..\external\lua\src;..\..\external\tolua\include;..\..\external\libxml2\include;..\..\external\pdcurses"
PreprocessorDefinitions="LIBXML_STATIC;WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ws2_32.lib libxml2.lib pdcurses.lib lua.lib tolua.lib"
OutputFile="$(OutDir)\eressea.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\external\$(ConfigurationName)"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\main.c"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\shared\src\build\stdafx.h"
>
</File>
</Filter>
<Filter
Name="Unity Build"
>
<File
RelativePath="..\..\shared\src\build\external.c"
>
</File>
<File
RelativePath="..\..\shared\src\build\gamecode.c"
>
</File>
<File
RelativePath="..\..\shared\src\build\kernel.c"
>
</File>
<File
RelativePath="..\..\shared\src\build\lib.c"
>
</File>
<File
RelativePath=".\server.c"
>
</File>
<File
RelativePath="..\..\shared\src\build\stdafx.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
PrecompiledHeaderThrough="stdafx.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\shared\src\build\util.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="src/util"
/>
</FileConfiguration>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,118 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>example</ProjectName>
<ProjectGuid>{4A17DAEE-2261-4E2C-96F6-BA4132A09551}</ProjectGuid>
<RootNamespace>build</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../../shared/src;../../external;../../external/lua/src;../../external/tolua/include;../../external/pdcurses;..\..\external\libxml2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>LIBXML_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<AdditionalDependencies>libxml2.lib;pdcurses.lib;lua.lib;tolua.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>..\..\external\$(Configuration)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>../../shared/src;../../external;../../external/lua/src;../../external/tolua/include;../../external/pdcurses;..\..\external\libxml2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>LIBXML_STATIC;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<AdditionalDependencies>libxml2.lib;pdcurses.lib;lua.lib;tolua.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>..\..\external\$(Configuration)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\shared\src\build\external.c" />
<ClCompile Include="..\..\shared\src\build\gamecode.c" />
<ClCompile Include="..\..\shared\src\build\kernel.c" />
<ClCompile Include="..\..\shared\src\build\lib.c" />
<ClCompile Include="server.c" />
<ClCompile Include="..\..\shared\src\build\stdafx.c">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">stdafx.h</PrecompiledHeaderFile>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\shared\src\build\util.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">src/util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\shared\src\build\stdafx.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\CMakeLists.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Unity Build">
<UniqueIdentifier>{28903f02-8887-4f37-9579-228fe73a2dcd}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="server.c">
<Filter>Unity Build</Filter>
</ClCompile>
<ClCompile Include="..\..\shared\src\build\external.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\shared\src\build\gamecode.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\shared\src\build\kernel.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\shared\src\build\lib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\shared\src\build\stdafx.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\shared\src\build\util.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\shared\src\build\stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\CMakeLists.txt" />
</ItemGroup>
</Project>

View File

@ -24,18 +24,19 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <gmtool.h>
#include <kernel/config.h>
#include <kernel/save.h>
#include <bindings/bindings.h>
#include <iniparser.h>
#include <lua.h>
#include <assert.h>
#include <locale.h>
#include <wctype.h>
#include <tests.h>
static const char *luafile = "setup.lua";
static const char *luafile = 0;
static const char *entry_point = NULL;
static const char *inifile = "eressea.ini";
static const char *logfile="eressea.log";
static const char *logfile= "eressea.log";
static int memdebug = 0;
static void parse_config(const char *filename)
@ -43,6 +44,7 @@ static void parse_config(const char *filename)
dictionary *d = iniparser_new(filename);
if (d) {
load_inifile(d);
log_debug("reading from configuration file %s\n", filename);
memdebug = iniparser_getint(d, "eressea:memcheck", memdebug);
entry_point = iniparser_getstring(d, "eressea:run", entry_point);
@ -50,6 +52,8 @@ static void parse_config(const char *filename)
/* only one value in the [editor] section */
force_color = iniparser_getint(d, "editor:color", force_color);
} else {
log_error("could not open configuration file %s\n", filename);
}
global.inifile = d;
}
@ -64,14 +68,13 @@ static int usage(const char *prog, const char *arg)
"-q : be quite (same as -v 0)\n"
"-v <level> : verbosity level\n"
"-C : run in interactive mode\n"
"--color : force curses to use colors even when not detected\n"
"--tests : run test suite\n" "--help : help\n", prog);
"--color : force curses to use colors even when not detected\n", prog);
return -1;
}
static int parse_args(int argc, char **argv, int *exitcode)
{
int i, run_tests = 0;
int i;
for (i = 1; i != argc; ++i) {
if (argv[i][0] != '-') {
@ -87,8 +90,6 @@ static int parse_args(int argc, char **argv, int *exitcode)
force_color = 1;
} else if (strcmp(argv[i] + 2, "help") == 0) {
return usage(argv[0], NULL);
} else if (strcmp(argv[i] + 2, "tests") == 0) {
run_tests = 1;
} else {
return usage(argv[0], argv[i]);
}
@ -140,10 +141,6 @@ static int parse_args(int argc, char **argv, int *exitcode)
log_stderr = LOG_CPERROR|LOG_CPWARNING|LOG_CPDEBUG|LOG_CPINFO;
break;
}
if (run_tests) {
*exitcode = RunAllTests();
return 1;
}
return 0;
}
@ -158,7 +155,9 @@ void locale_init(void)
int main(int argc, char **argv)
{
int err, result = 0;
lua_State * L;
log_open(logfile);
parse_config(inifile);
err = parse_args(argc, argv, &result);
@ -166,22 +165,19 @@ int main(int argc, char **argv)
return result;
}
log_open(logfile);
locale_init();
err = eressea_init();
if (err) {
log_error("initialization failed with code %d\n", err);
return err;
}
L = lua_init();
game_init();
err = eressea_run(luafile, entry_point);
err = eressea_run(L, luafile, entry_point);
if (err) {
log_error("server execution failed with code %d\n", err);
return err;
}
eressea_done();
game_done();
lua_done(L);
log_close();
return 0;
}