Bladeren bron

Projektdateien hinzufügen.

Kolja Strohm 6 jaren geleden
bovenliggende
commit
c2caaa5962

+ 30 - 0
ServerSystemStarter.sln

@@ -0,0 +1,30 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26020.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ServerSystemStarter", "ServerSystemStarter\ServerSystemStarter.vcxproj", "{70D2CF38-B4F1-4C91-AE22-678353175DCD}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
+		Release|ARM = Release|ARM
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{70D2CF38-B4F1-4C91-AE22-678353175DCD}.Debug|ARM.ActiveCfg = Debug|x64
+		{70D2CF38-B4F1-4C91-AE22-678353175DCD}.Debug|x64.ActiveCfg = Debug|x64
+		{70D2CF38-B4F1-4C91-AE22-678353175DCD}.Debug|x64.Build.0 = Debug|x64
+		{70D2CF38-B4F1-4C91-AE22-678353175DCD}.Debug|x86.ActiveCfg = Debug|x64
+		{70D2CF38-B4F1-4C91-AE22-678353175DCD}.Release|ARM.ActiveCfg = Release|x64
+		{70D2CF38-B4F1-4C91-AE22-678353175DCD}.Release|x64.ActiveCfg = Release|x64
+		{70D2CF38-B4F1-4C91-AE22-678353175DCD}.Release|x64.Build.0 = Release|x64
+		{70D2CF38-B4F1-4C91-AE22-678353175DCD}.Release|x86.ActiveCfg = Release|x64
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 462 - 0
ServerSystemStarter/Quelldateien/Start.cpp

@@ -0,0 +1,462 @@
+#ifdef WIN32
+#include <main.h>
+#else
+#include <spawn.h>
+#endif
+#include <Zeit.h>
+#include <iostream>
+#include <fstream>
+#include <Text.h>
+#include <Datei.h>
+#include <InitDatei.h>
+#include <sql.h>
+#include <Klient.h>
+
+using namespace Framework;
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-result" 
+#ifdef WIN32
+int KSGStart Framework::Start( Startparam p )
+#else
+int main()
+#endif
+{
+#ifdef _DEBUG
+	chdir( "/test/startup" );
+#else
+	chdir( "/ksg/Server/startup" );
+#endif
+	Network::Start( 100 );
+	Zeit *z = getZeit();
+	Text *pfad = new Text( "../log/startup/" );
+	pfad->append( z->getZeit( "y-m-d_h-i-s.log" ) );
+	z->release();
+	DateiPfadErstellen( pfad->getThis() );
+	std::ofstream file;
+	file.open( pfad->getText() );
+	std::streambuf* sbuf = std::cout.rdbuf();
+	std::cout.rdbuf( file.rdbuf() );
+	pfad->release();
+    system( "/usr/lib/sendmail -t < mail" );
+	std::cout << "Startet...\n";
+	std::cout << "Lese init Datei ../data/startup.ini ...\n";
+	InitDatei *dat = new InitDatei( "../data/startup.ini" );
+	if( !dat->laden() )
+	{
+		std::cout << "error: Datei konnte nicht gelesen werden. Das Programm wird geschlossen.\n";
+		dat->release();
+		file.close();
+		std::cout.rdbuf( sbuf );
+		Network::Exit();
+		return 1;
+	}
+
+	std::cout << "Verbindung mit Datenbank wird hergestellt...\n";
+	if( !dat->wertExistiert( "DBIP" ) )
+	{
+		std::cout << "error: Kein 'DBIP' Eintrag in der startup.ini gefunden. Das Programm wird geschlossen.\n";
+		dat->release();
+		file.close();
+		std::cout.rdbuf( sbuf );
+		Network::Exit();
+		return 2;
+	}
+	if( !dat->wertExistiert( "DBPort" ) )
+	{
+		std::cout << "error: Kein 'DBPort' Eintrag in der startup.ini gefunden. Das Programm wird geschlossen.\n";
+		dat->release();
+		file.close();
+		std::cout.rdbuf( sbuf );
+		Network::Exit();
+		return 2;
+	}
+	if( !dat->wertExistiert( "DBBenutzer" ) )
+	{
+		std::cout << "error: Kein 'DBBenutzer' Eintrag in der startup.ini gefunden. Das Programm wird geschlossen.\n";
+		dat->release();
+		file.close();
+		std::cout.rdbuf( sbuf );
+		Network::Exit();
+		return 2;
+	}
+	if( !dat->wertExistiert( "DBPasswort" ) )
+	{
+		std::cout << "error: Kein 'DBPasswort' Eintrag in der startup.ini gefunden. Das Programm wird geschlossen.\n";
+		dat->release();
+		file.close();
+		std::cout.rdbuf( sbuf );
+		Network::Exit();
+		return 2;
+	}
+	if( !dat->wertExistiert( "DBName" ) )
+	{
+		std::cout << "error: Kein 'DBName' Eintrag in der startup.ini gefunden. Das Programm wird geschlossen.\n";
+		dat->release();
+		file.close();
+		std::cout.rdbuf( sbuf );
+		Network::Exit();
+		return 2;
+	}
+	sql::Datenbank *db = new sql::Datenbank( dat->zWert( "DBBenutzer" )->getText(),
+											 dat->zWert( "DBPasswort" )->getText(),
+											 dat->zWert( "DBName" )->getText(),
+											 dat->zWert( "DBIP" )->getText(),
+											 (unsigned short)TextZuInt( dat->zWert( "DBPort" )->getText(), 10 ) );
+	if( !db->istOk() )
+	{
+		Text *err = db->getLetzterFehler();
+		std::cout << "error: Es konnte keine Verbindung zur datenbank hergestellt werden. Das Programm wird geschlossen.\n" << err->getText();
+		err->release();
+		db->release();
+		dat->release();
+		file.close();
+		std::cout.rdbuf( sbuf );
+		Network::Exit();
+		return 3;
+	}
+	std::cout << "Verbindung zur Datenbank erfolgreich Hergestellt.\n";
+	std::cout << "Überprüfe ob Datenbank Server läuft...\n";
+	if( !dat->wertExistiert( "DBServerIP" ) )
+	{
+		std::cout << "error: Kein 'DBServerIP' Eintrag in der startup.ini gefunden. Das Programm wird geschlossen.\n";
+		db->release();
+		dat->release();
+		file.close();
+		std::cout.rdbuf( sbuf );
+		Network::Exit();
+		return 2;
+	}
+	if( !dat->wertExistiert( "DBServerPort" ) )
+	{
+		std::cout << "error: Kein 'DBServerIP' Eintrag in der startup.ini gefunden. Das Programm wird geschlossen.\n";
+		db->release();
+		dat->release();
+		file.close();
+		std::cout.rdbuf( sbuf );
+		Network::Exit();
+		return 2;
+	}
+	Network::Klient *klient = new Network::Klient();
+	bool b = klient->verbinde( (unsigned short)TextZuInt( dat->zWert( "DBServerPort" )->getText(), 10 ), dat->zWert( "DBServerIP" )->getText() );
+	char ret = 0;
+	if( b )
+	{
+		klient->sende( "\6", 1 );
+		klient->getNachricht( &ret, 1 );
+		klient->trenne();
+	}
+	klient = klient->release();
+	if( b )
+	{
+		std::cout << "error: Der Datenbank Server läuft bereits. Es ist kein erneuter Start des Systems möglich. Das Programm wird geschlossen.\n";
+		db->release();
+		dat->release();
+		file.close();
+		std::cout.rdbuf( sbuf );
+		Network::Exit();
+		return 4;
+	}
+
+    std::cout << "App Server wird gestartet...\n";
+    if( !dat->wertExistiert( "AppServerPfad" ) )
+        std::cout << "warnung: Kein 'AppServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+    else
+    {
+        pid_t id;
+        char *args[] = { ( char* )"AppServer", (char*)0 };
+        chdir( dat->zWert( "AppServerPfad" )->getText() );
+        posix_spawn( &id, "AppServer", 0, 0, args, 0 );
+        std::cout << "App Server wurde gestartet.\n";
+    }
+
+	/*std::cout << "Chat App Server wird gestartet...\n";
+	if( !dat->wertExistiert( "ChatAppServerPfad" ) )
+		std::cout << "warnung: Kein 'ChatAppServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+	else
+	{
+		pid_t id;
+		char *args[] = { ( char* )"ChatAppServer", (char*)0 };
+		chdir( dat->zWert( "ChatAppServerPfad" )->getText() );
+		posix_spawn( &id, "ChatAppServer", 0, 0, args, 0 );
+		std::cout << "Chat App Server wurde gestartet.\n";
+	}*/
+
+	std::cout << "Main Server wird gestartet...\n";
+	if( !dat->wertExistiert( "MainServerPfad" ) )
+		std::cout << "warnung: Kein 'MainServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+	else
+	{
+		pid_t id;
+		char *args[] = { (char*)"MainServer", (char*)0 };
+		chdir( dat->zWert( "MainServerPfad" )->getText() );
+		posix_spawn( &id, "MainServer", 0, 0, args, 0 );
+		std::cout << "Main Server wurde gestartet.\n";
+	}
+
+	std::cout << "Lösche Client Liste in Datenbank...\n";
+	db->befehl( "SELECT id from client" );
+	sql::Result r = db->getResult();
+	for( int i = 0; i < r.zeilenAnzahl; i++ )
+	{
+		Text *befehl = new Text( "SELECT unregister_client( " );
+		befehl->append( r.values[ i ].getText() );
+		befehl->append( " )" );
+		db->befehl( befehl->getText() );
+		befehl->release();
+	}
+	std::cout << r.zeilenAnzahl << " Clients gelöscht.\n";
+	r.destroy();
+
+	std::cout << "Lösche laufende Spiele...\n";
+	db->befehl( "SELECT id FROM spiel WHERE end_datum IS NULL" );
+	r = db->getResult();
+	for( int i = 0; i < r.zeilenAnzahl; i++ )
+	{
+		Text *befehl = new Text( "DELETE FROM spiel_spieler WHERE spiel_id = " );
+		befehl->append( r.values[ i ].getText() );
+		db->befehl( befehl->getText() );
+		befehl->setText( "DELETE FROM spiel WHERE id = " );
+		befehl->append( r.values[ i ].getText() );
+		db->befehl( befehl->getText() );
+		befehl->release();
+	}
+	std::cout << r.zeilenAnzahl << " laufende Spiele gelöscht.\n";
+	r.destroy();
+
+	std::cout << "Lösche erstellte Spiele...\n";
+	db->befehl( "SELECT id FROM spiel_erstellt" );
+	r = db->getResult();
+	for( int i = 0; i < r.zeilenAnzahl; i++ )
+	{
+		Text *befehl = new Text( "DELETE FROM spiel_erstellt_spieler WHERE spiel_erstellt_id = " );
+		befehl->append( r.values[ i ].getText() );
+		db->befehl( befehl->getText() );
+		befehl->setText( "DELETE FROM spiel_erstellt_gruppe WHERE spiel_erstellt_id = " );
+		befehl->append( r.values[ i ].getText() );
+		db->befehl( befehl->getText() );
+		befehl->setText( "DELETE FROM spiel_erstellt WHERE id = " );
+		befehl->append( r.values[ i ].getText() );
+		db->befehl( befehl->getText() );
+		befehl->release();
+	}
+	std::cout << r.zeilenAnzahl << " erstellte Spiele gelöscht.\n";
+	r.destroy();
+
+	std::cout << "Lösche Warteschlange...\n";
+	db->befehl( "DELETE FROM account_anmeldung_fuer_spiel" );
+	std::cout << db->getZeilenAnzahl() << " Spieler aus der Warteschlange entfernt.\n";
+	db->befehl( "DELETE FROM gruppe_anmeldung_fuer_spiel" );
+	std::cout << db->getZeilenAnzahl() << " Gruppen aus der Warteschlange entfernt.\n";
+
+	std::cout << "Lösche Gruppen...\n";
+	db->befehl( "SELECT id FROM gruppe" );
+	r = db->getResult();
+	for( int i = 0; i < r.zeilenAnzahl; i++ )
+	{
+		Text *befehl = new Text( "DELETE FROM gruppe_spieler WHERE gruppe_id = " );
+		befehl->append( r.values[ i ].getText() );
+		db->befehl( befehl->getText() );
+		befehl->setText( "DELETE FROM gruppe WHERE id = " );
+		befehl->append( r.values[ i ].getText() );
+		db->befehl( befehl->getText() );
+		befehl->release();
+	}
+	std::cout << r.zeilenAnzahl << " Gruppen gelöscht.\n";
+	r.destroy();
+	db->befehl("UPDATE server a SET server_status_id = 1, tasks = 0 FROM server_typ b WHERE a.server_typ_name = b.name AND b.task_name = 'clients'");
+	std::cout << db->getZeilenAnzahl() << " Server zurückgesetzt.\n";
+
+	//std::cout << "Lösche Chaträume...\n";
+	//db->befehl( "SELECT id FROM chatroom" );
+	//r = db->getResult();
+	//for( int i = 0; i < r.zeilenAnzahl; i++ )
+	//{
+	//	Text *befehl = new Text( "DELETE FROM chatroom_spieler WHERE chatroom_id = " );
+	//	befehl->append( r.values[ i ].getText() );
+	//	db->befehl( befehl->getText() );
+	//	befehl->setText( "DELETE FROM chatroom WHERE id = " );
+	//	befehl->append( r.values[ i ].getText() );
+	//	db->befehl( befehl->getText() );
+	//	befehl->release();
+	//}
+	//std::cout << r.zeilenAnzahl << " Chaträume gelöscht.\n";
+	//r.destroy();
+
+	std::cout << "Starte Erhaltungs Server...\n";
+	if( !dat->wertExistiert( "ErhaltungServerPfad" ) )
+		std::cout << "warnung: Kein 'ErhaltungServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+	else
+	{
+		pid_t id;
+		char *args[] = { (char*)"ErhaltungServer", (char*)0 };
+		chdir( dat->zWert( "ErhaltungServerPfad" )->getText() );
+		posix_spawn( &id, "ErhaltungServer", 0, 0, args, 0 );
+		std::cout << "Erhaltung Server wurde gestartet.\n";
+	}
+
+	std::cout << "Starte Patch Server...\n";
+	if( !dat->wertExistiert( "PatchServerPfad" ) )
+		std::cout << "warnung: Kein 'PatchServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+	else
+	{
+		pid_t id;
+		char *args[] = { (char*)"PatchServer", (char*)0 };
+		chdir( dat->zWert( "PatchServerPfad" )->getText() );
+		posix_spawn( &id, "PatchServer", 0, 0, args, 0 );
+		std::cout << "Patch Server wurde gestartet.\n";
+	}
+
+	std::cout << "Starte Register Server...\n";
+	if( !dat->wertExistiert( "RegisterServerPfad" ) )
+		std::cout << "warnung: Kein 'RegisterServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+	else
+	{
+		pid_t id;
+		char *args[] = { (char*)"RegisterServer", (char*)0 };
+		chdir( dat->zWert( "RegisterServerPfad" )->getText() );
+		posix_spawn( &id, "RegisterServer", 0, 0, args, 0 );
+		std::cout << "Register Server wurde gestartet.\n";
+	}
+
+	std::cout << "Starte Login Server...\n";
+	if( !dat->wertExistiert( "LoginServerPfad" ) )
+		std::cout << "warnung: Kein 'LoginServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+	else
+	{
+		pid_t id;
+		char *args[] = { (char*)"LoginServer", (char*)0 };
+		chdir( dat->zWert( "LoginServerPfad" )->getText() );
+		posix_spawn( &id, "LoginServer", 0, 0, args, 0 );
+		std::cout << "Login Server wurde gestartet.\n";
+	}
+
+	std::cout << "Starte Information Server...\n";
+	if( !dat->wertExistiert( "InformationServerPfad" ) )
+		std::cout << "warnung: Kein 'InformationServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+	else
+	{
+		pid_t id;
+		char *args[] = { (char*)"InformationServer", (char*)0 };
+		chdir( dat->zWert( "InformationServerPfad" )->getText() );
+		posix_spawn( &id, "InformationServer", 0, 0, args, 0 );
+		std::cout << "Information Server wurde gestartet.\n";
+	}
+
+	std::cout << "Starte Chat Server...\n";
+	if( !dat->wertExistiert( "ChatServerPfad" ) )
+		std::cout << "warnung: Kein 'ChatServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+	else
+	{
+		pid_t id;
+		char *args[] = { (char*)"ChatServer", (char*)0 };
+		chdir( dat->zWert( "ChatServerPfad" )->getText() );
+		posix_spawn( &id, "ChatServer", 0, 0, args, 0 );
+		std::cout << "Chat Server wurde gestartet.\n";
+	}
+
+	std::cout << "Starte Anmeldung Server...\n";
+	if( !dat->wertExistiert( "AnmeldungServerPfad" ) )
+		std::cout << "warnung: Kein 'AnmeldungServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+	else
+	{
+		pid_t id;
+		char *args[] = { (char*)"AnmeldungServer", (char*)0 };
+		chdir( dat->zWert( "AnmeldungServerPfad" )->getText() );
+		posix_spawn( &id, "AnmeldungServer", 0, 0, args, 0 );
+		std::cout << "Anmeldung Server wurde gestartet.\n";
+    }
+
+    std::cout << "Starte karten Server...\n";
+    if( !dat->wertExistiert( "KartenServerPfad" ) )
+        std::cout << "warnung: Kein 'KartenServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+    else
+    {
+        pid_t id;
+        char *args[] = { ( char* )"KartenServer", (char*)0 };
+        chdir( dat->zWert( "KartenServerPfad" )->getText() );
+        posix_spawn( &id, "KartenServer", 0, 0, args, 0 );
+        std::cout << "Karten Server wurde gestartet.\n";
+    }
+
+	std::cout << "Starte spiel Server...\n";
+	if( !dat->wertExistiert( "SpielServerPfad" ) )
+		std::cout << "warnung: Kein 'SpielServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+	else
+	{
+		pid_t id;
+		char *args[] = { (char*)"SpielServer", (char*)0 };
+		chdir( dat->zWert( "SpielServerPfad" )->getText() );
+		posix_spawn( &id, "SpielServer", 0, 0, args, 0 );
+		std::cout << "Spiel Server wurde gestartet.\n";
+	}
+
+	std::cout << "Starte Shop Server...\n";
+	if( !dat->wertExistiert( "ShopServerPfad" ) )
+		std::cout << "warnung: Kein 'ShopServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+	else
+	{
+		pid_t id;
+		char *args[] = { (char*)"ShopServer", (char*)0 };
+		chdir( dat->zWert( "ShopServerPfad" )->getText() );
+		posix_spawn( &id, "ShopServer", 0, 0, args, 0 );
+		std::cout << "Shop Server wurde gestartet.\n";
+	}
+
+	std::cout << "Starte Historie Server...\n";
+	if( !dat->wertExistiert( "HistorieServerPfad" ) )
+		std::cout << "warnung: Kein 'HistorieServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+	else
+	{
+		pid_t id;
+		char *args[] = { ( char* )"HistorieServer", (char*)0 };
+		chdir( dat->zWert( "HistorieServerPfad" )->getText() );
+		posix_spawn( &id, "HistorieServer", 0, 0, args, 0 );
+		std::cout << "Historie Server wurde gestartet.\n";
+	}
+
+	std::cout << "Starte News Server...\n";
+	if( !dat->wertExistiert( "NewsServerPfad" ) )
+		std::cout << "warnung: Kein 'NewsServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+	else
+	{
+		pid_t id;
+		char *args[] = { ( char* )"NewsServer", (char*)0 };
+		chdir( dat->zWert( "NewsServerPfad" )->getText() );
+		posix_spawn( &id, "NewsServer", 0, 0, args, 0 );
+		std::cout << "News Server wurde gestartet.\n";
+	}
+
+	std::cout << "Starte Editor Server...\n";
+	if( !dat->wertExistiert( "EditorServerPfad" ) )
+		std::cout << "warnung: Kein 'EditorServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+	else
+	{
+		pid_t id;
+		char *args[] = { ( char* )"EditorServer", (char*)0 };
+		chdir( dat->zWert( "EditorServerPfad" )->getText() );
+		posix_spawn( &id, "EditorServer", 0, 0, args, 0 );
+		std::cout << "Editor Server wurde gestartet.\n";
+	}
+
+    std::cout << "Starte Minigame Server...\n";
+    if( !dat->wertExistiert( "MinigameServerPfad" ) )
+        std::cout << "warnung: Kein 'MinigameServerPfad' Eintrag in der startup.ini gefunden. Dieser Server wird nicht gestartet.\n";
+    else
+    {
+        pid_t id;
+        char *args[] = { ( char* )"MinigameServer", (char*)0 };
+        chdir( dat->zWert( "MinigameServerPfad" )->getText() );
+        posix_spawn( &id, "MinigameServer", 0, 0, args, 0 );
+        std::cout << "Minigame Server wurde gestartet.\n";
+    }
+
+	db->release();
+	dat->speichern();
+	dat->release();
+	std::cout << "Der Startvorgang wurde beendet.\n";
+	file.close();
+	std::cout.rdbuf( sbuf );
+	Network::Exit();
+	return 0;
+}
+#pragma GCC diagnostic pop 

+ 75 - 0
ServerSystemStarter/ServerSystemStarter.vcxproj

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{70d2cf38-b4f1-4c91-ae22-678353175dcd}</ProjectGuid>
+    <Keyword>Linux</Keyword>
+    <RootNamespace>ServerSystemStarter</RootNamespace>
+    <MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
+    <ApplicationType>Linux</ApplicationType>
+    <ApplicationTypeRevision>1.0</ApplicationTypeRevision>
+    <TargetLinuxPlatform>Generic</TargetLinuxPlatform>
+    <LinuxProjectType>{D51BCBC9-82E9-4017-911E-C93873C4EA2B}</LinuxProjectType>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <RemoteRootDir>/home/kolja/projects</RemoteRootDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <RemoteRootDir>/home/kolja/projects</RemoteRootDir>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings" />
+  <ImportGroup Label="Shared" />
+  <ImportGroup Label="PropertySheets" />
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <TargetExt />
+    <RemoteProjectDir>$(RemoteRootDir)/Server/Startup/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>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <RemoteProjectDir>$(RemoteRootDir)/Server/Startup/release</RemoteProjectDir>
+    <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>
+    <TargetExt />
+  </PropertyGroup>
+  <ItemGroup>
+    <ClCompile Include="Quelldateien\Start.cpp" />
+  </ItemGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Link>
+      <LibraryDependencies>Framework;Network;SQL;pq;pthread</LibraryDependencies>
+      <AdditionalOptions>-Wl,-rpath,../lib %(AdditionalOptions)</AdditionalOptions>
+      <AdditionalLibraryDirectories>$(RemoteRootDir)/sql/release/bin/x64/release;$(RemoteRootDir)/Network/release/bin/x64/release;$(RemoteRootDir)/Framework/release/bin/x64/release;/usr/lib/;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Link>
+      <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>
+      <AdditionalOptions>-Wl,-rpath,../lib %(AdditionalOptions)</AdditionalOptions>
+    </Link>
+    <ClCompile>
+      <UndefinePreprocessorDefinitions>
+      </UndefinePreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG</PreprocessorDefinitions>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets" />
+</Project>

BIN
ServerSystemStarter/readme/images/ArchOptions.gif


BIN
ServerSystemStarter/readme/images/ChangeRemote.gif


BIN
ServerSystemStarter/readme/images/ManageConnections.gif


BIN
ServerSystemStarter/readme/images/OutputTypes.gif


BIN
ServerSystemStarter/readme/images/debuggerexport.png


BIN
ServerSystemStarter/readme/images/firstconnection.png


BIN
ServerSystemStarter/readme/images/linker.png


BIN
ServerSystemStarter/readme/images/postbuild.png


+ 85 - 0
ServerSystemStarter/readme/readme.html

@@ -0,0 +1,85 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset='utf-8'>
+
+    <link rel="stylesheet" type="text/css" href="stylesheet.css" media="screen">
+
+    <title>Getting Started</title>
+  </head>
+
+<body>
+
+    <div class="container">
+        <div id="header">
+            <h1>Getting Started</h1>
+            <h2>Visual C++ for Linux Development extension</h2>
+        </div>
+    
+    <table>
+    <tr>    
+    <div id="main_content">
+        
+        <td>
+        <div id="lpanel">
+            <h1>Setting up your project for Linux Development</h1>
+
+            <p>With this extension you can author C++ code for Linux servers, desktops and devices. You can manage your connections to these machines from within VS. VS will automatically copy and remote build your sources and can launch your application with the debugger. Our project system supports targeting specific architectures, including ARM.</p>
+            <img src="images\ArchOptions.gif"/>
+            
+            <h1>Connecting to Linux</h1>
+            <h2>Prerequisites</h2>
+            <p>Today we only support building remotely on the Linux target machine. We are not limited by specific Linux distros but we do have dependencies on the presence of some tools. Specifically, we need openssh-server, g++, gdb and gdbserver. Use your favorite package manager to install them, e.g. on Debian based systems: sudo apt-get install openssh-server g++ gdb gdbserver</p>
+            
+            <h2>First connection</h2>
+            <p>The first time you target a Linux machine you will be prompted for connection information.  This is triggered by building the project.</p>
+            <img src="images\firstconnection.png"/>
+                
+            <h2>Adding and removing connections</h2>
+            <p>To add a new connection, go to Tools > Options and search for Linux. From here you can add and remove connections.</p>
+            <img src="images\ManageConnections.gif"/>
+            
+            <p>To change which connection a project is using go to the project properties remote settings and update the target machine.</p>
+            <img src="images\ChangeRemote.gif"/>
+            
+            <h1>Project Properties</h1>
+            <p>All of the options necessary to control C++ compilation are exposed on the project properies pages. We'll cover a few specific to how things work for Linux. First under remote settings, you will see the remote root is set to ~/projects/ by default and that we are setting the remote project directory to match our project name in that location. </p>
+            <img src="images\OutputTypes.gif"/>
+            
+            <p>Looking at the General settings for the project, you can see how our output and intermediate directories were configured. Additionally, you’ll see that this project was configured as an application – thus our executable is under bin/x64/Debug/ as ConsoleApplication1.out. Notice that for configuration types we also support static and dynamic libraries.</p>
+            
+            <p>Add additional library dependencies on the Linker > Input property page.</p>
+            <img src="images\linker.png"/>
+            
+            <p>You can pass additional pre launch commands to the debugger to do things like launch graphical apps on the remote linux machine.</p>
+            <img src="images\debuggerexport.png"/>
+            
+            <p>You can also send post build events to control remote behavior, as in this example that exports a gpio pin for use without requiring the executable run as super user.</p>
+            <img src="images\postbuild.png"/>
+            
+        </div>
+        </td>
+        <td>
+        <div id="rpanel">
+
+            <h1>Resources</h1>
+
+            <p>Check out the <a href="http://aka.ms/vslinuxext">VS Gallery VC++ for Linux Development page</a> where we will keep updates posted. You can also check out our <a href="https://blogs.msdn.microsoft.com/vcblog/2016/03/30/visual-c-for-linux-development">announcment blog post</a> for more in depth details on configuring the project properties.</p>
+            
+            <p>Here are other utilities you will find useful in connection with this extension.</p>
+            <ul>
+                <li>Learn more about <a href="http://aka.ms/vsiot">IoT Development</a></li>
+                <li><a href="http://aka.ms/vsiotext">VC++ for IoT Development Tools</a></li>
+                <li><a href="https://github.com/Azure/azure-iot-sdks">Azure IoT SDK</a>, includes a C API for connecting small devices to the Azure IoT Hub</li>
+            </ul>
+
+            <h1>Give us feedback</h1>
+            <p><a href="http://aka.ms/vslinux-feedback">UserVoice</a></p>
+        </div>
+        </td>   
+    </div>
+    </tr>
+    </table>
+    </div>
+</body>
+</html>

+ 119 - 0
ServerSystemStarter/readme/stylesheet.css

@@ -0,0 +1,119 @@
+body {
+  margin: 0;
+  padding: 0;
+  border: 0;
+  color: #1E1E1E;
+  font-size: 13px;
+  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
+  line-height: 1.45;
+  word-wrap: break-word;
+}
+
+/* General & 'Reset' Stuff */
+
+
+.container {
+  width: 1100px;
+  margin: 0 auto;
+}
+
+section {
+  display: block;
+  margin: 0;
+}
+
+h1, h2, h3, h4, h5, h6 {
+  margin: 0;
+}
+
+table, tr {
+    width: 1100px;
+    padding: 0px;
+    vertical-align: top;
+  }
+
+/* Header, <header>
+   header   - container
+   h1       - project name
+   h2       - project description
+*/
+
+#header {
+  color: #FFF;
+  background: #68217a;
+  position:relative;
+}
+h1, h2 {
+  font-family: "Segoe UI Light", "Segoe UI", Helvetica, Arial, sans-serif;
+  line-height: 1;
+  margin: 0 18px;;
+  padding: 0;
+}
+#header h1 {
+  font-size: 3.4em;
+  padding-top: 18px;
+  font-weight: normal;
+  margin-left: 15px;
+}
+
+#header h2 {
+  font-size: 1.5em;
+  margin-top: 10px;
+  padding-bottom: 18px;
+  font-weight: normal;
+}
+
+#main_content {
+  width: 100%;
+  display: flex;
+  flex-direction: row;
+}
+
+
+h1, h2, h3, h4, h5, h6 {
+  font-weight: bolder;
+}
+
+#main_content h1 {
+  font-size: 1.8em;
+  margin-top: 34px;
+}
+
+    #main_content h1:first-child {
+        margin-top: 30px;
+    }
+
+#main_content h2 {
+  font-size: 1.8em;
+}
+p, ul {
+    margin: 11px 18px;
+}
+
+#main_content a {
+    color: #06C;
+    text-decoration: none;
+}
+ul {
+        margin-top: 13px;
+    margin-left: 18px;
+    padding-left: 0;
+}
+    ul li {
+        margin-left: 18px;
+        padding-left: 0;
+    }
+#lpanel {
+    width: 870px;
+    float: left;
+}
+#rpanel ul {
+    list-style-type: none;
+}
+    #rpanel ul li {
+        line-height: 1.8em;
+    }
+#rpanel {
+    background: #e7e7e7;
+    width: 230px;
+}

+ 2 - 0
build.bat

@@ -0,0 +1,2 @@
+"D:\Visual Studio 2017\MSBuild\15.0\Bin\MSBuild.exe" "ServerSystemStarter.sln" /t:rebuild /p:configuration=debug /p:platform=x64
+"D:\Visual Studio 2017\MSBuild\15.0\Bin\MSBuild.exe" "ServerSystemStarter.sln" /t:rebuild /p:configuration=release /p:platform=x64