Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #16  
Old 05-06-2011, 07:59 PM
Bamzal
Sarnak
 
Join Date: Nov 2002
Posts: 31
Default

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;
Reply With Quote
  #17  
Old 05-06-2011, 08:04 PM
Bamzal
Sarnak
 
Join Date: Nov 2002
Posts: 31
Default

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
Reply With Quote
  #18  
Old 05-06-2011, 09:24 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

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

http://linux.die.net/man/3/strcasecmp
Reply With Quote
  #19  
Old 05-08-2011, 03:29 AM
Bamzal
Sarnak
 
Join Date: Nov 2002
Posts: 31
Default

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;
Reply With Quote
  #20  
Old 05-08-2011, 07:05 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

!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.
Reply With Quote
  #21  
Old 05-13-2011, 01:41 AM
Bamzal
Sarnak
 
Join Date: Nov 2002
Posts: 31
Default

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)
Reply With Quote
  #22  
Old 05-13-2011, 02:25 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:30 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3