Permalink
Browse files

MODIFIED: Battleground business logic is now mostly in plugins.

  • Loading branch information...
dfighter1985 committed Feb 28, 2012
1 parent f7457cc commit ab4ed3e1dd7d1d161650be50e1f872e0c2ed4140
Showing with 335 additions and 204 deletions.
  1. +2 −0 cmake/CMakeLists.txt
  2. +35 −0 cmake/battlegrounds/CMakeLists.txt
  3. +0 −12 cmake/world/CMakeLists.txt
  4. +2 −7 src/arcemu-shared/Log.h
  5. +1 −1 src/arcemu-world/Arenas.cpp
  6. +15 −0 src/arcemu-world/Battleground.h
  7. +32 −46 src/arcemu-world/BattlegroundHandler.cpp
  8. +36 −81 src/arcemu-world/BattlegroundMgr.cpp
  9. +42 −1 src/arcemu-world/BattlegroundMgr.h
  10. +1 −1 src/arcemu-world/HonorHandler.h
  11. +1 −0 src/arcemu-world/LootMgr.h
  12. +3 −3 src/arcemu-world/Master.cpp
  13. +3 −10 src/arcemu-world/Spell.cpp
  14. +4 −4 src/arcemu-world/SpellAuras.cpp
  15. +8 −6 src/arcemu-world/StdAfx.h
  16. +4 −4 src/arcemu-world/WUtil.h
  17. +1 −0 src/{arcemu-world → scripts/src/Battlegrounds}/AlteracValley.cpp
  18. 0 src/{arcemu-world → scripts/src/Battlegrounds}/AlteracValley.h
  19. +1 −0 src/{arcemu-world → scripts/src/Battlegrounds}/ArathiBasin.cpp
  20. 0 src/{arcemu-world → scripts/src/Battlegrounds}/ArathiBasin.h
  21. +2 −0 src/{arcemu-world → scripts/src/Battlegrounds}/EyeOfTheStorm.cpp
  22. +1 −1 src/{arcemu-world → scripts/src/Battlegrounds}/EyeOfTheStorm.h
  23. +2 −0 src/{arcemu-world → scripts/src/Battlegrounds}/IsleOfConquest.cpp
  24. 0 src/{arcemu-world → scripts/src/Battlegrounds}/IsleOfConquest.h
  25. +69 −0 src/scripts/src/Battlegrounds/Setup.cpp
  26. +27 −0 src/scripts/src/Battlegrounds/Setup.h
  27. +2 −25 src/{arcemu-world → scripts/src/Battlegrounds}/StrandOfTheAncient.cpp
  28. 0 src/{arcemu-world → scripts/src/Battlegrounds}/StrandOfTheAncient.h
  29. +2 −0 src/{arcemu-world → scripts/src/Battlegrounds}/WarsongGulch.cpp
  30. +1 −2 src/{arcemu-world → scripts/src/Battlegrounds}/WarsongGulch.h
  31. +38 −0 src/scripts/src/SpellHandlers/MiscSpells.cpp
View
@@ -199,6 +199,8 @@ add_subdirectory(shared)
add_subdirectory(logon)
add_subdirectory(world)
add_subdirectory(spellhandlers)
add_subdirectory(battlegrounds)
IF(NOT WIN32)
add_subdirectory(crashreport)
ENDIF()
@@ -0,0 +1,35 @@
PROJECT(Battlegrounds)
SET( prefix ${ROOT_PATH}/src/scripts/src/${PROJECT_NAME} )
#sources -contains source files for our library.
SET( sources
AlteracValley.cpp
ArathiBasin.cpp
EyeOfTheStorm.cpp
IsleOfConquest.cpp
Setup.cpp
StrandOfTheAncient.cpp
WarsongGulch.cpp
)
foreach(src IN ITEMS ${sources} )
SET( SRCS ${SRCS} ${prefix}/${src} )
endforeach(src)
include_directories( ${GLOBAL_INCLUDE_DIRS} )
add_library( ${PROJECT_NAME} SHARED ${SRCS} )
add_dependencies( ${PROJECT_NAME} shared world )
add_definitions( -DSCRIPTLIB -DSKIP_ALLOCATOR_SHARING )
target_link_libraries( ${PROJECT_NAME} world )
include(PCHSupport)
IF( CMAKE_GENERATOR MATCHES Visual*)
ADD_NATIVE_PRECOMPILED_HEADER(${PROJECT_NAME} Setup.h ${prefix}/Setup.cpp)
ENDIF()
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${ARCEMU_SCRIPTLIB_PATH} LIBRARY DESTINATION ${ARCEMU_SCRIPTLIB_PATH} )
#Cleap up our variables(Not required.)
unset( prefix )
unset( SRCS )
unset( sources )
View
@@ -13,8 +13,6 @@ SET(sources
AddonMgr.cpp
AIInterface.cpp
AIEvents.cpp
AlteracValley.cpp
ArathiBasin.cpp
AreaTrigger.cpp
Arenas.cpp
AuctionHouse.cpp
@@ -23,8 +21,6 @@ SET(sources
BattlegroundCommands.cpp
BattlegroundHandler.cpp
BattlegroundMgr.cpp
StrandOfTheAncient.cpp
IsleOfConquest.cpp
Channel.cpp
ChannelHandler.cpp
CharacterHandler.cpp
@@ -45,7 +41,6 @@ SET(sources
DynamicObject.cpp
EquipmentSetMgr.cpp
EventableObject.cpp
EyeOfTheStorm.cpp
EventMgr.cpp
faction.cpp
GameObject.cpp
@@ -115,7 +110,6 @@ SET(sources
Unit.cpp
Vehicle.cpp
VehicleHandler.cpp
WarsongGulch.cpp
WayPoints.cpp
WeatherMgr.cpp
World.cpp
@@ -170,8 +164,6 @@ SET( headers
AddonMgr.h
AIInterface.h
AIEvents.h
AlteracValley.h
ArathiBasin.h
AreaTrigger.h
Arenas.h
ArenaTeam.h
@@ -203,7 +195,6 @@ SET( headers
Events.h
EventableObject.h
EventMgr.h
EyeOfTheStorm.h
faction.h
GameObject.h
Gossip.h
@@ -260,8 +251,6 @@ SET( headers
SpellTarget.h
Stats.h
StdAfx.h
StrandOfTheAncient.h
IsleOfConquest.h
Entities/Summons/Summon.h
SummonHandler.h
TaxiMgr.h
@@ -274,7 +263,6 @@ SET( headers
Vehicle.h
Warlock.h
Warrior.h
WarsongGulch.h
WeatherMgr.h
Entities/Summons/WildSummon.h
WordFilter.h
View
@@ -108,7 +108,7 @@ class SERVER_DECL oLog : public Singleton< oLog >
}
};
class SessionLogWriter
class SERVER_DECL SessionLogWriter
{
FILE* m_file;
char* m_filename;
@@ -123,9 +123,7 @@ class SessionLogWriter
void Close();
};
extern SessionLogWriter* Anticheat_Log;
extern SessionLogWriter* GMCommand_Log;
extern SessionLogWriter* Player_Log;
#define sLog oLog::getSingleton()
@@ -136,9 +134,6 @@ extern SessionLogWriter* Player_Log;
#define Log sLog
#define sCheatLog (*Anticheat_Log)
#define sGMLog (*GMCommand_Log)
#define sPlrLog (*Player_Log)
class WorldLog : public Singleton<WorldLog>
{
@@ -760,7 +760,7 @@ void Arena::HookOnAreaTrigger(Player* plr, uint32 id)
s->prepare(&targets);
/* despawn the gameobject (not delete!) */
m_buffs[buffslot]->Despawn(0, BUFF_RESPAWN_TIME);
m_buffs[buffslot]->Despawn(0, 30*1000 /*BUFF_RESPAWN_TIME*/);
}
}
}
@@ -215,5 +215,20 @@ class SERVER_DECL CBattleground : public EventableObject
virtual void SetIsWeekend(bool isweekend) {}
void QueueAtNearestSpiritGuide(Player* plr, Creature* old);
/////////////////////////////////////////////////////////////////////////
//uint64 GetFlagHolderGUID( uint32 faction )
// Tells the GUID of the player who currently holds the flag
//
//Parameter(s)
// uint32 faction - The faction of the flag holder we are interested in
//
//Return Value
// Returns a GUID as an uint64 if the flag is held.
// Returns 0 otherwise.
//
//
/////////////////////////////////////////////////////////////////////////
virtual uint64 GetFlagHolderGUID( uint32 faction ) const{ return 0; }
};
@@ -184,55 +184,41 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & recv_da
if(!bg)
return;
if(bg->GetType() == BATTLEGROUND_WARSONG_GULCH)
{
uint32 count1 = 0;
uint32 count2 = 0;
Player* ap = objmgr.GetPlayer(TO< WarsongGulch* >(bg)->GetAllianceFlagHolderGUID());
if(ap) ++count2;
Player* hp = objmgr.GetPlayer(TO< WarsongGulch* >(bg)->GetHordeFlagHolderGUID());
if(hp) ++count2;
WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4 + 4 + 16 * count1 + 16 * count2));
data << count1;
data << count2;
if(ap)
{
data << (uint64)ap->GetGUID();
data << (float)ap->GetPositionX();
data << (float)ap->GetPositionY();
}
if(hp)
{
data << (uint64)hp->GetGUID();
data << (float)hp->GetPositionX();
data << (float)hp->GetPositionY();
}
SendPacket(&data);
uint32 count1 = 0;
uint32 count2 = 0;
Player *ap = objmgr.GetPlayer( bg->GetFlagHolderGUID( TEAM_ALLIANCE ) );
if( ap != NULL )
count2++;
Player *hp = objmgr.GetPlayer( bg->GetFlagHolderGUID( TEAM_HORDE ) );
// If the two are the same, then it's from a Bg that only has 1 flag like EOTS
if( ( ap != NULL ) &&
( hp != NULL ) &&
( ap->GetGUID() == hp->GetGUID() ) )
hp = NULL;
if( hp != NULL )
count2++;
WorldPacket data( MSG_BATTLEGROUND_PLAYER_POSITIONS, ( 4 + 4 + 16 * count1 + 16 * count2 ) );
data << uint32( count1 );
data << uint32( count2 );
if( ap != NULL ){
data << uint64( ap->GetGUID() );
data << float( ap->GetPositionX() );
data << float( ap->GetPositionY() );
}
else if(bg->GetType() == BATTLEGROUND_EYE_OF_THE_STORM)
{
uint32 count1 = 0;
uint32 count2 = 0;
Player* ap = objmgr.GetPlayer(TO< EyeOfTheStorm* >(bg)->GetFlagHolderGUID());
if(ap) ++count2;
WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4 + 4 + 16 * count1 + 16 * count2));
data << count1;
data << count2;
if(ap)
{
data << (uint64)ap->GetGUID();
data << (float)ap->GetPositionX();
data << (float)ap->GetPositionY();
}
SendPacket(&data);
if( hp != NULL ){
data << uint64( hp->GetGUID() );
data << float( hp->GetPositionX() );
data << float( hp->GetPositionY() );
}
SendPacket( &data );
}
void WorldSession::HandleBattleMasterJoinOpcode(WorldPacket & recv_data)
Oops, something went wrong.

0 comments on commit ab4ed3e

Please sign in to comment.