From 2015f21fa81fe73b630518628a65bc8f67b28655 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Sat, 29 Aug 2009 00:50:34 +0400 Subject: [PATCH] Even more fixes. --- src/game/GMTicketHandler.cpp | 3 ++- src/game/Player.cpp | 30 +++++++++++++----------------- src/game/Weather.cpp | 6 +++--- src/game/World.cpp | 9 +++++++++ 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/game/GMTicketHandler.cpp b/src/game/GMTicketHandler.cpp index ffdfae504..4e062ac9f 100644 --- a/src/game/GMTicketHandler.cpp +++ b/src/game/GMTicketHandler.cpp @@ -89,8 +89,9 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data ) recv_data >> ticketText; recv_data.read_skip(); // unk1, 0 - recv_data.read_skip(); // unk2, 1 + recv_data.read_skip(); // unk2, 1 recv_data.read_skip(); // unk3, 0 + recv_data.read_skip(); // unk4, 0 sLog.outDebug("TicketCreate: map %u, x %f, y %f, z %f, text %s", map, x, y, z, ticketText.c_str()); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index dc5027151..e6cc2b162 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -6217,29 +6217,19 @@ void Player::UpdateArea(uint32 newArea) void Player::UpdateZone(uint32 newZone, uint32 newArea) { - if(m_zoneUpdateId != newZone) - SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange... - - m_zoneUpdateId = newZone; - m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL; - - // zone changed, so area changed as well, update it - UpdateArea(newArea); - AreaTableEntry const* zone = GetAreaEntryByAreaID(newZone); if(!zone) return; - if (sWorld.getConfig(CONFIG_WEATHER)) + if(m_zoneUpdateId != newZone) { - Weather *wth = sWorld.FindWeather(zone->ID); - if(wth) + SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange... + + if (sWorld.getConfig(CONFIG_WEATHER)) { - wth->SendWeatherUpdateToPlayer(this); - } - else - { - if(!sWorld.AddWeather(zone->ID)) + if(Weather *wth = sWorld.FindWeather(zone->ID)) + wth->SendWeatherUpdateToPlayer(this); + else if(!sWorld.AddWeather(zone->ID)) { // send fine weather packet to remove old zone's weather Weather::SendFineWeatherUpdateToPlayer(this); @@ -6247,6 +6237,12 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) } } + m_zoneUpdateId = newZone; + m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL; + + // zone changed, so area changed as well, update it + UpdateArea(newArea); + // in PvP, any not controlled zone (except zone->team == 6, default case) // in PvE, only opposition team capital switch(zone->team) diff --git a/src/game/Weather.cpp b/src/game/Weather.cpp index 5065761fd..64e3ff979 100644 --- a/src/game/Weather.cpp +++ b/src/game/Weather.cpp @@ -186,7 +186,7 @@ bool Weather::ReGenerate() void Weather::SendWeatherUpdateToPlayer(Player *player) { - WorldPacket data( SMSG_WEATHER, (4+4+4) ); + WorldPacket data( SMSG_WEATHER, (4+4+1) ); data << uint32(GetWeatherState()) << (float)m_grade << uint8(0); player->GetSession()->SendPacket( &data ); @@ -194,7 +194,7 @@ void Weather::SendWeatherUpdateToPlayer(Player *player) void Weather::SendFineWeatherUpdateToPlayer(Player *player) { - WorldPacket data( SMSG_WEATHER, (4+4+4) ); + WorldPacket data( SMSG_WEATHER, (4+4+1) ); data << (uint32)WEATHER_STATE_FINE << (float)0.0f << uint8(0); player->GetSession()->SendPacket( &data ); @@ -215,7 +215,7 @@ bool Weather::UpdateWeather() WeatherState state = GetWeatherState(); - WorldPacket data( SMSG_WEATHER, (4+4+4) ); + WorldPacket data( SMSG_WEATHER, (4+4+1) ); data << uint32(state) << (float)m_grade << uint8(0); player->SendMessageToSet( &data, true ); diff --git a/src/game/World.cpp b/src/game/World.cpp index 36452d110..9889941c9 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -323,6 +323,15 @@ bool World::RemoveQueuedPlayer(WorldSession* sess) WorldSession* pop_sess = m_QueuedPlayer.front(); pop_sess->SetInQueue(false); pop_sess->SendAuthWaitQue(0); + pop_sess->SendAddonsInfo(); + + WorldPacket pkt(SMSG_CLIENTCACHE_VERSION, 4); + pkt << uint32(sWorld.getConfig(CONFIG_CLIENTCACHE_VERSION)); + pop_sess->SendPacket(&pkt); + + pop_sess->SendAccountDataTimes(GLOBAL_CACHE_MASK); + pop_sess->SendTutorialsData(); + m_QueuedPlayer.pop_front(); // update iter to point first queued socket or end() if queue is empty now