diff options
| author | Naios <naios-dev@live.de> | 2015-04-26 23:45:52 +0200 |
|---|---|---|
| committer | Naios <naios-dev@live.de> | 2015-04-26 23:45:52 +0200 |
| commit | 800d5d893964a82265577d3352d683035b589f78 (patch) | |
| tree | 7b68f59be62a5df207c158a3f70fbf5860b91f69 /src/server/game/Support | |
| parent | f4a4e5de3d7d89116bc6eda20c0d37361fdd2023 (diff) | |
Core/Misc: Replace tc's optional with boost::optional.
* benefits from empty optimization (objects are only constructed if needed).
* supports r-value references (move semantics) (boost >= 1.56.0).
* preparation for c++14/17's std::optional and std::none_t.
* add move constructor to CompactArray.
Diffstat (limited to 'src/server/game/Support')
| -rw-r--r-- | src/server/game/Support/SupportMgr.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/server/game/Support/SupportMgr.cpp b/src/server/game/Support/SupportMgr.cpp index 1c1fe13d16a..06d09615e59 100644 --- a/src/server/game/Support/SupportMgr.cpp +++ b/src/server/game/Support/SupportMgr.cpp @@ -322,7 +322,7 @@ void ComplaintTicket::LoadFromDB(Field* fields) _complaintType = GMSupportComplaintType(fields[++idx].GetUInt8()); int32 reportLineIndex = fields[++idx].GetInt32(); if (reportLineIndex != -1) - _chatLog.ReportLineIndex.Set(reportLineIndex); + _chatLog.ReportLineIndex = reportLineIndex; int64 closedBy = fields[++idx].GetInt64(); if (closedBy == 0) @@ -364,8 +364,8 @@ void ComplaintTicket::SaveToDB(SQLTransaction& trans) const stmt->setFloat(++idx, _facing); stmt->setUInt64(++idx, _targetCharacterGuid.GetCounter()); stmt->setUInt8(++idx, _complaintType); - if (_chatLog.ReportLineIndex.HasValue) - stmt->setInt32(++idx, _chatLog.ReportLineIndex.Value); + if (_chatLog.ReportLineIndex) + stmt->setInt32(++idx, *_chatLog.ReportLineIndex); else stmt->setInt32(++idx, -1); // empty ReportLineIndex stmt->setInt64(++idx, _closedBy.GetCounter()); @@ -1056,18 +1056,18 @@ void SupportMgr::SendGmTicket(WorldSession* session, GmTicket* ticket) const if (ticket) { response.Result = GMTICKET_STATUS_HASTEXT; - response.Info.HasValue = true; - - response.Info.Value.TicketID = ticket->GetId(); - response.Info.Value.TicketDescription = ticket->GetDescription(); - response.Info.Value.Category = 1; - response.Info.Value.TicketOpenTime = GetAge(ticket->GetLastModifiedTime()); - response.Info.Value.OldestTicketTime = sSupportMgr->GetOldestOpenTicket() ? GetAge(sSupportMgr->GetOldestOpenTicket()->GetLastModifiedTime()) : float(0); - response.Info.Value.UpdateTime = GetAge(sSupportMgr->GetLastChange()); - response.Info.Value.AssignedToGM = ticket->GetAssigendToStatus(); - response.Info.Value.OpenedByGM = ticket->GetOpenedByGmStatus(); - response.Info.Value.WaitTimeOverrideMessage = ""; - response.Info.Value.WaitTimeOverrideMinutes = 0; + response.Info = WorldPackets::Ticket::GMTicketGetTicketResponse::GMTicketInfo(); + + response.Info->TicketID = ticket->GetId(); + response.Info->TicketDescription = ticket->GetDescription(); + response.Info->Category = 1; + response.Info->TicketOpenTime = GetAge(ticket->GetLastModifiedTime()); + response.Info->OldestTicketTime = sSupportMgr->GetOldestOpenTicket() ? GetAge(sSupportMgr->GetOldestOpenTicket()->GetLastModifiedTime()) : float(0); + response.Info->UpdateTime = GetAge(sSupportMgr->GetLastChange()); + response.Info->AssignedToGM = ticket->GetAssigendToStatus(); + response.Info->OpenedByGM = ticket->GetOpenedByGmStatus(); + response.Info->WaitTimeOverrideMessage = ""; + response.Info->WaitTimeOverrideMinutes = 0; } else response.Result = GMTICKET_STATUS_DEFAULT; |
