瀏覽代碼

automatische speicherabbild erstellung bei server crashes

Kolja Strohm 6 年之前
父節點
當前提交
fd428a765e
共有 4 個文件被更改,包括 35 次插入12 次删除
  1. 5 5
      LoginServer/LoginServer.cpp
  2. 10 6
      LoginServer/LoginServer.vcxproj
  3. 5 0
      LoginServer/main.cpp
  4. 15 1
      build.bat

+ 5 - 5
LoginServer/LoginServer.cpp

@@ -989,7 +989,7 @@ bool MSGWeiterleitung::spielerLeavesGruppe( int gruppeId, int accountId )
 		if( ip->getLength() )
 		{
 			Klient *klient = new Klient();
-			unsigned char key[ 20 ] = { 79, 20, 190, 133, 10, 175, 51, 96, 62, 1, 180, 194, 126, 50, 211, 154, 105, 227, 22, 101 };
+			unsigned char key[ 20 ] = { 78, 20, 190, 133, 10, 175, 51, 96, 62, 1, 180, 194, 126, 50, 211, 154, 105, 227, 22, 101 };
 			klient->setSendeKey( (char*)key, 20 );
 			klient->setEmpfangKey( (char*)key, 20 );
 			ret = ret & klient->verbinde( port, ip->getText() );
@@ -1041,7 +1041,7 @@ bool MSGWeiterleitung::setGruppeAdmin( int gruppeId, int adminId )
 		if( ip->getLength() )
 		{
 			Klient *klient = new Klient();
-			unsigned char key[ 20 ] = { 79, 20, 190, 133, 10, 175, 51, 96, 62, 1, 180, 194, 126, 50, 211, 154, 105, 227, 22, 101 };
+			unsigned char key[ 20 ] = { 78, 20, 190, 133, 10, 175, 51, 96, 62, 1, 180, 194, 126, 50, 211, 154, 105, 227, 22, 101 };
 			klient->setSendeKey( (char*)key, 20 );
 			klient->setEmpfangKey( (char*)key, 20 );
 			ret = ret & klient->verbinde( port, ip->getText() );
@@ -1083,7 +1083,7 @@ bool MSGWeiterleitung::spielerLeavesChatroom( int chatroomId, int accountId )
 		if( ip->getLength() )
 		{
 			Klient *klient = new Klient();
-			unsigned char key[ 20 ] = { 79, 20, 190, 133, 10, 175, 51, 96, 62, 1, 180, 194, 126, 50, 211, 154, 105, 227, 22, 101 };
+			unsigned char key[ 20 ] = { 78, 20, 190, 133, 10, 175, 51, 96, 62, 1, 180, 194, 126, 50, 211, 154, 105, 227, 22, 101 };
 			klient->setSendeKey( (char*)key, 20 );
 			klient->setEmpfangKey( (char*)key, 20 );
 			ret = ret & klient->verbinde( port, ip->getText() );
@@ -1120,7 +1120,7 @@ bool MSGWeiterleitung::setChatroomAdmin( int chatroomId, int adminId )
 	if( ip->getLength() )
 	{
 		Klient *klient = new Klient();
-		unsigned char key[ 20 ] = { 79, 20, 190, 133, 10, 175, 51, 96, 62, 1, 180, 194, 126, 50, 211, 154, 105, 227, 22, 101 };
+		unsigned char key[ 20 ] = { 78, 20, 190, 133, 10, 175, 51, 96, 62, 1, 180, 194, 126, 50, 211, 154, 105, 227, 22, 101 };
 		klient->setSendeKey( (char*)key, 20 );
 		klient->setEmpfangKey( (char*)key, 20 );
 		ret = ret & klient->verbinde( port, ip->getText() );
@@ -1159,7 +1159,7 @@ bool MSGWeiterleitung::kickSpielerAusGruppe( int gruppeId )
 		if( ip->getLength() )
 		{
 			Klient *klient = new Klient();
-			unsigned char key[ 20 ] = { 79, 20, 190, 133, 10, 175, 51, 96, 62, 1, 180, 194, 126, 50, 211, 154, 105, 227, 22, 101 };
+			unsigned char key[ 20 ] = { 78, 20, 190, 133, 10, 175, 51, 96, 62, 1, 180, 194, 126, 50, 211, 154, 105, 227, 22, 101 };
 			klient->setSendeKey( (char*)key, 20 );
 			klient->setEmpfangKey( (char*)key, 20 );
 			ret = ret & klient->verbinde( port, ip->getText() );

+ 10 - 6
LoginServer/LoginServer.vcxproj

@@ -35,14 +35,18 @@
   <ImportGroup Label="PropertySheets" />
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <RemoteProjectDir>$(RemoteRootDir)/Server/$(ProjectName)/Release</RemoteProjectDir>
+    <RemoteProjectDir>$(RemoteRootDir)/Server/$(ProjectName)/release</RemoteProjectDir>
     <TargetExt />
-    <IncludePath>..\..\..\..\Allgemein\Framework;../../../Framework/Release;..\..\..\..\Allgemein\Network\Network;../../../Network/Release;..\..\..\..\Allgemein\sql\sql;../../../sql/Release;$(IncludePath)</IncludePath>
+    <IncludePath>..\..\..\..\Allgemein\Framework;../../../Framework/release;..\..\..\..\Allgemein\Network\Network;../../../Network/release;..\..\..\..\Allgemein\sql\sql;../../../sql/release;$(IncludePath)</IncludePath>
+    <OutDir>$(ProjectDir)bin\$(Platform)\release\</OutDir>
+    <IntDir>$(ProjectDir)obj\$(Platform)\release\</IntDir>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <TargetExt />
-    <RemoteProjectDir>$(RemoteRootDir)/Server/$(ProjectName)/Debug</RemoteProjectDir>
-    <IncludePath>..\..\..\..\Allgemein\Framework;../../../Framework/Debug;..\..\..\..\Allgemein\Network\Network;../../../Network/Debug;..\..\..\..\Allgemein\sql\sql;../../../sql/Debug;$(IncludePath)</IncludePath>
+    <RemoteProjectDir>$(RemoteRootDir)/Server/$(ProjectName)/debug</RemoteProjectDir>
+    <IncludePath>..\..\..\..\Allgemein\Framework;../../../Framework/debug;..\..\..\..\Allgemein\Network\Network;../../../Network/debug;..\..\..\..\Allgemein\sql\sql;../../../sql/debug;$(IncludePath)</IncludePath>
+    <OutDir>$(ProjectDir)bin\$(Platform)\debug\</OutDir>
+    <IntDir>$(ProjectDir)obj\$(Platform)\debug\</IntDir>
   </PropertyGroup>
   <ItemGroup>
     <ClCompile Include="Datenbank.cpp" />
@@ -55,7 +59,7 @@
   </ItemGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <Link>
-      <AdditionalLibraryDirectories>$(RemoteRootDir)/sql/Release/bin/x64/release;$(RemoteRootDir)/Network/Release/bin/x64/release;$(RemoteRootDir)/Framework/Release/bin/x64/release;/usr/lib/;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>$(RemoteRootDir)/sql/release/bin/x64/release;$(RemoteRootDir)/Network/release/bin/x64/release;$(RemoteRootDir)/Framework/release/bin/x64/release;/usr/lib/;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <LibraryDependencies>Framework;Network;SQL;pq;pthread</LibraryDependencies>
       <AdditionalOptions>-Wl,-rpath,../lib %(AdditionalOptions)</AdditionalOptions>
     </Link>
@@ -64,7 +68,7 @@
     <Link>
       <AdditionalOptions>-Wl,-rpath,../lib %(AdditionalOptions)</AdditionalOptions>
       <LibraryDependencies>dbgFramework;dbgNetwork;dbgSQL;pq;pthread</LibraryDependencies>
-      <AdditionalLibraryDirectories>$(RemoteRootDir)/sql/Debug/bin/x64/debug;$(RemoteRootDir)/Network/Debug/bin/x64/debug;$(RemoteRootDir)/Framework/Debug/bin/x64/debug;/usr/lib/;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>$(RemoteRootDir)/sql/debug/bin/x64/debug;$(RemoteRootDir)/Network/debug/bin/x64/debug;$(RemoteRootDir)/Framework/debug/bin/x64/debug;/usr/lib/;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+ 5 - 0
LoginServer/main.cpp

@@ -3,9 +3,14 @@
 #include <iostream>
 #include <fstream>
 #include <Globals.h>
+#include <sys/resource.h>
 
 int main()
 {
+	struct rlimit core_limits;
+	core_limits.rlim_cur = core_limits.rlim_max = RLIM_INFINITY;
+	setrlimit(RLIMIT_CORE, &core_limits);
+
     Framework::initFramework();
 	Zeit *z = getZeit();
 	Text *pfad = new Text( "../log/login/" );

+ 15 - 1
build.bat

@@ -1,2 +1,16 @@
+:DebugLinux64
+SET RETURN=DebugLinux64
+SET NEXT=ReleaseLinux64
 "D:\Visual Studio 2017\MSBuild\15.0\Bin\MSBuild.exe" "Login Server.sln" /t:rebuild /p:configuration=debug /p:platform=x64
-"D:\Visual Studio 2017\MSBuild\15.0\Bin\MSBuild.exe" "Login Server.sln" /t:rebuild /p:configuration=release /p:platform=x64
+if errorlevel 1 GOTO Error
+:ReleaseLinux64
+SET RETURN=ReleaseLinux64
+SET NEXT=End
+"D:\Visual Studio 2017\MSBuild\15.0\Bin\MSBuild.exe" "Login Server.sln" /t:rebuild /p:configuration=release /p:platform=x64
+if errorlevel 1 GOTO Error
+GOTO End
+:Error
+SET /p redo=Nochmal versuchen?(j/n):
+IF /I '%redo%' equ 'j' GOTO %RETURN%
+GOTO %NEXT%
+:End