From 68815423f7e6ebd3c1a84356f6c8a830a59f366c Mon Sep 17 00:00:00 2001 From: Sascha Volkenandt Date: Tue, 2 Jan 2007 21:09:12 +0000 Subject: - added options -i and -p to specify port and (possibly multiple) ip(s) - moved commandline-helpstring to setup class to ease maintaining - added default library directory /usr/local/lib --- tntconfig.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'tntconfig.cpp') diff --git a/tntconfig.cpp b/tntconfig.cpp index 1b0aadf..3735db2 100644 --- a/tntconfig.cpp +++ b/tntconfig.cpp @@ -32,10 +32,15 @@ void TntConfig::WriteConfig() } // XXX modularize - file << "MapUrl /([^.]+)(\\..+)? $1@libtnt-live" << std::endl; - file << "Listen 0.0.0.0 8003" << std::endl; - file << "PropertyFile " << m_propertiesPath << std::endl; - file << "CompPath " << Setup::Get().GetLibraryPath() << "/" << std::endl; + file << "MapUrl /([^.]+)(\\..+)? $1@libtnt-live" << endl; + file << "PropertyFile " << m_propertiesPath << endl; + file << "CompPath " << Setup::Get().GetLibraryPath() << endl; + + Setup::IpList const& ips = Setup::Get().GetServerIps(); + int port = Setup::Get().GetServerPort(); + for ( Setup::IpList::const_iterator ip = ips.begin(); ip != ips.end(); ++ip ) { + file << "Listen " << *ip << " " << port << endl; + } } void TntConfig::WriteProperties() @@ -52,8 +57,8 @@ void TntConfig::WriteProperties() } // XXX modularize - file << "rootLogger=INFO" << std::endl; - file << "logger.tntnet=INFO" << std::endl; + file << "rootLogger=INFO" << endl; + file << "logger.tntnet=INFO" << endl; } TntConfig const& TntConfig::Get() -- cgit v1.2.3