diff options
author | Shauren <shauren.trinity@gmail.com> | 2017-05-16 22:16:21 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2017-05-16 22:16:21 +0200 |
commit | a12a34b1dce93b17dcb2978937ac00288949ae13 (patch) | |
tree | 81dc0776fe697795169497ec213f3790459b6095 /src/server/game/Support | |
parent | b421a5c0cbaf8acd8f1152c96ad7872cb8d7c9e3 (diff) |
Core/Game: Include cleanup - removed G3D classes from packets
* Use our own Position class instead, with the coords written to packets being part of type
Diffstat (limited to 'src/server/game/Support')
-rw-r--r-- | src/server/game/Support/SupportMgr.cpp | 62 | ||||
-rw-r--r-- | src/server/game/Support/SupportMgr.h | 12 |
2 files changed, 34 insertions, 40 deletions
diff --git a/src/server/game/Support/SupportMgr.cpp b/src/server/game/Support/SupportMgr.cpp index 7e883dce63e..cc358436bec 100644 --- a/src/server/game/Support/SupportMgr.cpp +++ b/src/server/game/Support/SupportMgr.cpp @@ -32,7 +32,7 @@ Ticket::~Ticket() { } void Ticket::TeleportTo(Player* player) const { - player->TeleportTo(_mapId, _pos.x, _pos.y, _pos.z, 0.0f, 0); + player->TeleportTo(_mapId, _pos.GetPositionX(), _pos.GetPositionY(), _pos.GetPositionZ(), 0.0f, 0); } std::string Ticket::FormatViewMessageString(ChatHandler& handler, char const* closedName, char const* assignedToName, char const* unassignedName, char const* deletedName) const @@ -51,9 +51,9 @@ std::string Ticket::FormatViewMessageString(ChatHandler& handler, char const* cl return ss.str(); } -BugTicket::BugTicket() : _facing(0.0f) { } +BugTicket::BugTicket() { } -BugTicket::BugTicket(Player* player) : Ticket(player), _facing(0.0f) +BugTicket::BugTicket(Player* player) : Ticket(player) { _id = sSupportMgr->GenerateBugId(); } @@ -68,10 +68,10 @@ void BugTicket::LoadFromDB(Field* fields) _note = fields[++idx].GetString(); _createTime = fields[++idx].GetUInt32(); _mapId = fields[++idx].GetUInt16(); - _pos.x = fields[++idx].GetFloat(); - _pos.y = fields[++idx].GetFloat(); - _pos.z = fields[++idx].GetFloat(); - _facing = fields[++idx].GetFloat(); + _pos.m_positionX = fields[++idx].GetFloat(); + _pos.m_positionY = fields[++idx].GetFloat(); + _pos.m_positionZ = fields[++idx].GetFloat(); + _pos.SetOrientation(fields[++idx].GetFloat()); int64 closedBy = fields[++idx].GetInt64(); if (closedBy == 0) @@ -98,10 +98,10 @@ void BugTicket::SaveToDB() const stmt->setUInt64(++idx, _playerGuid.GetCounter()); stmt->setString(++idx, _note); stmt->setUInt16(++idx, _mapId); - stmt->setFloat(++idx, _pos.x); - stmt->setFloat(++idx, _pos.y); - stmt->setFloat(++idx, _pos.z); - stmt->setFloat(++idx, _facing); + stmt->setFloat(++idx, _pos.GetPositionX()); + stmt->setFloat(++idx, _pos.GetPositionY()); + stmt->setFloat(++idx, _pos.GetPositionZ()); + stmt->setFloat(++idx, _pos.GetOrientation()); stmt->setInt64(++idx, _closedBy.GetCounter()); stmt->setUInt64(++idx, _assignedTo.GetCounter()); stmt->setString(++idx, _comment); @@ -137,9 +137,9 @@ std::string BugTicket::FormatViewMessageString(ChatHandler& handler, bool detail return ss.str(); } -ComplaintTicket::ComplaintTicket() : _facing(0.0f), _complaintType(GMTICKET_SUPPORT_COMPLAINT_TYPE_NONE) { } +ComplaintTicket::ComplaintTicket() : _complaintType(GMTICKET_SUPPORT_COMPLAINT_TYPE_NONE) { } -ComplaintTicket::ComplaintTicket(Player* player) : Ticket(player), _facing(0.0f), _complaintType(GMTICKET_SUPPORT_COMPLAINT_TYPE_NONE) +ComplaintTicket::ComplaintTicket(Player* player) : Ticket(player), _complaintType(GMTICKET_SUPPORT_COMPLAINT_TYPE_NONE) { _id = sSupportMgr->GenerateComplaintId(); } @@ -154,10 +154,10 @@ void ComplaintTicket::LoadFromDB(Field* fields) _note = fields[++idx].GetString(); _createTime = fields[++idx].GetUInt32(); _mapId = fields[++idx].GetUInt16(); - _pos.x = fields[++idx].GetFloat(); - _pos.y = fields[++idx].GetFloat(); - _pos.z = fields[++idx].GetFloat(); - _facing = fields[++idx].GetFloat(); + _pos.m_positionX = fields[++idx].GetFloat(); + _pos.m_positionY = fields[++idx].GetFloat(); + _pos.m_positionZ = fields[++idx].GetFloat(); + _pos.SetOrientation(fields[++idx].GetFloat()); _targetCharacterGuid = ObjectGuid::Create<HighGuid::Player>(fields[++idx].GetUInt64()); _complaintType = GMSupportComplaintType(fields[++idx].GetUInt8()); int32 reportLineIndex = fields[++idx].GetInt32(); @@ -196,10 +196,10 @@ void ComplaintTicket::SaveToDB() const stmt->setUInt64(++idx, _playerGuid.GetCounter()); stmt->setString(++idx, _note); stmt->setUInt16(++idx, _mapId); - stmt->setFloat(++idx, _pos.x); - stmt->setFloat(++idx, _pos.y); - stmt->setFloat(++idx, _pos.z); - stmt->setFloat(++idx, _facing); + stmt->setFloat(++idx, _pos.GetPositionX()); + stmt->setFloat(++idx, _pos.GetPositionY()); + stmt->setFloat(++idx, _pos.GetPositionZ()); + stmt->setFloat(++idx, _pos.GetOrientation()); stmt->setUInt64(++idx, _targetCharacterGuid.GetCounter()); stmt->setUInt8(++idx, _complaintType); if (_chatLog.ReportLineIndex) @@ -260,9 +260,9 @@ std::string ComplaintTicket::FormatViewMessageString(ChatHandler& handler, bool return ss.str(); } -SuggestionTicket::SuggestionTicket() : _facing(0.0f) { } +SuggestionTicket::SuggestionTicket() { } -SuggestionTicket::SuggestionTicket(Player* player) : Ticket(player), _facing(0.0f) +SuggestionTicket::SuggestionTicket(Player* player) : Ticket(player) { _id = sSupportMgr->GenerateSuggestionId(); } @@ -277,10 +277,10 @@ void SuggestionTicket::LoadFromDB(Field* fields) _note = fields[++idx].GetString(); _createTime = fields[++idx].GetUInt32(); _mapId = fields[++idx].GetUInt16(); - _pos.x = fields[++idx].GetFloat(); - _pos.y = fields[++idx].GetFloat(); - _pos.z = fields[++idx].GetFloat(); - _facing = fields[++idx].GetFloat(); + _pos.m_positionX = fields[++idx].GetFloat(); + _pos.m_positionY = fields[++idx].GetFloat(); + _pos.m_positionZ = fields[++idx].GetFloat(); + _pos.SetOrientation(fields[++idx].GetFloat()); int64 closedBy = fields[++idx].GetInt64(); if (closedBy == 0) @@ -307,10 +307,10 @@ void SuggestionTicket::SaveToDB() const stmt->setUInt64(++idx, _playerGuid.GetCounter()); stmt->setString(++idx, _note); stmt->setUInt16(++idx, _mapId); - stmt->setFloat(++idx, _pos.x); - stmt->setFloat(++idx, _pos.y); - stmt->setFloat(++idx, _pos.z); - stmt->setFloat(++idx, _facing); + stmt->setFloat(++idx, _pos.GetPositionX()); + stmt->setFloat(++idx, _pos.GetPositionY()); + stmt->setFloat(++idx, _pos.GetPositionZ()); + stmt->setFloat(++idx, _pos.GetOrientation()); stmt->setInt64(++idx, _closedBy.GetCounter()); stmt->setUInt64(++idx, _assignedTo.GetCounter()); stmt->setString(++idx, _comment); diff --git a/src/server/game/Support/SupportMgr.h b/src/server/game/Support/SupportMgr.h index 47a257da7d3..9c1f9b39fd4 100644 --- a/src/server/game/Support/SupportMgr.h +++ b/src/server/game/Support/SupportMgr.h @@ -90,11 +90,12 @@ public: virtual void SetUnassigned() { _assignedTo.Clear(); } void SetClosedBy(ObjectGuid value) { _closedBy = value; } void SetComment(std::string const& comment) { _comment = comment; } - void SetPosition(uint32 mapId, G3D::Vector3& pos) + void SetPosition(uint32 mapId, Position const& pos) { _mapId = mapId; _pos = pos; } + void SetFacing(float facing) { _pos.SetOrientation(facing); } virtual void LoadFromDB(Field* fields) = 0; virtual void SaveToDB() const = 0; @@ -109,7 +110,7 @@ protected: uint32 _id; ObjectGuid _playerGuid; uint16 _mapId; - G3D::Vector3 _pos; + Position _pos; uint64 _createTime; ObjectGuid _closedBy; // 0 = Open, -1 = Console, playerGuid = player abandoned ticket, other = GM who closed it. ObjectGuid _assignedTo; @@ -125,7 +126,6 @@ public: std::string const& GetNote() const { return _note; } - void SetFacing(float facing) { _facing = facing; } void SetNote(std::string const& note) { _note = note; } void LoadFromDB(Field* fields) override; @@ -136,7 +136,6 @@ public: std::string FormatViewMessageString(ChatHandler& handler, bool detailed = false) const override; private: - float _facing; std::string _note; }; @@ -151,7 +150,6 @@ public: GMSupportComplaintType GetComplaintType() const { return _complaintType; } std::string const& GetNote() const { return _note; } - void SetFacing(float facing) { _facing = facing; } void SetTargetCharacterGuid(ObjectGuid targetCharacterGuid) { _targetCharacterGuid = targetCharacterGuid; @@ -169,7 +167,6 @@ public: std::string FormatViewMessageString(ChatHandler& handler, bool detailed = false) const override; private: - float _facing; ObjectGuid _targetCharacterGuid; GMSupportComplaintType _complaintType; ChatLog _chatLog; @@ -186,8 +183,6 @@ public: std::string const& GetNote() const { return _note; } void SetNote(std::string const& note) { _note = note; } - void SetFacing(float facing) { _facing = facing; } - void LoadFromDB(Field* fields) override; void SaveToDB() const override; void DeleteFromDB() override; @@ -196,7 +191,6 @@ public: std::string FormatViewMessageString(ChatHandler& handler, bool detailed = false) const override; private: - float _facing; std::string _note; }; |