Even more fixes.

This commit is contained in:
tomrus88 2009-08-29 00:50:34 +04:00
parent fdc20af337
commit 2015f21fa8
4 changed files with 27 additions and 21 deletions

View file

@ -89,8 +89,9 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
recv_data >> ticketText; recv_data >> ticketText;
recv_data.read_skip<uint32>(); // unk1, 0 recv_data.read_skip<uint32>(); // unk1, 0
recv_data.read_skip<uint32>(); // unk2, 1 recv_data.read_skip<uint8>(); // unk2, 1
recv_data.read_skip<uint32>(); // unk3, 0 recv_data.read_skip<uint32>(); // unk3, 0
recv_data.read_skip<uint32>(); // unk4, 0
sLog.outDebug("TicketCreate: map %u, x %f, y %f, z %f, text %s", map, x, y, z, ticketText.c_str()); sLog.outDebug("TicketCreate: map %u, x %f, y %f, z %f, text %s", map, x, y, z, ticketText.c_str());

View file

@ -6217,29 +6217,19 @@ void Player::UpdateArea(uint32 newArea)
void Player::UpdateZone(uint32 newZone, 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); AreaTableEntry const* zone = GetAreaEntryByAreaID(newZone);
if(!zone) if(!zone)
return; return;
if (sWorld.getConfig(CONFIG_WEATHER)) if(m_zoneUpdateId != newZone)
{ {
Weather *wth = sWorld.FindWeather(zone->ID); SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange...
if(wth)
if (sWorld.getConfig(CONFIG_WEATHER))
{ {
wth->SendWeatherUpdateToPlayer(this); if(Weather *wth = sWorld.FindWeather(zone->ID))
} wth->SendWeatherUpdateToPlayer(this);
else else if(!sWorld.AddWeather(zone->ID))
{
if(!sWorld.AddWeather(zone->ID))
{ {
// send fine weather packet to remove old zone's weather // send fine weather packet to remove old zone's weather
Weather::SendFineWeatherUpdateToPlayer(this); 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 PvP, any not controlled zone (except zone->team == 6, default case)
// in PvE, only opposition team capital // in PvE, only opposition team capital
switch(zone->team) switch(zone->team)

View file

@ -186,7 +186,7 @@ bool Weather::ReGenerate()
void Weather::SendWeatherUpdateToPlayer(Player *player) 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); data << uint32(GetWeatherState()) << (float)m_grade << uint8(0);
player->GetSession()->SendPacket( &data ); player->GetSession()->SendPacket( &data );
@ -194,7 +194,7 @@ void Weather::SendWeatherUpdateToPlayer(Player *player)
void Weather::SendFineWeatherUpdateToPlayer(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); data << (uint32)WEATHER_STATE_FINE << (float)0.0f << uint8(0);
player->GetSession()->SendPacket( &data ); player->GetSession()->SendPacket( &data );
@ -215,7 +215,7 @@ bool Weather::UpdateWeather()
WeatherState state = GetWeatherState(); 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); data << uint32(state) << (float)m_grade << uint8(0);
player->SendMessageToSet( &data, true ); player->SendMessageToSet( &data, true );

View file

@ -323,6 +323,15 @@ bool World::RemoveQueuedPlayer(WorldSession* sess)
WorldSession* pop_sess = m_QueuedPlayer.front(); WorldSession* pop_sess = m_QueuedPlayer.front();
pop_sess->SetInQueue(false); pop_sess->SetInQueue(false);
pop_sess->SendAuthWaitQue(0); 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(); m_QueuedPlayer.pop_front();
// update iter to point first queued socket or end() if queue is empty now // update iter to point first queued socket or end() if queue is empty now