Show
Ignore:
Timestamp:
11/19/08 13:44:02 (17 years ago)
Author:
yumileroy
Message:

[svn] Merge from Mangos:
3c7ac5bd3e20c33a22ac57c5c3bac23a0798dc9e 2008-10-23 19:06:27
Some endianess related fixes and cleanups. By VladimirMangos?.

Original author: megamage
Date: 2008-11-06 16:10:28-06:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/WorldSession.cpp

    r174 r181  
    1111 * This program is distributed in the hope that it will be useful, 
    1212 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1414 * GNU General Public License for more details. 
    1515 * 
    1616 * You should have received a copy of the GNU General Public License 
    1717 * along with this program; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
    1919 */ 
    2020 
     
    5151_logoutTime(0), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false), m_latency(0) 
    5252{ 
    53    if (sock) 
    54    { 
    55            m_Address = sock->GetRemoteAddress (); 
    56            sock->AddReference (); 
    57    } 
     53    if (sock) 
     54    { 
     55        m_Address = sock->GetRemoteAddress (); 
     56        sock->AddReference (); 
     57    } 
    5858} 
    5959 
     
    6262{ 
    6363    ///- unload player if not unloaded 
    64     if(_player) 
    65         LogoutPlayer(true); 
     64    if (_player) 
     65        LogoutPlayer (true); 
    6666 
    6767    /// - If have unclosed socket, close it 
    68   if (m_Socket) 
    69     { 
    70       m_Socket->CloseSocket ();    
    71       m_Socket->RemoveReference (); 
    72       m_Socket = NULL; 
     68    if (m_Socket) 
     69    { 
     70        m_Socket->CloseSocket (); 
     71        m_Socket->RemoveReference (); 
     72        m_Socket = NULL; 
    7373    } 
    7474 
     
    7676    while(!_recvQueue.empty()) 
    7777    { 
    78         WorldPacket *packet = _recvQueue.next(); 
     78        WorldPacket *packet = _recvQueue.next (); 
    7979        delete packet; 
    8080    } 
    81      
    8281} 
    8382 
     
    134133    } 
    135134 
    136         #endif                                                  // !TRINITY_DEBUG 
    137  
    138         if (m_Socket->SendPacket (*packet) == -1) 
    139                 m_Socket->CloseSocket (); 
     135    #endif                                                  // !MANGOS_DEBUG 
     136 
     137    if (m_Socket->SendPacket (*packet) == -1) 
     138        m_Socket->CloseSocket (); 
    140139} 
    141140 
     
    158157bool WorldSession::Update(uint32 /*diff*/) 
    159158{ 
    160   if (m_Socket && m_Socket->IsClosed ()) 
    161   { 
     159    if (m_Socket && m_Socket->IsClosed ()) 
     160    { 
    162161        m_Socket->RemoveReference (); 
    163162        m_Socket = NULL; 
    164   } 
    165    
     163    } 
     164 
    166165    WorldPacket *packet; 
    167166 
     
    248247        if (uint64 lguid = GetPlayer()->GetLootGUID()) 
    249248            DoLootRelease(lguid); 
    250              
     249 
    251250        ///- If the player just died before logging out, make him appear as a ghost 
    252251        //FIXME: logout must be delayed in case lost connection with client in time of combat 
     
    285284            // give honor to all attackers from set like group case 
    286285            for(std::set<Player*>::const_iterator itr = aset.begin(); itr != aset.end(); ++itr) 
    287                 (*itr)->RewardHonor(_player, aset.size(), -1, true); 
     286                (*itr)->RewardHonor(_player,aset.size()); 
    288287 
    289288            // give bg rewards and update counters like kill by first from attackers 
     
    403402        //No SQL injection as AccountId is uint32 
    404403        CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE account = '%u'", 
    405                         GetAccountId()); 
     404            GetAccountId()); 
    406405        sLog.outDebug( "SESSION: Sent SMSG_LOGOUT_COMPLETE Message" ); 
    407406    } 
     
    415414void WorldSession::KickPlayer() 
    416415{ 
    417         if (m_Socket) 
    418                 m_Socket->CloseSocket (); 
     416    if (m_Socket) 
     417        m_Socket->CloseSocket (); 
    419418} 
    420419 
     
    522521     } 
    523522 } 
    524   
    525  
    526  
    527