Show
Ignore:
Timestamp:
11/19/08 13:27:40 (17 years ago)
Author:
yumileroy
Message:

[svn] * Merge Temp dev SVN with Assembla.
* Changes include:

  • Implementation of w12x's Outdoor PvP and Game Event Systems.
  • Temporary removal of IRC Chat Bot (until infinite loop when disabled is fixed).
  • All mangos -> trinity (to convert your mangos_string table, please run mangos_string_to_trinity_string.sql).
  • Improved Config cleanup.
  • And many more changes.

Original author: Seline
Date: 2008-10-14 11:57:03-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/World.cpp

    r42 r44  
    11/* 
    2  * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> 
     2 * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> 
     3 * 
     4 * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/> 
    35 * 
    46 * This program is free software; you can redistribute it and/or modify 
     
    911 * This program is distributed in the hope that it will be useful, 
    1012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    1214 * GNU General Public License for more details. 
    1315 * 
    1416 * You should have received a copy of the GNU General Public License 
    1517 * along with this program; if not, write to the Free Software 
    16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
    1719 */ 
    1820 
     
    4648#include "Policies/SingletonImp.h" 
    4749#include "BattleGroundMgr.h" 
     50#include "OutdoorPvPMgr.h" 
    4851#include "TemporarySummon.h" 
    4952#include "WaypointMovementGenerator.h" 
     
    5760#include "WaypointManager.h" 
    5861#include "Util.h" 
    59 #include "IRCClient.h" 
    6062#include "Language.h" 
    6163 
     
    6567volatile uint32 World::m_worldLoopCounter = 0; 
    6668 
    67 float World::m_PlayerStartGold = 0; // starting gold 
    6869float World::m_MaxVisibleDistanceForCreature  = DEFAULT_VISIBILITY_DISTANCE; 
    6970float World::m_MaxVisibleDistanceForPlayer    = DEFAULT_VISIBILITY_DISTANCE; 
     
    524525        uint32 val = sConfig.GetIntDefault("WorldServerPort", DEFAULT_WORLDSERVER_PORT); 
    525526        if(val!=m_configs[CONFIG_PORT_WORLD]) 
    526             sLog.outError("WorldServerPort option can't be changed at mangosd.conf reload, using current value (%u).",m_configs[CONFIG_PORT_WORLD]); 
     527            sLog.outError("WorldServerPort option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_PORT_WORLD]); 
    527528    } 
    528529    else 
     
    533534        uint32 val = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME); 
    534535        if(val!=m_configs[CONFIG_SOCKET_SELECTTIME]) 
    535             sLog.outError("SocketSelectTime option can't be changed at mangosd.conf reload, using current value (%u).",m_configs[DEFAULT_SOCKET_SELECT_TIME]); 
     536            sLog.outError("SocketSelectTime option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[DEFAULT_SOCKET_SELECT_TIME]); 
    536537    } 
    537538    else 
     
    541542    m_configs[CONFIG_TCP_NO_DELAY] = sConfig.GetBoolDefault("TcpNoDelay", false); 
    542543    m_configs[CONFIG_GROUP_XP_DISTANCE] = sConfig.GetIntDefault("MaxGroupXPDistance", 74); 
    543     /// \todo Add MonsterSight and GuarderSight (with meaning) in mangosd.conf or put them as define 
     544    /// \todo Add MonsterSight and GuarderSight (with meaning) in Trinityd.conf or put them as define 
    544545    m_configs[CONFIG_SIGHT_MONSTER] = sConfig.GetIntDefault("MonsterSight", 50); 
    545546    m_configs[CONFIG_SIGHT_GUARDER] = sConfig.GetIntDefault("GuarderSight", 50); 
     
    549550        uint32 val = sConfig.GetIntDefault("GameType", 0); 
    550551        if(val!=m_configs[CONFIG_GAME_TYPE]) 
    551             sLog.outError("GameType option can't be changed at mangosd.conf reload, using current value (%u).",m_configs[CONFIG_GAME_TYPE]); 
     552            sLog.outError("GameType option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_GAME_TYPE]); 
    552553    } 
    553554    else 
     
    558559        uint32 val = sConfig.GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); 
    559560        if(val!=m_configs[CONFIG_REALM_ZONE]) 
    560             sLog.outError("RealmZone option can't be changed at mangosd.conf reload, using current value (%u).",m_configs[CONFIG_REALM_ZONE]); 
     561            sLog.outError("RealmZone option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_REALM_ZONE]); 
    561562    } 
    562563    else 
     
    725726        uint32 val = sConfig.GetIntDefault("Expansion",1); 
    726727        if(val!=m_configs[CONFIG_EXPANSION]) 
    727             sLog.outError("Expansion option can't be changed at mangosd.conf reload, using current value (%u).",m_configs[CONFIG_EXPANSION]); 
     728            sLog.outError("Expansion option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_EXPANSION]); 
    728729    } 
    729730    else 
     
    774775    m_configs[CONFIG_LISTEN_RANGE_YELL]      = sConfig.GetIntDefault("ListenRange.Yell", 300); 
    775776 
    776         m_PlayerStartGold = sConfig.GetFloatDefault("PlayerStart.Gold", 0); 
    777         if(m_PlayerStartGold < 0) 
    778                 m_PlayerStartGold = 0; 
    779  
    780         if(m_PlayerStartGold > MAX_MONEY_AMOUNT) 
    781                 m_PlayerStartGold = MAX_MONEY_AMOUNT; 
    782  
    783         m_configs[CONFIG_PLAYER_START_HONOR] = sConfig.GetIntDefault("PlayerStart.HonorPoints", 0); 
    784         if(m_configs[CONFIG_PLAYER_START_HONOR] < 0) 
    785                 m_configs[CONFIG_PLAYER_START_HONOR] = 0; 
    786  
    787         m_configs[CONFIG_PLAYER_START_ARENAPTS] = sConfig.GetIntDefault("PlayerStart.ArenaPoints", 0); 
    788         if(m_configs[CONFIG_PLAYER_START_ARENAPTS] < 0) 
    789                 m_configs[CONFIG_PLAYER_START_ARENAPTS] = 0; 
    790  
    791         m_configs[CONFIG_GM_START_LEVEL] = sConfig.GetIntDefault("GamemasterStartLevel", 70); 
    792         if(m_configs[CONFIG_GM_START_LEVEL] < 1) 
    793                 m_configs[CONFIG_GM_START_LEVEL] = 1; 
    794  
    795         m_configs[CONFIG_INSTANT_LOGOUT] = sConfig.GetBoolDefault("PlayerInstantLogout", false); 
    796         m_configs[CONFIG_BG_START_MUSIC] = sConfig.GetBoolDefault("MusicInBattleground", false); 
    797         m_configs[CONFIG_START_ALL_SPELLS] = sConfig.GetBoolDefault("PlayerStart.AllSpells", false); 
    798         // Leaving GM queue option out for now, it's not 100% functional with the ACE patch 
    799         //m_configs[CONFIG_QUEUE_FOR_GM] = sConfig.GetBoolDefault("EnableQueueForGMs", false); 
    800         m_configs[CONFIG_HONOR_AFTER_DUEL] = sConfig.GetIntDefault("HonorPointsAfterDuel", 0); 
    801         if(m_configs[CONFIG_HONOR_AFTER_DUEL] < 0) 
    802                 m_configs[CONFIG_HONOR_AFTER_DUEL]= 0; 
    803         m_configs[CONFIG_KICK_FROM_GMISLAND] = sConfig.GetBoolDefault("AntiCheat.GMIsland", false); 
    804         m_configs[CONFIG_START_ALL_EXPLORED] = sConfig.GetBoolDefault("PlayerStart.MapsExplored", false); 
    805         m_configs[CONFIG_DISABLE_BREATHING] = sConfig.GetBoolDefault("DisableWaterBreath", false); 
    806         m_configs[CONFIG_DISABLE_RES_SICKNESS] = sConfig.GetBoolDefault("DisableResurrectSickness", false); 
    807         m_configs[CONFIG_START_ALL_REP] = sConfig.GetBoolDefault("PlayerStart.AllReputation", false); 
    808         m_configs[CONFIG_ALWAYS_MAXSKILL] = sConfig.GetBoolDefault("AlwaysMaxWeaponSkill", false); 
    809         m_configs[CONFIG_START_ALL_TAXI] = sConfig.GetBoolDefault("PlayerStart.AllFlightPaths", false); 
    810         m_configs[CONFIG_PVP_TOKEN_ENABLE] = sConfig.GetBoolDefault("PvPToken.Enable", false); 
    811         m_configs[CONFIG_PVP_TOKEN_MAP_TYPE] = sConfig.GetIntDefault("PvPToken.MapAllowType", 4); 
    812         m_configs[CONFIG_PVP_TOKEN_ID] = sConfig.GetIntDefault("PvPToken.ItemID", 29434); 
    813         m_configs[CONFIG_PVP_TOKEN_COUNT] = sConfig.GetIntDefault("PvPToken.ItemCount", 1); 
    814         if(m_configs[CONFIG_PVP_TOKEN_COUNT] < 1) 
    815                 m_configs[CONFIG_PVP_TOKEN_COUNT] = 1; 
    816         m_configs[CONFIG_NO_RESET_TALENT_COST] = sConfig.GetBoolDefault("NoResetTalentsCost", false); 
     777    m_configs[CONFIG_PLAYER_START_GOLD] = sConfig.GetFloatDefault("PlayerStart.Gold", 0); 
     778    if(m_configs[CONFIG_PLAYER_START_GOLD] < 0) 
     779        m_configs[CONFIG_PLAYER_START_GOLD] = 0; 
     780 
     781    if(m_configs[CONFIG_PLAYER_START_GOLD] > MAX_MONEY_AMOUNT) 
     782        m_configs[CONFIG_PLAYER_START_GOLD] = MAX_MONEY_AMOUNT; 
     783 
     784    m_configs[CONFIG_PLAYER_START_HONOR] = sConfig.GetIntDefault("PlayerStart.HonorPoints", 0); 
     785    if(m_configs[CONFIG_PLAYER_START_HONOR] < 0) 
     786        m_configs[CONFIG_PLAYER_START_HONOR] = 0; 
     787 
     788    m_configs[CONFIG_PLAYER_START_ARENAPTS] = sConfig.GetIntDefault("PlayerStart.ArenaPoints", 0); 
     789    if(m_configs[CONFIG_PLAYER_START_ARENAPTS] < 0) 
     790        m_configs[CONFIG_PLAYER_START_ARENAPTS] = 0; 
     791 
     792    m_configs[CONFIG_GM_START_LEVEL] = sConfig.GetIntDefault("GamemasterStartLevel", 70); 
     793    if(m_configs[CONFIG_GM_START_LEVEL] < 1) 
     794        m_configs[CONFIG_GM_START_LEVEL] = 1; 
     795 
     796    m_configs[CONFIG_INSTANT_LOGOUT] = sConfig.GetBoolDefault("PlayerInstantLogout", false); 
     797    m_configs[CONFIG_BG_START_MUSIC] = sConfig.GetBoolDefault("MusicInBattleground", false); 
     798    m_configs[CONFIG_START_ALL_SPELLS] = sConfig.GetBoolDefault("PlayerStart.AllSpells", false); 
     799    m_configs[CONFIG_HONOR_AFTER_DUEL] = sConfig.GetIntDefault("HonorPointsAfterDuel", 0); 
     800    if(m_configs[CONFIG_HONOR_AFTER_DUEL] < 0) 
     801        m_configs[CONFIG_HONOR_AFTER_DUEL]= 0; 
     802    m_configs[CONFIG_START_ALL_EXPLORED] = sConfig.GetBoolDefault("PlayerStart.MapsExplored", false); 
     803    m_configs[CONFIG_DISABLE_BREATHING] = sConfig.GetBoolDefault("DisableWaterBreath", false); 
     804    m_configs[CONFIG_START_ALL_REP] = sConfig.GetBoolDefault("PlayerStart.AllReputation", false); 
     805    m_configs[CONFIG_ALWAYS_MAXSKILL] = sConfig.GetBoolDefault("AlwaysMaxWeaponSkill", false); 
     806    m_configs[CONFIG_START_ALL_TAXI] = sConfig.GetBoolDefault("PlayerStart.AllFlightPaths", false); 
     807    m_configs[CONFIG_PVP_TOKEN_ENABLE] = sConfig.GetBoolDefault("PvPToken.Enable", false); 
     808    m_configs[CONFIG_PVP_TOKEN_MAP_TYPE] = sConfig.GetIntDefault("PvPToken.MapAllowType", 4); 
     809    m_configs[CONFIG_PVP_TOKEN_ID] = sConfig.GetIntDefault("PvPToken.ItemID", 29434); 
     810    m_configs[CONFIG_PVP_TOKEN_COUNT] = sConfig.GetIntDefault("PvPToken.ItemCount", 1); 
     811    if(m_configs[CONFIG_PVP_TOKEN_COUNT] < 1) 
     812        m_configs[CONFIG_PVP_TOKEN_COUNT] = 1; 
     813    m_configs[CONFIG_NO_RESET_TALENT_COST] = sConfig.GetBoolDefault("NoResetTalentsCost", false); 
    817814 
    818815    m_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfig.GetIntDefault("Arena.MaxRatingDifference", 0); 
     
    884881    { 
    885882        if(dataPath!=m_dataPath) 
    886             sLog.outError("DataDir option can't be changed at mangosd.conf reload, using current value (%s).",m_dataPath.c_str()); 
     883            sLog.outError("DataDir option can't be changed at Trinityd.conf reload, using current value (%s).",m_dataPath.c_str()); 
    887884    } 
    888885    else 
     
    891888        sLog.outString("Using DataDir %s",m_dataPath.c_str()); 
    892889    } 
     890 
     891    std::string forbiddenmaps = sConfig.GetStringDefault("ForbiddenMaps", ""); 
     892    char * forbiddenMaps = new char[forbiddenmaps.length() + 1]; 
     893    forbiddenMaps[forbiddenmaps.length()] = 0; 
     894    strncpy(forbiddenMaps, forbiddenmaps.c_str(), forbiddenmaps.length()); 
     895    const char * delim = ","; 
     896    char * token = strtok(forbiddenMaps, delim); 
     897    while(token != NULL) 
     898    { 
     899        int32 mapid = strtol(token, NULL, 10); 
     900        m_forbiddenMapIds.insert(mapid); 
     901        token = strtok(NULL,delim); 
     902    } 
     903    delete[] forbiddenMaps; 
    893904 
    894905    bool enableLOS = sConfig.GetBoolDefault("vmap.enableLOS", false); 
     
    928939        !MapManager::ExistMapAndVMap(530,10349.6f,-6357.29f) || !MapManager::ExistMapAndVMap(530,-3961.64f,-13931.2f) ) ) 
    929940    { 
    930         sLog.outError("Correct *.map files not found in path '%smaps' or *.vmap/*vmdir files in '%svmaps'. Please place *.map/*.vmap/*.vmdir files in appropriate directories or correct the DataDir value in the mangosd.conf file.",m_dataPath.c_str(),m_dataPath.c_str()); 
     941        sLog.outError("Correct *.map files not found in path '%smaps' or *.vmap/*vmdir files in '%svmaps'. Please place *.map/*.vmap/*.vmdir files in appropriate directories or correct the DataDir value in the Trinityd.conf file.",m_dataPath.c_str(),m_dataPath.c_str()); 
    931942        exit(1); 
    932943    } 
     
    934945    ///- Loading strings. Getting no records means core load has to be canceled because no error message can be output. 
    935946    sLog.outString( "" ); 
    936     sLog.outString( "Loading MaNGOS strings..." ); 
    937     if (!objmgr.LoadMangosStrings()) 
     947    sLog.outString( "Loading Trinity strings..." ); 
     948    if (!objmgr.LoadTrinityStrings()) 
    938949        exit(1);                                            // Error message displayed in function already 
    939950 
     
    11811192    WorldDatabase.PExecute("INSERT INTO uptime (startstring, starttime, uptime) VALUES('%s', %ld, 0)", isoDate, m_startTime ); 
    11821193 
    1183     static uint32 autoanc = 1; 
    1184     autoanc = sIRC.autoanc; 
    1185  
    11861194    m_timers[WUPDATE_OBJECTS].SetInterval(0); 
    11871195    m_timers[WUPDATE_SESSIONS].SetInterval(0); 
     
    11921200    m_timers[WUPDATE_CORPSES].SetInterval(20*MINUTE*1000);  //erase corpses every 20 minutes 
    11931201 
    1194     m_timers[WUPDATE_AUTOANC].SetInterval(autoanc*MINUTE*1000); 
    1195  
    11961202    //to set mailtimer to return mails every day between 4 and 5 am 
    11971203    //mailtimer is increased when updating auctions 
     
    12151221    sBattleGroundMgr.CreateInitialBattleGrounds(); 
    12161222    sBattleGroundMgr.InitAutomaticArenaPointDistribution(); 
     1223 
     1224    ///- Initialize outdoor pvp 
     1225    sLog.outString( "Starting Outdoor PvP System" ); 
     1226    sOutdoorPvPMgr.InitOutdoorPvP(); 
    12171227 
    12181228    //Not sure if this can be moved up in the sequence (with static data loading) as it uses MapManager 
     
    14081418 
    14091419        sBattleGroundMgr.Update(diff); 
     1420 
     1421        sOutdoorPvPMgr.Update(diff); 
    14101422    } 
    14111423 
     
    14301442    } 
    14311443 
    1432     if (m_timers[WUPDATE_AUTOANC].Passed()) 
    1433     { 
    1434         m_timers[WUPDATE_AUTOANC].Reset(); /// </ul> 
    1435         SendRNDBroadcast(); 
    1436     } 
    14371444    MapManager::Instance().DoDelayedMovesAndRemoves(); ///- Move all creatures with "delayed move" and remove and delete all objects with "delayed remove" 
    14381445 
     
    14421449    // And last, but not least handle the issued cli commands 
    14431450    ProcessCliCommands(); 
     1451} 
     1452 
     1453void World::ForceGameEventUpdate() 
     1454{ 
     1455    m_timers[WUPDATE_EVENTS].Reset();                   // to give time for Update() to be processed 
     1456    uint32 nextGameEvent = gameeventmgr.Update(); 
     1457    m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); 
     1458    m_timers[WUPDATE_EVENTS].Reset(); 
    14441459} 
    14451460 
     
    17831798                int32 time_to_despawn = step.script->datalong2<5 ? 5 : (int32)step.script->datalong2; 
    17841799 
    1785                 CellPair p(MaNGOS::ComputeCellPair(summoner->GetPositionX(), summoner->GetPositionY())); 
     1800                CellPair p(Trinity::ComputeCellPair(summoner->GetPositionX(), summoner->GetPositionY())); 
    17861801                Cell cell(p); 
    17871802                cell.data.Part.reserved = ALL_DISTRICT; 
    17881803 
    1789                 MaNGOS::GameObjectWithDbGUIDCheck go_check(*summoner,step.script->datalong); 
    1790                 MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(go,go_check); 
    1791  
    1792                 TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker); 
     1804                Trinity::GameObjectWithDbGUIDCheck go_check(*summoner,step.script->datalong); 
     1805                Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(go,go_check); 
     1806 
     1807                TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker); 
    17931808                CellLock<GridReadGuard> cell_lock(cell, p); 
    17941809                cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(summoner->GetMapId(), summoner)); 
     
    18441859                int32 time_to_close = step.script->datalong2 < 15 ? 15 : (int32)step.script->datalong2; 
    18451860 
    1846                 CellPair p(MaNGOS::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY())); 
     1861                CellPair p(Trinity::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY())); 
    18471862                Cell cell(p); 
    18481863                cell.data.Part.reserved = ALL_DISTRICT; 
    18491864 
    1850                 MaNGOS::GameObjectWithDbGUIDCheck go_check(*caster,step.script->datalong); 
    1851                 MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(door,go_check); 
    1852  
    1853                 TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker); 
     1865                Trinity::GameObjectWithDbGUIDCheck go_check(*caster,step.script->datalong); 
     1866                Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(door,go_check); 
     1867 
     1868                TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker); 
    18541869                CellLock<GridReadGuard> cell_lock(cell, p); 
    18551870                cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(caster->GetMapId(), (Unit*)source)); 
     
    19001915                int32 time_to_open = step.script->datalong2 < 15 ? 15 : (int32)step.script->datalong2; 
    19011916 
    1902                 CellPair p(MaNGOS::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY())); 
     1917                CellPair p(Trinity::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY())); 
    19031918                Cell cell(p); 
    19041919                cell.data.Part.reserved = ALL_DISTRICT; 
    19051920 
    1906                 MaNGOS::GameObjectWithDbGUIDCheck go_check(*caster,step.script->datalong); 
    1907                 MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(door,go_check); 
    1908  
    1909                 TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker); 
     1921                Trinity::GameObjectWithDbGUIDCheck go_check(*caster,step.script->datalong); 
     1922                Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(door,go_check); 
     1923 
     1924                TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker); 
    19101925                CellLock<GridReadGuard> cell_lock(cell, p); 
    19111926                cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(caster->GetMapId(), (Unit*)source)); 
     
    21312146            data_list = &data_cache[cache_idx]; 
    21322147 
    2133             char const* text = objmgr.GetMangosString(string_id,loc_idx); 
     2148            char const* text = objmgr.GetTrinityString(string_id,loc_idx); 
    21342149 
    21352150            char buf[1000]; 
     
    25102525} 
    25112526 
    2512 void World::SendRNDBroadcast() 
    2513 { 
    2514     std::string msg; 
    2515     QueryResult *result = WorldDatabase.PQuery("SELECT `message` FROM `IRC_AutoAnnounce` ORDER BY RAND() LIMIT 1"); 
    2516     if(!result) 
    2517         return; 
    2518     msg = result->Fetch()[0].GetString(); 
    2519     delete result; 
    2520     std::string str = "|cffff0000[Automatic]:|r"; 
    2521     str += msg; 
    2522     sWorld.SendWorldText(LANG_AUTO_ANN); 
    2523     std::string ircchan = "#"; 
    2524     ircchan += sIRC._irc_chan[sIRC.anchn].c_str(); 
    2525     sIRC.Send_IRC_Channel(ircchan, sIRC.MakeMsg("\00304,08\037/!\\\037\017\00304 Automatic System Message \00304,08\037/!\\\037\017 %s", "%s", msg.c_str()), true); 
    2526 } 
    2527  
    25282527void World::InitResultQueue() 
    25292528{