// SMP Headless.cpp : Diese Anwendung committet alle änderungen und lädt sie zu allen verfügbaren patch servern hoch // #include #include #include #include "../SMP/Programm/Version/Version.h" #include "../SMP/Programm/Server/Patch/PatchServer.h" int main() { Framework::initFramework(); std::cout << " _ __ _____ _____ _____ __ __ _____ \n" " | |/ // ____|/ ____| / ____| \\/ | __ \\ \n" " | ' /| (___ | | __ | (___ | \\ / | |__) |\n" " | < \\___ \\| | |_ | \\___ \\| |\\/| | ___/\n" " | . \\ ____) | |__| | ____) | | | | |\n" " |_|\\_\\_____ /\\_____| |_____/|_| |_|_| \n\n"; InitDatei *iD = new InitDatei( "data/start/optionen.ini" ); iD->laden(); std::string login; std::string password; AdminAccount *account = 0; MSKlient *msk = new MSKlient( iD->zWert( "MainServerIP" )->getText(), TextZuInt( iD->zWert( "MainServerPort" )->getText(), 10 ) ); while( true ) { std::cout << "login: "; std::getline( std::cin, login ); std::cout << "password: "; HANDLE hStdin = GetStdHandle( STD_INPUT_HANDLE ); DWORD mode = 0; GetConsoleMode( hStdin, &mode ); SetConsoleMode( hStdin, mode & ( ~ENABLE_ECHO_INPUT ) ); std::getline( std::cin, password ); GetConsoleMode( hStdin, &mode ); SetConsoleMode( hStdin, mode | ENABLE_ECHO_INPUT ); if( msk->login( login.c_str(), password.c_str() ) ) account = new AdminAccount( login.c_str(), password.c_str() ); if( account ) break; std::cout << "\nFehler\n"; } std::cout << "\nVersionskontrolle\n"; Version *v = new Version( 0, msk->getThis(), 0, account->getThis(), 0 ); v->commitAll(); v->release(); PatchServer *s = new PatchServer( 0, iD->getThis(), msk->getThis(), 0, account->getThis(), 0 ); s->setSichtbar( 1 ); s->updateAll(); s->release(); account->release(); msk->release(); iD->release(); Framework::releaseFramework(); }