Changeset 39 for trunk/src/game
- Timestamp:
- 11/19/08 13:26:44 (17 years ago)
- Location:
- trunk/src/game
- Files:
-
- 15 added
- 13 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/AuctionHouse.cpp
r2 r39 27 27 #include "AuctionHouseObject.h" 28 28 #include "Util.h" 29 #include "IRCClient.h" 29 30 30 31 //please DO NOT use iterator++, because it is slower than ++iterator!!! … … 313 314 pl->SaveInventoryAndGoldToDB(); 314 315 CharacterDatabase.CommitTransaction(); 316 317 if((sIRC.BOTMASK & 1024) != 0) 318 sIRC.AHFunc(it->GetEntry(), it->GetProto()->Name1, pl->GetName(), location); 315 319 316 320 SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, AUCTION_OK); -
trunk/src/game/Channel.cpp
r2 r39 21 21 #include "World.h" 22 22 #include "SocialMgr.h" 23 #include "IRCClient.h" 23 24 24 25 Channel::Channel(std::string name, uint32 channel_id) … … 113 114 SendToOne(&data, p); 114 115 116 sIRC.Handle_WoW_Channel(m_name, objmgr.GetPlayer(p), CHANNEL_JOIN); 117 115 118 JoinNotify(p); 116 117 // if no owner first logged will become118 if(!IsConstant() && !m_ownerGUID)119 {120 SetOwner(p, (players.size() > 1 ? true : false));121 players[p].SetModerator(true);122 }123 119 } 124 120 … … 159 155 160 156 LeaveNotify(p); 157 158 sIRC.Handle_WoW_Channel(m_name, objmgr.GetPlayer(p), CHANNEL_LEAVE); 161 159 162 160 if(changeowner) -
trunk/src/game/Chat.cpp
r37 r39 457 457 { "cometome", SEC_ADMINISTRATOR, &ChatHandler::HandleComeToMeCommand, "", NULL }, 458 458 { "damage", SEC_ADMINISTRATOR, &ChatHandler::HandleDamageCommand, "", NULL }, 459 { "ircpm", SEC_PLAYER, &ChatHandler::HandleIRCpmCommand, "", NULL }, 459 460 { "combatstop", SEC_GAMEMASTER, &ChatHandler::HandleCombatStopCommand, "", NULL }, 460 461 { "flusharenapoints", SEC_ADMINISTRATOR, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL }, -
trunk/src/game/Chat.h
r37 r39 108 108 bool HandleGroupTeleCommand(const char* args); 109 109 bool HandleDrunkCommand(const char* args); 110 111 bool HandleIRCpmCommand(const char* args); 110 112 111 113 bool HandleEventActiveListCommand(const char* args); -
trunk/src/game/ChatHandler.cpp
r37 r39 35 35 #include "SpellAuras.h" 36 36 #include "Language.h" 37 #include "IRCClient.h" 37 38 #include "Util.h" 38 39 … … 428 429 break; 429 430 431 sIRC.Send_WoW_IRC(_player, channel, msg); 432 430 433 if(ChannelMgr* cMgr = channelMgr(_player->GetTeam())) 431 434 { -
trunk/src/game/GameEvent.cpp
r2 r39 25 25 #include "MapManager.h" 26 26 #include "Policies/SingletonImp.h" 27 #include "IRCClient.h" 27 28 28 29 INSTANTIATE_SINGLETON_1(GameEvent); … … 422 423 423 424 sLog.outString("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str()); 425 426 if((sIRC.BOTMASK & 256) != 0) 427 { 428 std::string ircchan = "#"; 429 ircchan += sIRC._irc_chan[sIRC.anchn].c_str(); 430 sIRC.Send_IRC_Channel(ircchan, sIRC.MakeMsg("\00304,08\037/!\\\037\017\00304 Game Event \00304,08\037/!\\\037\017 %s", "%s", mGameEvent[event_id].description.c_str()), true); 431 } 432 424 433 // spawn positive event tagget objects 425 434 GameEventSpawn(event_id); -
trunk/src/game/Language.h
r37 r39 641 641 LANG_ARENA_TESTING = 745, 642 642 643 LANG_AUTO_ANN = 746, 644 643 645 // in game strings 644 646 LANG_PET_INVALID_NAME = 800, -
trunk/src/game/Level1.cpp
r37 r39 32 32 #include "CellImpl.h" 33 33 #include "InstanceSaveMgr.h" 34 #include "IRCClient.h" 34 35 #include "Util.h" 35 36 #ifdef _DEBUG_VMAPS … … 124 125 125 126 sWorld.SendWorldText(LANG_SYSTEMMESSAGE,args); 127 128 if((sIRC.BOTMASK & 256) != 0) 129 { 130 std::string ircchan = "#"; 131 ircchan += sIRC._irc_chan[sIRC.anchn].c_str(); 132 sIRC.Send_IRC_Channel(ircchan, sIRC.MakeMsg("\00304,08\037/!\\\037\017\00304 System Message \00304,08\037/!\\\037\017 %s", "%s", args), true); 133 } 134 126 135 return true; 127 136 } … … 139 148 data << str; 140 149 sWorld.SendGlobalMessage(&data); 150 151 if((sIRC.BOTMASK & 256) != 0) 152 { 153 std::string ircchan = "#"; 154 ircchan += sIRC._irc_chan[sIRC.anchn].c_str(); 155 sIRC.Send_IRC_Channel(ircchan, sIRC.MakeMsg("\00304,08\037/!\\\037\017\00304 Global Notify \00304,08\037/!\\\037\017 %s", "%s", args), true); 156 } 141 157 142 158 return true; … … 2349 2365 } 2350 2366 2367 bool ChatHandler::HandleIRCpmCommand(const char* args) 2368 { 2369 std::string Msg = args; 2370 if (Msg.find(" ") == std::string::npos) 2371 return false; 2372 std::string To = Msg.substr(0, Msg.find(" ")); 2373 Msg = Msg.substr(Msg.find(" ") + 1); 2374 std::size_t pos; 2375 while((pos = To.find("||")) != std::string::npos) 2376 { 2377 std::size_t find1 = To.find("||", pos); 2378 To.replace(pos, find1 - pos + 2, "|"); 2379 } 2380 sIRC.SendIRC("PRIVMSG "+To+" : <WoW>["+m_session->GetPlayerName()+"] : " + Msg); 2381 //Msg = "|cffCC4ACCTo [" + To + "]: " + Msg + "|r"; 2382 sIRC.Send_WoW_Player(m_session->GetPlayer(), "|cffCC4ACCTo ["+To+"]: "+Msg); 2383 return true; 2384 } 2385 2351 2386 //teleport at coordinates 2352 2387 bool ChatHandler::HandleGoZoneXYCommand(const char* args) -
trunk/src/game/Makefile.am
r23 r39 142 142 $(srcdir)/InstanceSaveMgr.cpp \ 143 143 $(srcdir)/InstanceSaveMgr.h \ 144 $(srcdir)/IRCClient.cpp \ 145 $(srcdir)/IRCClient.h \ 146 $(srcdir)/IRCCmd.cpp \ 147 $(srcdir)/IRCCmd.h \ 148 $(srcdir)/IRCCmde.cpp \ 149 $(srcdir)/IRCConf.cpp \ 150 $(srcdir)/IRCConf.h \ 151 $(srcdir)/IRCConf.h \ 152 $(srcdir)/IRCFunc.h \ 153 $(srcdir)/IRCIO.cpp \ 154 $(srcdir)/IRCLog.cpp \ 155 $(srcdir)/IRCLog.h \ 156 $(srcdir)/IRCSock.cpp \ 157 $(srcdir)/MCS_OnlinePlayers.cpp \ 158 $(srcdir)/MCS_OnlinePlayers.h \ 144 159 $(srcdir)/Item.cpp \ 145 160 $(srcdir)/Item.h \ -
trunk/src/game/MiscHandler.cpp
r37 r39 255 255 data << uint32( pzoneid ); // player zone id 256 256 257 // 49 is maximum player count sent to client 258 if ((++clientcount) == 49) 257 // 49 is maximum player count sent to client - can be overriden 258 // through config, but is unstable 259 if ((++clientcount) == sWorld.getConfig(CONFIG_MAX_WHO)) 259 260 break; 260 261 } -
trunk/src/game/Player.cpp
r37 r39 59 59 #include "Spell.h" 60 60 #include "SocialMgr.h" 61 #include "IRCClient.h" 61 62 62 63 #include <cmath> … … 1717 1718 m_items[i]->AddToWorld(); 1718 1719 } 1720 if(sIRC.ajoin == 1) 1721 sIRC.AutoJoinChannel(this); 1719 1722 } 1720 1723 … … 2146 2149 2147 2150 UpdateAllStats(); 2151 2152 if((sIRC.BOTMASK & 64) != 0) 2153 { 2154 char temp [5]; 2155 sprintf(temp, "%u", level); 2156 std::string plevel = temp; 2157 std::string pname = GetName(); 2158 std::string ircchan = "#"; 2159 ircchan += sIRC._irc_chan[sIRC.Status].c_str(); 2160 sIRC.Send_IRC_Channel(ircchan, "\00311["+pname+"] : Has Reached Level: "+plevel, true); 2161 } 2148 2162 2149 2163 if(sWorld.getConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up -
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 -
trunk/src/game/World.h
r37 r39 60 60 WUPDATE_CORPSES = 5, 61 61 WUPDATE_EVENTS = 6, 62 WUPDATE_COUNT = 7 62 WUPDATE_COUNT = 7, 63 64 WUPDATE_AUTOANC = 7 65 63 66 }; 64 67 … … 92 95 CONFIG_STRICT_PET_NAMES, 93 96 CONFIG_CHARACTERS_CREATING_DISABLED, 97 CONFIG_MAX_WHO, 94 98 CONFIG_CHARACTERS_PER_ACCOUNT, 95 99 CONFIG_CHARACTERS_PER_REALM, … … 366 370 WorldSession* FindSession(uint32 id) const; 367 371 void AddSession(WorldSession *s); 372 373 void SendRNDBroadcast(); 374 368 375 bool RemoveSession(uint32 id); 369 376 /// Get the number of current active sessions