TrinityCore
GarrisonHandler.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "WorldSession.h"
19#include "Garrison.h"
20#include "GarrisonPackets.h"
21#include "Player.h"
22
24{
25 if (Garrison* garrison = _player->GetGarrison())
26 garrison->SendInfo();
27}
28
30{
32 return;
33
34 if (Garrison* garrison = _player->GetGarrison())
35 garrison->PlaceBuilding(garrisonPurchaseBuilding.PlotInstanceID, garrisonPurchaseBuilding.BuildingID);
36}
37
39{
41 return;
42
43 if (Garrison* garrison = _player->GetGarrison())
44 garrison->CancelBuildingConstruction(garrisonCancelConstruction.PlotInstanceID);
45}
46
48{
49 if (Garrison* garrison = _player->GetGarrison())
50 garrison->SendBlueprintAndSpecializationData();
51}
52
54{
55 if (Garrison* garrison = _player->GetGarrison())
56 garrison->SendMapData(_player);
57}
@ UNIT_NPC_FLAG_NONE
Definition: UnitDefines.h:296
@ UNIT_NPC_FLAG_2_GARRISON_ARCHITECT
Definition: UnitDefines.h:338
Creature * GetNPCIfCanInteractWith(ObjectGuid const &guid, NPCFlags npcFlags, NPCFlags2 npcFlags2) const
Definition: Player.cpp:1947
Garrison * GetGarrison() const
Definition: Player.h:2710
void HandleGarrisonGetMapData(WorldPackets::Garrison::GarrisonGetMapData &garrisonGetMapData)
void HandleGetGarrisonInfo(WorldPackets::Garrison::GetGarrisonInfo &getGarrisonInfo)
void HandleGarrisonRequestBlueprintAndSpecializationData(WorldPackets::Garrison::GarrisonRequestBlueprintAndSpecializationData &garrisonRequestBlueprintAndSpecializationData)
void HandleGarrisonPurchaseBuilding(WorldPackets::Garrison::GarrisonPurchaseBuilding &garrisonPurchaseBuilding)
void HandleGarrisonCancelConstruction(WorldPackets::Garrison::GarrisonCancelConstruction &garrisonCancelConstruction)
Player * _player