mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[11467] Reorder class Channel sections to default used in mangos
This commit is contained in:
parent
b8bb108757
commit
1e38db574a
4 changed files with 58 additions and 55 deletions
|
|
@ -624,7 +624,7 @@ void Channel::Invite(uint64 p, const char *newname)
|
||||||
if(!newp->GetSocial()->HasIgnore(p))
|
if(!newp->GetSocial()->HasIgnore(p))
|
||||||
{
|
{
|
||||||
MakeInvite(&data, p);
|
MakeInvite(&data, p);
|
||||||
SendToOne(&data, newp->GetGUID());
|
SendToOne(&data, newp->GetObjectGuid());
|
||||||
data.clear();
|
data.clear();
|
||||||
}
|
}
|
||||||
MakePlayerInvited(&data, newp->GetName());
|
MakePlayerInvited(&data, newp->GetName());
|
||||||
|
|
@ -667,9 +667,9 @@ void Channel::SendToAll(WorldPacket *data, uint64 p)
|
||||||
plr->GetSession()->SendPacket(data);
|
plr->GetSession()->SendPacket(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Channel::SendToOne(WorldPacket *data, uint64 who)
|
void Channel::SendToOne(WorldPacket *data, ObjectGuid who)
|
||||||
{
|
{
|
||||||
if (Player *plr = sObjectMgr.GetPlayer(who))
|
if (Player *plr = ObjectMgr::GetPlayer(who))
|
||||||
plr->GetSession()->SendPacket(data);
|
plr->GetSession()->SendPacket(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
#define _CHANNEL_H
|
#define _CHANNEL_H
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
#include "ObjectGuid.h"
|
||||||
#include "WorldPacket.h"
|
#include "WorldPacket.h"
|
||||||
#include "Opcodes.h"
|
#include "Opcodes.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
|
|
@ -145,17 +146,44 @@ class Channel
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::map<uint64, PlayerInfo> PlayerList;
|
public:
|
||||||
PlayerList players;
|
Channel(const std::string& name, uint32 channel_id);
|
||||||
typedef std::set<uint64> BannedList;
|
std::string GetName() const { return m_name; }
|
||||||
BannedList banned;
|
uint32 GetChannelId() const { return m_channelId; }
|
||||||
bool m_announce;
|
bool IsConstant() const { return m_channelId != 0; }
|
||||||
bool m_moderate;
|
bool IsAnnounce() const { return m_announce; }
|
||||||
std::string m_name;
|
bool IsLFG() const { return GetFlags() & CHANNEL_FLAG_LFG; }
|
||||||
std::string m_password;
|
std::string GetPassword() const { return m_password; }
|
||||||
uint8 m_flags;
|
void SetPassword(const std::string& npassword) { m_password = npassword; }
|
||||||
uint32 m_channelId;
|
void SetAnnounce(bool nannounce) { m_announce = nannounce; }
|
||||||
uint64 m_ownerGUID;
|
uint32 GetNumPlayers() const { return players.size(); }
|
||||||
|
uint8 GetFlags() const { return m_flags; }
|
||||||
|
bool HasFlag(uint8 flag) { return m_flags & flag; }
|
||||||
|
|
||||||
|
void Join(uint64 p, const char *pass);
|
||||||
|
void Leave(uint64 p, bool send = true);
|
||||||
|
void KickOrBan(uint64 good, const char *badname, bool ban);
|
||||||
|
void Kick(uint64 good, const char *badname) { KickOrBan(good, badname, false); }
|
||||||
|
void Ban(uint64 good, const char *badname) { KickOrBan(good, badname, true); }
|
||||||
|
void UnBan(uint64 good, const char *badname);
|
||||||
|
void Password(uint64 p, const char *pass);
|
||||||
|
void SetMode(uint64 p, const char *p2n, bool mod, bool set);
|
||||||
|
void SetOwner(uint64 p, bool exclaim = true);
|
||||||
|
void SetOwner(uint64 p, const char *newname);
|
||||||
|
void SendWhoOwner(uint64 p);
|
||||||
|
void SetModerator(uint64 p, const char *newname) { SetMode(p, newname, true, true); }
|
||||||
|
void UnsetModerator(uint64 p, const char *newname) { SetMode(p, newname, true, false); }
|
||||||
|
void SetMute(uint64 p, const char *newname) { SetMode(p, newname, false, true); }
|
||||||
|
void UnsetMute(uint64 p, const char *newname) { SetMode(p, newname, false, false); }
|
||||||
|
void List(Player* p);
|
||||||
|
void Announce(uint64 p);
|
||||||
|
void Moderate(uint64 p);
|
||||||
|
void Say(uint64 p, const char *what, uint32 lang);
|
||||||
|
void Invite(uint64 p, const char *newp);
|
||||||
|
void Voice(uint64 guid1, uint64 guid2);
|
||||||
|
void DeVoice(uint64 guid1, uint64 guid2);
|
||||||
|
void JoinNotify(uint64 guid); // invisible notify
|
||||||
|
void LeaveNotify(uint64 guid); // invisible notify
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// initial packet data (notify type and channel name)
|
// initial packet data (notify type and channel name)
|
||||||
|
|
@ -199,7 +227,7 @@ class Channel
|
||||||
void MakeVoiceOff(WorldPacket *data, uint64 guid); //+ 0x23
|
void MakeVoiceOff(WorldPacket *data, uint64 guid); //+ 0x23
|
||||||
|
|
||||||
void SendToAll(WorldPacket *data, uint64 p = 0);
|
void SendToAll(WorldPacket *data, uint64 p = 0);
|
||||||
void SendToOne(WorldPacket *data, uint64 who);
|
void SendToOne(WorldPacket *data, ObjectGuid who);
|
||||||
|
|
||||||
bool IsOn(uint64 who) const { return players.find(who) != players.end(); }
|
bool IsOn(uint64 who) const { return players.find(who) != players.end(); }
|
||||||
bool IsBanned(uint64 guid) const { return banned.find(guid) != banned.end(); }
|
bool IsBanned(uint64 guid) const { return banned.find(guid) != banned.end(); }
|
||||||
|
|
@ -239,43 +267,18 @@ class Channel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
private:
|
||||||
Channel(const std::string& name, uint32 channel_id);
|
bool m_announce;
|
||||||
std::string GetName() const { return m_name; }
|
bool m_moderate;
|
||||||
uint32 GetChannelId() const { return m_channelId; }
|
std::string m_name;
|
||||||
bool IsConstant() const { return m_channelId != 0; }
|
std::string m_password;
|
||||||
bool IsAnnounce() const { return m_announce; }
|
uint8 m_flags;
|
||||||
bool IsLFG() const { return GetFlags() & CHANNEL_FLAG_LFG; }
|
uint32 m_channelId;
|
||||||
std::string GetPassword() const { return m_password; }
|
uint64 m_ownerGUID;
|
||||||
void SetPassword(const std::string& npassword) { m_password = npassword; }
|
|
||||||
void SetAnnounce(bool nannounce) { m_announce = nannounce; }
|
|
||||||
uint32 GetNumPlayers() const { return players.size(); }
|
|
||||||
uint8 GetFlags() const { return m_flags; }
|
|
||||||
bool HasFlag(uint8 flag) { return m_flags & flag; }
|
|
||||||
|
|
||||||
void Join(uint64 p, const char *pass);
|
typedef std::map<uint64, PlayerInfo> PlayerList;
|
||||||
void Leave(uint64 p, bool send = true);
|
PlayerList players;
|
||||||
void KickOrBan(uint64 good, const char *badname, bool ban);
|
typedef std::set<uint64> BannedList;
|
||||||
void Kick(uint64 good, const char *badname) { KickOrBan(good, badname, false); }
|
BannedList banned;
|
||||||
void Ban(uint64 good, const char *badname) { KickOrBan(good, badname, true); }
|
|
||||||
void UnBan(uint64 good, const char *badname);
|
|
||||||
void Password(uint64 p, const char *pass);
|
|
||||||
void SetMode(uint64 p, const char *p2n, bool mod, bool set);
|
|
||||||
void SetOwner(uint64 p, bool exclaim = true);
|
|
||||||
void SetOwner(uint64 p, const char *newname);
|
|
||||||
void SendWhoOwner(uint64 p);
|
|
||||||
void SetModerator(uint64 p, const char *newname) { SetMode(p, newname, true, true); }
|
|
||||||
void UnsetModerator(uint64 p, const char *newname) { SetMode(p, newname, true, false); }
|
|
||||||
void SetMute(uint64 p, const char *newname) { SetMode(p, newname, false, true); }
|
|
||||||
void UnsetMute(uint64 p, const char *newname) { SetMode(p, newname, false, false); }
|
|
||||||
void List(Player* p);
|
|
||||||
void Announce(uint64 p);
|
|
||||||
void Moderate(uint64 p);
|
|
||||||
void Say(uint64 p, const char *what, uint32 lang);
|
|
||||||
void Invite(uint64 p, const char *newp);
|
|
||||||
void Voice(uint64 guid1, uint64 guid2);
|
|
||||||
void DeVoice(uint64 guid1, uint64 guid2);
|
|
||||||
void JoinNotify(uint64 guid); // invisible notify
|
|
||||||
void LeaveNotify(uint64 guid); // invisible notify
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -454,8 +454,8 @@ class ObjectMgr
|
||||||
|
|
||||||
typedef UNORDERED_MAP<uint32, WeatherZoneChances> WeatherZoneMap;
|
typedef UNORDERED_MAP<uint32, WeatherZoneChances> WeatherZoneMap;
|
||||||
|
|
||||||
Player* GetPlayer(const char* name) const { return ObjectAccessor::FindPlayerByName(name);}
|
static Player* GetPlayer(const char* name) { return ObjectAccessor::FindPlayerByName(name);}
|
||||||
Player* GetPlayer(ObjectGuid guid) const { return ObjectAccessor::FindPlayer(guid); }
|
static Player* GetPlayer(ObjectGuid guid) { return ObjectAccessor::FindPlayer(guid); }
|
||||||
|
|
||||||
static GameObjectInfo const *GetGameObjectInfo(uint32 id) { return sGOStorage.LookupEntry<GameObjectInfo>(id); }
|
static GameObjectInfo const *GetGameObjectInfo(uint32 id) { return sGOStorage.LookupEntry<GameObjectInfo>(id); }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11466"
|
#define REVISION_NR "11467"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue