Changeset 39 for trunk/src/game/World.cpp
- Timestamp:
- 11/19/08 13:26:44 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/World.cpp
r37 r39 57 57 #include "WaypointManager.h" 58 58 #include "Util.h" 59 #include "IRCClient.h" 60 #include "Language.h" 59 61 60 62 INSTANTIATE_SINGLETON_1( World ); … … 576 578 m_configs[CONFIG_CHARACTERS_CREATING_DISABLED] = sConfig.GetIntDefault("CharactersCreatingDisabled", 0); 577 579 580 m_configs[CONFIG_MAX_WHO] = sConfig.GetIntDefault("MaxWhoListReturns", 49); 581 578 582 m_configs[CONFIG_CHARACTERS_PER_REALM] = sConfig.GetIntDefault("CharactersPerRealm", 10); 579 583 if(m_configs[CONFIG_CHARACTERS_PER_REALM] < 1 || m_configs[CONFIG_CHARACTERS_PER_REALM] > 10) … … 1177 1181 WorldDatabase.PExecute("INSERT INTO uptime (startstring, starttime, uptime) VALUES('%s', %ld, 0)", isoDate, m_startTime ); 1178 1182 1183 static uint32 autoanc = 1; 1184 autoanc = sIRC.autoanc; 1185 1179 1186 m_timers[WUPDATE_OBJECTS].SetInterval(0); 1180 1187 m_timers[WUPDATE_SESSIONS].SetInterval(0); … … 1184 1191 //Update "uptime" table based on configuration entry in minutes. 1185 1192 m_timers[WUPDATE_CORPSES].SetInterval(20*MINUTE*1000); //erase corpses every 20 minutes 1193 1194 m_timers[WUPDATE_AUTOANC].SetInterval(autoanc*MINUTE*1000); 1186 1195 1187 1196 //to set mailtimer to return mails every day between 4 and 5 am … … 1421 1430 } 1422 1431 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" 1426 1438 1427 1439 // update the instance reset times … … 2495 2507 } 2496 2508 // print the console message here so it looks right 2497 p_zprintf("mangos>"); 2509 p_zprintf("Trinity Core> "); 2510 } 2511 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); 2498 2526 } 2499 2527