Changeset 149 for trunk/src/game/WorldSession.cpp
- Timestamp:
- 11/19/08 13:40:46 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/WorldSession.cpp
r128 r149 52 52 { 53 53 if (sock) 54 55 56 57 54 { 55 m_Address = sock->GetRemoteAddress (); 56 sock->AddReference (); 57 } 58 58 } 59 59 … … 100 100 if (!m_Socket) 101 101 return; 102 102 103 #ifdef TRINITY_DEBUG 104 103 105 // Code for network use statistic 104 106 static uint64 sendPacketCount = 0; … … 132 134 sendLastPacketBytes = packet->wpos(); // wpos is real written size 133 135 } 134 #endif // !TRINITY_DEBUG 135 136 if (m_Socket->SendPacket (*packet) == -1) 137 { 138 m_Socket->CloseSocket (); 139 } 136 137 #endif // !TRINITY_DEBUG 138 139 if (m_Socket->SendPacket (*packet) == -1) 140 m_Socket->CloseSocket (); 140 141 } 141 142 … … 158 159 bool WorldSession::Update(uint32 /*diff*/) 159 160 { 160 if (m_Socket) 161 if (m_Socket->IsClosed ()) 162 { 161 if (m_Socket && m_Socket->IsClosed ()) 162 { 163 163 m_Socket->RemoveReference (); 164 164 m_Socket = NULL; 165 165 } 166 166 167 167 WorldPacket *packet; … … 396 396 ///- Since each account can only have one online character at any given time, ensure all characters for active account are marked as offline 397 397 //No SQL injection as AccountId is uint32 398 CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE account = '%u'", GetAccountId()); 398 CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE account = '%u'", 399 GetAccountId()); 399 400 sLog.outDebug( "SESSION: Sent SMSG_LOGOUT_COMPLETE Message" ); 400 401 } … … 408 409 void WorldSession::KickPlayer() 409 410 { 410 if (m_Socket) 411 { 412 m_Socket->CloseSocket (); 413 } 411 if (m_Socket) 412 m_Socket->CloseSocket (); 414 413 } 415 414