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/GridNotifiersImpl.h

    r2 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 
    19 #ifndef MANGOS_GRIDNOTIFIERSIMPL_H 
    20 #define MANGOS_GRIDNOTIFIERSIMPL_H 
     21#ifndef TRINITY_GRIDNOTIFIERSIMPL_H 
     22#define TRINITY_GRIDNOTIFIERSIMPL_H 
    2123 
    2224#include "GridNotifiers.h" 
     
    3032template<class T> 
    3133inline void 
    32 MaNGOS::VisibleNotifier::Visit(GridRefManager<T> &m) 
     34Trinity::VisibleNotifier::Visit(GridRefManager<T> &m) 
    3335{ 
    3436    for(typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter) 
     
    4042 
    4143inline void 
    42 MaNGOS::ObjectUpdater::Visit(CreatureMapType &m) 
     44Trinity::ObjectUpdater::Visit(CreatureMapType &m) 
    4345{ 
    4446    for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter) 
     
    4850 
    4951inline void 
    50 MaNGOS::PlayerRelocationNotifier::Visit(PlayerMapType &m) 
     52Trinity::PlayerRelocationNotifier::Visit(PlayerMapType &m) 
    5153{ 
    5254    for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) 
     
    9496 
    9597inline void 
    96 MaNGOS::PlayerRelocationNotifier::Visit(CreatureMapType &m) 
     98Trinity::PlayerRelocationNotifier::Visit(CreatureMapType &m) 
    9799{ 
    98100    if(!i_player.isAlive() || i_player.isInFlight()) 
     
    106108template<> 
    107109inline void 
    108 MaNGOS::CreatureRelocationNotifier::Visit(PlayerMapType &m) 
     110Trinity::CreatureRelocationNotifier::Visit(PlayerMapType &m) 
    109111{ 
    110112    if(!i_creature.isAlive()) 
     
    118120template<> 
    119121inline void 
    120 MaNGOS::CreatureRelocationNotifier::Visit(CreatureMapType &m) 
     122Trinity::CreatureRelocationNotifier::Visit(CreatureMapType &m) 
    121123{ 
    122124    if(!i_creature.isAlive()) 
     
    131133} 
    132134 
    133 inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target) 
     135inline void Trinity::DynamicObjectUpdater::VisitHelper(Unit* target) 
    134136{ 
    135137    if(!target->isAlive() || target->isInFlight() ) 
     
    181183template<> 
    182184inline void 
    183 MaNGOS::DynamicObjectUpdater::Visit(CreatureMapType  &m) 
     185Trinity::DynamicObjectUpdater::Visit(CreatureMapType  &m) 
    184186{ 
    185187    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     
    189191template<> 
    190192inline void 
    191 MaNGOS::DynamicObjectUpdater::Visit(PlayerMapType  &m) 
     193Trinity::DynamicObjectUpdater::Visit(PlayerMapType  &m) 
    192194{ 
    193195    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     
    200202 
    201203template<class Check> 
    202 void MaNGOS::WorldObjectSearcher<Check>::Visit(GameObjectMapType &m) 
     204void Trinity::WorldObjectSearcher<Check>::Visit(GameObjectMapType &m) 
    203205{ 
    204206    // already found 
     
    217219 
    218220template<class Check> 
    219 void MaNGOS::WorldObjectSearcher<Check>::Visit(PlayerMapType &m) 
    220 { 
    221     // already found 
    222     if(i_object) 
    223         return; 
    224  
    225     for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
    226     { 
    227         if(i_check(itr->getSource())) 
    228         { 
    229             i_object = itr->getSource(); 
    230             return; 
    231         } 
    232     } 
    233 } 
    234  
    235 template<class Check> 
    236 void MaNGOS::WorldObjectSearcher<Check>::Visit(CreatureMapType &m) 
    237 { 
    238     // already found 
    239     if(i_object) 
    240         return; 
    241  
    242     for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
    243     { 
    244         if(i_check(itr->getSource())) 
    245         { 
    246             i_object = itr->getSource(); 
    247             return; 
    248         } 
    249     } 
    250 } 
    251  
    252 template<class Check> 
    253 void MaNGOS::WorldObjectSearcher<Check>::Visit(CorpseMapType &m) 
     221void Trinity::WorldObjectSearcher<Check>::Visit(PlayerMapType &m) 
     222{ 
     223    // already found 
     224    if(i_object) 
     225        return; 
     226 
     227    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     228    { 
     229        if(i_check(itr->getSource())) 
     230        { 
     231            i_object = itr->getSource(); 
     232            return; 
     233        } 
     234    } 
     235} 
     236 
     237template<class Check> 
     238void Trinity::WorldObjectSearcher<Check>::Visit(CreatureMapType &m) 
     239{ 
     240    // already found 
     241    if(i_object) 
     242        return; 
     243 
     244    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     245    { 
     246        if(i_check(itr->getSource())) 
     247        { 
     248            i_object = itr->getSource(); 
     249            return; 
     250        } 
     251    } 
     252} 
     253 
     254template<class Check> 
     255void Trinity::WorldObjectSearcher<Check>::Visit(CorpseMapType &m) 
    254256{ 
    255257    // already found 
     
    268270 
    269271template<class Check> 
    270 void MaNGOS::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType &m) 
     272void Trinity::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType &m) 
    271273{ 
    272274    // already found 
     
    285287 
    286288template<class Check> 
    287 void MaNGOS::WorldObjectListSearcher<Check>::Visit(PlayerMapType &m) 
    288 { 
    289     for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
    290         if(i_check(itr->getSource())) 
    291             i_objects.push_back(itr->getSource()); 
    292 } 
    293  
    294 template<class Check> 
    295 void MaNGOS::WorldObjectListSearcher<Check>::Visit(CreatureMapType &m) 
    296 { 
    297     for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
    298         if(i_check(itr->getSource())) 
    299             i_objects.push_back(itr->getSource()); 
    300 } 
    301  
    302 template<class Check> 
    303 void MaNGOS::WorldObjectListSearcher<Check>::Visit(CorpseMapType &m) 
     289void Trinity::WorldObjectListSearcher<Check>::Visit(PlayerMapType &m) 
     290{ 
     291    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     292        if(i_check(itr->getSource())) 
     293            i_objects.push_back(itr->getSource()); 
     294} 
     295 
     296template<class Check> 
     297void Trinity::WorldObjectListSearcher<Check>::Visit(CreatureMapType &m) 
     298{ 
     299    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     300        if(i_check(itr->getSource())) 
     301            i_objects.push_back(itr->getSource()); 
     302} 
     303 
     304template<class Check> 
     305void Trinity::WorldObjectListSearcher<Check>::Visit(CorpseMapType &m) 
    304306{ 
    305307    for(CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     
    309311 
    310312template<class Check> 
    311 void MaNGOS::WorldObjectListSearcher<Check>::Visit(GameObjectMapType &m) 
     313void Trinity::WorldObjectListSearcher<Check>::Visit(GameObjectMapType &m) 
    312314{ 
    313315    for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     
    317319 
    318320template<class Check> 
    319 void MaNGOS::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType &m) 
     321void Trinity::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType &m) 
    320322{ 
    321323    for(DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     
    327329 
    328330template<class Check> 
    329 void MaNGOS::GameObjectSearcher<Check>::Visit(GameObjectMapType &m) 
     331void Trinity::GameObjectSearcher<Check>::Visit(GameObjectMapType &m) 
    330332{ 
    331333    // already found 
     
    344346 
    345347template<class Check> 
    346 void MaNGOS::GameObjectLastSearcher<Check>::Visit(GameObjectMapType &m) 
     348void Trinity::GameObjectLastSearcher<Check>::Visit(GameObjectMapType &m) 
    347349{ 
    348350    for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     
    354356 
    355357template<class Check> 
    356 void MaNGOS::GameObjectListSearcher<Check>::Visit(GameObjectMapType &m) 
     358void Trinity::GameObjectListSearcher<Check>::Visit(GameObjectMapType &m) 
    357359{ 
    358360    for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     
    364366 
    365367template<class Check> 
    366 void MaNGOS::UnitSearcher<Check>::Visit(CreatureMapType &m) 
    367 { 
    368     // already found 
    369     if(i_object) 
    370         return; 
    371  
    372     for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
    373     { 
    374         if(i_check(itr->getSource())) 
    375         { 
    376             i_object = itr->getSource(); 
    377             return; 
    378         } 
    379     } 
    380 } 
    381  
    382 template<class Check> 
    383 void MaNGOS::UnitSearcher<Check>::Visit(PlayerMapType &m) 
    384 { 
    385     // already found 
    386     if(i_object) 
    387         return; 
    388  
    389     for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
    390     { 
    391         if(i_check(itr->getSource())) 
    392         { 
    393             i_object = itr->getSource(); 
    394             return; 
    395         } 
    396     } 
    397 } 
    398  
    399 template<class Check> 
    400 void MaNGOS::UnitLastSearcher<Check>::Visit(CreatureMapType &m) 
    401 { 
    402     for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
    403     { 
    404         if(i_check(itr->getSource())) 
    405             i_object = itr->getSource(); 
    406     } 
    407 } 
    408  
    409 template<class Check> 
    410 void MaNGOS::UnitLastSearcher<Check>::Visit(PlayerMapType &m) 
    411 { 
    412     for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
    413     { 
    414         if(i_check(itr->getSource())) 
    415             i_object = itr->getSource(); 
    416     } 
    417 } 
    418  
    419 template<class Check> 
    420 void MaNGOS::UnitListSearcher<Check>::Visit(PlayerMapType &m) 
    421 { 
    422     for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
    423         if(i_check(itr->getSource())) 
    424             i_objects.push_back(itr->getSource()); 
    425 } 
    426  
    427 template<class Check> 
    428 void MaNGOS::UnitListSearcher<Check>::Visit(CreatureMapType &m) 
     368void Trinity::UnitSearcher<Check>::Visit(CreatureMapType &m) 
     369{ 
     370    // already found 
     371    if(i_object) 
     372        return; 
     373 
     374    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     375    { 
     376        if(i_check(itr->getSource())) 
     377        { 
     378            i_object = itr->getSource(); 
     379            return; 
     380        } 
     381    } 
     382} 
     383 
     384template<class Check> 
     385void Trinity::UnitSearcher<Check>::Visit(PlayerMapType &m) 
     386{ 
     387    // already found 
     388    if(i_object) 
     389        return; 
     390 
     391    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     392    { 
     393        if(i_check(itr->getSource())) 
     394        { 
     395            i_object = itr->getSource(); 
     396            return; 
     397        } 
     398    } 
     399} 
     400 
     401template<class Check> 
     402void Trinity::UnitLastSearcher<Check>::Visit(CreatureMapType &m) 
     403{ 
     404    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     405    { 
     406        if(i_check(itr->getSource())) 
     407            i_object = itr->getSource(); 
     408    } 
     409} 
     410 
     411template<class Check> 
     412void Trinity::UnitLastSearcher<Check>::Visit(PlayerMapType &m) 
     413{ 
     414    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     415    { 
     416        if(i_check(itr->getSource())) 
     417            i_object = itr->getSource(); 
     418    } 
     419} 
     420 
     421template<class Check> 
     422void Trinity::UnitListSearcher<Check>::Visit(PlayerMapType &m) 
     423{ 
     424    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     425        if(i_check(itr->getSource())) 
     426            i_objects.push_back(itr->getSource()); 
     427} 
     428 
     429template<class Check> 
     430void Trinity::UnitListSearcher<Check>::Visit(CreatureMapType &m) 
    429431{ 
    430432    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     
    436438 
    437439template<class Check> 
    438 void MaNGOS::CreatureSearcher<Check>::Visit(CreatureMapType &m) 
    439 { 
    440     // already found 
    441     if(i_object) 
    442         return; 
    443  
    444     for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
    445     { 
    446         if(i_check(itr->getSource())) 
    447         { 
    448             i_object = itr->getSource(); 
    449             return; 
    450         } 
    451     } 
    452 } 
    453  
    454 template<class Check> 
    455 void MaNGOS::CreatureLastSearcher<Check>::Visit(CreatureMapType &m) 
    456 { 
    457     for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
    458     { 
    459         if(i_check(itr->getSource())) 
    460             i_object = itr->getSource(); 
    461     } 
    462 } 
    463  
    464 template<class Check> 
    465 void MaNGOS::CreatureListSearcher<Check>::Visit(CreatureMapType &m) 
    466 { 
    467     for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
    468         if(i_check(itr->getSource())) 
    469             i_objects.push_back(itr->getSource()); 
    470 } 
    471  
    472 template<class Check> 
    473 void MaNGOS::PlayerSearcher<Check>::Visit(PlayerMapType &m) 
    474 { 
    475     // already found 
    476     if(i_object) 
    477         return; 
    478  
    479     for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
    480     { 
    481         if(i_check(itr->getSource())) 
    482         { 
    483             i_object = itr->getSource(); 
    484             return; 
    485         } 
    486     } 
    487 } 
    488  
    489 #endif                                                      // MANGOS_GRIDNOTIFIERSIMPL_H 
     440void Trinity::CreatureSearcher<Check>::Visit(CreatureMapType &m) 
     441{ 
     442    // already found 
     443    if(i_object) 
     444        return; 
     445 
     446    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     447    { 
     448        if(i_check(itr->getSource())) 
     449        { 
     450            i_object = itr->getSource(); 
     451            return; 
     452        } 
     453    } 
     454} 
     455 
     456template<class Check> 
     457void Trinity::CreatureLastSearcher<Check>::Visit(CreatureMapType &m) 
     458{ 
     459    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     460    { 
     461        if(i_check(itr->getSource())) 
     462            i_object = itr->getSource(); 
     463    } 
     464} 
     465 
     466template<class Check> 
     467void Trinity::CreatureListSearcher<Check>::Visit(CreatureMapType &m) 
     468{ 
     469    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     470        if(i_check(itr->getSource())) 
     471            i_objects.push_back(itr->getSource()); 
     472} 
     473 
     474template<class Check> 
     475void Trinity::PlayerSearcher<Check>::Visit(PlayerMapType &m) 
     476{ 
     477    // already found 
     478    if(i_object) 
     479        return; 
     480 
     481    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) 
     482    { 
     483        if(i_check(itr->getSource())) 
     484        { 
     485            i_object = itr->getSource(); 
     486            return; 
     487        } 
     488    } 
     489} 
     490 
     491#endif                                                      // TRINITY_GRIDNOTIFIERSIMPL_H