Parsing the config files

MMOInteractiveMMOInteractive James E. ProctorOrganization: PersonalProject: MMO called Rise of HeroesMember
All the demos come with config files. You pass the config file name when starting the application and since the demos use the ICE Application framework they get parsed through that. How do I parse the config files not using the Ice Application framework?

Comments

  • marcmarc FloridaMarc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications EngineAdministrators, ZeroC Staff ZeroC Staff
    Config files are translated to properties. You can also create your own properties and load files, or populate the property set programmatically. Have a look at http://www.zeroc.com/doc/Ice-3.4.1-IceTouch/manual/Properties.31.9.html.
  • MMOInteractiveMMOInteractive James E. ProctorOrganization: PersonalProject: MMO called Rise of HeroesMember
    After posting this I started playing around with it. I haven't tested it yet but would something like this work?
    Ice::InitializationData initData;
    		initData.properties = Ice::createProperties();
    		initData.properties->setProperty("BuildId", string("Ice ") + ICE_STRING_VERSION);
    		initData.properties->load("config.client");
    
    		Ice::CommunicatorPtr peer = Ice::initialize(initData);
    
  • dwaynedwayne St. John's, NewfoundlandDwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications EngineMember
    That code will read the configuration file "config.client" into the initData.properties property set as well as setting the extra property "BuildId" in that property set. If that is what you want to do, the yes, this should work.
Sign In or Register to comment.