[10413] Add some missing class/struct forward declarations and includes.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
cipherCOM 2010-08-27 23:48:40 +04:00 committed by VladimirMangos
parent 47dc7dcf1b
commit 1ccf1ccd86
6 changed files with 55 additions and 15 deletions

View file

@ -21,6 +21,17 @@
#include "ObjectGuid.h" #include "ObjectGuid.h"
#include "ArenaTeam.h" #include "ArenaTeam.h"
#include "World.h" #include "World.h"
#include "Player.h"
void ArenaTeamMember::ModifyPersonalRating(Player* plr, int32 mod, uint32 slot)
{
if (int32(personal_rating) + mod < 0)
personal_rating = 0;
else
personal_rating += mod;
if(plr)
plr->SetArenaTeamInfoField(slot, ARENA_TEAM_PERSONAL_RATING, personal_rating);
}
ArenaTeam::ArenaTeam() ArenaTeam::ArenaTeam()
{ {

View file

@ -19,6 +19,14 @@
#ifndef MANGOSSERVER_ARENATEAM_H #ifndef MANGOSSERVER_ARENATEAM_H
#define MANGOSSERVER_ARENATEAM_H #define MANGOSSERVER_ARENATEAM_H
#include "Common.h"
#include "ObjectGuid.h"
class QueryResult;
class WorldPacket;
class WorldSession;
class Player;
enum ArenaTeamCommandTypes enum ArenaTeamCommandTypes
{ {
ERR_ARENA_TEAM_CREATE_S = 0x00, ERR_ARENA_TEAM_CREATE_S = 0x00,
@ -96,15 +104,7 @@ struct ArenaTeamMember
uint32 wins_season; uint32 wins_season;
uint32 personal_rating; uint32 personal_rating;
void ModifyPersonalRating(Player* plr, int32 mod, uint32 slot) void ModifyPersonalRating(Player* plr, int32 mod, uint32 slot);
{
if (int32(personal_rating) + mod < 0)
personal_rating = 0;
else
personal_rating += mod;
if(plr)
plr->SetArenaTeamInfoField(slot, ARENA_TEAM_PERSONAL_RATING, personal_rating);
}
}; };
struct ArenaTeamStats struct ArenaTeamStats

View file

@ -775,6 +775,12 @@ ChatCommand * ChatHandler::getCommandTable()
return commandTable; return commandTable;
} }
ChatHandler::ChatHandler(WorldSession* session) : m_session(session) {}
ChatHandler::ChatHandler(Player* player) : m_session(player->GetSession()) {}
ChatHandler::~ChatHandler() {}
const char *ChatHandler::GetMangosString(int32 entry) const const char *ChatHandler::GetMangosString(int32 entry) const
{ {
return m_session->GetMangosString(entry); return m_session->GetMangosString(entry);
@ -796,6 +802,11 @@ bool ChatHandler::isAvailable(ChatCommand const& cmd) const
return GetAccessLevel() >= (AccountTypes)cmd.SecurityLevel; return GetAccessLevel() >= (AccountTypes)cmd.SecurityLevel;
} }
std::string ChatHandler::GetNameLink() const
{
return GetNameLink(m_session->GetPlayer());
}
bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong) bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong)
{ {
WorldSession* target_session = NULL; WorldSession* target_session = NULL;
@ -3251,6 +3262,11 @@ uint32 ChatHandler::ExtractAccountId(char** args, std::string* accountName /*= N
return account_id; return account_id;
} }
std::string ChatHandler::GetNameLink(Player* chr) const
{
return playerLink(chr->GetName());
}
bool ChatHandler::needReportToTarget(Player* chr) const bool ChatHandler::needReportToTarget(Player* chr) const
{ {
Player* pl = m_session->GetPlayer(); Player* pl = m_session->GetPlayer();

View file

@ -25,13 +25,19 @@
struct AchievementEntry; struct AchievementEntry;
struct AreaTrigger; struct AreaTrigger;
struct AreaTriggerEntry;
struct FactionEntry; struct FactionEntry;
struct FactionState; struct FactionState;
struct GameTele; struct GameTele;
struct SpellEntry;
class QueryResult;
class ChatHandler; class ChatHandler;
class WorldSession; class WorldSession;
class WorldPacket;
class GMTicket; class GMTicket;
class Object;
class GameObject;
class Creature; class Creature;
class Player; class Player;
class Unit; class Unit;
@ -57,9 +63,9 @@ enum ChatCommandSearchResult
class ChatHandler class ChatHandler
{ {
public: public:
explicit ChatHandler(WorldSession* session) : m_session(session) {} explicit ChatHandler(WorldSession* session);
explicit ChatHandler(Player* player) : m_session(player->GetSession()) {} explicit ChatHandler(Player* player);
~ChatHandler() {} ~ChatHandler();
static void FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit *speaker); static void FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit *speaker);
@ -97,7 +103,7 @@ class ChatHandler
virtual uint32 GetAccountId() const; virtual uint32 GetAccountId() const;
virtual AccountTypes GetAccessLevel() const; virtual AccountTypes GetAccessLevel() const;
virtual bool isAvailable(ChatCommand const& cmd) const; virtual bool isAvailable(ChatCommand const& cmd) const;
virtual std::string GetNameLink() const { return GetNameLink(m_session->GetPlayer()); } virtual std::string GetNameLink() const;
virtual bool needReportToTarget(Player* chr) const; virtual bool needReportToTarget(Player* chr) const;
virtual LocaleConstant GetSessionDbcLocale() const; virtual LocaleConstant GetSessionDbcLocale() const;
virtual int GetSessionDbLocaleIndex() const; virtual int GetSessionDbLocaleIndex() const;
@ -597,7 +603,7 @@ class ChatHandler
// select by arg (name/link) or in-game selection online/offline player // select by arg (name/link) or in-game selection online/offline player
std::string playerLink(std::string const& name) const { return m_session ? "|cffffffff|Hplayer:"+name+"|h["+name+"]|h|r" : name; } std::string playerLink(std::string const& name) const { return m_session ? "|cffffffff|Hplayer:"+name+"|h["+name+"]|h|r" : name; }
std::string GetNameLink(Player* chr) const { return playerLink(chr->GetName()); } std::string GetNameLink(Player* chr) const;
GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid,uint32 entry); GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid,uint32 entry);

View file

@ -19,6 +19,8 @@
#ifndef MANGOSSERVER_GROUP_H #ifndef MANGOSSERVER_GROUP_H
#define MANGOSSERVER_GROUP_H #define MANGOSSERVER_GROUP_H
#include "Common.h"
#include "ObjectGuid.h"
#include "GroupReference.h" #include "GroupReference.h"
#include "GroupRefManager.h" #include "GroupRefManager.h"
#include "BattleGround.h" #include "BattleGround.h"
@ -29,8 +31,13 @@
#include <vector> #include <vector>
struct ItemPrototype; struct ItemPrototype;
class WorldSession;
class Map;
class BattleGround; class BattleGround;
class InstanceSave; class InstanceSave;
class Field;
class Unit;
#define MAX_GROUP_SIZE 5 #define MAX_GROUP_SIZE 5
#define MAX_RAID_SIZE 40 #define MAX_RAID_SIZE 40

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10412" #define REVISION_NR "10413"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__