aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/base/auth_database.sql77
-rw-r--r--sql/updates/auth/2012_03_28_00_auth_account.sql13
-rw-r--r--sql/updates/auth/2012_03_28_01_auth_account_access.sql3
-rw-r--r--sql/updates/auth/2012_03_28_02_auth_account_banned.sql4
-rw-r--r--sql/updates/auth/2012_03_28_03_auth_ip_banned.sql2
-rw-r--r--sql/updates/auth/2012_03_28_04_auth_logs.sql5
-rw-r--r--sql/updates/auth/2012_03_28_05_auth_realmcharacters.sql4
-rw-r--r--sql/updates/auth/2012_03_28_06_auth_realmlist.sql6
-rw-r--r--sql/updates/auth/2012_03_28_07_auth_uptime.sql6
-rw-r--r--sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql1
-rwxr-xr-xsrc/server/authserver/Realms/RealmList.cpp4
-rwxr-xr-xsrc/server/authserver/Realms/RealmList.h2
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAI.cpp12
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAI.h2
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp6
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h4
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp4
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundSA.cpp5
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp12
-rwxr-xr-xsrc/server/game/Events/GameEventMgr.cpp2
-rw-r--r--src/server/game/Grids/GridDefines.h3
-rwxr-xr-xsrc/server/game/World/World.cpp18
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp16
-rw-r--r--src/server/shared/Database/Implementation/CharacterDatabase.cpp2
-rwxr-xr-xsrc/server/shared/Logging/Log.cpp2
-rwxr-xr-xsrc/server/worldserver/Master.cpp11
26 files changed, 138 insertions, 88 deletions
diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql
index 305ba679bf2..5803529da1e 100644
--- a/sql/base/auth_database.sql
+++ b/sql/base/auth_database.sql
@@ -1,8 +1,8 @@
--- MySQL dump 10.13 Distrib 5.5.21, for Win64 (x86)
+-- MySQL dump 10.13 Distrib 5.5.22, for Win64 (x86)
--
-- Host: localhost Database: auth
-- ------------------------------------------------------
--- Server version 5.5.21
+-- Server version 5.5.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -23,27 +23,27 @@ DROP TABLE IF EXISTS `account`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `account` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier',
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier',
`username` varchar(32) NOT NULL DEFAULT '',
`sha_pass_hash` varchar(40) NOT NULL DEFAULT '',
- `sessionkey` longtext,
- `v` longtext,
- `s` longtext,
- `email` text,
+ `sessionkey` varchar(80) NOT NULL DEFAULT '',
+ `v` varchar(64) NOT NULL DEFAULT '',
+ `s` varchar(64) NOT NULL DEFAULT '',
+ `email` varchar(254) NOT NULL DEFAULT '',
`joindate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `last_ip` varchar(30) NOT NULL DEFAULT '127.0.0.1',
- `failed_logins` int(11) unsigned NOT NULL DEFAULT '0',
+ `last_ip` varchar(15) NOT NULL DEFAULT '127.0.0.1',
+ `failed_logins` int(10) unsigned NOT NULL DEFAULT '0',
`locked` tinyint(3) unsigned NOT NULL DEFAULT '0',
`last_login` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `online` tinyint(4) NOT NULL DEFAULT '0',
+ `online` tinyint(3) unsigned NOT NULL DEFAULT '0',
`expansion` tinyint(3) unsigned NOT NULL DEFAULT '2',
- `mutetime` bigint(40) NOT NULL DEFAULT '0',
+ `mutetime` bigint(20) NOT NULL DEFAULT '0',
`locale` tinyint(3) unsigned NOT NULL DEFAULT '0',
- `os` varchar(4) NOT NULL DEFAULT '',
- `recruiter` int(11) NOT NULL DEFAULT '0',
+ `os` varchar(3) NOT NULL DEFAULT '',
+ `recruiter` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_username` (`username`)
-) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Account System';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Account System';
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -63,11 +63,11 @@ DROP TABLE IF EXISTS `account_access`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `account_access` (
- `id` int(11) unsigned NOT NULL,
+ `id` int(10) unsigned NOT NULL,
`gmlevel` tinyint(3) unsigned NOT NULL,
`RealmID` int(11) NOT NULL DEFAULT '-1',
PRIMARY KEY (`id`,`RealmID`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -87,14 +87,14 @@ DROP TABLE IF EXISTS `account_banned`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `account_banned` (
- `id` int(11) NOT NULL DEFAULT '0' COMMENT 'Account id',
+ `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Account id',
`bandate` int(10) unsigned NOT NULL DEFAULT '0',
`unbandate` int(10) unsigned NOT NULL DEFAULT '0',
`bannedby` varchar(50) NOT NULL,
`banreason` varchar(255) NOT NULL,
- `active` tinyint(4) NOT NULL DEFAULT '1',
+ `active` tinyint(3) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`id`,`bandate`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Ban List';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Ban List';
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -120,7 +120,7 @@ CREATE TABLE `ip_banned` (
`bannedby` varchar(50) NOT NULL DEFAULT '[Console]',
`banreason` varchar(255) NOT NULL DEFAULT 'no reason',
PRIMARY KEY (`ip`,`bandate`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Banned IPs';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Banned IPs';
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -140,11 +140,11 @@ DROP TABLE IF EXISTS `logs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `logs` (
- `time` int(14) NOT NULL,
- `realm` int(4) NOT NULL,
- `type` int(4) NOT NULL,
- `string` text
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+ `time` int(10) unsigned NOT NULL,
+ `realm` int(10) unsigned NOT NULL,
+ `type` tinyint(3) unsigned NOT NULL,
+ `string` text CHARACTER SET latin1
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -164,12 +164,12 @@ DROP TABLE IF EXISTS `realmcharacters`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `realmcharacters` (
- `realmid` int(11) unsigned NOT NULL DEFAULT '0',
- `acctid` bigint(20) unsigned NOT NULL,
+ `realmid` int(10) unsigned NOT NULL DEFAULT '0',
+ `acctid` int(10) unsigned NOT NULL,
`numchars` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`realmid`,`acctid`),
KEY `acctid` (`acctid`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Realm Character Tracker';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Realm Character Tracker';
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -189,19 +189,19 @@ DROP TABLE IF EXISTS `realmlist`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `realmlist` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL DEFAULT '',
- `address` varchar(32) NOT NULL DEFAULT '127.0.0.1',
- `port` int(11) NOT NULL DEFAULT '8085',
+ `address` varchar(15) NOT NULL DEFAULT '127.0.0.1',
+ `port` smallint(5) unsigned NOT NULL DEFAULT '8085',
`icon` tinyint(3) unsigned NOT NULL DEFAULT '0',
`flag` tinyint(3) unsigned NOT NULL DEFAULT '2',
`timezone` tinyint(3) unsigned NOT NULL DEFAULT '0',
`allowedSecurityLevel` tinyint(3) unsigned NOT NULL DEFAULT '0',
`population` float unsigned NOT NULL DEFAULT '0',
- `gamebuild` int(11) unsigned NOT NULL DEFAULT '12340',
+ `gamebuild` int(10) unsigned NOT NULL DEFAULT '12340',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_name` (`name`)
-) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Realm System';
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Realm System';
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -222,14 +222,13 @@ DROP TABLE IF EXISTS `uptime`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `uptime` (
- `realmid` int(11) unsigned NOT NULL,
- `starttime` bigint(20) unsigned NOT NULL DEFAULT '0',
- `startstring` varchar(64) NOT NULL DEFAULT '',
- `uptime` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `realmid` int(10) unsigned NOT NULL,
+ `starttime` int(10) unsigned NOT NULL DEFAULT '0',
+ `uptime` int(10) unsigned NOT NULL DEFAULT '0',
`maxplayers` smallint(5) unsigned NOT NULL DEFAULT '0',
`revision` varchar(255) NOT NULL DEFAULT 'Trinitycore',
PRIMARY KEY (`realmid`,`starttime`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Uptime system';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Uptime system';
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -250,4 +249,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2012-03-26 18:21:51
+-- Dump completed on 2012-03-28 18:26:06
diff --git a/sql/updates/auth/2012_03_28_00_auth_account.sql b/sql/updates/auth/2012_03_28_00_auth_account.sql
new file mode 100644
index 00000000000..199baac5178
--- /dev/null
+++ b/sql/updates/auth/2012_03_28_00_auth_account.sql
@@ -0,0 +1,13 @@
+ALTER TABLE `account`
+ CHANGE `id` `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identifier',
+ CHANGE `sessionkey` `sessionkey` VARCHAR(80) NOT NULL DEFAULT '',
+ CHANGE `v` `v` VARCHAR(64) NOT NULL DEFAULT '',
+ CHANGE `s` `s` VARCHAR(64) NOT NULL DEFAULT '',
+ CHANGE `email` `email` VARCHAR(254) NOT NULL DEFAULT '',
+ CHANGE `last_ip` `last_ip` VARCHAR(15) NOT NULL DEFAULT '127.0.0.1',
+ CHANGE `failed_logins` `failed_logins` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ CHANGE `online` `online` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
+ CHANGE `mutetime` `mutetime` BIGINT(20) NOT NULL DEFAULT '0',
+ CHANGE `os` `os` VARCHAR(3) NOT NULL DEFAULT '',
+ CHANGE `recruiter` `recruiter` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ ROW_FORMAT=DEFAULT ENGINE=INNODB;
diff --git a/sql/updates/auth/2012_03_28_01_auth_account_access.sql b/sql/updates/auth/2012_03_28_01_auth_account_access.sql
new file mode 100644
index 00000000000..456dbf6c104
--- /dev/null
+++ b/sql/updates/auth/2012_03_28_01_auth_account_access.sql
@@ -0,0 +1,3 @@
+ALTER TABLE `account_access`
+ CHANGE `id` `id` INT(10) UNSIGNED NOT NULL,
+ ROW_FORMAT=DEFAULT ENGINE=INNODB;
diff --git a/sql/updates/auth/2012_03_28_02_auth_account_banned.sql b/sql/updates/auth/2012_03_28_02_auth_account_banned.sql
new file mode 100644
index 00000000000..917cea1a684
--- /dev/null
+++ b/sql/updates/auth/2012_03_28_02_auth_account_banned.sql
@@ -0,0 +1,4 @@
+ALTER TABLE `account_banned`
+ CHANGE `id` `id` INT(10) UNSIGNED DEFAULT '0' NOT NULL COMMENT 'Account id',
+ CHANGE `active` `active` TINYINT(3) UNSIGNED DEFAULT '1' NOT NULL,
+ ROW_FORMAT=DEFAULT ENGINE=INNODB;
diff --git a/sql/updates/auth/2012_03_28_03_auth_ip_banned.sql b/sql/updates/auth/2012_03_28_03_auth_ip_banned.sql
new file mode 100644
index 00000000000..2e754effc60
--- /dev/null
+++ b/sql/updates/auth/2012_03_28_03_auth_ip_banned.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `ip_banned`
+ ROW_FORMAT=DEFAULT ENGINE=INNODB;
diff --git a/sql/updates/auth/2012_03_28_04_auth_logs.sql b/sql/updates/auth/2012_03_28_04_auth_logs.sql
new file mode 100644
index 00000000000..4c837a47ed1
--- /dev/null
+++ b/sql/updates/auth/2012_03_28_04_auth_logs.sql
@@ -0,0 +1,5 @@
+ALTER TABLE `logs`
+ CHANGE `time` `time` INT(10) UNSIGNED NOT NULL,
+ CHANGE `realm` `realm` INT(10) UNSIGNED NOT NULL,
+ CHANGE `type` `type` TINYINT(3) UNSIGNED NOT NULL,
+ ROW_FORMAT=DEFAULT ENGINE=INNODB;
diff --git a/sql/updates/auth/2012_03_28_05_auth_realmcharacters.sql b/sql/updates/auth/2012_03_28_05_auth_realmcharacters.sql
new file mode 100644
index 00000000000..e50b3c3f331
--- /dev/null
+++ b/sql/updates/auth/2012_03_28_05_auth_realmcharacters.sql
@@ -0,0 +1,4 @@
+ALTER TABLE `realmcharacters`
+ CHANGE `realmid` `realmid` INT(10) UNSIGNED DEFAULT 0 NOT NULL,
+ CHANGE `acctid` `acctid` INT(10) UNSIGNED NOT NULL,
+ ROW_FORMAT=DEFAULT ENGINE=INNODB;
diff --git a/sql/updates/auth/2012_03_28_06_auth_realmlist.sql b/sql/updates/auth/2012_03_28_06_auth_realmlist.sql
new file mode 100644
index 00000000000..725702a9803
--- /dev/null
+++ b/sql/updates/auth/2012_03_28_06_auth_realmlist.sql
@@ -0,0 +1,6 @@
+ALTER TABLE `realmlist`
+ CHANGE `id` `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ CHANGE `address` `address` VARCHAR(15) DEFAULT '127.0.0.1' NOT NULL,
+ CHANGE `port` `port` SMALLINT(5) UNSIGNED DEFAULT '8085' NOT NULL,
+ CHANGE `gamebuild` `gamebuild` INT(10) UNSIGNED DEFAULT '12340' NOT NULL,
+ ROW_FORMAT=DEFAULT ENGINE=INNODB;
diff --git a/sql/updates/auth/2012_03_28_07_auth_uptime.sql b/sql/updates/auth/2012_03_28_07_auth_uptime.sql
new file mode 100644
index 00000000000..0ea4e3321df
--- /dev/null
+++ b/sql/updates/auth/2012_03_28_07_auth_uptime.sql
@@ -0,0 +1,6 @@
+ALTER TABLE `uptime`
+ DROP COLUMN `startstring`,
+ CHANGE `realmid` `realmid` INT(10) UNSIGNED NOT NULL,
+ CHANGE `starttime` `starttime` INT(10) UNSIGNED DEFAULT 0 NOT NULL,
+ CHANGE `uptime` `uptime` INT(10) UNSIGNED DEFAULT 0 NOT NULL,
+ ROW_FORMAT=DEFAULT ENGINE=INNODB;
diff --git a/sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql b/sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql
deleted file mode 100644
index da3a0f786b8..00000000000
--- a/sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql
+++ /dev/null
@@ -1 +0,0 @@
-DELETE FROM `character_queststatus` WHERE `status`=0;
diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp
index efcced51089..f856156825d 100755
--- a/src/server/authserver/Realms/RealmList.cpp
+++ b/src/server/authserver/Realms/RealmList.cpp
@@ -31,7 +31,7 @@ void RealmList::Initialize(uint32 updateInterval)
UpdateRealms(true);
}
-void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build)
+void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build)
{
// Create new if not exist or update existed
Realm& realm = m_realms[name];
@@ -82,7 +82,7 @@ void RealmList::UpdateRealms(bool init)
uint32 realmId = fields[0].GetUInt32();
const std::string& name = fields[1].GetString();
const std::string& address = fields[2].GetString();
- uint32 port = fields[3].GetUInt32();
+ uint16 port = fields[3].GetUInt16();
uint8 icon = fields[4].GetUInt8();
RealmFlags flag = RealmFlags(fields[5].GetUInt8());
uint8 timezone = fields[6].GetUInt8();
diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h
index 4d258953ae0..c8407b0fea1 100755
--- a/src/server/authserver/Realms/RealmList.h
+++ b/src/server/authserver/Realms/RealmList.h
@@ -71,7 +71,7 @@ public:
private:
void UpdateRealms(bool init=false);
- void UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build);
+ void UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build);
RealmMap m_realms;
uint32 m_UpdateInterval;
diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp
index 11887611ae8..7a2b83273c9 100755
--- a/src/server/game/AI/EventAI/CreatureEventAI.cpp
+++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp
@@ -95,7 +95,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c)
m_AttackDistance = 0.0f;
m_AttackAngle = 0.0f;
- m_InvinceabilityHpLevel = 0;
+ m_InvincibilityHpLevel = 0;
//Handle Spawned Events
if (!m_bEmptyList)
@@ -816,9 +816,9 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
case ACTION_T_SET_INVINCIBILITY_HP_LEVEL:
{
if (action.invincibility_hp_level.is_percent)
- m_InvinceabilityHpLevel = me->CountPctFromMaxHealth(action.invincibility_hp_level.hp_level);
+ m_InvincibilityHpLevel = me->CountPctFromMaxHealth(action.invincibility_hp_level.hp_level);
else
- m_InvinceabilityHpLevel = action.invincibility_hp_level.hp_level;
+ m_InvincibilityHpLevel = action.invincibility_hp_level.hp_level;
break;
}
case ACTION_T_MOUNT_TO_ENTRY_OR_MODEL:
@@ -1350,12 +1350,12 @@ void CreatureEventAI::ReceiveEmote(Player* player, uint32 textEmote)
void CreatureEventAI::DamageTaken(Unit* /*done_by*/, uint32& damage)
{
- if (m_InvinceabilityHpLevel > 0 && me->GetHealth() < m_InvinceabilityHpLevel+damage)
+ if (m_InvincibilityHpLevel > 0 && me->GetHealth() < m_InvincibilityHpLevel+damage)
{
- if (me->GetHealth() <= m_InvinceabilityHpLevel)
+ if (me->GetHealth() <= m_InvincibilityHpLevel)
damage = 0;
else
- damage = me->GetHealth() - m_InvinceabilityHpLevel;
+ damage = me->GetHealth() - m_InvincibilityHpLevel;
}
}
diff --git a/src/server/game/AI/EventAI/CreatureEventAI.h b/src/server/game/AI/EventAI/CreatureEventAI.h
index c4daf2563e0..3d2bcf888c8 100755
--- a/src/server/game/AI/EventAI/CreatureEventAI.h
+++ b/src/server/game/AI/EventAI/CreatureEventAI.h
@@ -641,6 +641,6 @@ class CreatureEventAI : public CreatureAI
bool m_MeleeEnabled; // If we allow melee auto attack
float m_AttackDistance; // Distance to attack from
float m_AttackAngle; // Angle of attack
- uint32 m_InvinceabilityHpLevel; // Minimal health level allowed at damage apply
+ uint32 m_InvincibilityHpLevel; // Minimal health level allowed at damage apply
};
#endif
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index 2ff25544b2c..4eb7f8a7f50 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -68,7 +68,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
mFollowCredit = 0;
mFollowArrivedEntry = 0;
mFollowCreditType = 0;
- mInvinceabilityHpLevel = 0;
+ mInvincibilityHpLevel = 0;
}
void SmartAI::UpdateDespawn(const uint32 diff)
@@ -640,8 +640,8 @@ void SmartAI::SpellHitTarget(Unit* target, const SpellInfo* spellInfo)
void SmartAI::DamageTaken(Unit* doneBy, uint32& damage)
{
GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED, doneBy, damage);
- if ((me->GetHealth() - damage) <= mInvinceabilityHpLevel)
- damage -= mInvinceabilityHpLevel;
+ if ((me->GetHealth() - damage) <= mInvincibilityHpLevel)
+ damage = me->GetHealth() - mInvincibilityHpLevel;
}
void SmartAI::HealReceived(Unit* doneBy, uint32& addhealth)
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index 0b925f852f4..94e5e65cf8b 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -174,7 +174,7 @@ class SmartAI : public CreatureAI
void SetSwim(bool swim = true);
- void SetInvinceabilityHpLevel(uint32 level) { mInvinceabilityHpLevel = level; }
+ void SetInvincibilityHpLevel(uint32 level) { mInvincibilityHpLevel = level; }
void sGossipHello(Player* player);
void sGossipSelect(Player* player, uint32 sender, uint32 action);
@@ -223,7 +223,7 @@ class SmartAI : public CreatureAI
bool mCanAutoAttack;
bool mCanCombatMove;
bool mForcedPaused;
- uint32 mInvinceabilityHpLevel;
+ uint32 mInvincibilityHpLevel;
bool AssistPlayerInCombat(Unit* who);
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 5eaa1577642..b2c4fd29868 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -1043,9 +1043,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
if (e.action.invincHP.percent)
- ai->SetInvinceabilityHpLevel(me->CountPctFromMaxHealth(e.action.invincHP.percent));
+ ai->SetInvincibilityHpLevel(me->CountPctFromMaxHealth(e.action.invincHP.percent));
else
- ai->SetInvinceabilityHpLevel(e.action.invincHP.minHP);
+ ai->SetInvincibilityHpLevel(e.action.invincHP.minHP);
break;
}
case SMART_ACTION_SET_DATA:
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
index b236bd41210..6d784488aad 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
@@ -37,6 +37,11 @@ BattlegroundSA::BattlegroundSA()
SignaledRoundTwo = false;
SignaledRoundTwoHalfMin = false;
InitSecondRound = false;
+
+ //! This is here to prevent an uninitialised variable warning
+ //! The warning only occurs when SetUpBattleGround fails though.
+ //! In the future this function should be called BEFORE sending initial worldstates.
+ memset(&GraveyardStatus, 0, sizeof(GraveyardStatus));
}
BattlegroundSA::~BattlegroundSA()
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index f25d90855d4..7d2c62feb73 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -858,6 +858,10 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep
isDebugAreaTriggers = false;
+ m_WeeklyQuestChanged = false;
+
+ m_SeasonalQuestChanged = false;
+
SetPendingBind(0, 0);
}
@@ -17958,14 +17962,8 @@ void Player::_LoadQuestStatus(PreparedQueryResult result)
QuestStatusData& questStatusData = m_QuestStatus[quest_id];
uint8 qstatus = fields[1].GetUInt8();
- if (qstatus < MAX_QUEST_STATUS && qstatus > QUEST_STATUS_NONE)
+ if (qstatus < MAX_QUEST_STATUS)
questStatusData.Status = QuestStatus(qstatus);
- else if (qstatus == QUEST_STATUS_NONE)
- {
- sLog->outError("Player %s (GUID: %u) has QUEST_STATUS_NONE for quest %u and should be removed from character_queststatus.",
- GetName(), GetGUIDLow(), quest_id);
- continue;
- }
else
{
questStatusData.Status = QUEST_STATUS_INCOMPLETE;
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp
index b15ffc361d7..bf7bc13345a 100755
--- a/src/server/game/Events/GameEventMgr.cpp
+++ b/src/server/game/Events/GameEventMgr.cpp
@@ -823,7 +823,7 @@ void GameEventMgr::LoadFromDB()
{
Field* fields = result->Fetch();
- int8 event_id = fields[0].GetInt8();
+ uint8 event_id = fields[0].GetUInt8();
if (event_id >= mGameEventVendors.size())
{
diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h
index 99bb20fe9f6..7bd0da34a46 100644
--- a/src/server/game/Grids/GridDefines.h
+++ b/src/server/game/Grids/GridDefines.h
@@ -215,8 +215,7 @@ namespace Trinity
inline bool IsValidMapCoord(float c)
{
- //! Since we visit grids in circles, we cannot allow players to relocate to grids on the edge of a map - thus the use of CENTER_GRID_OFFSET
- return finite(c) && (std::fabs(c) <= MAP_HALFSIZE - CENTER_GRID_OFFSET - 0.5f);
+ return finite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5f);
}
inline bool IsValidMapCoord(float x, float y)
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 3e730bd27af..a842c288c89 100755
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1666,18 +1666,10 @@ void World::SetInitialWorldSettings()
///- Initialize game time and timers
sLog->outString("Initialize game time and timers");
m_gameTime = time(NULL);
- m_startTime=m_gameTime;
-
- tm local;
- time_t curr;
- time(&curr);
- local=*(localtime(&curr)); // dereference and assign
- char isoDate[128];
- sprintf(isoDate, "%04d-%02d-%02d %02d:%02d:%02d",
- local.tm_year+1900, local.tm_mon+1, local.tm_mday, local.tm_hour, local.tm_min, local.tm_sec);
+ m_startTime = m_gameTime;
- LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime, revision) VALUES('%u', " UI64FMTD ", '%s', 0, '%s')",
- realmID, uint64(m_startTime), isoDate, _FULLVERSION); // One-time query
+ LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, uptime, revision) VALUES(%u, %u, 0, '%s')",
+ realmID, uint32(m_startTime), _FULLVERSION); // One-time query
m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILLISECONDS);
m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILLISECONDS);
@@ -1962,10 +1954,10 @@ void World::Update(uint32 diff)
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_UPTIME_PLAYERS);
- stmt->setUInt64(0, uint64(tmpDiff));
+ stmt->setUInt32(0, tmpDiff);
stmt->setUInt16(1, uint16(maxOnlinePlayers));
stmt->setUInt32(2, realmID);
- stmt->setUInt64(3, uint64(m_startTime));
+ stmt->setUInt32(3, uint32(m_startTime));
LoginDatabase.Execute(stmt);
}
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index b012fe5f183..a327a200c98 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -185,6 +185,11 @@ class spell_pri_penance : public SpellScriptLoader
{
PrepareSpellScript(spell_pri_penance_SpellScript);
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
bool Validate(SpellInfo const* spellEntry)
{
if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_PENANCE_R1))
@@ -219,10 +224,21 @@ class spell_pri_penance : public SpellScriptLoader
}
}
+ SpellCastResult CheckCast()
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ if (GetTargetUnit())
+ if (Player* target = GetTargetUnit()->ToPlayer())
+ if (caster->GetTeam() != target->GetTeam() && !caster->IsValidAttackTarget(target))
+ return SPELL_FAILED_BAD_TARGETS;
+ return SPELL_CAST_OK;
+ }
+
void Register()
{
// add dummy effect spell handler to Penance
OnEffectHitTarget += SpellEffectFn(spell_pri_penance_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ OnCheckCast += SpellCheckCastFn(spell_pri_penance_SpellScript::CheckCast);
}
};
diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp
index 3d30e97544a..a9754cfc73d 100644
--- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp
+++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp
@@ -71,7 +71,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
"base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM character_aura WHERE guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SPELL, "SELECT spell, active, disabled FROM character_spell WHERE guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_SEL_CHARACTER_QUESTSTATUS, "SELECT quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, "
- "itemcount1, itemcount2, itemcount3, itemcount4, playercount FROM character_queststatus WHERE guid = ?", CONNECTION_ASYNC)
+ "itemcount1, itemcount2, itemcount3, itemcount4, playercount FROM character_queststatus WHERE guid = ? AND status <> 0", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_SEL_CHARACTER_DAILYQUESTSTATUS, "SELECT quest, time FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_SEL_CHARACTER_WEEKLYQUESTSTATUS, "SELECT quest FROM character_queststatus_weekly WHERE guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SEASONALQUESTSTATUS, "SELECT quest, event FROM character_queststatus_seasonal WHERE guid = ?", CONNECTION_ASYNC)
diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp
index a9bb282cf86..0a53706fea2 100755
--- a/src/server/shared/Logging/Log.cpp
+++ b/src/server/shared/Logging/Log.cpp
@@ -382,7 +382,7 @@ void Log::outDB(LogTypes type, const char * str)
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_LOG);
stmt->setInt32(0, realm);
- stmt->setInt32(1, type);
+ stmt->setUInt8(1, uint8(type));
stmt->setString(2, logStr);
LoginDatabase.Execute(stmt);
diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp
index f4945e025b0..03b2859c514 100755
--- a/src/server/worldserver/Master.cpp
+++ b/src/server/worldserver/Master.cpp
@@ -270,7 +270,11 @@ int Master::Run()
LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag & ~%u, population = 0 WHERE id = '%u'", REALM_FLAG_INVALID, realmID);
sLog->outString("%s (worldserver-daemon) ready...", _FULLVERSION);
- sWorldSocketMgr->Wait();
+
+ // when the main thread closes the singletons get unloaded
+ // since worldrunnable uses them, it will crash if unloaded after master
+ world_thread.wait();
+ rar_thread.wait();
if (soap_thread)
{
@@ -282,11 +286,6 @@ int Master::Run()
// set server offline
LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, realmID);
- // when the main thread closes the singletons get unloaded
- // since worldrunnable uses them, it will crash if unloaded after master
- world_thread.wait();
- rar_thread.wait();
-
///- Clean database before leaving
ClearOnlineAccounts();