OregonCore  revision 3611e8a-git
Your Favourite TBC server
Channel.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore Project. See AUTHORS file for Copyright information
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #include "Channel.h"
19 #include "ObjectMgr.h"
20 #include "SocialMgr.h"
21 #include "World.h"
22 
23 Channel::Channel(const std::string& name, uint32 channel_id)
24  : m_name(name), m_announce(true), m_moderate(false), m_password(""), m_flags(0), m_channelId(channel_id), m_ownerGUID(0)
25 {
26  // set special flags if built-in channel
27  ChatChannelsEntry const* ch = GetChannelEntryFor(channel_id);
28  if (ch) // it's built-in channel
29  {
30  channel_id = ch->ChannelID; // built-in channel
31  m_announce = false; // no join/leave announces
32 
33  m_flags |= CHANNEL_FLAG_GENERAL; // for all built-in channels
34 
35  if (ch->flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel
37 
38  if (ch->flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels
40 
41  if (ch->flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel
43  else // for all other channels
45  }
46  else // it's custom channel
48 }
49 
50 void Channel::Join(uint64 p, const char* pass)
51 {
52  WorldPacket data;
53  if (IsOn(p))
54  {
55  if (!IsConstant()) // non send error message for built-in channels
56  {
57  MakePlayerAlreadyMember(&data, p);
58  SendToOne(&data, p);
59  }
60  return;
61  }
62 
63  if (IsBanned(p))
64  {
65  MakeBanned(&data);
66  SendToOne(&data, p);
67  return;
68  }
69 
70  if (m_password.length() > 0 && strcmp(pass, m_password.c_str()))
71  {
72  MakeWrongPassword(&data);
73  SendToOne(&data, p);
74  return;
75  }
76 
77  Player* plr = sObjectMgr.GetPlayer(p);
78 
79  if (plr)
80  {
83  (plr->GetGroup() || plr->m_lookingForGroup.Empty()))
84  {
85  MakeNotInLfg(&data);
86  SendToOne(&data, p);
87  return;
88  }
89 
90  if (plr->GetGuildId() && (GetFlags() == 0x38))
91  return;
92 
93  plr->JoinedChannel(this);
94  }
95 
97  {
98  MakeJoined(&data, p);
99  SendToAll(&data);
100  }
101 
102  data.clear();
103 
104  PlayerInfo pinfo;
105  pinfo.player = p;
106  pinfo.flags = MEMBER_FLAG_NONE;
107  players[p] = pinfo;
108 
109  MakeYouJoined(&data);
110  SendToOne(&data, p);
111 
112  JoinNotify(p);
113 
114  // if no owner first logged will become
115  if (!IsConstant() && !m_ownerGUID)
116  {
117  SetOwner(p, (players.size() > 1 ? true : false));
118  players[p].SetModerator(true);
119  }
120 }
121 
122 void Channel::Leave(uint64 p, bool send)
123 {
124  if (!IsOn(p))
125  {
126  if (send)
127  {
128  WorldPacket data;
129  MakeNotMember(&data);
130  SendToOne(&data, p);
131  }
132  }
133  else
134  {
135  Player* plr = sObjectMgr.GetPlayer(p);
136 
137  if (send)
138  {
139  WorldPacket data;
140  MakeYouLeft(&data);
141  SendToOne(&data, p);
142  if (plr)
143  plr->LeftChannel(this);
144  data.clear();
145  }
146 
147  bool changeowner = players[p].IsOwner();
148 
149  players.erase(p);
150  if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld.getConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL)))
151  {
152  WorldPacket data;
153  MakeLeft(&data, p);
154  SendToAll(&data);
155  }
156 
157  LeaveNotify(p);
158 
159  if (changeowner)
160  {
161  uint64 newowner = !players.empty() ? players.begin()->second.player : 0;
162  players[newowner].SetModerator(true);
163  SetOwner(newowner);
164  }
165  }
166 }
167 
168 void Channel::KickOrBan(uint64 good, const char* badname, bool ban)
169 {
170  uint32 sec = 0;
171  Player* gplr = sObjectMgr.GetPlayer(good);
172  if (gplr)
173  sec = gplr->GetSession()->GetSecurity();
174 
175  if (!IsOn(good))
176  {
177  WorldPacket data;
178  MakeNotMember(&data);
179  SendToOne(&data, good);
180  }
181  else if (!players[good].IsModerator() && sec < SEC_GAMEMASTER)
182  {
183  WorldPacket data;
184  MakeNotModerator(&data);
185  SendToOne(&data, good);
186  }
187  else
188  {
189  Player* bad = sObjectMgr.GetPlayer(badname);
190  if (bad == NULL || !IsOn(bad->GetGUID()))
191  {
192  WorldPacket data;
193  MakePlayerNotFound(&data, badname);
194  SendToOne(&data, good);
195  }
196  else if (sec < SEC_GAMEMASTER && bad->GetGUID() == m_ownerGUID && good != m_ownerGUID)
197  {
198  WorldPacket data;
199  MakeNotOwner(&data);
200  SendToOne(&data, good);
201  }
202  else
203  {
204  bool changeowner = (m_ownerGUID == bad->GetGUID());
205 
206  WorldPacket data;
207 
208  if (ban && !IsBanned(bad->GetGUID()))
209  {
210  banned.insert(bad->GetGUID());
211  MakePlayerBanned(&data, bad->GetGUID(), good);
212  }
213  else
214  MakePlayerKicked(&data, bad->GetGUID(), good);
215 
216  SendToAll(&data);
217  players.erase(bad->GetGUID());
218  bad->LeftChannel(this);
219 
220  if (changeowner)
221  {
222  uint64 newowner = !players.empty() ? good : false;
223  players[newowner].SetModerator(true);
224  SetOwner(newowner);
225  }
226  }
227  }
228 }
229 
230 void Channel::UnBan(uint64 good, const char* badname)
231 {
232  uint32 sec = 0;
233  Player* gplr = sObjectMgr.GetPlayer(good);
234  if (gplr)
235  sec = gplr->GetSession()->GetSecurity();
236 
237  if (!IsOn(good))
238  {
239  WorldPacket data;
240  MakeNotMember(&data);
241  SendToOne(&data, good);
242  }
243  else if (!players[good].IsModerator() && sec < SEC_GAMEMASTER)
244  {
245  WorldPacket data;
246  MakeNotModerator(&data);
247  SendToOne(&data, good);
248  }
249  else
250  {
251  Player* bad = sObjectMgr.GetPlayer(badname);
252  if (bad == NULL || !IsBanned(bad->GetGUID()))
253  {
254  WorldPacket data;
255  MakePlayerNotFound(&data, badname);
256  SendToOne(&data, good);
257  }
258  else
259  {
260  banned.erase(bad->GetGUID());
261 
262  WorldPacket data;
263  MakePlayerUnbanned(&data, bad->GetGUID(), good);
264  SendToAll(&data);
265  }
266  }
267 }
268 
269 void Channel::Password(uint64 p, const char* pass)
270 {
271  uint32 sec = 0;
272  Player* plr = sObjectMgr.GetPlayer(p);
273  if (plr)
274  sec = plr->GetSession()->GetSecurity();
275 
276  if (!IsOn(p))
277  {
278  WorldPacket data;
279  MakeNotMember(&data);
280  SendToOne(&data, p);
281  }
282  else if (!players[p].IsModerator() && sec < SEC_GAMEMASTER)
283  {
284  WorldPacket data;
285  MakeNotModerator(&data);
286  SendToOne(&data, p);
287  }
288  else
289  {
290  m_password = pass;
291 
292  WorldPacket data;
293  MakePasswordChanged(&data, p);
294  SendToAll(&data);
295  }
296 }
297 
298 void Channel::SetMode(uint64 p, const char* p2n, bool mod, bool set)
299 {
300  Player* plr = sObjectMgr.GetPlayer(p);
301  if (!plr)
302  return;
303 
304  uint32 sec = plr->GetSession()->GetSecurity();
305 
306  if (!IsOn(p))
307  {
308  WorldPacket data;
309  MakeNotMember(&data);
310  SendToOne(&data, p);
311  }
312  else if (!players[p].IsModerator() && sec < SEC_GAMEMASTER)
313  {
314  WorldPacket data;
315  MakeNotModerator(&data);
316  SendToOne(&data, p);
317  }
318  else
319  {
320  Player* newp = sObjectMgr.GetPlayer(p2n);
321  if (!newp || !newp->isGMVisible())
322  {
323  WorldPacket data;
324  MakePlayerNotFound(&data, p2n);
325  SendToOne(&data, p);
326  return;
327  }
328 
329  if (p == m_ownerGUID && newp->GetGUID() == m_ownerGUID && mod)
330  return;
331 
332  if (!IsOn(newp->GetGUID()))
333  {
334  WorldPacket data;
335  MakePlayerNotFound(&data, p2n);
336  SendToOne(&data, p);
337  return;
338  }
339 
340  // allow make moderator from another team only if both is GMs
341  // at this moment this only way to show channel post for GM from another team
342  if ((plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || newp->GetSession()->GetSecurity() < SEC_GAMEMASTER) &&
343  plr->GetTeam() != newp->GetTeam() && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
344  {
345  WorldPacket data;
346  MakePlayerNotFound(&data, p2n);
347  SendToOne(&data, p);
348  return;
349  }
350 
351  if (m_ownerGUID == newp->GetGUID() && m_ownerGUID != p)
352  {
353  WorldPacket data;
354  MakeNotOwner(&data);
355  SendToOne(&data, p);
356  return;
357  }
358 
359  if (mod)
360  SetModerator(newp->GetGUID(), set);
361  else
362  SetMute(newp->GetGUID(), set);
363  }
364 }
365 
366 void Channel::SetOwner(uint64 p, const char* newname)
367 {
368  Player* plr = sObjectMgr.GetPlayer(p);
369  if (!plr)
370  return;
371 
372  uint32 sec = plr->GetSession()->GetSecurity();
373 
374  if (!IsOn(p))
375  {
376  WorldPacket data;
377  MakeNotMember(&data);
378  SendToOne(&data, p);
379  return;
380  }
381 
382  if (sec < SEC_GAMEMASTER && p != m_ownerGUID)
383  {
384  WorldPacket data;
385  MakeNotOwner(&data);
386  SendToOne(&data, p);
387  return;
388  }
389 
390  Player* newp = sObjectMgr.GetPlayer(newname);
391  if (newp == NULL || !IsOn(newp->GetGUID()))
392  {
393  WorldPacket data;
394  MakePlayerNotFound(&data, newname);
395  SendToOne(&data, p);
396  return;
397  }
398 
399  if (newp->GetTeam() != plr->GetTeam() && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
400  {
401  WorldPacket data;
402  MakePlayerNotFound(&data, newname);
403  SendToOne(&data, p);
404  return;
405  }
406 
407  players[newp->GetGUID()].SetModerator(true);
408  SetOwner(newp->GetGUID());
409 }
410 
412 {
413  if (!IsOn(p))
414  {
415  WorldPacket data;
416  MakeNotMember(&data);
417  SendToOne(&data, p);
418  }
419  else
420  {
421  WorldPacket data;
422  MakeChannelOwner(&data);
423  SendToOne(&data, p);
424  }
425 }
426 
427 void Channel::List(Player* player)
428 {
429  uint64 p = player->GetGUID();
430 
431  if (!IsOn(p))
432  {
433  WorldPacket data;
434  MakeNotMember(&data);
435  SendToOne(&data, p);
436  }
437  else
438  {
439  WorldPacket data(SMSG_CHANNEL_LIST, 1 + (GetName().size() + 1) + 1 + 4 + players.size() * (8 + 1));
440  data << uint8(1); // channel type?
441  data << GetName(); // channel name
442  data << uint8(GetFlags()); // channel flags?
443 
444  size_t pos = data.wpos();
445  data << uint32(0); // size of list, placeholder
446 
447  bool gmInWhoList = sWorld.getConfig(CONFIG_GM_IN_WHO_LIST) || player->GetSession()->GetSecurity() > SEC_PLAYER;
448 
449  uint32 count = 0;
450  for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
451  {
452  Player* plr = sObjectMgr.GetPlayer(i->first);
453 
454  // PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
455  // MODERATOR, GAME MASTER, ADMINISTRATOR can see all
456  if (plr && (plr->GetSession()->GetSecurity() == SEC_PLAYER || (gmInWhoList && plr->IsVisibleGloballyFor(player))))
457  {
458  data << uint64(i->first);
459  data << uint8(i->second.flags); // flags seems to be changed...
460  ++count;
461  }
462  }
463 
464  data.put<uint32>(pos, count);
465 
466  SendToOne(&data, p);
467  }
468 }
469 
471 {
472  uint32 sec = 0;
473  Player* plr = sObjectMgr.GetPlayer(p);
474  if (plr)
475  sec = plr->GetSession()->GetSecurity();
476 
477  if (!IsOn(p))
478  {
479  WorldPacket data;
480  MakeNotMember(&data);
481  SendToOne(&data, p);
482  }
483  else if (!players[p].IsModerator() && sec < SEC_GAMEMASTER)
484  {
485  WorldPacket data;
486  MakeNotModerator(&data);
487  SendToOne(&data, p);
488  }
489  else
490  {
492 
493  WorldPacket data;
494  if (m_announce)
495  MakeAnnouncementsOn(&data, p);
496  else
497  MakeAnnouncementsOff(&data, p);
498  SendToAll(&data);
499  }
500 }
501 
503 {
504  uint32 sec = 0;
505  Player* plr = sObjectMgr.GetPlayer(p);
506  if (plr)
507  sec = plr->GetSession()->GetSecurity();
508 
509  if (!IsOn(p))
510  {
511  WorldPacket data;
512  MakeNotMember(&data);
513  SendToOne(&data, p);
514  }
515  else if (!players[p].IsModerator() && sec < SEC_GAMEMASTER)
516  {
517  WorldPacket data;
518  MakeNotModerator(&data);
519  SendToOne(&data, p);
520  }
521  else
522  {
524 
525  WorldPacket data;
526  if (m_moderate)
527  MakeModerationOn(&data, p);
528  else
529  MakeModerationOff(&data, p);
530  SendToAll(&data);
531  }
532 }
533 
534 void Channel::Say(uint64 p, const char* what, uint32 lang)
535 {
536  if (!what)
537  return;
539  lang = LANG_UNIVERSAL;
540 
541  uint32 sec = 0;
542  Player* plr = sObjectMgr.GetPlayer(p);
543  if (plr)
544  sec = plr->GetSession()->GetSecurity();
545 
546  if (!IsOn(p))
547  {
548  WorldPacket data;
549  MakeNotMember(&data);
550  SendToOne(&data, p);
551  }
552  else if (players[p].IsMuted())
553  {
554  WorldPacket data;
555  MakeMuted(&data);
556  SendToOne(&data, p);
557  }
558  else if (m_moderate && !players[p].IsModerator() && sec < SEC_GAMEMASTER)
559  {
560  WorldPacket data;
561  MakeNotModerator(&data);
562  SendToOne(&data, p);
563  }
564  else
565  {
566  uint32 messageLength = strlen(what) + 1;
567 
568  WorldPacket data(SMSG_MESSAGECHAT, 1 + 4 + 8 + 4 + m_name.size() + 1 + 8 + 4 + messageLength + 1);
569  data << (uint8)CHAT_MSG_CHANNEL;
570  data << (uint32)lang;
571  data << p; // 2.1.0
572  data << uint32(0); // 2.1.0
573  data << m_name;
574  data << p;
575  data << messageLength;
576  data << what;
577  data << uint8(plr ? plr->GetChatTag() : 0);
578 
579  SendToAll(&data, !players[p].IsModerator() ? p : false);
580  }
581 }
582 
583 void Channel::Invite(uint64 p, const char* newname)
584 {
585  if (!IsOn(p))
586  {
587  WorldPacket data;
588  MakeNotMember(&data);
589  SendToOne(&data, p);
590  return;
591  }
592 
593  Player* newp = sObjectMgr.GetPlayer(newname);
594  if (!newp)
595  {
596  WorldPacket data;
597  MakePlayerNotFound(&data, newname);
598  SendToOne(&data, p);
599  return;
600  }
601 
602  Player* plr = sObjectMgr.GetPlayer(p);
603  if (!plr)
604  return;
605 
606  if (newp->GetTeam() != plr->GetTeam() && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
607  {
608  WorldPacket data;
609  MakeInviteWrongFaction(&data);
610  SendToOne(&data, p);
611  return;
612  }
613 
614  if (IsOn(newp->GetGUID()))
615  {
616  WorldPacket data;
617  MakePlayerAlreadyMember(&data, newp->GetGUID());
618  SendToOne(&data, p);
619  return;
620  }
621 
622  WorldPacket data;
623  if (!newp->GetSocial()->HasIgnore(GUID_LOPART(p)))
624  {
625  MakeInvite(&data, p);
626  SendToOne(&data, newp->GetGUID());
627  data.clear();
628  }
629  MakePlayerInvited(&data, newp->GetName());
630  SendToOne(&data, p);
631 }
632 
633 void Channel::SetOwner(uint64 guid, bool exclaim)
634 {
635  if (m_ownerGUID)
636  {
637  // [] will re-add player after it possible removed
638  PlayerList::iterator p_itr = players.find(m_ownerGUID);
639  if (p_itr != players.end())
640  p_itr->second.SetOwner(false);
641  }
642 
643  m_ownerGUID = guid;
644  if (m_ownerGUID)
645  {
646  uint8 oldFlag = GetPlayerFlags(m_ownerGUID);
647  players[m_ownerGUID].SetModerator(true);
648  players[m_ownerGUID].SetOwner(true);
649 
650  WorldPacket data;
651  MakeModeChange(&data, m_ownerGUID, oldFlag);
652  SendToAll(&data);
653 
654  if (exclaim)
655  {
657  SendToAll(&data);
658  }
659  }
660 }
661 
663 {
664  for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
665  {
666  Player* plr = sObjectMgr.GetPlayer(i->first, true);
667  if (plr)
668  {
669  if (!p || !plr->GetSocial()->HasIgnore(GUID_LOPART(p)))
670  plr->GetSession()->SendPacket(data);
671  }
672  }
673 }
674 
676 {
677  for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
678  {
679  if (i->first != who)
680  {
681  Player* plr = sObjectMgr.GetPlayer(i->first);
682  if (plr)
683  plr->GetSession()->SendPacket(data);
684  }
685  }
686 }
687 
689 {
690  Player* plr = sObjectMgr.GetPlayer(who);
691  if (plr)
692  plr->GetSession()->SendPacket(data);
693 }
694 
695 void Channel::Voice(uint64 /*guid1*/, uint64 /*guid2*/)
696 {
697 
698 }
699 
700 void Channel::DeVoice(uint64 /*guid1*/, uint64 /*guid2*/)
701 {
702 
703 }
704 
705 // done
707 {
708  data->Initialize(SMSG_CHANNEL_NOTIFY, 1 + m_name.size() + 1);
709  *data << uint8(notify_type);
710  *data << m_name;
711 }
712 
713 // done 0x00
715 {
717  *data << uint64(guid);
718 }
719 
720 // done 0x01
722 {
724  *data << uint64(guid);
725 }
726 
727 // done 0x02
729 {
731  *data << uint8(GetFlags());
732  *data << uint32(GetChannelId());
733  *data << uint32(0);
734 }
735 
736 // done 0x03
738 {
740  *data << uint32(GetChannelId());
741  *data << uint8(0); // can be 0x00 and 0x01
742 }
743 
744 // done 0x04
746 {
748 }
749 
750 // done 0x05
752 {
754 }
755 
756 // done 0x06
758 {
760 }
761 
762 // done 0x07
764 {
766  *data << uint64(guid);
767 }
768 
769 // done 0x08
771 {
773  *data << uint64(guid);
774 }
775 
776 // done 0x09
777 void Channel::MakePlayerNotFound(WorldPacket* data, const std::string& name)
778 {
780  *data << name;
781 }
782 
783 // done 0x0A
785 {
787 }
788 
789 // done 0x0B
791 {
792  std::string name = "";
793 
794  if (!sObjectMgr.GetPlayerNameByGUID(m_ownerGUID, name) || name.empty())
795  name = "PLAYER_NOT_FOUND";
796 
798  *data << ((IsConstant() || !m_ownerGUID) ? "Nobody" : name);
799 }
800 
801 // done 0x0C
802 void Channel::MakeModeChange(WorldPacket* data, uint64 guid, uint8 oldflags)
803 {
805  *data << uint64(guid);
806  *data << uint8(oldflags);
807  *data << uint8(GetPlayerFlags(guid));
808 }
809 
810 // done 0x0D
812 {
814  *data << uint64(guid);
815 }
816 
817 // done 0x0E
819 {
821  *data << uint64(guid);
822 }
823 
824 // done 0x0F
826 {
828  *data << uint64(guid);
829 }
830 
831 // done 0x10
833 {
835  *data << uint64(guid);
836 }
837 
838 // done 0x11
840 {
842 }
843 
844 // done 0x12
846 {
848  *data << uint64(bad);
849  *data << uint64(good);
850 }
851 
852 // done 0x13
854 {
856 }
857 
858 // done 0x14
860 {
862  *data << uint64(bad);
863  *data << uint64(good);
864 }
865 
866 // done 0x15
868 {
870  *data << uint64(bad);
871  *data << uint64(good);
872 }
873 
874 // done 0x16
876 {
878  *data << uint64(guid);
879 }
880 
881 // done 0x17
883 {
885  *data << uint64(guid);
886 }
887 
888 // done 0x18
890 {
892  *data << uint64(guid);
893 }
894 
895 // done 0x19
897 {
899 }
900 
901 // done 0x1A
903 {
905 }
906 
907 // done 0x1B
909 {
911 }
912 
913 // done 0x1C
915 {
917 }
918 
919 // done 0x1D
920 void Channel::MakePlayerInvited(WorldPacket* data, const std::string& name)
921 {
923  *data << name;
924 }
925 
926 // done 0x1E
928 {
930  *data << uint64(guid);
931 }
932 
933 // done 0x1F
935 {
937 }
938 
939 // done 0x20
941 {
943 }
944 
945 // done 0x21
947 {
949 }
950 
951 // done 0x22
953 {
955  *data << uint64(guid);
956 }
957 
958 // done 0x23
960 {
962  *data << uint64(guid);
963 }
964 
966 {
967  WorldPacket data;
968 
969  if (IsConstant())
970  data.Initialize(SMSG_USERLIST_ADD, 8 + 1 + 1 + 4 + GetName().size() + 1);
971  else
972  data.Initialize(SMSG_USERLIST_UPDATE, 8 + 1 + 1 + 4 + GetName().size() + 1);
973 
974  data << uint64(guid);
975  data << uint8(GetPlayerFlags(guid));
976  data << uint8(GetFlags());
977  data << uint32(GetNumPlayers());
978  data << GetName();
979  SendToAll(&data);
980 }
981 
983 {
984  WorldPacket data(SMSG_USERLIST_REMOVE, 8 + 1 + 4 + GetName().size() + 1);
985  data << uint64(guid);
986  data << uint8(GetFlags());
987  data << uint32(GetNumPlayers());
988  data << GetName();
989  SendToAll(&data);
990 }
991 
void MakeVoiceOn(WorldPacket *data, uint64 guid)
Definition: Channel.cpp:952
void SetMute(uint64 p, bool set)
Definition: Channel.h:251
Group * GetGroup()
Definition: Player.h:2589
void SetOwner(uint64 p, bool exclaim=true)
Definition: Channel.cpp:633
uint32 GetChannelId() const
Definition: Channel.h:270
void Moderate(uint64 p)
Definition: Channel.cpp:502
void MakeJoined(WorldPacket *data, uint64 guid)
Definition: Channel.cpp:714
#define GUID_LOPART(x)
Definition: ObjectGuid.h:110
void LeaveNotify(uint64 guid)
Definition: Channel.cpp:982
void Join(uint64 p, const char *pass)
Definition: Channel.cpp:50
void MakePlayerNotFound(WorldPacket *data, const std::string &name)
Definition: Channel.cpp:777
bool IsOn(uint64 who) const
Definition: Channel.h:219
void Leave(uint64 p, bool send=true)
Definition: Channel.cpp:122
bool IsBanned(const uint64 guid) const
Definition: Channel.h:224
uint8 GetPlayerFlags(uint64 p) const
Definition: Channel.h:229
std::string m_password
Definition: Channel.h:169
bool isGMVisible() const
Definition: Player.h:1032
void JoinNotify(uint64 guid)
Definition: Channel.cpp:965
void DeVoice(uint64 guid1, uint64 guid2)
Definition: Channel.cpp:700
bool HasIgnore(uint32 ignore_guid)
Definition: SocialMgr.cpp:162
void MakeLeft(WorldPacket *data, uint64 guid)
Definition: Channel.cpp:721
void SetModerator(uint64 p, bool set)
Definition: Channel.h:238
void MakeWrongFaction(WorldPacket *data)
Definition: Channel.cpp:902
ChatChannelsEntry const * GetChannelEntryFor(uint32 channel_id)
Definition: DBCStores.cpp:682
void SendToAllButOne(WorldPacket *data, uint64 who)
Definition: Channel.cpp:675
void Voice(uint64 guid1, uint64 guid2)
Definition: Channel.cpp:695
void MakePlayerUnbanned(WorldPacket *data, uint64 bad, uint64 good)
Definition: Channel.cpp:867
bool HasFlag(uint8 flag)
Definition: Channel.h:306
NULL Dbg ErrDB Arena Chat Char Map MMap false
Definition: Log.cpp:556
void MakeNotifyPacket(WorldPacket *data, uint8 notify_type)
Definition: Channel.cpp:706
void Initialize(uint16 opcode, size_t newres=200)
Definition: WorldPacket.h:37
void MakeWrongPassword(WorldPacket *data)
Definition: Channel.cpp:745
void MakeNotModerated(WorldPacket *data)
Definition: Channel.cpp:914
bool m_announce
Definition: Channel.h:167
void MakeModerationOff(WorldPacket *data, uint64 guid)
Definition: Channel.cpp:832
BannedList banned
Definition: Channel.h:165
#define sObjectMgr
Definition: ObjectMgr.h:1285
void SendPacket(WorldPacket const *packet)
void Invite(uint64 p, const char *newp)
Definition: Channel.cpp:583
void MakeNotInArea(WorldPacket *data)
Definition: Channel.cpp:940
void SendWhoOwner(uint64 p)
Definition: Channel.cpp:411
void MakeInvite(WorldPacket *data, uint64 guid)
Definition: Channel.cpp:889
uint8 m_flags
Definition: Channel.h:170
void MakePlayerKicked(WorldPacket *data, uint64 bad, uint64 good)
Definition: Channel.cpp:845
bool Empty() const
Definition: Player.h:320
void Say(uint64 p, const char *what, uint32 lang)
Definition: Channel.cpp:534
void UnBan(uint64 good, const char *badname)
Definition: Channel.cpp:230
size_t wpos() const
Definition: ByteBuffer.h:264
void MakePlayerInviteBanned(WorldPacket *data, uint64 guid)
Definition: Channel.cpp:927
ACE_UINT8 uint8
Definition: Define.h:73
PlayerSocial * GetSocial()
Definition: Player.h:985
void MakeModerationOn(WorldPacket *data, uint64 guid)
Definition: Channel.cpp:825
void MakeVoiceOff(WorldPacket *data, uint64 guid)
Definition: Channel.cpp:959
void MakeAnnouncementsOn(WorldPacket *data, uint64 guid)
Definition: Channel.cpp:811
bool IsVisibleGloballyFor(Player *pl) const
Definition: Player.cpp:18711
void MakeThrottled(WorldPacket *data)
Definition: Channel.cpp:934
uint32 GetNumPlayers() const
Definition: Channel.h:298
void put(size_t pos, T value)
Definition: ByteBuffer.h:79
LookingForGroup m_lookingForGroup
Definition: Player.h:2498
uint8 GetChatTag() const
Definition: Player.cpp:1542
bool IsConstant() const
Definition: Channel.h:274
void MakeYouJoined(WorldPacket *data)
Definition: Channel.cpp:728
void LeftChannel(Channel *c)
Definition: Player.cpp:4655
void MakeYouLeft(WorldPacket *data)
Definition: Channel.cpp:737
void SendToAll(WorldPacket *data, uint64 p=0)
Definition: Channel.cpp:662
void MakeMuted(WorldPacket *data)
Definition: Channel.cpp:839
void MakeChannelOwner(WorldPacket *data)
Definition: Channel.cpp:790
void MakeInvalidName(WorldPacket *data)
Definition: Channel.cpp:908
void MakeModeChange(WorldPacket *data, uint64 guid, uint8 oldflags)
Definition: Channel.cpp:802
void MakePlayerBanned(WorldPacket *data, uint64 bad, uint64 good)
Definition: Channel.cpp:859
void MakeOwnerChanged(WorldPacket *data, uint64 guid)
Definition: Channel.cpp:770
uint32 GetGuildId()
Definition: Player.h:1837
const char * GetName() const
Definition: Object.h:692
ACE_UINT64 uint64
Definition: Define.h:70
void MakePlayerAlreadyMember(WorldPacket *data, uint64 guid)
Definition: Channel.cpp:882
PlayerList players
Definition: Channel.h:163
void MakeNotInLfg(WorldPacket *data)
Definition: Channel.cpp:946
Channel(const std::string &name, uint32 channel_id)
Definition: Channel.cpp:23
void KickOrBan(uint64 good, const char *badname, bool ban)
Definition: Channel.cpp:168
void JoinedChannel(Channel *c)
Definition: Player.cpp:4650
void MakePlayerInvited(WorldPacket *data, const std::string &name)
Definition: Channel.cpp:920
void Password(uint64 p, const char *pass)
Definition: Channel.cpp:269
std::string m_name
Definition: Channel.h:166
void Announce(uint64 p)
Definition: Channel.cpp:470
uint32 GetTeam() const
Definition: Player.h:2075
void MakePasswordChanged(WorldPacket *data, uint64 guid)
Definition: Channel.cpp:763
void List(Player *p)
Definition: Channel.cpp:427
void MakeNotMember(WorldPacket *data)
Definition: Channel.cpp:751
void MakeAnnouncementsOff(WorldPacket *data, uint64 guid)
Definition: Channel.cpp:818
WorldSession * GetSession() const
Definition: Player.h:1959
#define sWorld
Definition: World.h:860
void uint32 GetSecurity() const
Definition: WorldSession.h:96
void SetMode(uint64 p, const char *p2n, bool mod, bool set)
Definition: Channel.cpp:298
ACE_UINT32 uint32
Definition: Define.h:71
void MakeBanned(WorldPacket *data)
Definition: Channel.cpp:853
void SendToOne(WorldPacket *data, uint64 who)
Definition: Channel.cpp:688
void MakeNotModerator(WorldPacket *data)
Definition: Channel.cpp:757
true
Definition: Log.cpp:534
void MakeNotOwner(WorldPacket *data)
Definition: Channel.cpp:784
void MakePlayerNotBanned(WorldPacket *data, uint64 guid)
Definition: Channel.cpp:875
void MakeInviteWrongFaction(WorldPacket *data)
Definition: Channel.cpp:896
Definition: Player.h:922
uint8 GetFlags() const
Definition: Channel.h:302
void clear()
Definition: ByteBuffer.h:73
uint64 m_ownerGUID
Definition: Channel.h:172
std::string GetName() const
Definition: Channel.h:266
bool m_moderate
Definition: Channel.h:168
const uint64 & GetGUID() const
Definition: Object.h:156