Beispiel #1
0
        private static void HandleGuildNotice(GameSession session, PacketReader packet)
        {
            packet.ReadByte();
            string notice = packet.ReadUnicodeString();

            Guild guild = GameServer.GuildManager.GetGuildById(session.Player.Guild.Id);

            if (guild == null)
            {
                return;
            }

            GuildMember member = guild.Members.FirstOrDefault(x => x.Player == session.Player);

            if (member == null)
            {
                return;
            }

            if (!((GuildRights)guild.Ranks[member.Rank].Rights).HasFlag(GuildRights.CanGuildNotice))
            {
                return;
            }

            session.Send(GuildPacket.GuildNoticeConfirm(notice));
            guild.BroadcastPacketGuild(GuildPacket.GuildNoticeChange(session.Player, notice));
        }