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

Reply
 
Thread Tools Display Modes
  #1  
Old 02-10-2012, 09:51 AM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

When posting code in the forums, it's easier to read if you surround the code with blocks (code) (/code) except don't use parentheses, use brackets--> []. I used parentheses here because if i use brackets it doesn't show, it converts to:
Code:
if(true) {
    do_something();
}
__________________
The Realm
Reply With Quote
  #2  
Old 02-10-2012, 06:54 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I moved your posts to their own thread. The thread titled "Sticky: Post Your New Code Here!" doesn't literally mean to post submissions in that thread. I locked that thread so it doesn't happen again.

Unfortunately, unless you can provide a diff of what you did, your code in this thread will probably just be ignored. We can't tell what you changed without spending a ton of time to figure out where everything should go. If you post a diff, it will make more sense.

If you use TortoiseSVN for getting your source code, then posting a diff is VERY easy. Just right click on your EQEmuServer folder and select TortoiseSVN->Create Patch...

Then, select the files you want to show in your patch diff and click OK. You then have the option to save your diff, but the easiest thing to do is click Save to clipboard.

Then start a post on this forum and click the # button above your post window where the B I U buttons and such are. Then just press CTRL+V to paste your code diff.

The code boxes are done like this

\[CODE\]Here is where you put code\[/CODE\]
Without the \ slashes.

Here is an example of what it should look like:

Code:
Index: changelog.txt
===================================================================
--- changelog.txt	(revision 2099)
+++ changelog.txt	(working copy)
@@ -1,5 +1,8 @@
 EQEMu Changelog (Started on Sept 24, 2003 15:50)
 -------------------------------------------------------
+==02/10/2012==
+Trevius: Look, I made a change!
+
 ==02/03/2012==
 Trevius: Added accout_status field to the discovered_items table to make it easier to remove accidental GM item discovery from the table.
 
Index: zone/entity.cpp
===================================================================
--- zone/entity.cpp	(revision 2097)
+++ zone/entity.cpp	(working copy)
@@ -4453,12 +4453,12 @@
 
 void EntityList::SignalAllClients(int32 data)
 {
-	LinkedListIterator<Client*> iterator(client_list); 
+	LinkedListIterator<Client*> iterator(client_list);
 	iterator.Reset();
-	while(iterator.MoreElements()) 
+	while(iterator.MoreElements())
 	{
 		Client *ent = iterator.GetData();
-		if(ent)
+		if (ent->CastToClient() && ent->CastToClient()->Connected())
 		{
 			ent->Signal(data);
 		}
@@ -4469,12 +4469,15 @@
 void EntityList::GetMobList(list<Mob*> &m_list)
 {
 	m_list.clear();
-	LinkedListIterator<Mob*> iterator(mob_list); 
+	LinkedListIterator<Mob*> iterator(mob_list);
 	iterator.Reset();
-	while(iterator.MoreElements()) 
+	while(iterator.MoreElements())
 	{
 		Mob *ent = iterator.GetData();
-		m_list.push_back(ent);
+		if (!ent->IsClient() || (ent->IsClient() && ent->CastToClient() && ent->CastToClient()->Connected()))
+		{
+			m_list.push_back(ent);
+		}
 		iterator.Advance();
 	}
 }
@@ -4482,12 +4485,15 @@
 void EntityList::GetNPCList(list<NPC*> &n_list)
 {
 	n_list.clear();
-	LinkedListIterator<NPC*> iterator(npc_list); 
+	LinkedListIterator<NPC*> iterator(npc_list);
 	iterator.Reset();
-	while(iterator.MoreElements()) 
+	while(iterator.MoreElements())
 	{
 		NPC *ent = iterator.GetData();
-		n_list.push_back(ent);
+		if (ent->GetHP() > 0)
+		{
+			n_list.push_back(ent);
+		}
 		iterator.Advance();
 	}
 }
@@ -4495,12 +4501,15 @@
 void EntityList::GetClientList(list<Client*> &c_list)
 {
 	c_list.clear();
-	LinkedListIterator<Client*> iterator(client_list); 
+	LinkedListIterator<Client*> iterator(client_list);
 	iterator.Reset();
-	while(iterator.MoreElements()) 
+	while(iterator.MoreElements())
 	{
 		Client *ent = iterator.GetData();
-		c_list.push_back(ent);
+		if (ent->CastToClient() && ent->CastToClient()->Connected())
+		{
+			c_list.push_back(ent);
+		}
 		iterator.Advance();
 	}
 }
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 02-10-2012 at 07:07 PM..
Reply With Quote
Reply

Thread Tools
Display Modes

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 09:52 AM.


 

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