AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
ServerMailMgr.h File Reference

Manages the ServerMail operations, including template loading, condition checking, and mail delivery. More...

#include "Define.h"
#include <string>
#include <unordered_map>
#include <vector>

Go to the source code of this file.

Classes

struct  ServerMailCondition
 Represents a condition that must be met for a player to receive a server mail. More...
 
struct  ServerMailItems
 Represents an item reward associated with a server mail template. More...
 
struct  ServerMail
 Represents a server mail template, including rewards, conditions, and metadata. More...
 
class  ServerMailMgr
 

Macros

#define sServerMailMgr   ServerMailMgr::instance()
 

Typedefs

typedef std::unordered_map< uint32, ServerMailServerMailContainer
 

Enumerations

enum class  ServerMailConditionType : uint8 {
  Invalid = 0 ,
  Level = 1 ,
  PlayTime = 2 ,
  Quest = 3 ,
  Achievement = 4 ,
  Reputation = 5 ,
  Faction = 6 ,
  Race = 7 ,
  Class = 8
}
 Represents the type of conditions that can be applied to server mail. More...
 

Variables

constexpr std::pair< std::string_view, ServerMailConditionTypeServerMailConditionTypePairs []
 Assign string condition to corresponding ServerMailConditionType enum value.
 

Detailed Description

Manages the ServerMail operations, including template loading, condition checking, and mail delivery.

This class handles the loading of server mail templates, associated items, and conditions from the database. It also provides functionality to check player eligibility for receiving server mails based on configured conditions.

Key features:

  • Supports multi-item mails via mail_server_template_items
  • Supports flexible mail conditions (level, playtime, quest, achievement) via mail_server_template_conditions
  • Ensures all related data is loaded and validated on startup

Definition in file ServerMailMgr.h.

Macro Definition Documentation

◆ sServerMailMgr

#define sServerMailMgr   ServerMailMgr::instance()

Typedef Documentation

◆ ServerMailContainer

typedef std::unordered_map<uint32, ServerMail> ServerMailContainer

Enumeration Type Documentation

◆ ServerMailConditionType

enum class ServerMailConditionType : uint8
strong

Represents the type of conditions that can be applied to server mail.

Enumerator
Invalid 

Internal use, not used in DB.

Level 

Requires the player to be at least a specific level.

PlayTime 

Requires the player to have played for a minimum amount of time (in milliseconds).

Quest 

Requires the player to have completed a specific quest.

Achievement 

Requires the player to have earned a specific achievement.

Reputation 

Requires the player to have earned reputation with a specific faction.

Faction 

Requires the player to be a part of a specific faction. Horde/Alliance.

Race 

Requires the player to be a specific race.

Class 

Requires the player to be a specific class.

46{
47 Invalid = 0,
48 Level = 1,
49 PlayTime = 2,
50 Quest = 3,
51 Achievement = 4,
52 Reputation = 5,
53 Faction = 6,
54 Race = 7,
55 Class = 8,
56};
@ Faction
Requires the player to be a part of a specific faction. Horde/Alliance.
@ Invalid
Internal use, not used in DB.
@ Race
Requires the player to be a specific race.
@ Reputation
Requires the player to have earned reputation with a specific faction.
@ Class
Requires the player to be a specific class.
@ Level
Requires the player to be at least a specific level.
@ PlayTime
Requires the player to have played for a minimum amount of time (in milliseconds).
@ Achievement
Requires the player to have earned a specific achievement.
Definition QuestDef.h:210

Variable Documentation

◆ ServerMailConditionTypePairs

constexpr std::pair<std::string_view, ServerMailConditionType> ServerMailConditionTypePairs[]
constexpr
Initial value:
=
{
}
@ Quest
Requires the player to have completed a specific quest.

Assign string condition to corresponding ServerMailConditionType enum value.

Referenced by ServerMailMgr::GetServerMailConditionType().