Author Topic: Magic PtokaX behavior on Settings.xml file with XML syntax errors  (Read 1448 times)

0 Members and 1 Guest are viewing this topic.

Offline dmvn

  • Member
  • ***
  • Posts: 27
  • Karma: +3/-0
    • DMVN Educational Project
I've spent rather long time to dig out following problem:
PtokaX silently loads default settings without notifying user, if Settings.xml could not be loaded by tinyXML library.
But this appears as some kind of magic to user:

When I start PtokaX (v5.0.1 or SVN latest), it says 'Server start failed', and system.log contains message like
Tue 24 Dec 2013 10:52:02 AM MSK - Resolving of hostname '<Enter hub address here>' has failed.

I looked to Settings.xml - there was specified a valid IP address. I've checked network settings - all was pretty good, but where is the problem?
Only strace and looking through the sources helped me to find out the problem:

SettingManager.cpp:

Code: C++
  1.     if(doc.LoadFile()) {
  2.         TiXmlHandle cfg(&doc);
  3.        // XML reading
  4.      }
  5.     // else DO NOTHING!
  6.  

Here should be some diagnostics using methods
doc.ErrorDesc(), ErrorRow(), doc.ErrorColumn()

And I think server should NOT start if settings file is syntactically incorrect.

PtokaX forum


Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 475
  • Karma: +209/-22
  • PtokaX developer
Re: Magic PtokaX behavior on Settings.xml file with XML syntax errors
« Reply #1 on: 27 December, 2013, 01:39:57 »
Ops :angel: I will fix that  ;)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

PtokaX forum

Re: Magic PtokaX behavior on Settings.xml file with XML syntax errors
« Reply #1 on: 27 December, 2013, 01:39:57 »