Exemplo n.º 1
0
        private static void HandleRankChange(GameSession session, PacketReader packet)
        {
            string memberName = packet.ReadUnicodeString();
            byte   rank       = packet.ReadByte();

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

            if (guild == null || session.Player.CharacterId != guild.LeaderCharacterId)
            {
                return;
            }

            GuildMember member = guild.Members.First(x => x.Player.Name == memberName);

            if (member == null || member.Rank == rank)
            {
                return;
            }

            member.Rank = rank;
            session.Send(GuildPacket.RankChangeConfirm(memberName, rank));
            guild.BroadcastPacketGuild(GuildPacket.RankChangeNotice(session.Player.Name, memberName, rank));
        }