Client Config

While working out some details in my head regarding the movement logic needed for 0.1.0 I realized that having the server hard coded wasn't going to fly once I was in that phase.

So, my first thought was ok I'll just read it in from a plain text file. I mean all I need is a host name I don't need anything fancy.

Of course I realized that wasn't an elegant solution to the problem and before you know it I was coding a configuration class.

I used the irrlicht built in xml parser so it wasn't that hard to make a nice xml based configuration system. I created the logic for loading server information and for now I'm using the first one it finds as the default.

Now that worked so well in fact I decided to make the resolution and other display settings configurable. I remember someone else doing something like that on the forum but I think that was in .net and was tied to a GUI. I'm trying to make this in such a way that I can use it in a wxwidgets based Configuration Utility later.

Much to my surprise it worked beautifully. I didn't even have to spend lots of time debugging it just worked. I was a happy camper.

So now here is the bottom line to all of this. You can now configure what server you connect to and what display settings are used by modifying the client.cfg file. This means no more rebuilds to test different display settings and no rebuild to switch servers.

For me this means I don't need the entry in my host file I was using to point the client to the server I wanted. lol I'm such a hack.

But anyway this may just mark the beginning of more and more run time configuration. I currently have no plans to create the GUI I was talking about or adding more configuration options. But as always I make no promises I get distracted lol.

Comments

Popular posts from this blog

VK9 - Milestone8 Completed

VK9 - Milestone13 Completed

VK9 - Milestone16 Completed