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

[svn] * Various small changes here and there.
* Implementing MangChat? IRC system.
* Added new config option, MAX_WHO, can be used to set the limit of characters being sent in a /who request from client.

Original author: XTZGZoReX
Date: 2008-10-12 14:03:38-05:00

Files:
1 modified

Legend:

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

    r37 r39  
    5757#include "WaypointManager.h" 
    5858#include "Util.h" 
     59#include "IRCClient.h" 
     60#include "Language.h" 
    5961 
    6062INSTANTIATE_SINGLETON_1( World ); 
     
    576578    m_configs[CONFIG_CHARACTERS_CREATING_DISABLED] = sConfig.GetIntDefault("CharactersCreatingDisabled", 0); 
    577579 
     580    m_configs[CONFIG_MAX_WHO] = sConfig.GetIntDefault("MaxWhoListReturns", 49); 
     581 
    578582    m_configs[CONFIG_CHARACTERS_PER_REALM] = sConfig.GetIntDefault("CharactersPerRealm", 10); 
    579583    if(m_configs[CONFIG_CHARACTERS_PER_REALM] < 1 || m_configs[CONFIG_CHARACTERS_PER_REALM] > 10) 
     
    11771181    WorldDatabase.PExecute("INSERT INTO uptime (startstring, starttime, uptime) VALUES('%s', %ld, 0)", isoDate, m_startTime ); 
    11781182 
     1183    static uint32 autoanc = 1; 
     1184    autoanc = sIRC.autoanc; 
     1185 
    11791186    m_timers[WUPDATE_OBJECTS].SetInterval(0); 
    11801187    m_timers[WUPDATE_SESSIONS].SetInterval(0); 
     
    11841191                                                            //Update "uptime" table based on configuration entry in minutes. 
    11851192    m_timers[WUPDATE_CORPSES].SetInterval(20*MINUTE*1000);  //erase corpses every 20 minutes 
     1193 
     1194    m_timers[WUPDATE_AUTOANC].SetInterval(autoanc*MINUTE*1000); 
    11861195 
    11871196    //to set mailtimer to return mails every day between 4 and 5 am 
     
    14211430    } 
    14221431 
    1423     /// </ul> 
    1424     ///- Move all creatures with "delayed move" and remove and delete all objects with "delayed remove" 
    1425     MapManager::Instance().DoDelayedMovesAndRemoves(); 
     1432    if (m_timers[WUPDATE_AUTOANC].Passed()) 
     1433    { 
     1434        m_timers[WUPDATE_AUTOANC].Reset(); /// </ul> 
     1435        SendRNDBroadcast(); 
     1436    } 
     1437    MapManager::Instance().DoDelayedMovesAndRemoves(); ///- Move all creatures with "delayed move" and remove and delete all objects with "delayed remove" 
    14261438 
    14271439    // update the instance reset times 
     
    24952507    } 
    24962508    // print the console message here so it looks right 
    2497     p_zprintf("mangos>"); 
     2509    p_zprintf("Trinity Core> "); 
     2510} 
     2511 
     2512void 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); 
    24982526} 
    24992527