Init
This commit is contained in:
344
Samples/AutopatcherServer/AutopatcherServer.vcxproj
Normal file
344
Samples/AutopatcherServer/AutopatcherServer.vcxproj
Normal file
@ -0,0 +1,344 @@
|
||||
<?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 - Unicode|Win32">
|
||||
<Configuration>Debug - Unicode</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release - Unicode|Win32">
|
||||
<Configuration>Release - Unicode</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Retail - Unicode|Win32">
|
||||
<Configuration>Retail - Unicode</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Retail|Win32">
|
||||
<Configuration>Retail</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>AutopatcherServer_PostgreSQL</ProjectName>
|
||||
<ProjectGuid>{4BDF263B-655B-4F1D-B42F-65260DC688A6}</ProjectGuid>
|
||||
<RootNamespace>AutopatcherServer_PostgreSQL</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|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" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</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" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'">$(Configuration)\</OutDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'">$(Configuration)\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'">$(Configuration)\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'">$(Configuration)\</OutDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'">false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>./;./../../Source/include;./../../DependentExtensions/Autopatcher;./../../DependentExtensions/bzip2-1.0.6;./../../DependentExtensions/Autopatcher/AutopatcherPostgreRepository;./../../DependentExtensions/PostgreSQLInterface;./../../DependentExtensions/openssl/include/x86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>./../../Lib/SLikeNet_LibStatic_Debug_Win32.lib;ws2_32.lib;./../../DependentExtensions\Autopatcher\AutopatcherPostgreRepository\Debug\AutopatcherPostgreSQLRepository.lib;C:\Program Files (x86)\PostgreSQL\9.2\lib\libpq.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
<IgnoreSpecificDefaultLibraries>LIBCD.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)AutopatcherServer.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy "C:\Program Files (x86)\PostgreSQL\9.2\bin\*.dll" "$(OutDir)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>./;./../../Source/include;./../../DependentExtensions/Autopatcher;./../../DependentExtensions/bzip2-1.0.6;./../../DependentExtensions/Autopatcher/AutopatcherPostgreRepository;./../../DependentExtensions/PostgreSQLInterface;./../../DependentExtensions/openssl/include/x86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>./../../Lib/SLikeNet_LibStatic_Debug - Unicode_Win32.lib;ws2_32.lib;./../../DependentExtensions\Autopatcher\AutopatcherPostgreRepository\Debug - Unicode\AutopatcherPostgreSQLRepository.lib;C:\Program Files (x86)\PostgreSQL\9.2\lib\libpq.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
<IgnoreSpecificDefaultLibraries>LIBCD.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)AutopatcherServer.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy "C:\Program Files (x86)\PostgreSQL\9.2\bin\*.dll" "$(OutDir)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>./;./../../Source/include;./../../DependentExtensions/Autopatcher;./../../DependentExtensions/bzip2-1.0.6;./../../DependentExtensions/Autopatcher/AutopatcherPostgreRepository;./../../DependentExtensions/PostgreSQLInterface;./../../DependentExtensions/openssl/include/x86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>./../../Lib/SLikeNet_LibStatic_Release_Win32.lib;ws2_32.lib;./../../DependentExtensions\Autopatcher\AutopatcherPostgreRepository\Release\AutopatcherPostgreSQLRepository.lib;C:\Program Files (x86)\PostgreSQL\9.2\lib\libpq.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>LIBCD.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy "C:\Program Files (x86)\PostgreSQL\9.2\bin\*.dll" "$(OutDir)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>./;./../../Source/include;./../../DependentExtensions/Autopatcher;./../../DependentExtensions/bzip2-1.0.6;./../../DependentExtensions/Autopatcher/AutopatcherPostgreRepository;./../../DependentExtensions/PostgreSQLInterface;./../../DependentExtensions/openssl/include/x86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;_RETAIL;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>./../../Lib/SLikeNet_LibStatic_Retail_Win32.lib;ws2_32.lib;./../../DependentExtensions\Autopatcher\AutopatcherPostgreRepository\Retail\AutopatcherPostgreSQLRepository.lib;C:\Program Files (x86)\PostgreSQL\9.2\lib\libpq.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>LIBCD.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy "C:\Program Files (x86)\PostgreSQL\9.2\bin\*.dll" "$(OutDir)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>./;./../../Source/include;./../../DependentExtensions/Autopatcher;./../../DependentExtensions/bzip2-1.0.6;./../../DependentExtensions/Autopatcher/AutopatcherPostgreRepository;./../../DependentExtensions/PostgreSQLInterface;./../../DependentExtensions/openssl/include/x86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>./../../Lib/SLikeNet_LibStatic_Release - Unicode_Win32.lib;ws2_32.lib;./../../DependentExtensions\Autopatcher\AutopatcherPostgreRepository\Release - Unicode\AutopatcherPostgreSQLRepository.lib;C:\Program Files (x86)\PostgreSQL\9.2\lib\libpq.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>LIBCD.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy "C:\Program Files (x86)\PostgreSQL\9.2\bin\*.dll" "$(OutDir)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>./;./../../Source/include;./../../DependentExtensions/Autopatcher;./../../DependentExtensions/bzip2-1.0.6;./../../DependentExtensions/Autopatcher/AutopatcherPostgreRepository;./../../DependentExtensions/PostgreSQLInterface;./../../DependentExtensions/openssl/include/x86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;_RETAIL;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>./../../Lib/SLikeNet_LibStatic_Retail - Unicode_Win32.lib;ws2_32.lib;./../../DependentExtensions\Autopatcher\AutopatcherPostgreRepository\Retail - Unicode\AutopatcherPostgreSQLRepository.lib;C:\Program Files (x86)\PostgreSQL\9.2\lib\libpq.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>LIBCD.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy "C:\Program Files (x86)\PostgreSQL\9.2\bin\*.dll" "$(OutDir)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\DependentExtensions\Autopatcher\AutopatcherServer.cpp" />
|
||||
<ClCompile Include="..\..\DependentExtensions\Autopatcher\CreatePatch.cpp" />
|
||||
<ClCompile Include="..\..\DependentExtensions\Autopatcher\MemoryCompressor.cpp" />
|
||||
<ClCompile Include="..\..\DependentExtensions\bzip2-1.0.6\blocksort.c">
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4127</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'">4127</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'">4127</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'">4127</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4127</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'">4127</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\DependentExtensions\bzip2-1.0.6\bzlib.c">
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4100;4127;4244;4996</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'">4100;4127;4244;4996</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'">4100;4127;4244;4996</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'">4100;4127;4244;4996</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4100;4127;4244;4996</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'">4100;4127;4244;4996</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\DependentExtensions\bzip2-1.0.6\compress.c">
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\DependentExtensions\bzip2-1.0.6\crctable.c" />
|
||||
<ClCompile Include="..\..\DependentExtensions\bzip2-1.0.6\decompress.c">
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\DependentExtensions\bzip2-1.0.6\huffman.c">
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'">4127;4244</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\DependentExtensions\bzip2-1.0.6\randtable.c" />
|
||||
<ClCompile Include="AutopatcherServerTest.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\DependentExtensions\Autopatcher\AutopatcherServer.h" />
|
||||
<ClInclude Include="..\..\DependentExtensions\Autopatcher\CreatePatch.h" />
|
||||
<ClInclude Include="..\..\DependentExtensions\Autopatcher\MemoryCompressor.h" />
|
||||
<ClInclude Include="..\..\DependentExtensions\bzip2-1.0.6\bzlib.h" />
|
||||
<ClInclude Include="..\..\DependentExtensions\bzip2-1.0.6\bzlib_private.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\DependentExtensions\Autopatcher\AutopatcherPostgreRepository\AutopatcherPostgreRepository.vcxproj">
|
||||
<Project>{0fd54bd0-c49c-4681-80ce-aa22b8995ca8}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Lib\LibStatic\LibStatic.vcxproj">
|
||||
<Project>{6533bdae-0f0c-45e4-8fe7-add0f37fe063}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
71
Samples/AutopatcherServer/AutopatcherServer.vcxproj.filters
Normal file
71
Samples/AutopatcherServer/AutopatcherServer.vcxproj.filters
Normal file
@ -0,0 +1,71 @@
|
||||
<?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;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="BZip">
|
||||
<UniqueIdentifier>{765f1609-6db6-4e37-ba56-6075f30060ab}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Main">
|
||||
<UniqueIdentifier>{e9ffd4fe-f03b-40c1-b6d4-43febc3e0425}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\DependentExtensions\Autopatcher\AutopatcherServer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\DependentExtensions\Autopatcher\CreatePatch.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\DependentExtensions\Autopatcher\MemoryCompressor.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\DependentExtensions\bzip2-1.0.6\blocksort.c">
|
||||
<Filter>BZip</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\DependentExtensions\bzip2-1.0.6\bzlib.c">
|
||||
<Filter>BZip</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\DependentExtensions\bzip2-1.0.6\compress.c">
|
||||
<Filter>BZip</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\DependentExtensions\bzip2-1.0.6\crctable.c">
|
||||
<Filter>BZip</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\DependentExtensions\bzip2-1.0.6\decompress.c">
|
||||
<Filter>BZip</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\DependentExtensions\bzip2-1.0.6\huffman.c">
|
||||
<Filter>BZip</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\DependentExtensions\bzip2-1.0.6\randtable.c">
|
||||
<Filter>BZip</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AutopatcherServerTest.cpp">
|
||||
<Filter>Main</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\DependentExtensions\Autopatcher\AutopatcherServer.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\DependentExtensions\Autopatcher\CreatePatch.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\DependentExtensions\Autopatcher\MemoryCompressor.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\DependentExtensions\bzip2-1.0.6\bzlib.h">
|
||||
<Filter>BZip</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\DependentExtensions\bzip2-1.0.6\bzlib_private.h">
|
||||
<Filter>BZip</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
348
Samples/AutopatcherServer/AutopatcherServerTest.cpp
Normal file
348
Samples/AutopatcherServer/AutopatcherServerTest.cpp
Normal file
@ -0,0 +1,348 @@
|
||||
/*
|
||||
* Original work: Copyright (c) 2014, Oculus VR, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* RakNet License.txt file in the licenses directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the RakNet Patents.txt file in the same directory.
|
||||
*
|
||||
*
|
||||
* Modified work: Copyright (c) 2016-2020, SLikeSoft UG (haftungsbeschränkt)
|
||||
*
|
||||
* This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
|
||||
* license found in the license.txt file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// Common includes
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "slikenet/Kbhit.h"
|
||||
|
||||
#include "slikenet/GetTime.h"
|
||||
#include "slikenet/peerinterface.h"
|
||||
#include "slikenet/MessageIdentifiers.h"
|
||||
#include "slikenet/BitStream.h"
|
||||
#include "slikenet/StringCompressor.h"
|
||||
#include "slikenet/FileListTransfer.h"
|
||||
#include "slikenet/FileList.h" // FLP_Printf
|
||||
#include "slikenet/PacketizedTCP.h"
|
||||
#include "slikenet/Gets.h"
|
||||
#include "slikenet/linux_adapter.h"
|
||||
#include "slikenet/osx_adapter.h"
|
||||
|
||||
// Server only includes
|
||||
#include "AutopatcherServer.h"
|
||||
// Replace this repository with your own implementation if you don't want to use PostgreSQL
|
||||
#include "AutopatcherPostgreRepository.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "slikenet/WindowsIncludes.h" // Sleep
|
||||
#else
|
||||
#include <unistd.h> // usleep
|
||||
#endif
|
||||
|
||||
#define USE_TCP
|
||||
#define LISTEN_PORT 60000
|
||||
#define MAX_INCOMING_CONNECTIONS 128
|
||||
|
||||
char WORKING_DIRECTORY[MAX_PATH];
|
||||
char PATH_TO_XDELTA_EXE[MAX_PATH];
|
||||
|
||||
// The default AutopatcherPostgreRepository2 uses bsdiff which takes too much memory for large files.
|
||||
// I override MakePatch to use XDelta in this case
|
||||
class AutopatcherPostgreRepository2_WithXDelta : public SLNet::AutopatcherPostgreRepository2
|
||||
{
|
||||
int MakePatch(const char *oldFile, const char *newFile, char **patch, unsigned int *patchLength, int *patchAlgorithm)
|
||||
{
|
||||
FILE *fpOld;
|
||||
fopen_s(&fpOld, oldFile, "rb");
|
||||
fseek(fpOld, 0, SEEK_END);
|
||||
int contentLengthOld = ftell(fpOld);
|
||||
FILE *fpNew;
|
||||
fopen_s(&fpNew, newFile, "rb");
|
||||
fseek(fpNew, 0, SEEK_END);
|
||||
int contentLengthNew = ftell(fpNew);
|
||||
|
||||
if ((contentLengthOld < 33554432 && contentLengthNew < 33554432) || PATH_TO_XDELTA_EXE[0]==0)
|
||||
{
|
||||
// Use bsdiff, which does a good job but takes a lot of memory based on the size of the file
|
||||
*patchAlgorithm=0;
|
||||
bool b = MakePatchBSDiff(fpOld, contentLengthOld, fpNew, contentLengthNew, patch, patchLength);
|
||||
fclose(fpOld);
|
||||
fclose(fpNew);
|
||||
return b==false ? -1 : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*patchAlgorithm=1;
|
||||
fclose(fpOld);
|
||||
fclose(fpNew);
|
||||
|
||||
char buff[128];
|
||||
SLNet::TimeUS time = SLNet::GetTimeUS();
|
||||
#if defined(_WIN32)
|
||||
sprintf_s(buff, "%I64u", time);
|
||||
#else
|
||||
sprintf_s(buff, "%llu", (long long unsigned int) time);
|
||||
#endif
|
||||
|
||||
// Invoke xdelta
|
||||
// See https://code.google.com/p/xdelta/wiki/CommandLineSyntax
|
||||
char commandLine[512];
|
||||
_snprintf(commandLine, sizeof(commandLine)-1, "-f -s %s %s patchServer_%s.tmp", oldFile, newFile, buff);
|
||||
commandLine[511]=0;
|
||||
|
||||
SHELLEXECUTEINFOA shellExecuteInfo;
|
||||
shellExecuteInfo.cbSize = sizeof(SHELLEXECUTEINFOA);
|
||||
shellExecuteInfo.fMask = SEE_MASK_NOASYNC | SEE_MASK_NO_CONSOLE;
|
||||
shellExecuteInfo.hwnd = nullptr;
|
||||
shellExecuteInfo.lpVerb = "open";
|
||||
shellExecuteInfo.lpFile = PATH_TO_XDELTA_EXE;
|
||||
shellExecuteInfo.lpParameters = commandLine;
|
||||
shellExecuteInfo.lpDirectory = WORKING_DIRECTORY;
|
||||
shellExecuteInfo.nShow = SW_SHOWNORMAL;
|
||||
shellExecuteInfo.hInstApp = nullptr;
|
||||
ShellExecuteExA(&shellExecuteInfo);
|
||||
//ShellExecute(nullptr, "open", PATH_TO_XDELTA_EXE, commandLine, WORKING_DIRECTORY, SW_SHOWNORMAL);
|
||||
|
||||
char pathToPatch[MAX_PATH];
|
||||
sprintf_s(pathToPatch, "%s/patchServer_%s.tmp", WORKING_DIRECTORY, buff);
|
||||
// r+ instead of r, because I want exclusive access in case xdelta is still working
|
||||
FILE *fpPatch;
|
||||
errno_t error = fopen_s(&fpPatch, pathToPatch, "r+b");
|
||||
SLNet::TimeUS stopWaiting = time + 60000000 * 5;
|
||||
while (error!=0 && SLNet::GetTimeUS() < stopWaiting)
|
||||
{
|
||||
RakSleep(1000);
|
||||
error = fopen_s(&fpPatch, pathToPatch, "r+b");
|
||||
}
|
||||
if (error!=0)
|
||||
return 1;
|
||||
fseek(fpPatch, 0, SEEK_END);
|
||||
*patchLength = ftell(fpPatch);
|
||||
fseek(fpPatch, 0, SEEK_SET);
|
||||
*patch = (char*) rakMalloc_Ex(*patchLength, _FILE_AND_LINE_);
|
||||
fread(*patch, 1, *patchLength, fpPatch);
|
||||
fclose(fpPatch);
|
||||
|
||||
int unlinkRes = _unlink(pathToPatch);
|
||||
while (unlinkRes!=0 && SLNet::GetTimeUS() < stopWaiting)
|
||||
{
|
||||
RakSleep(1000);
|
||||
unlinkRes = _unlink(pathToPatch);
|
||||
}
|
||||
if (unlinkRes!=0) {
|
||||
char buff2[1024];
|
||||
strerror_s(buff2, errno);
|
||||
printf("\nWARNING: unlink %s failed.\nerr=%i (%s)\n", pathToPatch, errno, buff2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
int main(int, char **)
|
||||
{
|
||||
printf("Server starting... ");
|
||||
SLNet::AutopatcherServer autopatcherServer;
|
||||
// SLNet::FLP_Printf progressIndicator;
|
||||
SLNet::FileListTransfer fileListTransfer;
|
||||
static const int workerThreadCount=4; // Used for checking patches only
|
||||
static const int sqlConnectionObjectCount=32; // Used for both checking patches and downloading
|
||||
AutopatcherPostgreRepository2_WithXDelta connectionObject[sqlConnectionObjectCount];
|
||||
SLNet::AutopatcherRepositoryInterface *connectionObjectAddresses[sqlConnectionObjectCount];
|
||||
for (int i=0; i < sqlConnectionObjectCount; i++)
|
||||
connectionObjectAddresses[i]=&connectionObject[i];
|
||||
// fileListTransfer.AddCallback(&progressIndicator);
|
||||
autopatcherServer.SetFileListTransferPlugin(&fileListTransfer);
|
||||
// PostgreSQL is fast, so this may not be necessary, or could use fewer threads
|
||||
// This is used to read increments of large files concurrently, thereby serving users downloads as other users read from the DB
|
||||
fileListTransfer.StartIncrementalReadThreads(sqlConnectionObjectCount);
|
||||
autopatcherServer.SetMaxConurrentUsers(MAX_INCOMING_CONNECTIONS); // More users than this get queued up
|
||||
SLNet::AutopatcherServerLoadNotifier_Printf loadNotifier;
|
||||
autopatcherServer.SetLoadManagementCallback(&loadNotifier);
|
||||
#ifdef USE_TCP
|
||||
SLNet::PacketizedTCP packetizedTCP;
|
||||
if (packetizedTCP.Start(LISTEN_PORT,MAX_INCOMING_CONNECTIONS)==false)
|
||||
{
|
||||
printf("Failed to start TCP. Is the port already in use?");
|
||||
return 1;
|
||||
}
|
||||
packetizedTCP.AttachPlugin(&autopatcherServer);
|
||||
packetizedTCP.AttachPlugin(&fileListTransfer);
|
||||
#else
|
||||
SLNet::RakPeerInterface *rakPeer;
|
||||
rakPeer = SLNet::RakPeerInterface::GetInstance();
|
||||
SLNet::SocketDescriptor socketDescriptor(LISTEN_PORT,0);
|
||||
rakPeer->Startup(MAX_INCOMING_CONNECTIONS,&socketDescriptor, 1);
|
||||
rakPeer->SetMaximumIncomingConnections(MAX_INCOMING_CONNECTIONS);
|
||||
rakPeer->AttachPlugin(&autopatcherServer);
|
||||
rakPeer->AttachPlugin(&fileListTransfer);
|
||||
#endif
|
||||
printf("started.\n");
|
||||
|
||||
printf("Enter database password:\n");
|
||||
char connectionString[256],password[128];
|
||||
char username[256];
|
||||
strcpy_s(username, "postgres");
|
||||
gets_s(password);
|
||||
if (password[0]==0) strcpy_s(password, "aaaa");
|
||||
strcpy_s(connectionString, "user=");
|
||||
strcat_s(connectionString, username);
|
||||
strcat_s(connectionString, " password=");
|
||||
strcat_s(connectionString, password);
|
||||
for (int conIdx=0; conIdx < sqlConnectionObjectCount; conIdx++)
|
||||
{
|
||||
if (connectionObject[conIdx].Connect(connectionString)==false)
|
||||
{
|
||||
printf("Database connection failed.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
printf("Database connection suceeded.\n");
|
||||
printf("Starting threads\n");
|
||||
// 4 Worker threads, which is CPU intensive
|
||||
// A greater number of SQL connections, which read files incrementally for large downloads
|
||||
autopatcherServer.StartThreads(workerThreadCount,sqlConnectionObjectCount, connectionObjectAddresses);
|
||||
autopatcherServer.CacheMostRecentPatch(0);
|
||||
// autopatcherServer.SetAllowDownloadOfOriginalUnmodifiedFiles(false);
|
||||
printf("System ready for connections\n");
|
||||
|
||||
// https://code.google.com/p/xdelta/downloads/list
|
||||
printf("Optional: Enter path to xdelta.exe: ");
|
||||
Gets(PATH_TO_XDELTA_EXE, sizeof(PATH_TO_XDELTA_EXE));
|
||||
if (PATH_TO_XDELTA_EXE[0]==0)
|
||||
strcpy_s(PATH_TO_XDELTA_EXE, "c:/xdelta3-3.0.6-win32.exe");
|
||||
|
||||
if (PATH_TO_XDELTA_EXE[0])
|
||||
{
|
||||
printf("Enter working directory to store temporary files: ");
|
||||
Gets(WORKING_DIRECTORY, sizeof(WORKING_DIRECTORY));
|
||||
if (WORKING_DIRECTORY[0]==0)
|
||||
GetTempPathA(MAX_PATH, WORKING_DIRECTORY);
|
||||
if (WORKING_DIRECTORY[strlen(WORKING_DIRECTORY)-1]=='\\' || WORKING_DIRECTORY[strlen(WORKING_DIRECTORY)-1]=='/')
|
||||
WORKING_DIRECTORY[strlen(WORKING_DIRECTORY)-1]=0;
|
||||
}
|
||||
|
||||
printf("(D)rop database\n(C)reate database.\n(A)dd application\n(U)pdate revision.\n(R)emove application\n(Q)uit\n");
|
||||
|
||||
int ch;
|
||||
SLNet::Packet *p;
|
||||
for(;;)
|
||||
{
|
||||
#ifdef USE_TCP
|
||||
SLNet::SystemAddress notificationAddress;
|
||||
notificationAddress=packetizedTCP.HasCompletedConnectionAttempt();
|
||||
if (notificationAddress!= SLNet::UNASSIGNED_SYSTEM_ADDRESS)
|
||||
printf("ID_CONNECTION_REQUEST_ACCEPTED\n");
|
||||
notificationAddress=packetizedTCP.HasNewIncomingConnection();
|
||||
if (notificationAddress!= SLNet::UNASSIGNED_SYSTEM_ADDRESS)
|
||||
printf("ID_NEW_INCOMING_CONNECTION\n");
|
||||
notificationAddress=packetizedTCP.HasLostConnection();
|
||||
if (notificationAddress!= SLNet::UNASSIGNED_SYSTEM_ADDRESS)
|
||||
printf("ID_CONNECTION_LOST\n");
|
||||
|
||||
p=packetizedTCP.Receive();
|
||||
while (p)
|
||||
{
|
||||
packetizedTCP.DeallocatePacket(p);
|
||||
p=packetizedTCP.Receive();
|
||||
}
|
||||
#else
|
||||
p=rakPeer->Receive();
|
||||
while (p)
|
||||
{
|
||||
if (p->data[0]==ID_NEW_INCOMING_CONNECTION)
|
||||
printf("ID_NEW_INCOMING_CONNECTION\n");
|
||||
else if (p->data[0]==ID_DISCONNECTION_NOTIFICATION)
|
||||
printf("ID_DISCONNECTION_NOTIFICATION\n");
|
||||
else if (p->data[0]==ID_CONNECTION_LOST)
|
||||
printf("ID_CONNECTION_LOST\n");
|
||||
|
||||
rakPeer->DeallocatePacket(p);
|
||||
p=rakPeer->Receive();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (_kbhit())
|
||||
{
|
||||
ch=_getch();
|
||||
if (ch=='q')
|
||||
break;
|
||||
else if (ch=='c')
|
||||
{
|
||||
if (connectionObject[0].CreateAutopatcherTables()==false)
|
||||
printf("%s", connectionObject[0].GetLastError());
|
||||
}
|
||||
else if (ch=='d')
|
||||
{
|
||||
if (connectionObject[0].DestroyAutopatcherTables()==false)
|
||||
printf("%s", connectionObject[0].GetLastError());
|
||||
}
|
||||
else if (ch=='a')
|
||||
{
|
||||
printf("Enter application name to add: ");
|
||||
char appName[512];
|
||||
Gets(appName,sizeof(appName));
|
||||
if (appName[0]==0)
|
||||
strcpy_s(appName, "TestApp");
|
||||
|
||||
if (connectionObject[0].AddApplication(appName, username)==false)
|
||||
printf("%s", connectionObject[0].GetLastError());
|
||||
else
|
||||
printf("Done\n");
|
||||
}
|
||||
else if (ch=='r')
|
||||
{
|
||||
printf("Enter application name to remove: ");
|
||||
char appName[512];
|
||||
Gets(appName,sizeof(appName));
|
||||
if (appName[0]==0)
|
||||
strcpy_s(appName, "TestApp");
|
||||
|
||||
if (connectionObject[0].RemoveApplication(appName)==false)
|
||||
printf("%s", connectionObject[0].GetLastError());
|
||||
else
|
||||
printf("Done\n");
|
||||
}
|
||||
else if (ch=='u')
|
||||
{
|
||||
printf("Enter application name: ");
|
||||
char appName[512];
|
||||
Gets(appName,sizeof(appName));
|
||||
if (appName[0]==0)
|
||||
strcpy_s(appName, "TestApp");
|
||||
|
||||
printf("Enter application directory: ");
|
||||
char appDir[512];
|
||||
Gets(appDir,sizeof(appDir));
|
||||
if (appDir[0]==0)
|
||||
strcpy_s(appDir, "D:\\temp");
|
||||
|
||||
if (connectionObject[0].UpdateApplicationFiles(appName, appDir, username, 0)==false)
|
||||
{
|
||||
printf("%s", connectionObject[0].GetLastError());
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Update success.\n");
|
||||
autopatcherServer.CacheMostRecentPatch(appName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RakSleep(30);
|
||||
}
|
||||
|
||||
|
||||
#ifdef USE_TCP
|
||||
packetizedTCP.Stop();
|
||||
#else
|
||||
SLNet::RakPeerInterface::DestroyInstance(rakPeer);
|
||||
#endif
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
37
Samples/AutopatcherServer/CMakeLists.txt
Normal file
37
Samples/AutopatcherServer/CMakeLists.txt
Normal file
@ -0,0 +1,37 @@
|
||||
#
|
||||
# This file was taken from RakNet 4.082.
|
||||
# Please see licenses/RakNet license.txt for the underlying license and related copyright.
|
||||
#
|
||||
#
|
||||
# Modified work: Copyright (c) 2017-2019, SLikeSoft UG (haftungsbeschränkt)
|
||||
#
|
||||
# This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
|
||||
# license found in the license.txt file in the root directory of this source tree.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
project(AutopatcherServer)
|
||||
|
||||
IF(WIN32 AND NOT UNIX)
|
||||
FILE(GLOB AUTOSRC "${Autopatcher_SOURCE_DIR}/AutopatcherServer.cpp" "${Autopatcher_SOURCE_DIR}/MemoryCompressor.cpp" "${Autopatcher_SOURCE_DIR}/CreatePatch.cpp" "${Autopatcher_SOURCE_DIR}/AutopatcherServer.h")
|
||||
FILE(GLOB BZSRC "${BZip2_SOURCE_DIR}/*.c" "${BZip2_SOURCE_DIR}/*.h")
|
||||
LIST(REMOVE_ITEM BZSRC "${BZip2_SOURCE_DIR}/dlltest.c" "${BZip2_SOURCE_DIR}/mk251.c" "${BZip2_SOURCE_DIR}/bzip2recover.c")
|
||||
SOURCE_GROUP(BZip FILES ${BZSRC})
|
||||
SOURCE_GROUP("Source Files" FILES ${AUTOSRC})
|
||||
SOURCE_GROUP(Main "AutopatcherServerTest.cpp")
|
||||
include_directories(${SLIKENET_HEADER_FILES} ./ ${AutopatcherPostgreRepository_SOURCE_DIR} ${PostgreSQLInterface_SOURCE_DIR} ${Autopatcher_SOURCE_DIR} ${BZip2_SOURCE_DIR})
|
||||
add_executable(AutopatcherServer_PostgreSQL "AutopatcherServerTest.cpp" ${AUTOSRC} ${BZSRC})
|
||||
target_link_libraries(AutopatcherServer_PostgreSQL ${SLIKENET_COMMON_LIBS} AutopatcherPostgreRepository)
|
||||
VSUBFOLDER(AutopatcherServer_PostgreSQL "Samples/AutoPatcher/Server/PostgreSQL")
|
||||
ELSE(WIN32 AND NOT UNIX)
|
||||
include_directories(${SLIKENET_HEADER_FILES} ./ ${AutopatcherPostgreRepository_SOURCE_DIR} ${PostgreSQLInterface_SOURCE_DIR} ${Autopatcher_SOURCE_DIR})
|
||||
add_executable(AutopatcherServer_PostgreSQL "AutopatcherServerTest.cpp")
|
||||
target_link_libraries(AutopatcherServer_PostgreSQL ${SLIKENET_COMMON_LIBS} LibAutopatcher AutopatcherPostgreRepository LibPostgreSQLInterface)
|
||||
ENDIF(WIN32 AND NOT UNIX)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user