// level 0 chat
#define LANG_SYSTEMMESSAGE "|cffff0000[System Message]:|r"
+#define LANG_EVENTMESSAGE "|cffff0000[Event Started]:|r"
+#define LANG_EVENTENDEDMESSAGE "|cffff0000[Event Ended]:|r"
#define LANG_NO_HELP_CMD "There is no help for that command"
#define LANG_NO_CMD "There is no such command"
#define LANG_NO_SUBCMD "There is no such subcommand"
Index: src/game/Level1.cpp //4643浮点补丁
// center of grid
- float x = (grid_x-CENTER_GRID_ID+0.5)*SIZE_OF_GRIDS;
- float y = (grid_y-CENTER_GRID_ID+0.5)*SIZE_OF_GRIDS;
+ float x = (grid_x-CENTER_GRID_ID+0.5f)*SIZE_OF_GRIDS;
+ float y = (grid_y-CENTER_GRID_ID+0.5f)*SIZE_OF_GRIDS;
if (itm.chanceOrRef >= 0)
{
// Group of current loot - check for item chance in the group
- if (CumulativeChance[GroupId] == 0.0)
+ if (CumulativeChance[GroupId] == 0.0f)
RolledChance[GroupId] = rand_chance();
if (CumulativeChance[GroupId] >= RolledChance[GroupId])
// An item from the group already accepted
@@ -208,7 +208,7 @@
// Reference to a group of another loot
int LootId = -int(itm.chanceOrRef);
float Chance = rand_chance();
- float CumulChance = 0.0;
+ float CumulChance = 0.0f;
void Map::InitResetTime()
{
- if (Instanceable())
+ // for i_resetDelayTime==0 call single time for i_resetTime==0 //4645当机补丁
+ if (Instanceable() && (i_resetDelayTime != 0 || i_resetTime == 0) )
{
i_resetTime = time(NULL) + i_resetDelayTime; // only used for Instanceable() case
void MapInstanced::MoveAllCreaturesInMoveList()
{
- for (HM_NAMESPACE::hash_map< uint32, Map* >::iterator i = InstancedMaps.begin(); i != InstancedMaps.end(); i++)
+ for (HM_NAMESPACE::hash_map< uint32, Map* >::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); i++)
{
i->second->MoveAllCreaturesInMoveList();
}
@@ -81,7 +82,7 @@
{
bool remove_result = false;
- for (HM_NAMESPACE::hash_map< uint32, Map* >::iterator i = InstancedMaps.begin(); i != InstancedMaps.end(); i++)
+ for (HM_NAMESPACE::hash_map< uint32, Map* >::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); i++)
{
remove_result = remove_result || i->second->RemoveBones(guid, x, y);
}
@@ -92,14 +93,14 @@
void MapInstanced::UnloadAll()
{
// Unload instanced maps //4645当机补丁
- for (HM_NAMESPACE::hash_map< uint32, Map* >::iterator i = InstancedMaps.begin(); i != InstancedMaps.end(); i++)
+ for (HM_NAMESPACE::hash_map< uint32, Map* >::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); i++)
i->second->UnloadAll();
// Delete the maps only after everything is unloaded to prevent crashes
- for (HM_NAMESPACE::hash_map< uint32, Map* >::iterator i = InstancedMaps.begin(); i != InstancedMaps.end(); i++)
+ for (HM_NAMESPACE::hash_map< uint32, Map* >::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); i++)
delete i->second;
//if you add new opcode .. Do NOT forget to change the following define MAX_OPCODE_ID and also add new opcode to table in opcodes.cpp
-#define MAX_OPCODE_ID 999
+#define MAX_OPCODE_ID 1001
/// Results of friend related commands
enum FriendsResult
Index: src/game/Pet.cpp //2.2.3升级补丁
ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race);
if(!rEntry)
{
- sLog.outError("Race %u not found in DB?(Wrong DBC files?)",race);
+ sLog.outError("Race %u not found in DB?(Wrong DBC files?)",race);
return false;
}
honor = ((f * diff_level * (190 + v_rank*10))/6);
- honor *= ((float)k_level) / 70.0; //factor of dependence on levels of the killer
+ honor *= ((float)k_level) / 70.0f; //4643浮点补丁 //factor of dependence on levels of the killer
//pct mods for pct fields act like flat mods
float value = base_dodge + GetStat(STAT_AGILITY)/classrate;
- value += float(GetDefenseSkillBonusValue()*0.04)+ GetBaseModValue(modGroup, FLAT_MOD);
+ value += float(GetDefenseSkillBonusValue()*0.04f)+ GetBaseModValue(modGroup, FLAT_MOD);
value += GetRatingBonusValue(PLAYER_FIELD_DODGE_RATING);
///- Send the weather packet to all players in this zone
uint32 sound = GetSound();
if (m_grade >= 1)
- m_grade = 0.9999;
+ m_grade = 0.9999f;
else if (m_grade < 0)
- m_grade = 0.0001;
+ m_grade = 0.0001f;
/// Logon Challenge command handler
@@ -435,6 +440,10 @@
b.SetRand(19 * 8);
BigNumber gmod=g.ModExp(b, N);
B = ((v * 3) + gmod) % N;
+
+ if (B.GetNumBytes() < 32)
+ sLog.outDetail("Interesting, calculation of B in realmd is < 32.");
+
ASSERT(gmod.GetNumBytes() <= 32);
BigNumber unk3;
@@ -442,7 +451,7 @@
///- Fill the response packet with the result
pkt << (uint8)REALM_AUTH_SUCCESS;
- pkt.append(B.AsByteArray(), 32);
+ pkt.append(B.AsByteArray(), B.GetNumBytes());
pkt << (uint8)1;
pkt.append(g.AsByteArray(), 1);
pkt << (uint8)32;
@@ -456,7 +465,10 @@
QueryResult *localeresult = dbRealmServer.PQuery("SELECT `locale` FROM `localization` WHERE `string` = '%c%c'",ch->country[3],ch->country[2]);
if( localeresult )
+ {
_localization=(*localeresult)[0].GetUInt8();
+ delete localeresult;
+ }
else
_localization=LOCALE_ENG;
if (_localization>=MAX_LOCALE)
@@ -609,7 +621,9 @@
///- Update the sessionkey, last_ip and last login time in the account table for this account
// No SQL injection (escaped user name) and IP address as received by socket
- dbRealmServer.PExecute("UPDATE `account` SET `sessionkey` = '%s', `last_ip` = '%s', `last_login` = NOW(), `locale` = '%u' WHERE `username` = '%s'",K.AsHexStr(), GetRemoteAddress().c_str(), _localization, _safelogin.c_str() );
+ const char* K_hex = K.AsHexStr();
+ dbRealmServer.PExecute("UPDATE `account` SET `sessionkey` = '%s', `last_ip` = '%s', `last_login` = NOW(), `locale` = '%u' WHERE `username` = '%s'", K_hex, GetRemoteAddress().c_str(), _localization, _safelogin.c_str() );
+ OPENSSL_free((void*)K_hex);
///- Finish SRP6 and send the final result to the client
sha.Initialize();
Index: src/game/BattleGroundMgr.cpp // 4624当机补丁
===================================================================
--- trunk/src/game/BattleGroundMgr.cpp 2007/10/19 20:11:42 4623
+++ trunk/src/game/BattleGroundMgr.cpp 2007/10/21 01:24:05 4624
@@ -327,12 +327,15 @@
bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 p_time)
{
Player* plr = objmgr.GetPlayer( m_PlayerGuid );
+
+ // player logged off (we should do nothing, he is correctly removed from queue in another procedure)
if (!plr)
- // player logged off (we should do nothing, he is correctly removed from queue in another procedure)
return true;
+
+ // player is already in battleground ... do nothing (battleground queue status is deleted when player is teleported to BG)
if (plr->GetBattleGroundId() > 0)
- // player is already in battleground ... do nothing (battleground queue status is deleted when player is teleported to BG)
return true;
+
BattleGround* bg = sBattleGroundMgr.GetBattleGround(m_BgInstanceGUID);
if (bg)
{
@@ -340,7 +343,9 @@
if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES) // player is in queue
{
// check if player is invited to this bg ... this check must be here, because when player leaves queue and joins another, it would cause a problems
- if (sBattleGroundMgr.m_BattleGroundQueues[bg->GetTypeID()].m_QueuedPlayers[bg->GetQueueType()].find(m_PlayerGuid)->second.IsInvitedToBGInstanceGUID == m_BgInstanceGUID)
+ BattleGroundQueue::QueuedPlayersMap const& qpMap = sBattleGroundMgr.m_BattleGroundQueues[bg->GetTypeID()].m_QueuedPlayers[bg->GetQueueType()];
+ BattleGroundQueue::QueuedPlayersMap::const_iterator qItr = qpMap.find(m_PlayerGuid);
+ if (qItr != qpMap.end() && qItr->second.IsInvitedToBGInstanceGUID == m_BgInstanceGUID)
{
WorldPacket data;
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, plr->GetTeam(), queueSlot, STATUS_WAIT_JOIN, BG_REMIND_INVITE_TIME, 0);