diff options
28 files changed, 310 insertions, 169 deletions
diff --git a/dep/include/mersennetwister/MersenneTwister.h b/dep/include/mersennetwister/MersenneTwister.h index 708b675eed4..0fbd9242e45 100644 --- a/dep/include/mersennetwister/MersenneTwister.h +++ b/dep/include/mersennetwister/MersenneTwister.h @@ -238,7 +238,7 @@ inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength ) initialize(19650218UL); register int i = 1; register uint32 j = 0; - register int k = ( N > seedLength ? N : seedLength ); + register int k = ( N > int(seedLength) ? N : int(seedLength) ); for( ; k; --k ) { state[i] = diff --git a/sql/mangos.sql b/sql/mangos.sql index 75b4fce25e6..7302faea9fc 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -22,7 +22,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) default NULL, - `required_7312_01_mangos_mangos_string` bit(1) default NULL + `required_7331_01_mangos_command` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -235,7 +235,7 @@ INSERT INTO `command` VALUES ('account create',4,'Syntax: .account create $account $password\r\n\r\nCreate account and set password to it.'), ('account delete',4,'Syntax: .account delete $account\r\n\r\nDelete account with all characters.'), ('account onlinelist',4,'Syntax: .account onlinelist\r\n\r\nShow list of online accounts.'), -('account set addon',3,'Syntax: .account set addon [$account] #addon\r\n\r\nSet user (posible targeted) expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk.'), +('account set addon',3,'Syntax: .account set addon [$account] #addon\r\n\r\nSet user (possible targeted) expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk.'), ('account set gmlevel',4,'Syntax: .account set gmlevel [$account] #level\r\n\r\nSet the security level for targeted player (can''t be used at self) or for account $name to a level of #level.\r\n\r\n#level may range from 0 to 3.'), ('account set password',4,'Syntax: .account set password $account $password $password\r\n\r\nSet password for account.'), ('additem',3,'Syntax: .additem #itemid/[#itemname]/#shift-click-item-link #itemcount\r\n\r\nAdds the specified number of items of id #itemid (or exact (!) name $itemname in brackets, or link created by shift-click at item in inventory or recipe) to your or selected character inventory. If #itemcount is omitted, only one item will be added.\r\n.'), @@ -243,16 +243,16 @@ INSERT INTO `command` VALUES ('addmove',2,'Syntax: .addmove #creature_guid [#waittime]\r\n\r\nAdd your current location as a waypoint for creature with guid #creature_guid. And optional add wait time.'), ('announce',1,'Syntax: .announce $MessageToBroadcast\r\n\r\nSend a global message to all players online in chat log.'), ('aura',3,'Syntax: .aura #spellid\r\n\r\nAdd the aura from spell #spellid to the selected Unit.'), -('ban account',3,'Syntax is: ban account $Name $bantime $reason\r\nBan account kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'), -('ban character',3,'Syntax is: ban character $Name $bantime $reason\r\nBan account and kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'), -('ban ip',3,'Syntax is: ban ip $Ip $bantime $reason\r\nBan IP.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'), -('baninfo account',3,'Syntax is: baninfo account\r\nWatch full information about a specific ban.'), -('baninfo character',3,'Syntax is: baninfo character\r\nWatch full information about a specific ban.'), -('baninfo ip',3,'Syntax is: baninfo ip\r\nWatch full information about a specific ban.'), +('ban account',3,'Syntax: .ban account $Name $bantime $reason\r\nBan account kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'), +('ban character',3,'Syntax: .ban character $Name $bantime $reason\r\nBan account and kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'), +('ban ip',3,'Syntax: .ban ip $Ip $bantime $reason\r\nBan IP.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'), +('baninfo account',3,'Syntax: .baninfo account\r\nWatch full information about a specific ban.'), +('baninfo character',3,'Syntax: .baninfo character\r\nWatch full information about a specific ban.'), +('baninfo ip',3,'Syntax: .baninfo ip\r\nWatch full information about a specific ban.'), ('bank',3,'Syntax: .bank\r\n\r\nShow your bank inventory.'), -('banlist account',3,'Syntax is: banlist account [$Name]\r\nSearches the banlist for a account name pattern or show full list account bans.'), -('banlist character',3,'Syntax is: banlist character $Name\r\nSearches the banlist for a character name pattern. Pattern required.'), -('banlist ip',3,'Syntax is: banlist ip [$Ip]\r\nSearches the banlist for a IP pattern or show full list of IP bans.'), +('banlist account',3,'Syntax: .banlist account [$Name]\r\nSearches the banlist for a account name pattern or show full list account bans.'), +('banlist character',3,'Syntax: .banlist character $Name\r\nSearches the banlist for a character name pattern. Pattern required.'), +('banlist ip',3,'Syntax: .banlist ip [$Ip]\r\nSearches the banlist for a IP pattern or show full list of IP bans.'), ('cast',3,'Syntax: .cast #spellid [triggered]\r\n Cast #spellid to selected target. If no target selected cast to self. If \'trigered\' or part provided then spell casted with triggered flag.'), ('cast back',3,'Syntax: .cast back #spellid [triggered]\r\n Selected target will cast #spellid to your character. If \'trigered\' or part provided then spell casted with triggered flag.'), ('cast dist',3,'Syntax: .cast dist #spellid [#dist [triggered]]\r\n You will cast spell to pint at distance #dist. If \'trigered\' or part provided then spell casted with triggered flag. Not all spells can be casted as area spells.'), @@ -284,7 +284,7 @@ INSERT INTO `command` VALUES ('flusharenapoints','3','Syntax: .flusharenapoints\r\n\r\nUse it to distribute arena points based on arena team ratings, and start a new week.'), ('gm',1,'Syntax: .gm [on/off]\r\n\r\nEnable or Disable in game GM MODE or show current state of on/off not provided.'), ('gm chat',1,'Syntax: .gm chat [on/off]\r\n\r\nEnable or disable chat GM MODE (show gm badge in messages) or show current state of on/off not provided.'), -('gm fly',3,'Syntax: .gm fly on/off\r\nEnable/disable gm fly mode.'), +('gm fly',3,'Syntax: .gm fly [on/off]\r\nEnable/disable gm fly mode.'), ('gm ingame',0,'Syntax: .gm ingame\r\n\r\nDisplay a list of available in game Game Masters.'), ('gm list',3,'Syntax: .gm list\r\n\r\nDisplay a list of all Game Masters accounts and security levels.'), ('gm online',0,'Syntax: .gm online\r\n\r\nDisplay a list of available Game Masters.'), @@ -300,7 +300,7 @@ INSERT INTO `command` VALUES ('gobject add',2,'Syntax: .gobject add #id <spawntimeSecs>\r\n\r\nAdd a game object from game object templates to the world at your current location using the #id.\r\nspawntimesecs sets the spawntime, it is optional.\r\n\r\nNote: this is a copy of .gameobject.'), ('gobject delete',2,'Syntax: .gobject delete #go_guid\r\nDelete gameobject with guid #go_guid.'), ('gobject move',2,'Syntax: .gobject move #goguid [#x #y #z]\r\n\r\nMove gameobject #goguid to character coordinates (or to (#x,#y,#z) coordinates if its provide).'), -('gobject near ',3,'Syntax: .gobject near [#distance]\r\n\r\nOutput gameobjects at distance #distance from player. Output gameobject guids and coordinates sorted by distance from character. If #distance not provided use 10 as default value.'), +('gobject near',3,'Syntax: .gobject near [#distance]\r\n\r\nOutput gameobjects at distance #distance from player. Output gameobject guids and coordinates sorted by distance from character. If #distance not provided use 10 as default value.'), ('gobject phase',3,'Syntax: .gobject phase #guid #phasemask\r\n\r\nGameobject with DB guid #guid phasemask changed to #phasemask with related world vision update for players. Gameobject state saved to DB and persistent.'), ('gobject turn',2,'Syntax: .gobject turn #goguid \r\n\r\nSet for gameobject #goguid orientation same as current character orientation.'), ('gobject target',2,'Syntax: .gobject target [#go_id|#go_name_part]\r\n\r\nLocate and show position nearest gameobject. If #go_id or #go_name_part provide then locate and show position of nearest gameobject with gameobject template id #go_id or name included #go_name_part as part.'), @@ -349,9 +349,9 @@ INSERT INTO `command` VALUES ('lookup item',3,'Syntax: .lookup item $itemname\r\n\r\nLooks up an item by $itemname, and returns all matches with their Item ID\'s.'), ('lookup itemset',3,'Syntax: .lookup itemset $itemname\r\n\r\nLooks up an item set by $itemname, and returns all matches with their Item set ID\'s.'), ('lookup object',3,'Syntax: .lookup object $objname\r\n\r\nLooks up an gameobject by $objname, and returns all matches with their Gameobject ID\'s.'), -('lookup player account',2,'Syntax : .lookup player account $account ($limit) \r\n\r\n Searchs players, which account username is $account with optional parametr $limit of results.'), -('lookup player ip',2,'Syntax : .lookup player ip $ip ($limit) \r\n\r\n Searchs players, which account ast_ip is $ip with optional parametr $limit of results.'), -('lookup player email',2,'Syntax : .lookup player email $email ($limit) \r\n\r\n Searchs players, which account email is $email with optional parametr $limit of results.'), +('lookup player account',2,'Syntax: .lookup player account $account ($limit) \r\n\r\n Searchs players, which account username is $account with optional parametr $limit of results.'), +('lookup player ip',2,'Syntax: .lookup player ip $ip ($limit) \r\n\r\n Searchs players, which account ast_ip is $ip with optional parametr $limit of results.'), +('lookup player email',2,'Syntax: .lookup player email $email ($limit) \r\n\r\n Searchs players, which account email is $email with optional parametr $limit of results.'), ('lookup quest',3,'Syntax: .lookup quest $namepart\r\n\r\nLooks up a quest by $namepart, and returns all matches with their quest ID\'s.'), ('lookup skill',3,'Syntax: .lookup skill $$namepart\r\n\r\nLooks up a skill by $namepart, and returns all matches with their skill ID\'s.'), ('lookup spell',3,'Syntax: .lookup spell $namepart\r\n\r\nLooks up a spell by $namepart, and returns all matches with their spell ID\'s.'), @@ -369,18 +369,18 @@ INSERT INTO `command` VALUES ('modify honor',1,'Syntax: .modify honor $amount\r\n\r\nAdd $amount honor points to the selected player.'), ('modify hp',1,'Syntax: .modify hp #newhp\r\n\r\nModify the hp of the selected player. If no player is selected, modify your hp.'), ('modify mana',1,'Syntax: .modify mana #newmana\r\n\r\nModify the mana of the selected player. If no player is selected, modify your mana.'), -('modify money',1,'Syntax:\r\n.modify money #money\r\n.money #money\r\n\r\nAdd or remove money to the selected player. If no player is selected, modify your money.\r\n\r\n #gold can be negative to remove money.'), +('modify money',1,'Syntax: .modify money #money\r\n.money #money\r\n\r\nAdd or remove money to the selected player. If no player is selected, modify your money.\r\n\r\n #gold can be negative to remove money.'), ('modify morph',2,'Syntax: .modify morph #displayid\r\n\r\nChange your current model id to #displayid.'), -('modify mount',1,'Syntax:\r\n.modify mount #id #speed\r\nDisplay selected player as mounted at #id creature and set speed to #speed value.'), +('modify mount',1,'Syntax: .modify mount #id #speed\r\nDisplay selected player as mounted at #id creature and set speed to #speed value.'), ('modify phase',3,'Syntax: .modify phase #phasemask\r\n\r\nSelected character phasemask changed to #phasemask with related world vision update. Change active until in game phase changed, or GM-mode enable/disable, or re-login. Character pts pasemask update to same value.'), ('modify rage',1,'Syntax: .modify rage #newrage\r\n\r\nModify the rage of the selected player. If no player is selected, modify your rage.'), ('modify rep',2,'Syntax: .modify rep #repId (#repvalue | $rankname [#delta])\r\nSets the selected players reputation with faction #repId to #repvalue or to $reprank.\r\nIf the reputation rank name is provided, the resulting reputation will be the lowest reputation for that rank plus the delta amount, if specified.\r\nYou can use \'.pinfo rep\' to list all known reputation ids, or use \'.lookup faction $name\' to locate a specific faction id.'), ('modify runicpower',1,'Syntax: .modify runicpower #newrunicpower\r\n\r\nModify the runic power of the selected player. If no player is selected, modify your runic power.'), ('modify scale',1,''), -('modify speed',1,'Syntax:\r\n.modify speed #rate\r\n.speed #rate\r\n\r\nModify the running speed of the selected player to \"normal base run speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'), +('modify speed',1,'Syntax: .modify speed #rate\r\n.speed #rate\r\n\r\nModify the running speed of the selected player to \"normal base run speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'), ('modify spell',1,''), ('modify swim',1,'Syntax: .modify swim #rate\r\n\r\nModify the swim speed of the selected player to \"normal swim speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'), -('modify titles',1,'Syntax:\r\n.modify titles #mask\r\n\r\nAllows user to use all titles from #mask.\r\n\r\n #mask=0 disables the title-choose-field'), +('modify titles',1,'Syntax: .modify titles #mask\r\n\r\nAllows user to use all titles from #mask.\r\n\r\n #mask=0 disables the title-choose-field'), ('movegens',3,'Syntax: .movegens\r\n Show movement generators stack for selected creature or player.'), ('mute',1,'Syntax: .mute $playerName $timeInMinutes\r\n\r\nDisible chat messaging for any character from account of character $playerName at $timeInMinutes minutes.'), ('namego',1,'Syntax: .namego $charactername\r\n\r\nTeleport the given character to you.'), @@ -412,8 +412,8 @@ INSERT INTO `command` VALUES ('npc whisper',1,'Syntax: .npc whisper #playerguid #text\r\nMake the selected npc whisper #text to #playerguid.'), ('npc unfollow',2,'Syntax: .npc unfollow\r\n\r\nSelected creature (non pet) stop follow you.'), ('password',0,'Syntax: .password $old_password $new_password $new_password\r\n\r\nChange your account password.'), -('pdump write',3,'Syntax is: pdump write $filename $playerNameOrGUID\r\nWrite character dump with name/guid $playerNameOrGUID to file $filename.'), -('pdump load',3,'Syntax is: pdump load $filename $account [$newname] [$newguid]\r\nLoad character dump from dump file into character list of $account with saved or $newname, with saved (or first free) or $newguid guid.'), +('pdump write',3,'Syntax: .pdump write $filename $playerNameOrGUID\r\nWrite character dump with name/guid $playerNameOrGUID to file $filename.'), +('pdump load',3,'Syntax: .pdump load $filename $account [$newname] [$newguid]\r\nLoad character dump from dump file into character list of $account with saved or $newname, with saved (or first free) or $newguid guid.'), ('pinfo',2,'Syntax: .pinfo [$player_name] [rep]\r\n\r\nOutput account information for selected player or player find by $player_name. If \"rep\" parameter provided show reputation information for player.'), ('plimit',3,'Syntax: .plimit [#num|-1|-2|-3|reset|player|moderator|gamemaster|administrator]\r\n\r\nWithout arg show current player amount and security level limitations for login to server, with arg set player linit ($num > 0) or securiti limitation ($num < 0 or security leme name. With `reset` sets player limit to the one in the config file'), ('quest add',3,'Syntax: .quest add #quest_id\r\n\r\nAdd to character quest log quest #quest_id. Quest started from item can\'t be added by this command but correct .additem call provided in command output.'), @@ -430,11 +430,11 @@ INSERT INTO `command` VALUES ('repairitems',2,'Syntax: .repairitems\r\n\r\nRepair all selected player''s items.'), ('reset achievements',3,'Syntax: .reset achievements [$playername]\r\n\r\nReset achievements data for selected or named (online or offline) character. Achievements for persistance progress data like completed quests/etc re-filled at reset. Achievements for events like kills/casts/etc will lost.'), ('reset all',3,'Syntax: .reset all spells\r\n\r\nSyntax: .reset all talents\r\n\r\nRequest reset spells or talents at next login each existed character.'), -('reset honor',3,'Syntax:\r\n.reset honor [Playername]\r\n Reset all honor data for targeted character.'), -('reset level',3,'Syntax:\r\n.reset level [Playername]\r\n Reset level to 1 including reset stats and talents. Equipped items with greater level requirement can be lost.'), -('reset spells',3,'Syntax:\r\n.reset spells [Playername]\r\n Removes all non-original spells from spellbook.\r\n. Playername can be name of offline character.'), -('reset stats',3,'Syntax:\r\n.reset stats [Playername]\r\n Resets(recalculate) all stats of the targeted player to their original VALUESat current level.'), -('reset talents',3,'Syntax:\r\n.reset talents [Playername]\r\n Removes all talents of the targeted player. Playername can be name of offline character.'), +('reset honor',3,'Syntax: .reset honor [Playername]\r\n Reset all honor data for targeted character.'), +('reset level',3,'Syntax: .reset level [Playername]\r\n Reset level to 1 including reset stats and talents. Equipped items with greater level requirement can be lost.'), +('reset spells',3,'Syntax: .reset spells [Playername]\r\n Removes all non-original spells from spellbook.\r\n. Playername can be name of offline character.'), +('reset stats',3,'Syntax: .reset stats [Playername]\r\n Resets(recalculate) all stats of the targeted player to their original VALUESat current level.'), +('reset talents',3,'Syntax: .reset talents [Playername]\r\n Removes all talents of the targeted player. Playername can be name of offline character.'), ('respawn',3,'Syntax: .respawn\r\n\r\nRespawn selected creature or respawn all nearest creatures (if none selected) and GO without waiting respawn time expiration.'), ('revive',3,'Syntax: .revive\r\n\r\nRevive the selected player. If no player is selected, it will revive you.'), ('save',0,'Syntax: .save\r\n\r\nSaves your character.'), @@ -468,9 +468,9 @@ INSERT INTO `command` VALUES ('tele name',1,'Syntax: .tele name #playername #location\r\n\r\nTeleport a player to a given location.'), ('ticket',2,'Syntax: .ticket on\r\n .ticket off\r\n .ticket #num\r\n .ticket $character_name\r\n\r\non/off for GMs to show or not a new ticket directly, $character_name to show ticket of this character, #num to show ticket #num.'), ('unaura',3,'Syntax: .unaura #spellid\r\n\r\nRemove aura due to spell #spellid from the selected Unit.'), -('unban account',3,'Syntax is: unban account $Name\r\nUnban accounts for account name pattern.'), -('unban character',3,'Syntax is: unban character $Name\r\nUnban accounts for character name pattern.'), -('unban ip',3,'Syntax is: unban ip $Ip\r\nUnban accounts for IP pattern.'), +('unban account',3,'Syntax: .unban account $Name\r\nUnban accounts for account name pattern.'), +('unban character',3,'Syntax: .unban character $Name\r\nUnban accounts for character name pattern.'), +('unban ip',3,'Syntax : .unban ip $Ip\r\nUnban accounts for IP pattern.'), ('unlearn',3,'Syntax: .unlearn #spell [all]\r\n\r\nUnlearn for selected player a spell #spell. If \'all\' provided then all ranks unlearned.'), ('unmute',1,'Syntax: .unmute $playerName\r\n\r\nRestore chat messaging for any character from account of character $playerName.'), ('waterwalk',2,'Syntax: .waterwalk on/off\r\n\r\nSet on/off waterwalk state for selected player.'), diff --git a/sql/updates/7331_01_mangos_command.sql b/sql/updates/7331_01_mangos_command.sql new file mode 100644 index 00000000000..4a3b2733158 --- /dev/null +++ b/sql/updates/7331_01_mangos_command.sql @@ -0,0 +1,65 @@ +ALTER TABLE db_version CHANGE COLUMN required_7312_01_mangos_mangos_string required_7331_01_mangos_command bit; + +DELETE FROM `command` WHERE `name` = 'account set addon'; +DELETE FROM `command` WHERE `name` = 'ban account'; +DELETE FROM `command` WHERE `name` = 'ban character'; +DELETE FROM `command` WHERE `name` = 'ban ip'; +DELETE FROM `command` WHERE `name` = 'baninfo account'; +DELETE FROM `command` WHERE `name` = 'baninfo character'; +DELETE FROM `command` WHERE `name` = 'baninfo ip'; +DELETE FROM `command` WHERE `name` = 'banlist account'; +DELETE FROM `command` WHERE `name` = 'banlist character'; +DELETE FROM `command` WHERE `name` = 'banlist ip'; +DELETE FROM `command` WHERE `name` = 'gm fly'; +/* next command deleted even in case it has been already corrected (trailing space) */ +DELETE FROM `command` WHERE `name` = 'gobject near '; +DELETE FROM `command` WHERE `name` = 'gobject near'; + +DELETE FROM `command` WHERE `name` = 'lookup player account'; +DELETE FROM `command` WHERE `name` = 'lookup player ip'; +DELETE FROM `command` WHERE `name` = 'lookup player email'; +DELETE FROM `command` WHERE `name` = 'modify money'; +DELETE FROM `command` WHERE `name` = 'modify mount'; +DELETE FROM `command` WHERE `name` = 'modify speed'; +DELETE FROM `command` WHERE `name` = 'modify titles'; +DELETE FROM `command` WHERE `name` = 'pdump write'; +DELETE FROM `command` WHERE `name` = 'pdump load'; +DELETE FROM `command` WHERE `name` = 'reset honor'; +DELETE FROM `command` WHERE `name` = 'reset level'; +DELETE FROM `command` WHERE `name` = 'reset spells'; +DELETE FROM `command` WHERE `name` = 'reset stats'; +DELETE FROM `command` WHERE `name` = 'reset talents'; +DELETE FROM `command` WHERE `name` = 'unban account'; +DELETE FROM `command` WHERE `name` = 'unban character'; +DELETE FROM `command` WHERE `name` = 'unban ip'; + +INSERT INTO `command` VALUES +('account set addon',3,'Syntax: .account set addon [$account] #addon\r\n\r\nSet user (possible targeted) expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk.'), +('ban account',3,'Syntax: .ban account $Name $bantime $reason\r\nBan account kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'), +('ban character',3,'Syntax: .ban character $Name $bantime $reason\r\nBan account and kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'), +('ban ip',3,'Syntax: .ban ip $Ip $bantime $reason\r\nBan IP.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'), +('baninfo account',3,'Syntax: .baninfo account\r\nWatch full information about a specific ban.'), +('baninfo character',3,'Syntax: .baninfo character\r\nWatch full information about a specific ban.'), +('baninfo ip',3,'Syntax: .baninfo ip\r\nWatch full information about a specific ban.'), +('banlist account',3,'Syntax: .banlist account [$Name]\r\nSearches the banlist for a account name pattern or show full list account bans.'), +('banlist character',3,'Syntax: .banlist character $Name\r\nSearches the banlist for a character name pattern. Pattern required.'), +('banlist ip',3,'Syntax: .banlist ip [$Ip]\r\nSearches the banlist for a IP pattern or show full list of IP bans.'), +('gm fly',3,'Syntax: .gm fly [on/off]\r\nEnable/disable gm fly mode.'), +('gobject near',3,'Syntax: .gobject near [#distance]\r\n\r\nOutput gameobjects at distance #distance from player. Output gameobject guids and coordinates sorted by distance from character. If #distance not provided use 10 as default value.'), +('lookup player account',2,'Syntax: .lookup player account $account ($limit) \r\n\r\n Searchs players, which account username is $account with optional parametr $limit of results.'), +('lookup player ip',2,'Syntax: .lookup player ip $ip ($limit) \r\n\r\n Searchs players, which account ast_ip is $ip with optional parametr $limit of results.'), +('lookup player email',2,'Syntax: .lookup player email $email ($limit) \r\n\r\n Searchs players, which account email is $email with optional parametr $limit of results.'), +('modify money',1,'Syntax: .modify money #money\r\n.money #money\r\n\r\nAdd or remove money to the selected player. If no player is selected, modify your money.\r\n\r\n #gold can be negative to remove money.'), +('modify mount',1,'Syntax: .modify mount #id #speed\r\nDisplay selected player as mounted at #id creature and set speed to #speed value.'), +('modify speed',1,'Syntax: .modify speed #rate\r\n.speed #rate\r\n\r\nModify the running speed of the selected player to \"normal base run speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'), +('modify titles',1,'Syntax: .modify titles #mask\r\n\r\nAllows user to use all titles from #mask.\r\n\r\n #mask=0 disables the title-choose-field'), +('pdump write',3,'Syntax: .pdump write $filename $playerNameOrGUID\r\nWrite character dump with name/guid $playerNameOrGUID to file $filename.'), +('pdump load',3,'Syntax: .pdump load $filename $account [$newname] [$newguid]\r\nLoad character dump from dump file into character list of $account with saved or $newname, with saved (or first free) or $newguid guid.'), +('reset honor',3,'Syntax: .reset honor [Playername]\r\n Reset all honor data for targeted character.'), +('reset level',3,'Syntax: .reset level [Playername]\r\n Reset level to 1 including reset stats and talents. Equipped items with greater level requirement can be lost.'), +('reset spells',3,'Syntax: .reset spells [Playername]\r\n Removes all non-original spells from spellbook.\r\n. Playername can be name of offline character.'), +('reset stats',3,'Syntax: .reset stats [Playername]\r\n Resets(recalculate) all stats of the targeted player to their original VALUESat current level.'), +('reset talents',3,'Syntax: .reset talents [Playername]\r\n Removes all talents of the targeted player. Playername can be name of offline character.'), +('unban account',3,'Syntax: .unban account $Name\r\nUnban accounts for account name pattern.'), +('unban character',3,'Syntax: .unban character $Name\r\nUnban accounts for character name pattern.'), +('unban ip',3,'Syntax : .unban ip $Ip\r\nUnban accounts for IP pattern.');
\ No newline at end of file diff --git a/src/framework/GameSystem/NGrid.h b/src/framework/GameSystem/NGrid.h index 6b89cdbedba..45e05e73a1e 100644 --- a/src/framework/GameSystem/NGrid.h +++ b/src/framework/GameSystem/NGrid.h @@ -67,11 +67,11 @@ class TRINITY_DLL_DECL NGrid public: typedef Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES, ThreadModel> GridType; - NGrid(uint32 id, int32 x, int32 y, time_t expiry, bool unload = true) : - i_gridId(id), i_cellstate(GRID_STATE_INVALID), i_x(x), i_y(y), i_GridObjectDataLoaded(false) - { - i_GridInfo = GridInfo(expiry, unload); - } + NGrid(uint32 id, int32 x, int32 y, time_t expiry, bool unload = true) + : i_gridId(id), i_x(x), i_y(y), i_cellstate(GRID_STATE_INVALID), i_GridObjectDataLoaded(false) + { + i_GridInfo = GridInfo(expiry, unload); + } const GridType& operator()(unsigned short x, unsigned short y) const { return i_cells[x][y]; } GridType& operator()(unsigned short x, unsigned short y) { return i_cells[x][y]; } diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index 7b902869fcc..989c1be35d9 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -293,7 +293,7 @@ void AchievementMgr::LoadFromDB(QueryResult *achievementResult, QueryResult *cri time_t date = time_t(fields[2].GetUInt64()); AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(id); - if(!criteria || criteria->timeLimit && date + criteria->timeLimit < time(NULL)) + if (!criteria || (criteria->timeLimit && time_t(date + criteria->timeLimit) < time(NULL))) continue; CriteriaProgress& progress = m_criteriaProgress[id]; @@ -401,8 +401,8 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if(!achievement) continue; - if(achievement->factionFlag == ACHIEVEMENT_FACTION_FLAG_HORDE && GetPlayer()->GetTeam() != HORDE || - achievement->factionFlag == ACHIEVEMENT_FACTION_FLAG_ALLIANCE && GetPlayer()->GetTeam() != ALLIANCE) + if ((achievement->factionFlag == ACHIEVEMENT_FACTION_FLAG_HORDE && GetPlayer()->GetTeam() != HORDE) || + (achievement->factionFlag == ACHIEVEMENT_FACTION_FLAG_ALLIANCE && GetPlayer()->GetTeam() != ALLIANCE)) continue; switch (type) @@ -440,7 +440,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui for(QuestStatusMap::iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr!=GetPlayer()->getQuestStatusMap().end(); itr++) { Quest const* quest = objmgr.GetQuestTemplate(itr->first); - if(itr->second.m_rewarded && quest->GetZoneOrSort() == achievementCriteria->complete_quests_in_zone.zoneID) + if(itr->second.m_rewarded && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == achievementCriteria->complete_quests_in_zone.zoneID) counter++; } SetCriteriaProgress(achievementCriteria, counter); @@ -650,6 +650,77 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui SetCriteriaProgress(achievementCriteria, 1, true); break; } + case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY: + case ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE: + case ACHIEVEMENT_CRITERIA_TYPE_DEATH: + case ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON: + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID: + case ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM: + case ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE: + case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA: + case ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA: + case ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA: + case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL: + case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING: + case ACHIEVEMENT_CRITERIA_TYPE_REACH_TEAM_RATING: + case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL: + case ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK: + case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM: + case ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS: + case ACHIEVEMENT_CRITERIA_TYPE_HK_RACE: + case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE: + case ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE: + case ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS: + case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM: + case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS: + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS: + case ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS: + case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD: + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING: + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER: + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL: + case ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY: + case ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT: + case ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL: + case ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT: + case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE: + case ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL: + case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE: + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS: + case ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID: + case ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED: + case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION: + case ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION: + case ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS: + case ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM: + case ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM: + case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED: + case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_POWER: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_STAT: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_ARMOR: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_RATING: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED: + case ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED: + case ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED: + case ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED: + case ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN: + case ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE: + case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE: + case ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL: + case ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS: + case ACHIEVEMENT_CRITERIA_TYPE_TOTAL: + break; // Not implemented yet :( } if(IsCompletedCriteria(achievementCriteria)) CompletedCriteria(achievementCriteria); @@ -682,27 +753,27 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve switch(achievementCriteria->requiredType) { case ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL: - if(achievement->ID == 467 && GetPlayer()->getClass() != CLASS_SHAMAN || - achievement->ID == 466 && GetPlayer()->getClass() != CLASS_DRUID || - achievement->ID == 465 && GetPlayer()->getClass() != CLASS_PALADIN || - achievement->ID == 464 && GetPlayer()->getClass() != CLASS_PRIEST || - achievement->ID == 463 && GetPlayer()->getClass() != CLASS_WARLOCK || - achievement->ID == 462 && GetPlayer()->getClass() != CLASS_HUNTER || - achievement->ID == 461 && GetPlayer()->getClass() != CLASS_DEATH_KNIGHT || - achievement->ID == 460 && GetPlayer()->getClass() != CLASS_MAGE || - achievement->ID == 459 && GetPlayer()->getClass() != CLASS_WARRIOR || - achievement->ID == 458 && GetPlayer()->getClass() != CLASS_ROGUE || - - achievement->ID == 1404 && GetPlayer()->getRace() != RACE_GNOME || - achievement->ID == 1405 && GetPlayer()->getRace() != RACE_BLOODELF || - achievement->ID == 1406 && GetPlayer()->getRace() != RACE_DRAENEI || - achievement->ID == 1407 && GetPlayer()->getRace() != RACE_DWARF || - achievement->ID == 1408 && GetPlayer()->getRace() != RACE_HUMAN || - achievement->ID == 1409 && GetPlayer()->getRace() != RACE_NIGHTELF || - achievement->ID == 1410 && GetPlayer()->getRace() != RACE_ORC || - achievement->ID == 1411 && GetPlayer()->getRace() != RACE_TAUREN || - achievement->ID == 1412 && GetPlayer()->getRace() != RACE_TROLL || - achievement->ID == 1413 && GetPlayer()->getRace() != RACE_UNDEAD_PLAYER ) + if ((achievement->ID == 467 && GetPlayer()->getClass() != CLASS_SHAMAN ) || + (achievement->ID == 466 && GetPlayer()->getClass() != CLASS_DRUID ) || + (achievement->ID == 465 && GetPlayer()->getClass() != CLASS_PALADIN ) || + (achievement->ID == 464 && GetPlayer()->getClass() != CLASS_PRIEST ) || + (achievement->ID == 463 && GetPlayer()->getClass() != CLASS_WARLOCK ) || + (achievement->ID == 462 && GetPlayer()->getClass() != CLASS_HUNTER ) || + (achievement->ID == 461 && GetPlayer()->getClass() != CLASS_DEATH_KNIGHT)|| + (achievement->ID == 460 && GetPlayer()->getClass() != CLASS_MAGE ) || + (achievement->ID == 459 && GetPlayer()->getClass() != CLASS_WARRIOR ) || + (achievement->ID == 458 && GetPlayer()->getClass() != CLASS_ROGUE ) || + + (achievement->ID == 1404 && GetPlayer()->getRace() != RACE_GNOME ) || + (achievement->ID == 1405 && GetPlayer()->getRace() != RACE_BLOODELF ) || + (achievement->ID == 1406 && GetPlayer()->getRace() != RACE_DRAENEI ) || + (achievement->ID == 1407 && GetPlayer()->getRace() != RACE_DWARF ) || + (achievement->ID == 1408 && GetPlayer()->getRace() != RACE_HUMAN ) || + (achievement->ID == 1409 && GetPlayer()->getRace() != RACE_NIGHTELF ) || + (achievement->ID == 1410 && GetPlayer()->getRace() != RACE_ORC ) || + (achievement->ID == 1411 && GetPlayer()->getRace() != RACE_TAUREN ) || + (achievement->ID == 1412 && GetPlayer()->getRace() != RACE_TROLL ) || + (achievement->ID == 1413 && GetPlayer()->getRace() != RACE_UNDEAD_PLAYER) ) return false; return progress->counter >= achievementCriteria->reach_level.level; case ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT: @@ -837,10 +908,9 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, if(entry->timeLimit) { time_t now = time(NULL); - if(progress->date + entry->timeLimit < now) - { + if(time_t(progress->date + entry->timeLimit) < now) progress->counter = 1; - } + // also it seems illogical, the timeframe will be extended at every criteria update progress->date = now; } @@ -972,7 +1042,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() barGoLink bar(1); bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outErrorDb(">> Loaded 0 achievement criteria."); return; } @@ -1003,7 +1073,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() barGoLink bar(1); bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded 0 realm completed achievements . DB table `character_achievement` is empty."); return; } @@ -1018,7 +1088,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() delete result; - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded %u realm completed achievements.",m_allCompletedAchievements.size()); } @@ -1035,7 +1105,7 @@ void AchievementGlobalMgr::LoadRewards() bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outErrorDb(">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty."); return; } @@ -1144,7 +1214,7 @@ void AchievementGlobalMgr::LoadRewardLocales() bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty."); return; } @@ -1174,7 +1244,7 @@ void AchievementGlobalMgr::LoadRewardLocales() int idx = objmgr.GetOrNewIndexForLocale(LocaleConstant(i)); if(idx >= 0) { - if(data.subject.size() <= idx) + if(data.subject.size() <= size_t(idx)) data.subject.resize(idx+1); data.subject[idx] = str; @@ -1186,7 +1256,7 @@ void AchievementGlobalMgr::LoadRewardLocales() int idx = objmgr.GetOrNewIndexForLocale(LocaleConstant(i)); if(idx >= 0) { - if(data.text.size() <= idx) + if(data.text.size() <= size_t(idx)) data.text.resize(idx+1); data.text[idx] = str; diff --git a/src/game/ArenaTeam.cpp b/src/game/ArenaTeam.cpp index 0e2ea0d341d..a556210d4c5 100644 --- a/src/game/ArenaTeam.cpp +++ b/src/game/ArenaTeam.cpp @@ -632,11 +632,13 @@ void ArenaTeam::SaveToDB() { // save team and member stats to db // called after a match has ended, or when calculating arena_points + CharacterDatabase.BeginTransaction(); CharacterDatabase.PExecute("UPDATE arena_team_stats SET rating = '%u',games = '%u',played = '%u',rank = '%u',wins = '%u',wins2 = '%u' WHERE arenateamid = '%u'", stats.rating, stats.games_week, stats.games_season, stats.rank, stats.wins_week, stats.wins_season, GetId()); for(MemberList::iterator itr = members.begin(); itr != members.end(); ++itr) { - CharacterDatabase.PExecute("UPDATE arena_team_member SET played_week = '%u', wons_week = '%u', played_season = '%u', wons_season = '%u', personal_rating = '%u' WHERE arenateamid = '%u' AND guid = '%u'", itr->games_week, itr->wins_week, itr->games_season, itr->wins_season, itr->personal_rating, Id, itr->guid); + CharacterDatabase.PExecute("UPDATE arena_team_member SET played_week = '%u', wons_week = '%u', played_season = '%u', wons_season = '%u', personal_rating = '%u' WHERE arenateamid = '%u' AND guid = '%u'", itr->games_week, itr->wins_week, itr->games_season, itr->wins_season, itr->personal_rating, Id, GUID_LOPART(itr->guid)); } + CharacterDatabase.CommitTransaction(); } void ArenaTeam::FinishWeek() diff --git a/src/game/ArenaTeam.h b/src/game/ArenaTeam.h index ec79e305ba9..eb19c984f05 100644 --- a/src/game/ArenaTeam.h +++ b/src/game/ArenaTeam.h @@ -98,7 +98,7 @@ struct ArenaTeamMember void ModifyPersonalRating(Player* plr, int32 mod, uint32 slot) { - if (personal_rating + mod < 0) + if (int32(personal_rating) + mod < 0) personal_rating = 0; else personal_rating += mod; diff --git a/src/game/AuctionHouseMgr.cpp b/src/game/AuctionHouseMgr.cpp index 2786c21a9d5..e3b737c6278 100644 --- a/src/game/AuctionHouseMgr.cpp +++ b/src/game/AuctionHouseMgr.cpp @@ -290,7 +290,7 @@ void AuctionHouseMgr::LoadAuctionItems() { barGoLink bar(1); bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded 0 auction items"); return; } @@ -341,7 +341,7 @@ void AuctionHouseMgr::LoadAuctions() { barGoLink bar(1); bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded 0 auctions. DB table `auctionhouse` is empty."); return; } @@ -354,7 +354,7 @@ void AuctionHouseMgr::LoadAuctions() { barGoLink bar(1); bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded 0 auctions. DB table `auctionhouse` is empty."); return; } @@ -364,7 +364,7 @@ void AuctionHouseMgr::LoadAuctions() { barGoLink bar(1); bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded 0 auctions. DB table `auctionhouse` is empty."); return; } @@ -583,22 +583,22 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player ItemPrototype const *proto = item->GetProto(); - if (itemClass != (0xffffffff) && proto->Class != itemClass) + if (itemClass != 0xffffffff && proto->Class != itemClass) continue; - if (itemSubClass != (0xffffffff) && proto->SubClass != itemSubClass) + if (itemSubClass != 0xffffffff && proto->SubClass != itemSubClass) continue; - if (inventoryType != (0xffffffff) && proto->InventoryType != inventoryType) + if (inventoryType != 0xffffffff && proto->InventoryType != inventoryType) continue; - if (quality != (0xffffffff) && proto->Quality != quality) + if (quality != 0xffffffff && proto->Quality != quality) continue; - if( levelmin != (0x00) && (proto->RequiredLevel < levelmin || levelmax != (0x00) && proto->RequiredLevel > levelmax ) ) + if (levelmin != 0x00 && (proto->RequiredLevel < levelmin || (levelmax != 0x00 && proto->RequiredLevel > levelmax))) continue; - if( usable != (0x00) && player->CanUseItem( item ) != EQUIP_ERR_OK ) + if (usable != 0x00 && player->CanUseItem( item ) != EQUIP_ERR_OK) continue; std::string name = proto->Name1; @@ -616,10 +616,10 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player } } - if( !wsearchedname.empty() && !Utf8FitTo(name, wsearchedname) ) + if (!wsearchedname.empty() && !Utf8FitTo(name, wsearchedname) ) continue; - if ((count < 50) && (totalcount >= listfrom)) + if (count < 50 && totalcount >= listfrom) { ++count; Aentry->BuildAuctionInfo(data); diff --git a/src/game/Bag.h b/src/game/Bag.h index 34f56439cea..1c341b5611d 100644 --- a/src/game/Bag.h +++ b/src/game/Bag.h @@ -24,10 +24,7 @@ // Maximum 36 Slots ( (CONTAINER_END - CONTAINER_FIELD_SLOT_1)/2 #define MAX_BAG_SIZE 36 // 2.0.12 -#include "Object.h" #include "ItemPrototype.h" -#include "Unit.h" -#include "Creature.h" #include "Item.h" class Bag : public Item diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h index 270d20cdb31..fd93746ebfc 100644 --- a/src/game/BattleGround.h +++ b/src/game/BattleGround.h @@ -218,10 +218,11 @@ enum BattleGroundJoinError class BattleGroundScore { public: - BattleGroundScore() : KillingBlows(0), HonorableKills(0), Deaths(0), DamageDone(0), HealingDone(0), BonusHonor(0) {}; - virtual ~BattleGroundScore() //virtual destructor is used when deleting score from scores map - { - }; + BattleGroundScore() : KillingBlows(0), Deaths(0), HonorableKills(0), + BonusHonor(0), DamageDone(0), HealingDone(0) + {} + virtual ~BattleGroundScore() {} //virtual destructor is used when deleting score from scores map + uint32 KillingBlows; uint32 Deaths; uint32 HonorableKills; @@ -448,7 +449,7 @@ class BattleGround void DoorClose(uint32 type); const char *GetTrinityString(int32 entry); - virtual bool HandlePlayerUnderMap(Player * plr) {return false;} + virtual bool HandlePlayerUnderMap(Player * /*plr*/) { return false; } // since arenas can be AvA or Hvh, we have to get the "temporary" team of a player uint32 GetPlayerTeam(uint64 guid); diff --git a/src/game/Channel.cpp b/src/game/Channel.cpp index 87ede40f0b0..8d61dd733ea 100644 --- a/src/game/Channel.cpp +++ b/src/game/Channel.cpp @@ -24,7 +24,7 @@ #include "SocialMgr.h" Channel::Channel(const std::string& name, uint32 channel_id) -: m_name(name), m_announce(true), m_moderate(false), m_channelId(channel_id), m_ownerGUID(0), m_password(""), m_flags(0) +: m_announce(true), m_moderate(false), m_name(name), m_flags(0), m_channelId(channel_id), m_ownerGUID(0) { // set special flags if built-in channel ChatChannelsEntry const* ch = GetChannelEntryFor(channel_id); @@ -455,7 +455,7 @@ void Channel::List(Player* player) // PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters // MODERATOR, GAME MASTER, ADMINISTRATOR can see all - if( plr && ( plr->GetSession()->GetSecurity() == SEC_PLAYER || gmInWhoList && plr->IsVisibleGloballyFor(player) ) ) + if (plr && ( plr->GetSession()->GetSecurity() == SEC_PLAYER || (gmInWhoList && plr->IsVisibleGloballyFor(player)))) { data << uint64(i->first); data << uint8(i->second.flags); // flags seems to be changed... @@ -693,12 +693,12 @@ void Channel::SendToOne(WorldPacket *data, uint64 who) plr->GetSession()->SendPacket(data); } -void Channel::Voice(uint64 guid1, uint64 guid2) +void Channel::Voice(uint64 /*guid1*/, uint64 /*guid2*/) { } -void Channel::DeVoice(uint64 guid1, uint64 guid2) +void Channel::DeVoice(uint64 /*guid1*/, uint64 /*guid2*/) { } diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index 8970bf82822..d6f2cf0888d 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -457,7 +457,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data ) return; } - if(have_same_race && skipCinematics == 1 || skipCinematics == 2) + if ((have_same_race && skipCinematics == 1) || skipCinematics == 2) pNewChar->setCinematic(1); // not show intro // Player created, save it now diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 9244978868e..6c0e8a419ac 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -139,10 +139,10 @@ Unit(), i_AI(NULL), i_AI_possessed(NULL), lootForPickPocketed(false), lootForBody(false), m_groupLootTimer(0), lootingGroupLeaderGUID(0), m_lootMoney(0), m_lootRecipient(0), m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_respawnradius(0.0f), -m_gossipOptionLoaded(false), m_emoteState(0), m_isPet(false), m_isTotem(false), m_isVehicle(false), m_reactState(REACT_AGGRESSIVE), -m_defaultMovementType(IDLE_MOTION_TYPE), m_equipmentId(0), -m_AlreadyCallAssistance(false), m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), -m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTableGuid(0), m_formationID(0) +m_gossipOptionLoaded(false), m_emoteState(0), m_isPet(false), m_isVehicle(false), m_isTotem(false), +m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_AlreadyCallAssistance(false), +m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL), +m_creatureInfo(NULL), m_reactState(REACT_AGGRESSIVE), m_formationID(0) { m_regenTimer = 200; m_valuesCount = UNIT_END; diff --git a/src/game/Debugcmds.cpp b/src/game/Debugcmds.cpp index 68e934abc7c..4d8e8f8fd77 100644 --- a/src/game/Debugcmds.cpp +++ b/src/game/Debugcmds.cpp @@ -90,9 +90,6 @@ bool ChatHandler::HandleSetPoiCommand(const char* args) return false; uint32 icon = atol(icon_text); - if ( icon < 0 ) - icon = 0; - uint32 flags = atol(flags_text); sLog.outDetail("Command : POI, NPC = %u, icon = %u flags = %u", target->GetGUIDLow(), icon,flags); @@ -278,8 +275,7 @@ bool ChatHandler::HandleSendChatMsgCommand(const char* args) bool ChatHandler::HandleSendQuestPartyMsgCommand(const char* args) { uint32 msg = atol((char*)args); - if (msg >= 0) - m_session->GetPlayer()->SendPushToPartyResponse(m_session->GetPlayer(), msg); + m_session->GetPlayer()->SendPushToPartyResponse(m_session->GetPlayer(), msg); return true; } @@ -296,8 +292,7 @@ bool ChatHandler::HandleGetLootRecipient(const char* /*args*/) bool ChatHandler::HandleSendQuestInvalidMsgCommand(const char* args) { uint32 msg = atol((char*)args); - if (msg >= 0) - m_session->GetPlayer()->SendCanTakeQuestResponse(msg); + m_session->GetPlayer()->SendCanTakeQuestResponse(msg); return true; } @@ -640,11 +635,11 @@ bool ChatHandler::HandleSpawnVehicle(const char* args) return true; } -bool ChatHandler::HandleSendLargePacketCommand(const char* args) +bool ChatHandler::HandleSendLargePacketCommand(const char* /*args*/) { const char* stuffingString = "This is a dummy string to push the packet's size beyond 128000 bytes. "; std::ostringstream ss; - while(strlen(ss.str().c_str()) < 128000) + while(ss.str().size() < 128000) ss << stuffingString; SendSysMessage(ss.str().c_str()); return true; diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index 713dbc69b19..e0aff678fa6 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -200,7 +200,7 @@ void PlayerMenu::SendPointOfInterest( uint32 poi_id ) PointOfInterest const* poi = objmgr.GetPointOfInterest(poi_id); if(!poi) { - sLog.outErrorDb("Requested send not existed POI (Id: %u), ignore."); + sLog.outErrorDb("Requested send not existed POI (Id: %u), ignore.",poi_id); return; } diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h index bfc8b58a6d9..db1e700fe55 100644 --- a/src/game/GridNotifiers.h +++ b/src/game/GridNotifiers.h @@ -1034,7 +1034,7 @@ namespace Trinity ~LocalizedPacketDo() { - for(int i = 0; i < i_data_cache.size(); ++i) + for(size_t i = 0; i < i_data_cache.size(); ++i) delete i_data_cache[i]; } void operator()( Player* p ); diff --git a/src/game/InstanceSaveMgr.cpp b/src/game/InstanceSaveMgr.cpp index b138c33d9a6..bd1b1c610a6 100644 --- a/src/game/InstanceSaveMgr.cpp +++ b/src/game/InstanceSaveMgr.cpp @@ -142,9 +142,8 @@ void InstanceSaveManager::RemoveInstanceSave(uint32 InstanceId) } } -InstanceSave::InstanceSave(uint16 MapId, uint32 InstanceId, uint8 difficulty, - time_t resetTime, bool canReset) -: m_mapid(MapId), m_instanceid(InstanceId), m_resetTime(resetTime), +InstanceSave::InstanceSave(uint16 MapId, uint32 InstanceId, uint8 difficulty, time_t resetTime, bool canReset) +: m_resetTime(resetTime), m_instanceid(InstanceId), m_mapid(MapId), m_difficulty(difficulty), m_canReset(canReset) { } @@ -375,14 +374,14 @@ void InstanceSaveManager::LoadResetTimes() // get the current reset times for normal instances (these may need to be updated) // these are only kept in memory for InstanceSaves that are loaded later // resettime = 0 in the DB for raid/heroic instances so those are skipped - typedef std::map<uint32, std::pair<uint32, uint64> > ResetTimeMapType; + typedef std::map<uint32, std::pair<uint32, time_t> > ResetTimeMapType; ResetTimeMapType InstResetTime; QueryResult *result = CharacterDatabase.Query("SELECT id, map, resettime FROM instance WHERE resettime > 0"); if( result ) { do { - if(uint64 resettime = (*result)[2].GetUInt64()) + if(time_t resettime = time_t((*result)[2].GetUInt64())) { uint32 id = (*result)[0].GetUInt32(); uint32 mapid = (*result)[1].GetUInt32(); @@ -400,11 +399,11 @@ void InstanceSaveManager::LoadResetTimes() { Field *fields = result->Fetch(); uint32 instance = fields[1].GetUInt32(); - uint64 resettime = fields[0].GetUInt64() + 2 * HOUR; + time_t resettime = time_t(fields[0].GetUInt64() + 2 * HOUR); ResetTimeMapType::iterator itr = InstResetTime.find(instance); if(itr != InstResetTime.end() && itr->second.second != resettime) { - CharacterDatabase.DirectPExecute("UPDATE instance SET resettime = '"I64FMTD"' WHERE id = '%u'", resettime, instance); + CharacterDatabase.DirectPExecute("UPDATE instance SET resettime = '"I64FMTD"' WHERE id = '%u'", uint64(resettime), instance); itr->second.second = resettime; } } diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index 7ffa5143786..a845ce29b50 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -350,14 +350,14 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data ) data << int32(pProto->Stackable); data << pProto->ContainerSlots; data << pProto->StatsCount; // item stats count - for(int i = 0; i < pProto->StatsCount; i++) + for(uint32 i = 0; i < pProto->StatsCount; ++i) { data << pProto->ItemStat[i].ItemStatType; data << pProto->ItemStat[i].ItemStatValue; } data << pProto->ScalingStatDistribution; // scaling stats distribution data << pProto->ScalingStatValue; // some kind of flags used to determine stat values column - for(int i = 0; i < 5; i++) + for(int i = 0; i < 5; ++i) { data << pProto->Damage[i].DamageMin; data << pProto->Damage[i].DamageMax; @@ -1137,7 +1137,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) return; //this slot is excepted when applying / removing meta gem bonus - uint8 slot = itemTarget->IsEquipped() ? itemTarget->GetSlot() : NULL_SLOT; + uint8 slot = itemTarget->IsEquipped() ? itemTarget->GetSlot() : uint8(NULL_SLOT); Item *Gems[MAX_GEM_SOCKETS]; for(int i = 0; i < MAX_GEM_SOCKETS; ++i) diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 0097da93525..8eb2a07b905 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -3553,7 +3553,7 @@ bool ChatHandler::HandleGuildInviteCommand(const char *args) plGuid = objmgr.GetPlayerGUIDByName (plName); if (!plGuid) - false; + return false; // player's guild membership checked in AddMember before add if (!targetGuild->AddMember (plGuid,targetGuild->GetLowestRank ())) @@ -6985,8 +6985,6 @@ bool ChatHandler::HandleSendMoneyCommand(const char* args) return false; } - uint32 mailId = objmgr.GenerateMailID(); - // from console show not existed sender uint32 sender_guidlo = m_session ? m_session->GetPlayer()->GetGUIDLow() : 0; diff --git a/src/game/Map.cpp b/src/game/Map.cpp index ac4a6fd18df..598b74e903f 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -210,9 +210,9 @@ void Map::DeleteStateMachine() } Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode) - : i_id(id), i_gridExpiry(expiry), i_mapEntry (sMapStore.LookupEntry(id)), - i_InstanceId(InstanceId), i_spawnMode(SpawnMode), m_unloadTimer(0) - , i_lock(false) + : i_mapEntry (sMapStore.LookupEntry(id)), i_spawnMode(SpawnMode), + i_id(id), i_InstanceId(InstanceId), m_unloadTimer(0), i_gridExpiry(expiry) + , i_lock(false) { for(unsigned int idx=0; idx < MAX_NUMBER_OF_GRIDS; ++idx) { @@ -1641,8 +1641,9 @@ template void Map::Remove(DynamicObject *, bool); /* ******* Dungeon Instance Maps ******* */ InstanceMap::InstanceMap(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode) - : Map(id, expiry, InstanceId, SpawnMode), i_data(NULL), - m_resetAfterUnload(false), m_unloadWhenEmpty(false) + : Map(id, expiry, InstanceId, SpawnMode), + m_resetAfterUnload(false), m_unloadWhenEmpty(false), + i_data(NULL), i_script_id(0) { // the timer is started by default, and stopped when the first player joins // this make sure it gets unloaded if for some reason no player joins diff --git a/src/game/Object.h b/src/game/Object.h index 1d7749c3989..26b7df1e8d9 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -433,7 +433,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object virtual void SetPhaseMask(uint32 newPhaseMask, bool update); uint32 GetPhaseMask() const { return m_phaseMask; } bool InSamePhase(WorldObject const* obj) const { return InSamePhase(obj->GetPhaseMask()); } - bool InSamePhase(uint32 phasemask) const { return GetPhaseMask()==0 && phasemask==0 || (GetPhaseMask() & phasemask); } + bool InSamePhase(uint32 phasemask) const { return (GetPhaseMask() & phasemask); } uint32 GetZoneId() const; uint32 GetAreaId() const; diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 09c0b127118..34cfa48c917 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -341,7 +341,7 @@ void ObjectMgr::LoadCreatureLocales() bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded 0 creature locale strings. DB table `locales_creature` is empty."); return; } @@ -409,7 +409,7 @@ void ObjectMgr::LoadNpcOptionLocales() bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded 0 npc_option locale strings. DB table `locales_npc_option` is empty."); return; } @@ -472,7 +472,7 @@ void ObjectMgr::LoadPointOfInterestLocales() bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded 0 points_of_interest locale strings. DB table `locales_points_of_interest` is empty."); return; } @@ -950,7 +950,7 @@ void ObjectMgr::LoadCreatures() bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outErrorDb(">> Loaded 0 creature. DB table `creature` is empty."); return; } @@ -1394,7 +1394,7 @@ void ObjectMgr::LoadItemLocales() bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded 0 Item locale strings. DB table `locales_item` is empty."); return; } @@ -3508,7 +3508,7 @@ void ObjectMgr::LoadQuestLocales() bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded 0 Quest locale strings. DB table `locales_quest` is empty."); return; } @@ -4145,7 +4145,7 @@ void ObjectMgr::LoadPageTextLocales() bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded 0 PageText locale strings. DB table `locales_page_text` is empty."); return; } @@ -4326,7 +4326,7 @@ void ObjectMgr::LoadNpcTextLocales() bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded 0 Quest locale strings. DB table `locales_npc_text` is empty."); return; } @@ -4394,7 +4394,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) { barGoLink bar(1); bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Only expired mails (need to be return or delete) or DB table `mail` is empty."); return; // any mails need to be returned or deleted } @@ -5440,7 +5440,7 @@ void ObjectMgr::LoadGameObjectLocales() bar.step(); - sLog.outString(""); + sLog.outString(); sLog.outString(">> Loaded 0 gameobject locale strings. DB table `locales_gameobject` is empty."); return; } @@ -5472,9 +5472,9 @@ void ObjectMgr::LoadGameObjectLocales() } } - for(int i = MAX_LOCALE; i < MAX_LOCALE*2-1; ++i) + for(int i = 1; i < MAX_LOCALE; ++i) { - std::string str = fields[i].GetCppString(); + std::string str = fields[i+(MAX_LOCALE-1)].GetCppString(); if(!str.empty()) { int idx = GetOrNewIndexForLocale(LocaleConstant(i)); @@ -6030,19 +6030,19 @@ void ObjectMgr::LoadWeatherZoneChances() if(wzc.data[season].rainChance > 100) { wzc.data[season].rainChance = 25; - sLog.outErrorDb("Weather for zone %u season %u has wrong rain chance > 100%",zone_id,season); + sLog.outErrorDb("Weather for zone %u season %u has wrong rain chance > 100%%",zone_id,season); } if(wzc.data[season].snowChance > 100) { wzc.data[season].snowChance = 25; - sLog.outErrorDb("Weather for zone %u season %u has wrong snow chance > 100%",zone_id,season); + sLog.outErrorDb("Weather for zone %u season %u has wrong snow chance > 100%%",zone_id,season); } if(wzc.data[season].stormChance > 100) { wzc.data[season].stormChance = 25; - sLog.outErrorDb("Weather for zone %u season %u has wrong storm chance > 100%",zone_id,season); + sLog.outErrorDb("Weather for zone %u season %u has wrong storm chance > 100%%",zone_id,season); } } @@ -6518,7 +6518,7 @@ bool ObjectMgr::LoadTrinityStrings(DatabaseType& db, char const* table, int32 mi bar.step(); - sLog.outString(""); + sLog.outString(); if(min_value == MIN_TRINITY_STRING_ID) // error only in case internal strings sLog.outErrorDb(">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.",table); else diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 7cd59aba455..2fe81a3e98b 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -341,7 +341,7 @@ int32 GetSpellMaxDuration(SpellEntry const *spellInfo); inline bool IsSpellHaveEffect(SpellEntry const *spellInfo, SpellEffects effect) { for(int i= 0; i < 3; ++i) - if(spellInfo->Effect[i]==effect) + if(SpellEffects(spellInfo->Effect[i])==effect) return true; return false; } diff --git a/src/game/Unit.h b/src/game/Unit.h index 5b54cc013a4..c2c8c4bf403 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -634,7 +634,9 @@ enum DiminishingLevels struct DiminishingReturn { - DiminishingReturn(DiminishingGroup group, uint32 t, uint32 count) : DRGroup(group), hitTime(t), hitCount(count), stack(0) {} + DiminishingReturn(DiminishingGroup group, uint32 t, uint32 count) + : DRGroup(group), stack(0), hitTime(t), hitCount(count) + {} DiminishingGroup DRGroup:16; uint16 stack:16; @@ -682,9 +684,11 @@ struct CalcDamageInfo // Spell damage info structure based on structure sending in SMSG_SPELLNONMELEEDAMAGELOG opcode struct SpellNonMeleeDamage{ - SpellNonMeleeDamage(Unit *_attacker, Unit *_target, uint32 _SpellID, uint32 _schoolMask) : - attacker(_attacker), target(_target), SpellID(_SpellID), damage(0), schoolMask(_schoolMask), - absorb(0), resist(0), phusicalLog(false), unused(false), blocked(0), HitInfo(0), cleanDamage(0) {} + SpellNonMeleeDamage(Unit *_attacker, Unit *_target, uint32 _SpellID, uint32 _schoolMask) + : target(_target), attacker(_attacker), SpellID(_SpellID), damage(0), schoolMask(_schoolMask), + absorb(0), resist(0), phusicalLog(false), unused(false), blocked(0), HitInfo(0), cleanDamage(0) + {} + Unit *target; Unit *attacker; uint32 SpellID; diff --git a/src/game/World.cpp b/src/game/World.cpp index cb9f2acf396..1c2f448ca1f 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -599,7 +599,11 @@ void World::LoadConfigSettings(bool reload) { uint32 val = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME); if(val!=m_configs[CONFIG_SOCKET_SELECTTIME]) +<<<<<<< HEAD:src/game/World.cpp sLog.outError("SocketSelectTime option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[DEFAULT_SOCKET_SELECT_TIME]); +======= + sLog.outError("SocketSelectTime option can't be changed at mangosd.conf reload, using current value (%u).",m_configs[CONFIG_SOCKET_SELECTTIME]); +>>>>>>> 76028880380c6f08320a1b55c2c9882741bf877a:src/game/World.cpp } else m_configs[CONFIG_SOCKET_SELECTTIME] = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME); @@ -659,7 +663,7 @@ void World::LoadConfigSettings(bool reload) } m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = sConfig.GetIntDefault("HeroicCharactersPerRealm", 1); - if(m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] < 0 || m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] > 10) + if(int32(m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]) < 0 || m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] > 10) { sLog.outError("HeroicCharactersPerRealm (%i) must be in range 0..10. Set to 1.",m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]); m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = 1; @@ -668,7 +672,7 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_MIN_LEVEL_FOR_HEROIC_CHARACTER_CREATING] = sConfig.GetIntDefault("MinLevelForHeroicCharacterCreating", 55); m_configs[CONFIG_SKIP_CINEMATICS] = sConfig.GetIntDefault("SkipCinematics", 0); - if(m_configs[CONFIG_SKIP_CINEMATICS] < 0 || m_configs[CONFIG_SKIP_CINEMATICS] > 2) + if(int32(m_configs[CONFIG_SKIP_CINEMATICS]) < 0 || m_configs[CONFIG_SKIP_CINEMATICS] > 2) { sLog.outError("SkipCinematics (%i) must be in range 0..2. Set to 0.",m_configs[CONFIG_SKIP_CINEMATICS]); m_configs[CONFIG_SKIP_CINEMATICS] = 0; @@ -716,7 +720,7 @@ void World::LoadConfigSettings(bool reload) } m_configs[CONFIG_START_PLAYER_MONEY] = sConfig.GetIntDefault("StartPlayerMoney", 0); - if(m_configs[CONFIG_START_PLAYER_MONEY] < 0) + if(int32(m_configs[CONFIG_START_PLAYER_MONEY]) < 0) { sLog.outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.",m_configs[CONFIG_START_PLAYER_MONEY],MAX_MONEY_AMOUNT,0); m_configs[CONFIG_START_PLAYER_MONEY] = 0; @@ -729,14 +733,14 @@ void World::LoadConfigSettings(bool reload) } m_configs[CONFIG_MAX_HONOR_POINTS] = sConfig.GetIntDefault("MaxHonorPoints", 75000); - if(m_configs[CONFIG_MAX_HONOR_POINTS] < 0) + if(int32(m_configs[CONFIG_MAX_HONOR_POINTS]) < 0) { sLog.outError("MaxHonorPoints (%i) can't be negative. Set to 0.",m_configs[CONFIG_MAX_HONOR_POINTS]); m_configs[CONFIG_MAX_HONOR_POINTS] = 0; } m_configs[CONFIG_START_HONOR_POINTS] = sConfig.GetIntDefault("StartHonorPoints", 0); - if(m_configs[CONFIG_START_HONOR_POINTS] < 0) + if(int32(m_configs[CONFIG_START_HONOR_POINTS]) < 0) { sLog.outError("StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.", m_configs[CONFIG_START_HONOR_POINTS],m_configs[CONFIG_MAX_HONOR_POINTS],0); @@ -750,14 +754,14 @@ void World::LoadConfigSettings(bool reload) } m_configs[CONFIG_MAX_ARENA_POINTS] = sConfig.GetIntDefault("MaxArenaPoints", 5000); - if(m_configs[CONFIG_MAX_ARENA_POINTS] < 0) + if(int32(m_configs[CONFIG_MAX_ARENA_POINTS]) < 0) { sLog.outError("MaxArenaPoints (%i) can't be negative. Set to 0.",m_configs[CONFIG_MAX_ARENA_POINTS]); m_configs[CONFIG_MAX_ARENA_POINTS] = 0; } m_configs[CONFIG_START_ARENA_POINTS] = sConfig.GetIntDefault("StartArenaPoints", 0); - if(m_configs[CONFIG_START_ARENA_POINTS] < 0) + if(int32(m_configs[CONFIG_START_ARENA_POINTS]) < 0) { sLog.outError("StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.", m_configs[CONFIG_START_ARENA_POINTS],m_configs[CONFIG_MAX_ARENA_POINTS],0); @@ -822,7 +826,7 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_MAIL_DELIVERY_DELAY] = sConfig.GetIntDefault("MailDeliveryDelay",HOUR); m_configs[CONFIG_UPTIME_UPDATE] = sConfig.GetIntDefault("UpdateUptimeInterval", 10); - if(m_configs[CONFIG_UPTIME_UPDATE]<=0) + if(int32(m_configs[CONFIG_UPTIME_UPDATE])<=0) { sLog.outError("UpdateUptimeInterval (%i) must be > 0, set to default 10.",m_configs[CONFIG_UPTIME_UPDATE]); m_configs[CONFIG_UPTIME_UPDATE] = 10; @@ -1107,9 +1111,15 @@ void World::SetInitialWorldSettings() } ///- Loading strings. Getting no records means core load has to be canceled because no error message can be output. +<<<<<<< HEAD:src/game/World.cpp sLog.outString( "" ); sLog.outString( "Loading Trinity strings..." ); if (!objmgr.LoadTrinityStrings()) +======= + sLog.outString(); + sLog.outString("Loading MaNGOS strings..."); + if (!objmgr.LoadMangosStrings()) +>>>>>>> 76028880380c6f08320a1b55c2c9882741bf877a:src/game/World.cpp exit(1); // Error message displayed in function already ///- Update the realm entry in the database with the realm type from the config file diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp index 06247f810a6..6c94dbd8cb4 100644 --- a/src/game/WorldSocket.cpp +++ b/src/game/WorldSocket.cpp @@ -489,8 +489,7 @@ int WorldSocket::handle_input_header (void) EndianConvertReverse(header.size); EndianConvert(header.cmd); - if ((header.size < 4) || (header.size > 10240) || - (header.cmd < 0) || (header.cmd > 10240) ) + if ((header.size < 4) || (header.size > 10240) || (header.cmd > 10240)) { sLog.outError ("WorldSocket::handle_input_header: client sent mailformed packet size = %d , cmd = %d", header.size, header.cmd); @@ -734,7 +733,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) } else { - sLog.outError ("WorldSocket::ProcessIncoming: Client not authed opcode = ", opcode); + sLog.outError ("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); return -1; } } diff --git a/src/shared/Database/SQLStorageImpl.h b/src/shared/Database/SQLStorageImpl.h index 6cb67832f02..b7927851fef 100644 --- a/src/shared/Database/SQLStorageImpl.h +++ b/src/shared/Database/SQLStorageImpl.h @@ -22,13 +22,13 @@ template<class T> template<class S, class D> -void SQLStorageLoaderBase<T>::convert(uint32 field_pos, S src, D &dst) +void SQLStorageLoaderBase<T>::convert(uint32 /*field_pos*/, S src, D &dst) { dst = D(src); } template<class T> -void SQLStorageLoaderBase<T>::convert_str_to_str(uint32 field_pos, char *src, char *&dst) +void SQLStorageLoaderBase<T>::convert_str_to_str(uint32 /*field_pos*/, char *src, char *&dst) { if(!src) { @@ -45,7 +45,7 @@ void SQLStorageLoaderBase<T>::convert_str_to_str(uint32 field_pos, char *src, ch template<class T> template<class S> -void SQLStorageLoaderBase<T>::convert_to_str(uint32 field_pos, S src, char * & dst) +void SQLStorageLoaderBase<T>::convert_to_str(uint32 /*field_pos*/, S /*src*/, char * & dst) { dst = new char[1]; *dst = 0; @@ -53,7 +53,7 @@ void SQLStorageLoaderBase<T>::convert_to_str(uint32 field_pos, S src, char * & d template<class T> template<class D> -void SQLStorageLoaderBase<T>::convert_from_str(uint32 field_pos, char * src, D& dst) +void SQLStorageLoaderBase<T>::convert_from_str(uint32 /*field_pos*/, char * /*src*/, D& dst) { dst = 0; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index bbb37f52cf3..019806b2369 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7328" + #define REVISION_NR "7331" #endif // __REVISION_NR_H__ |
