mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 22:01:30 +00:00
Simplify connection logic
This commit is contained in:
parent
6af1ae32ae
commit
26b24c02f1
@ -143,11 +143,11 @@ void LoadDatabaseConnections()
|
||||
*/
|
||||
if (!Config->ContentDbHost.empty()) {
|
||||
if (!content_db.Connect(
|
||||
!Config->ContentDbHost.empty() ? Config->ContentDbHost.c_str() : Config->DatabaseHost.c_str(),
|
||||
!Config->ContentDbUsername.empty() ? Config->ContentDbUsername.c_str() : Config->DatabaseUsername.c_str(),
|
||||
!Config->ContentDbPassword.empty() ? Config->ContentDbPassword.c_str() : Config->DatabasePassword.c_str(),
|
||||
!Config->ContentDbName.empty() ? Config->ContentDbName.c_str() : Config->DatabaseDB.c_str(),
|
||||
Config->ContentDbPort != 0 ? Config->ContentDbPort : Config->DatabasePort
|
||||
Config->ContentDbHost.c_str() ,
|
||||
Config->ContentDbUsername.c_str(),
|
||||
Config->ContentDbPassword.c_str(),
|
||||
Config->ContentDbName.c_str(),
|
||||
Config->ContentDbPort
|
||||
)) {
|
||||
LogError("Cannot continue without a content database connection");
|
||||
std::exit(1);
|
||||
|
||||
@ -242,11 +242,11 @@ int main(int argc, char** argv) {
|
||||
*/
|
||||
if (!Config->ContentDbHost.empty()) {
|
||||
if (!content_db.Connect(
|
||||
!Config->ContentDbHost.empty() ? Config->ContentDbHost.c_str() : Config->DatabaseHost.c_str(),
|
||||
!Config->ContentDbUsername.empty() ? Config->ContentDbUsername.c_str() : Config->DatabaseUsername.c_str(),
|
||||
!Config->ContentDbPassword.empty() ? Config->ContentDbPassword.c_str() : Config->DatabasePassword.c_str(),
|
||||
!Config->ContentDbName.empty() ? Config->ContentDbName.c_str() : Config->DatabaseDB.c_str(),
|
||||
Config->ContentDbPort != 0 ? Config->ContentDbPort : Config->DatabasePort
|
||||
Config->ContentDbHost.c_str() ,
|
||||
Config->ContentDbUsername.c_str(),
|
||||
Config->ContentDbPassword.c_str(),
|
||||
Config->ContentDbName.c_str(),
|
||||
Config->ContentDbPort
|
||||
)) {
|
||||
LogError("Cannot continue without a content database connection");
|
||||
return 1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user