EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   EQEmu\templates .html files don't work? (https://www.eqemulator.org/forums/showthread.php?t=33455)

Bamzal 05-06-2011 07:59 PM

Thanks for the help lerxst. Pretty sure that I found the issue.

WorldHTTPEnabled=false to begin with, and in the code to check, the logic is reversed so it I would have to fix the logic or else a workaround is to just set enabled to anything BUT true in the eqemu_config.xml :)

Original:
Code:

                text = sub_ele->Attribute("enabled");
                if (text && !strcasecmp(text,"true"))
                        WorldHTTPEnabled=true;

It was either designed to leave as false in the config file or else was recently modified incorrectly?

Changed to:
Code:

                text = sub_ele->Attribute("enabled");
                if (text && strcasecmp(text,"true"))
                        WorldHTTPEnabled=true;


Bamzal 05-06-2011 08:04 PM

Looks like the same is done with the TELNET service also:
Code:

                text = sub_ele->Attribute("telnet");
                if (text && !strcasecmp(text,"enabled"))
                        TelnetEnabled=true;

Odd

lerxst2112 05-06-2011 09:24 PM

You are reading the code incorrectly. The strcasecmp function returns 0 if the strings match.

http://linux.die.net/man/3/strcasecmp

Bamzal 05-08-2011 03:29 AM

If thats the case then now I read it as:
if (text && !=0)

Then I would assume it should be:
Code:

text = sub_ele->Attribute("telnet");
if (text && strcasecmp(text,"enabled") == 0)
        TelnetEnabled=true;


lerxst2112 05-08-2011 07:05 PM

!strcasecmp(text,"enabled") and strcasecmp(text,"enabled") == 0 are the same thing.

Trust me, the way it is written now works just fine.

There's some reason your config isn't being read properly. My guess is you have more than one config file and you're changing the wrong one. If that is not the case, then adding some logging of the various attributes that are being read may shed some light on things.

Bamzal 05-13-2011 01:41 AM

I added some code to debug, and everything suddenly started working as intended. Not sure what exactly changed but it's all good now. Thanks!

eqemu_config.xml
Code:

<http port="9080" enabled="true" mimefile="mime.types" />
EQEmuConfig::do_world
Code:

// Get the <http> element
sub_ele = ele->FirstChildElement("http");
if(sub_ele != NULL) {
        cout << "\n(Hello 1 - Reading Fiile)\n";

        text = sub_ele->Attribute("mimefile");
        if (text)
                WorldHTTPMimeFile=text;

        text = sub_ele->Attribute("port");
        if (text)
                WorldHTTPPort=atoi(text);

        text = sub_ele->Attribute("enabled");
        if (text && !strcasecmp(text,"true")) {
                cout << "\n(Hello 2 - Original if)\n";
                WorldHTTPEnabled=true;
        }

        if (text && strcasecmp(text,"true") == 0) {
                cout << "\n(Hello 3 - Modified But Same if)\n";
                WorldHTTPEnabled=true;
        }
}

Console
Code:

[Debug] [WORLD__INIT] Loading server configuration..

(Hello 1 - Reading Fiile)

(Hello 2 - Original if)

(Hello 3 - Modified But Same if)


lerxst2112 05-13-2011 02:25 AM

If I had a dollar for every time something didn't work until I added a printf that didn't change anything but for whatever reason it started working I'd be at a strip club.


All times are GMT -4. The time now is 08:33 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.