Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
dialogs.cfg not required to start Server
Browse files Browse the repository at this point in the history
  • Loading branch information
wipe2238 committed Feb 8, 2019
1 parent 104789b commit b1c822c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions Docs/changelog/CHANGELOG.md
Expand Up @@ -13,6 +13,7 @@ Complete list of changes in FOClassic since [FOnline SDK r412](https://github.co
- all dialogs must be defined in `Dialogs` section; any other sections, if present, are ignored and can be used for game-specific settings
- key name should be a path to dialog file (without extension), key value defines dialog id; examples: `all_alco = 1`, `hub/keri = 1000`
- dialogs defined without/with invalid id (not a number, value less or equal 0) are silently ignored
- Server will continue initialization even if _dialogs.cfg_ is missing


## [v6](https://github.com/rotators/foclassic/releases/tag/v6/)
Expand Down
1 change: 1 addition & 0 deletions Source/CMakeLists.txt
Expand Up @@ -5,6 +5,7 @@
add_subdirectory( AngelScript )
add_subdirectory( Libs )

PdbSetup( angelscript )
PdbSetup( angelscript-preprocessor )

message( STATUS "Configuring engine..." )
Expand Down
12 changes: 5 additions & 7 deletions Source/Dialogs.cpp
Expand Up @@ -60,24 +60,22 @@ bool DialogManager::LoadDialogs( const char* list_name )

if( !list_name )
{
WriteLogX( " ERROR: list name nullptr.\n" );
WriteLog( "Load dialogs... ERROR list_name nullptr\n" );
return false;
}

WriteLogX( "\n" );

Ini dialogs_cfg;
if( !dialogs_cfg.LoadFile( FileManager::GetFullPath( list_name, PATH_SERVER_DIALOGS ) ) )
{
WriteLog( "Load dialogs.. cannot load file<%s>\n", list_name );
return false;
WriteLog( "Load dialogs.. skipped : cannot load file<%s>\n", list_name );
return true;
}

StrVec dialogs;
if( !dialogs_cfg.IsSection( SECTION_SERVER_DIALOGS ) || dialogs_cfg.GetSectionKeys( SECTION_SERVER_DIALOGS, dialogs ) == 0 )
{
WriteLog( "Load dialogs... section<%s> in file<%s> not found or empty\n", SECTION_SERVER_DIALOGS, list_name );
return false;
WriteLog( "Load dialogs... skipped : no dialogs found\n" );
return true;
}

uint total = dialogs.size(), loaded = 0;
Expand Down

0 comments on commit b1c822c

Please sign in to comment.