<commit_before>/*
 * AscEmu Framework based on ArcEmu MMORPG Server
 * Copyright (c) 2014-2021 AscEmu Team <http://www.ascemu.org>
 * Copyright (C) 2008-2012 ArcEmu Team <http://www.ArcEmu.org/>
 * Copyright (C) 2005-2007 Ascent Team
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#pragma once

#include "Units/Players/PlayerDefines.hpp"
#include "Units/Players/PlayerCache.h"
#include "Units/Stats.h"
#include "Server/Definitions.h"
#include "Management/QuestDefines.hpp"
#include "Management/Battleground/BattlegroundMgr.h"
#include "Management/MailMgr.h"
#include "Management/ItemPrototype.h"
#include "Management/AchievementMgr.h"
#include "Units/Unit.h"
#include "Storage/DBC/DBCStructures.hpp"
#include "Storage/MySQLStructures.h"
#include "Macros/MapsMacros.hpp"
#include "Macros/PlayerMacros.hpp"
#include "Units/Creatures/AIInterface.h" //?? what?
#include "WorldConf.h"
#include "Management/AuctionHouse.h"
#include "Management/Guild/Guild.hpp"
#include "Management/ObjectUpdates/SplineManager.h"
#include "Management/ObjectUpdates/UpdateManager.h"
#include "Data/WoWPlayer.hpp"

struct CharCreate;
class QuestLogEntry;
struct BGScore;
class AchievementMgr;
class Channel;
class Creature;
class Battleground;
class TaxiPath;
class GameObject;
class Transporter;
class Corpse;
class Guild;
class Pet;
class Charter;
class LfgMatch;
struct LevelInfo;
class SpeedCheatDetector;
struct GuildMember;

class QueryBuffer;
struct QuestProperties;
struct SpellShapeshiftForm;
class CBattleground;
class Instance;
struct CharRaceEntry;
struct CharClassEntry;
//struct VendorRestrictionEntry;
struct Trainer;
class Aura;

struct OnHitSpell;

struct CreateInfo_ItemStruct
{
    uint32 protoid;
    uint8 slot;
    uint32 amount;
};

struct CreateInfo_SkillStruct
{
    uint32 skillid;
    uint32 currentval;
    uint32 maxval;
};

// APGL End
// MIT Start
#pragma pack(push,1)
struct ActionButton
{
    uint32_t Action;
    uint8_t Type;
    uint8_t Misc;
};
#pragma pack(pop)

struct CreateInfo_ActionBarStruct
{
    uint8_t button;
    uint32_t action;
    uint8_t type;
    uint8_t misc;
};
// MIT End
// APGL Start

struct PlayerCreateInfo
{
    uint8 index;
    uint8 race;
    uint8 class_;
    uint32 mapId;
    uint32 zoneId;
    float positionX;
    float positionY;
    float positionZ;
    float orientation;
    uint8 strength;
    uint8 ability;
    uint8 stamina;
    uint8 intellect;
    uint8 spirit;
    uint32 health;
    uint32 mana;
    uint32 rage;
    uint32 focus;
    uint32 energy;
    uint32 attackpower;
    float mindmg;
    float maxdmg;
    uint32_t taximask[DBC_TAXI_MASK_SIZE];
    std::list<CreateInfo_ItemStruct> items;
    std::list<CreateInfo_SkillStruct> skills;
    std::list<CreateInfo_ActionBarStruct> actionbars;
    std::set<uint32> spell_list;
};

struct DamageSplit
{
    Player* caster;
    Aura* aura;
    uint32 miscVal;
    union
    {
        uint32 damage;
        float damagePCT;
    };
};

struct LoginAura
{
    uint32 id;
    uint32 dur;
    bool positive;
    uint32 charges;
};

struct FactionReputation
{
    int32 standing;
    uint8 flag;
    int32 baseStanding;
    int32 CalcStanding() { return standing - baseStanding; }
    bool Positive() { return standing >= 0; }
};

typedef std::unordered_map<uint32, uint32> PlayerInstanceMap;
class SERVER_DECL PlayerInfo
{
    public:

        ~PlayerInfo();

        uint32 guid;
        uint32 acct;
        char* name;
        uint8_t race;
        uint8_t gender;
        uint8 cl;
        uint32 team;
        uint8 role;

        time_t lastOnline;
        uint32 lastZone;
        uint32 lastLevel;
        Group* m_Group;
        int8 subGroup;
        Mutex savedInstanceIdsLock;
        PlayerInstanceMap savedInstanceIds[NUM_INSTANCE_MODES];

        Player* m_loggedInPlayer;
        uint32 m_guild;
        uint32 guildRank;
};

struct PlayerPet
{<commit_msg>Add comments to playerinfo class<commit_after>/*
 * AscEmu Framework based on ArcEmu MMORPG Server
 * Copyright (c) 2014-2021 AscEmu Team <http://www.ascemu.org>
 * Copyright (C) 2008-2012 ArcEmu Team <http://www.ArcEmu.org/>
 * Copyright (C) 2005-2007 Ascent Team
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#pragma once

#include "Units/Players/PlayerDefines.hpp"
#include "Units/Players/PlayerCache.h"
#include "Units/Stats.h"
#include "Server/Definitions.h"
#include "Management/QuestDefines.hpp"
#include "Management/Battleground/BattlegroundMgr.h"
#include "Management/MailMgr.h"
#include "Management/ItemPrototype.h"
#include "Management/AchievementMgr.h"
#include "Units/Unit.h"
#include "Storage/DBC/DBCStructures.hpp"
#include "Storage/MySQLStructures.h"
#include "Macros/MapsMacros.hpp"
#include "Macros/PlayerMacros.hpp"
#include "Units/Creatures/AIInterface.h" //?? what?
#include "WorldConf.h"
#include "Management/AuctionHouse.h"
#include "Management/Guild/Guild.hpp"
#include "Management/ObjectUpdates/SplineManager.h"
#include "Management/ObjectUpdates/UpdateManager.h"
#include "Data/WoWPlayer.hpp"

struct CharCreate;
class QuestLogEntry;
struct BGScore;
class AchievementMgr;
class Channel;
class Creature;
class Battleground;
class TaxiPath;
class GameObject;
class Transporter;
class Corpse;
class Guild;
class Pet;
class Charter;
class LfgMatch;
struct LevelInfo;
class SpeedCheatDetector;
struct GuildMember;

class QueryBuffer;
struct QuestProperties;
struct SpellShapeshiftForm;
class CBattleground;
class Instance;
struct CharRaceEntry;
struct CharClassEntry;
//struct VendorRestrictionEntry;
struct Trainer;
class Aura;

struct OnHitSpell;

struct CreateInfo_ItemStruct
{
    uint32 protoid;
    uint8 slot;
    uint32 amount;
};

struct CreateInfo_SkillStruct
{
    uint32 skillid;
    uint32 currentval;
    uint32 maxval;
};

// APGL End
// MIT Start
#pragma pack(push,1)
struct ActionButton
{
    uint32_t Action;
    uint8_t Type;
    uint8_t Misc;
};
#pragma pack(pop)

struct CreateInfo_ActionBarStruct
{
    uint8_t button;
    uint32_t action;
    uint8_t type;
    uint8_t misc;
};
// MIT End
// APGL Start

struct PlayerCreateInfo
{
    uint8 index;
    uint8 race;
    uint8 class_;
    uint32 mapId;
    uint32 zoneId;
    float positionX;
    float positionY;
    float positionZ;
    float orientation;
    uint8 strength;
    uint8 ability;
    uint8 stamina;
    uint8 intellect;
    uint8 spirit;
    uint32 health;
    uint32 mana;
    uint32 rage;
    uint32 focus;
    uint32 energy;
    uint32 attackpower;
    float mindmg;
    float maxdmg;
    uint32_t taximask[DBC_TAXI_MASK_SIZE];
    std::list<CreateInfo_ItemStruct> items;
    std::list<CreateInfo_SkillStruct> skills;
    std::list<CreateInfo_ActionBarStruct> actionbars;
    std::set<uint32> spell_list;
};

struct DamageSplit
{
    Player* caster;
    Aura* aura;
    uint32 miscVal;
    union
    {
        uint32 damage;
        float damagePCT;
    };
};

struct LoginAura
{
    uint32 id;
    uint32 dur;
    bool positive;
    uint32 charges;
};

struct FactionReputation
{
    int32 standing;
    uint8 flag;
    int32 baseStanding;
    int32 CalcStanding() { return standing - baseStanding; }
    bool Positive() { return standing >= 0; }
};

typedef std::unordered_map<uint32, uint32> PlayerInstanceMap;
class SERVER_DECL PlayerInfo
{
    public:

        ~PlayerInfo();

        uint32 guid;        // there is a filed for that
        uint32 acct;
        char* name;         // Part of Player class
        uint8_t race;       // Part of PlayerCreateInfo
        uint8_t gender;     // there is a field for that in playerbytes3
        uint8 cl;           // class? Part of PlayerCreateInfo. It is determind on player creation.
        uint32 team;        // team? there is a field for that since bc. Investigate further for what this is used.
        uint8 role;         // bg related?

        time_t lastOnline;
        uint32 lastZone;
        uint32 lastLevel;
        Group* m_Group;
        int8 subGroup;
        Mutex savedInstanceIdsLock;
        PlayerInstanceMap savedInstanceIds[NUM_INSTANCE_MODES];

        Player* m_loggedInPlayer;
        uint32 m_guild;
        uint32 guildRank;
};

struct PlayerPet
{
{'fraction_non_alphanumeric': 0.08429734361610969, 'fraction_numerical': 0.02474293059125964, 'mean_word_length': 3.4568019093078757, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6866282', 'n_tokens_mistral': 3104, 'n_tokens_neox': 2949, 'n_words': 887}