Parsing the config files

MMOInteractiveMMOInteractive Member James E. ProctorOrganization: PersonalProject: MMO called Rise of Heroes
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 FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine 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 Member James E. ProctorOrganization: PersonalProject: MMO called Rise of Heroes
    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, NewfoundlandMember Dwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications Engine
    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.