Adding support for search path listing, and changing some module call conventions in core

parent 3d793d60
......@@ -159,6 +159,7 @@ int main( int argc, char* argv[] )
"[ VAServer ] r Reset core" << endl <<
"[ VAServer ] l Circulate log levels" << endl <<
"[ VAServer ] c List connected clients" << endl <<
"[ VAServer ] s List search paths" << endl <<
"[ VAServer ] q Quit" << endl << endl;
while( true )
......@@ -200,20 +201,39 @@ int main( int argc, char* argv[] )
if( ( char ) c == 'l' )
{
CVAStruct oArgs, oReturn, oNewArgs;
oArgs[ "command" ] = "get";
oArgs[ std::string( "debug" ) ] = CVAStruct();
oArgs[ std::string( "debug" ) ][ std::string( "loglevel" ) ] = true;
oArgs[ "getloglevel" ] = true;
pServer->GetCoreInstance()->CallModule( "VACore", oArgs, oReturn );
int iCurrentLogLevel = oReturn[ std::string( "debug" ) ][ std::string( "loglevel" ) ];
int iCurrentLogLevel = oReturn[ "loglevel" ];
int iNewLogLevel = int( iCurrentLogLevel + 1 ) % 6;
oNewArgs[ "command" ] = "set";
oNewArgs[ "debug" ] = CVAStruct();
oNewArgs[ std::string( "debug" ) ][ std::string( "loglevel" ) ] = iNewLogLevel;
oNewArgs[ "setloglevel" ] = iNewLogLevel;
pServer->GetCoreInstance()->CallModule( "VACore", oNewArgs, oReturn );
cout << "[ VAServer ] Switched to log level: " << IVACore::GetLogLevelStr( iNewLogLevel ) << endl;
}
if( ( char ) c == 's' )
{
CVAStruct oArgs, oReturn;
oArgs[ "getsearchpaths" ] = true;
pServer->GetCoreInstance()->CallModule( "VACore", oArgs, oReturn );
CVAStruct& oSearchPaths( oReturn[ "searchpaths" ] );
if( oSearchPaths.IsEmpty() )
cout << "[ VAServer ] No search paths added, yet" << endl;
else
{
cout << "[ VAServer ] Listing all search paths on server side:" << endl;
CVAStruct::const_iterator cit = oSearchPaths.Begin();
while( cit != oSearchPaths.End() )
{
CVAStructValue oValue( cit->second );
cit++;
if( oValue.IsString() )
cout << "[ VAServer ] + '" << std::string( oValue ) << "'" << endl;
}
}
}
if( ( char ) c == 'r' )
{
cout << "[ VAServer ] Resetting server manually" << endl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment