Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2009, 10:57 AM
erde
Sarnak
 
Join Date: Sep 2006
Location: Germany
Posts: 82
Default Small patch to see the long name of the zone in the web interface

Small patch to see the long name of the zone in the web interface, i am working currently on a server status page so i need this piece of code

Code:
diff -r 1119a9fad2a9 world/EQW.cpp
--- a/world/EQW.cpp	Sun Apr 19 10:41:37 2009 +0200
+++ b/world/EQW.cpp	Sun Apr 19 16:39:35 2009 +0200
@@ -140,7 +140,7 @@
 	res["zone_id"] = itoa(zs->GetZoneID());
 	res["launch_name"] = zs->GetLaunchName();
 	res["short_name"] = zs->GetZoneName();
-	res["long_name"] = zs->GetZoneName();	//TODO: get this some day
+	res["long_name"] = zs->GetZoneLongName();
 	res["port"] = itoa(zs->GetCPort());
 	res["player_count"] = itoa(zs->NumPlayers());
diff -r 1119a9fad2a9 world/zoneserver.cpp
--- a/world/zoneserver.cpp	Sun Apr 19 10:41:37 2009 +0200
+++ b/world/zoneserver.cpp	Sun Apr 19 16:39:35 2009 +0200
@@ -64,7 +64,8 @@
 	BootingUp = false;
 	
 	const char* zn = MakeLowerString(database.GetZoneName(iZoneID));
-
+	char*	longname;
+	
 	if (iZoneID)
 		zlog(WORLD__ZONE,"Setting to '%s' (%d)%s",(zn) ? zn : "",iZoneID,iStaticZone ? " (Static)" : "");
 
@@ -80,9 +81,21 @@
 	staticzone = iStaticZone;
 
 	if (zn)
+	{
 		strcpy(zone_name, zn);
+		if( database.GetZoneLongName( (char*)zone_name, &longname, NULL, NULL, NULL, NULL, NULL, NULL ) )
+		{
+			strcpy(long_name, longname);
+			safe_delete( longname );
+		}
+		else
+			strcpy(long_name, "");
+	}
 	else
+	{
 		strcpy(zone_name, "");
+		strcpy(long_name, "");
+	}	
 
 	client_list.ZoneBootup(this);
 	ls_zboot.Start();
diff -r 1119a9fad2a9 world/zoneserver.h
--- a/world/zoneserver.h	Sun Apr 19 10:41:37 2009 +0200
+++ b/world/zoneserver.h	Sun Apr 19 16:39:35 2009 +0200
@@ -50,6 +50,7 @@
 	void		SendGroupIDs();
 
 	inline const char*	GetZoneName() const	{ return zone_name; }
+	inline const char*	GetZoneLongName() const	{ return long_name; }
 	const char*			GetCompileTime() const{ return compiled; }
 	void				SetCompile(char* in_compile){ strcpy(compiled,in_compile); }
 	inline int32		GetZoneID() const	{ return zoneID; }
@@ -82,6 +83,7 @@
 	int32	pNumPlayers;
 	char	compiled[25];
 	char	zone_name[16];
+	char	long_name[256];
 	int32	zoneID;
 	int32	oldZoneID;
 	Timer	ls_zboot;
__________________
"Yes, the artwork is awful. I am an engineer, not an artist " - David H. Eberly
Reply With Quote
  #2  
Old 04-19-2009, 02:45 PM
erde
Sarnak
 
Join Date: Sep 2006
Location: Germany
Posts: 82
Default

Here is a pic how it looks now
__________________
"Yes, the artwork is awful. I am an engineer, not an artist " - David H. Eberly
Reply With Quote
  #3  
Old 04-21-2009, 02:07 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

Thanks, this will be in my next commit.
Reply With Quote
  #4  
Old 05-03-2009, 04:18 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

This has been committed in Revision 454.
Reply With Quote
  #5  
Old 05-05-2009, 07:00 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

On a related note; Is there any way to have this screen display which dynamic zone process that each zone is using? As far as I can tell, the only way to currently figure out which zones are using which process is to read through the log files. It would be nice if there was a considerably easier way to do this. It would be very useful.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #6  
Old 05-06-2009, 03:36 AM
erde
Sarnak
 
Join Date: Sep 2006
Location: Germany
Posts: 82
Default

Quote:
Originally Posted by trevius View Post
On a related note; Is there any way to have this screen display which dynamic zone process that each zone is using? As far as I can tell, the only way to currently figure out which zones are using which process is to read through the log files. It would be nice if there was a considerably easier way to do this. It would be very useful.
I cant look into the log file currently, i am at work. But do you mean the process id? To be able to attach to the process and debug?

I am not a win or linux system programmer, but i think nothing is impossible. Only takes time, i will look into these when i have some time.
__________________
"Yes, the artwork is awful. I am an engineer, not an artist " - David H. Eberly
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 06:51 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3