aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp13
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundIC.h2
-rw-r--r--src/server/game/Chat/Channels/ChannelMgr.cpp12
-rw-r--r--src/server/game/Handlers/PetHandler.cpp4
-rw-r--r--src/server/game/Spells/SpellEffects.cpp2
-rw-r--r--src/server/scripts/Commands/cs_account.cpp4
-rw-r--r--src/server/shared/Logging/AppenderFile.cpp4
-rw-r--r--src/server/shared/Logging/AppenderFile.h3
8 files changed, 30 insertions, 14 deletions
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
index 6fc68c62d1f..29d4e4124c0 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
@@ -544,7 +544,11 @@ void BattlegroundIC::EventPlayerClickedOnFlag(Player* player, GameObject* target
float cords[4] = {banner->GetPositionX(), banner->GetPositionY(), banner->GetPositionZ(), banner->GetOrientation() };
DelObject(nodePoint[i].gameobject_type);
- AddObject(nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry, cords[0], cords[1], cords[2], cords[3], 0, 0, 0, 0, RESPAWN_ONE_DAY);
+ if (!AddObject(nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry, cords[0], cords[1], cords[2], cords[3], 0, 0, 0, 0, RESPAWN_ONE_DAY))
+ {
+ TC_LOG_ERROR(LOG_FILTER_BATTLEGROUND, "Isle of Conquest: There was an error spawning a banner (type: %u, entry: %u). Isle of Conquest BG cancelled.", nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry);
+ Battleground::EndBattleground(WINNER_NONE);
+ }
GetBGObject(nodePoint[i].gameobject_type)->SetUInt32Value(GAMEOBJECT_FACTION, nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_Factions[1] : BG_IC_Factions[0]);
@@ -641,10 +645,13 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
for (uint8 u = 0; u < MAX_HANGAR_TELEPORTERS_SPAWNS; ++u)
{
uint8 type = BG_IC_GO_HANGAR_TELEPORTER_1+u;
- AddObject(type, (nodePoint->faction == TEAM_ALLIANCE ? GO_ALLIANCE_GUNSHIP_PORTAL : GO_HORDE_GUNSHIP_PORTAL),
+ if (!AddObject(type, (nodePoint->faction == TEAM_ALLIANCE ? GO_ALLIANCE_GUNSHIP_PORTAL : GO_HORDE_GUNSHIP_PORTAL),
BG_IC_HangarTeleporters[u].GetPositionX(), BG_IC_HangarTeleporters[u].GetPositionY(),
BG_IC_HangarTeleporters[u].GetPositionZ(), BG_IC_HangarTeleporters[u].GetOrientation(),
- 0, 0, 0, 0, RESPAWN_ONE_DAY);
+ 0, 0, 0, 0, RESPAWN_ONE_DAY))
+ {
+ TC_LOG_ERROR(LOG_FILTER_BATTLEGROUND, "Isle of Conquest: There was an error spawning a gunship portal. Type: %u", BG_IC_GO_HANGAR_TELEPORTER_1+u);
+ }
}
//TC_LOG_ERROR(LOG_FILTER_BATTLEGROUND, "BG_IC_GO_HANGAR_BANNER CAPTURED Faction: %u", nodePoint->faction);
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
index 34d03a5d92c..6fdc97f25c5 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
@@ -818,7 +818,7 @@ const Position allianceGunshipPassengers[5] =
struct ICNodePoint
{
uint32 gameobject_type; // with this we will get the GameObject of that point
- uint32 gameobject_entry; // what gamoebject entry is active here.
+ uint32 gameobject_entry; // what gameobject entry is active here.
uint8 faction; // who has this node
ICNodePointType nodeType; // here we can specify if it is graveyards, hangar etc...
uint32 banners[4]; // the banners that have this point
diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp
index 62b3416f72e..96d28035b29 100644
--- a/src/server/game/Chat/Channels/ChannelMgr.cpp
+++ b/src/server/game/Chat/Channels/ChannelMgr.cpp
@@ -43,7 +43,9 @@ ChannelMgr* ChannelMgr::forTeam(uint32 team)
Channel* ChannelMgr::GetJoinChannel(std::string const& name, uint32 channelId)
{
std::wstring wname;
- Utf8toWStr(name, wname);
+ if (!Utf8toWStr(name, wname))
+ return NULL;
+
wstrToLower(wname);
ChannelMap::const_iterator i = channels.find(wname);
@@ -61,7 +63,9 @@ Channel* ChannelMgr::GetJoinChannel(std::string const& name, uint32 channelId)
Channel* ChannelMgr::GetChannel(std::string const& name, Player* player, bool pkt)
{
std::wstring wname;
- Utf8toWStr(name, wname);
+ if (!Utf8toWStr(name, wname))
+ return NULL;
+
wstrToLower(wname);
ChannelMap::const_iterator i = channels.find(wname);
@@ -84,7 +88,9 @@ Channel* ChannelMgr::GetChannel(std::string const& name, Player* player, bool pk
void ChannelMgr::LeftChannel(std::string const& name)
{
std::wstring wname;
- Utf8toWStr(name, wname);
+ if (!Utf8toWStr(name, wname))
+ return;
+
wstrToLower(wname);
ChannelMap::const_iterator i = channels.find(wname);
diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp
index 32cd7ee4725..0badd503c17 100644
--- a/src/server/game/Handlers/PetHandler.cpp
+++ b/src/server/game/Handlers/PetHandler.cpp
@@ -630,7 +630,9 @@ void WorldSession::HandlePetRename(WorldPacket& recvData)
}
std::wstring wname;
- Utf8toWStr(name, wname);
+ if (!Utf8toWStr(name, wname))
+ return;
+
if (!ObjectMgr::CheckDeclinedNames(wname, declinedname))
{
SendPetNameInvalid(PET_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME, name, &declinedname);
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 98c188df08f..a8d4c85656b 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -5604,7 +5604,7 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex)
// Blood Tap
if (m_spellInfo->Id == 45529 && count > 0)
{
- for (uint32 l = 0; l < MAX_RUNES && count > 0; ++l)
+ for (uint32 l = 0; l + 1 < MAX_RUNES && count > 0; ++l)
{
// Check if both runes are on cd as that is the only time when this needs to come into effect
if ((player->GetRuneCooldown(l) && player->GetCurrentRune(l) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)) && (player->GetRuneCooldown(l+1) && player->GetCurrentRune(l+1) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)))
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 6fcf9dfdbec..f0d27104035 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -453,9 +453,9 @@ public:
char* oldPassword = strtok((char*)args, " "); // This extracts [$oldpassword]
char* newPassword = strtok(NULL, " "); // This extracts [$newpassword]
char* passwordConfirmation = strtok(NULL, " "); // This extracts [$newpasswordconfirmation]
- char* emailConfirmation = NULL; // This defines the emailConfirmation variable, which is optional depending on sec type.
+ const char* emailConfirmation; // This defines the emailConfirmation variable, which is optional depending on sec type.
if (!(emailConfirmation = strtok(NULL, " "))) // This extracts [$emailconfirmation]. If it doesn't exist, however...
- emailConfirmation = '\0'; // ... it's simply "" for emailConfirmation.
+ emailConfirmation = ""; // ... it's simply "" for emailConfirmation.
//Is any of those variables missing for any reason ? We return false.
if (!oldPassword || !newPassword || !passwordConfirmation)
diff --git a/src/server/shared/Logging/AppenderFile.cpp b/src/server/shared/Logging/AppenderFile.cpp
index 93d53bcc30d..54458346bb9 100644
--- a/src/server/shared/Logging/AppenderFile.cpp
+++ b/src/server/shared/Logging/AppenderFile.cpp
@@ -40,7 +40,7 @@ AppenderFile::~AppenderFile()
void AppenderFile::_write(LogMessage const& message)
{
- bool exceedMaxSize = maxFileSize > 0 && (fileSize + message.Size()) > maxFileSize;
+ bool exceedMaxSize = maxFileSize > 0 && (fileSize.value() + message.Size()) > maxFileSize;
if (dynamicName)
{
@@ -56,7 +56,7 @@ void AppenderFile::_write(LogMessage const& message)
fprintf(logfile, "%s%s", message.prefix.c_str(), message.text.c_str());
fflush(logfile);
- fileSize += message.Size();
+ fileSize += uint64(message.Size());
if (dynamicName)
CloseFile();
diff --git a/src/server/shared/Logging/AppenderFile.h b/src/server/shared/Logging/AppenderFile.h
index c15974799e1..de94a46d692 100644
--- a/src/server/shared/Logging/AppenderFile.h
+++ b/src/server/shared/Logging/AppenderFile.h
@@ -19,6 +19,7 @@
#define APPENDERFILE_H
#include "Appender.h"
+#include "ace/Atomic_Op.h"
class AppenderFile: public Appender
{
@@ -37,7 +38,7 @@ class AppenderFile: public Appender
bool dynamicName;
bool backup;
uint64 maxFileSize;
- uint64 fileSize;
+ ACE_Atomic_Op<ACE_Thread_Mutex, uint64> fileSize;
};
#endif