Public feed #888907

Anonymous

public text v1 · immutable
Raw Edit
·published 2008-02-02 14:49 UTC
rendered paste body
Index: src/game/WorldSocket.cpp
===================================================================
--- src/game/WorldSocket.cpp	(revision 5129)
+++ src/game/WorldSocket.cpp	(working copy)
@@ -97,7 +97,13 @@
 /// Copy the packet to the to-be-sent queue
 void WorldSocket::SendPacket(WorldPacket* packet)
 {
-    WorldPacket *pck = new WorldPacket(*packet);
+    // if packet is 0x0
+	if(!packet)
+	{
+		sLog.outError("In WorldSocket::SendPacket get Exeption. Argument packet is NULL");
+		return;
+	}
+	WorldPacket *pck = new WorldPacket(*packet);
     ASSERT(pck);
     _sendQueue.add(pck);
 }
Index: src/game/WorldSocketMgr.cpp
===================================================================
--- src/game/WorldSocketMgr.cpp	(revision 5129)
+++ src/game/WorldSocketMgr.cpp	(working copy)
@@ -24,6 +24,7 @@
 #include "WorldSocket.h"
 #include "WorldSocketMgr.h"
 #include "Policies/SingletonImp.h"
+#include "Log.h"
 
 INSTANTIATE_SINGLETON_1( WorldSocketMgr );
 
@@ -50,6 +51,8 @@
     SocketSet::iterator i;
     for(i = m_sockets.begin(); i != m_sockets.end(); i++)
     {
-        (*i)->Update(diff);
+		if((*i)->IsConnected())
+		(*i)->Update(diff);
+		else sLog.outError("WorldSocketMgr::Update attemp to update disconected sockets, crash?");
     }
 }