mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 14:37:44 +00:00
Add missing --pass param
This commit is contained in:
parent
63ecd9a3c9
commit
73bce03040
1 changed files with 12 additions and 9 deletions
|
@ -102,7 +102,8 @@ int main( int32_t argc, char* argv[] )
|
||||||
std::string user;
|
std::string user;
|
||||||
std::string host;
|
std::string host;
|
||||||
std::string database;
|
std::string database;
|
||||||
|
std::string pass;
|
||||||
|
|
||||||
g_log.setLogPath( "log/SapphireDbm" );
|
g_log.setLogPath( "log/SapphireDbm" );
|
||||||
g_log.init();
|
g_log.init();
|
||||||
|
|
||||||
|
@ -129,13 +130,15 @@ int main( int32_t argc, char* argv[] )
|
||||||
host = val;
|
host = val;
|
||||||
else if( arg == "database" )
|
else if( arg == "database" )
|
||||||
database = val;
|
database = val;
|
||||||
|
else if( arg == "pass" )
|
||||||
|
pass = val;
|
||||||
else if( arg == "sfile" )
|
else if( arg == "sfile" )
|
||||||
sFile = val;
|
sFile = val;
|
||||||
else if( arg == "ifile" )
|
else if( arg == "ifile" )
|
||||||
iFile = val;
|
iFile = val;
|
||||||
else if( arg == "force" )
|
else if( arg == "force" )
|
||||||
force = true;
|
force = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( host.empty() )
|
if( host.empty() )
|
||||||
host = "127.0.0.1";
|
host = "127.0.0.1";
|
||||||
|
@ -146,14 +149,14 @@ int main( int32_t argc, char* argv[] )
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto dbm = DbManager( host, database, user, "", 3306 );
|
auto dbm = DbManager( host, database, user, pass, 3306 );
|
||||||
|
|
||||||
if( !sFile.empty() && !iFile.empty() )
|
if( !sFile.empty() && !iFile.empty() )
|
||||||
{
|
{
|
||||||
dbm.setInsertFile( iFile );
|
dbm.setInsertFile( iFile );
|
||||||
dbm.setSchemaFile( sFile );
|
dbm.setSchemaFile( sFile );
|
||||||
}
|
}
|
||||||
if( force )
|
if( force )
|
||||||
dbm.setForceMode( true );
|
dbm.setForceMode( true );
|
||||||
//initialize|check|update|clearchars|liquidate
|
//initialize|check|update|clearchars|liquidate
|
||||||
if( mode.find( "initialize" ) != std::string::npos )
|
if( mode.find( "initialize" ) != std::string::npos )
|
||||||
|
@ -177,11 +180,11 @@ int main( int32_t argc, char* argv[] )
|
||||||
dbm.setMode( Mode::LIQUIDATE );
|
dbm.setMode( Mode::LIQUIDATE );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_log.fatal( "Not a valid mode: " + mode + " !" );
|
g_log.fatal( "Not a valid mode: " + mode + " !" );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_log.info( "Launching in " + mode + " mode..." );
|
g_log.info( "Launching in " + mode + " mode..." );
|
||||||
|
|
||||||
if( !dbm.connect() )
|
if( !dbm.connect() )
|
||||||
|
|
Loading…
Add table
Reference in a new issue