Ejemplo n.º 1
0
    def handle(world_session, socket, reader):
        if len(reader.data) > 1:  # Avoid handling empty Guild Demote packet.
            target_name = PacketReader.read_string(reader.data, 0).strip()
            target_player_mgr = RealmDatabaseManager.character_get_by_name(
                target_name)
            player_mgr = world_session.player_mgr

            if not player_mgr.guild_manager:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, '',
                    GuildCommandResults.GUILD_PLAYER_NOT_IN_GUILD)
            elif player_mgr.guild_manager.get_rank(
                    player_mgr.guid) > GuildRank.GUILDRANK_OFFICER:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, '',
                    GuildCommandResults.GUILD_PERMISSIONS)
            elif not target_player_mgr:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, target_name,
                    GuildCommandResults.GUILD_PLAYER_NOT_FOUND)
            elif not player_mgr.guild_manager.has_member(
                    target_player_mgr.guid):
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, target_name,
                    GuildCommandResults.GUILD_PLAYER_NOT_IN_GUILD)
            elif not player_mgr.guild_manager.demote_rank(
                    target_player_mgr.guid):
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, '',
                    GuildCommandResults.GUILD_INTERNAL)

        return 0
Ejemplo n.º 2
0
    def handle(world_session, socket, reader):
        player = world_session.player_mgr

        if not player.guild_manager:
            GuildManager.send_guild_command_result(
                player, GuildTypeCommand.GUILD_CREATE_S, '',
                GuildCommandResults.GUILD_PLAYER_NOT_IN_GUILD)
        else:
            guild_name = PacketWriter.string_to_bytes(
                player.guild_manager.guild.name)
            data = pack(f'<{len(guild_name)}s', guild_name)

            # Members count
            data += pack('<I', len(player.guild_manager.members))
            accounts = RealmDatabaseManager.guild_get_accounts(
                guild_id=player.guild_manager.guild.guild_id)
            data += pack('<I', len(accounts))

            for member in player.guild_manager.members.values():
                player_name = PacketWriter.string_to_bytes(
                    member.character.name)
                data += pack(f'<{len(player_name)}sI', player_name,
                             member.rank)

            player.enqueue_packet(
                PacketWriter.get_packet(OpCode.SMSG_GUILD_ROSTER, data))

        return 0
Ejemplo n.º 3
0
    def send_guild(sender, message, lang, chat_type):
        if sender.guild_manager:
            sender_packet = ChatManager._get_message_packet(
                sender.guid, sender.chat_flags, message, chat_type, lang)

            if chat_type == ChatMsgs.CHAT_MSG_GUILD:
                sender.guild_manager.send_message_to_guild(
                    sender_packet,
                    GuildChatMessageTypes.G_MSGTYPE_ALL,
                    source=sender)
            else:
                if sender.guild_manager.get_rank(
                        sender.guid) > GuildRank.GUILDRANK_OFFICER:
                    GuildManager.send_guild_command_result(
                        sender, GuildTypeCommand.GUILD_CREATE_S, '',
                        GuildCommandResults.GUILD_PERMISSIONS)
                else:
                    sender.guild_manager.send_message_to_guild(
                        sender_packet,
                        GuildChatMessageTypes.G_MSGTYPE_OFFICERCHAT,
                        source=sender)
        else:
            GuildManager.send_guild_command_result(
                sender, GuildTypeCommand.GUILD_CREATE_S, '',
                GuildCommandResults.GUILD_PLAYER_NOT_IN_GUILD)
Ejemplo n.º 4
0
    def handle(world_session, socket, reader):
        if len(reader.data) > 1:  # Avoid handling empty Guild Create packet.
            if not world_session.player_mgr.is_gm:
                return 0
            guild_name = PacketReader.read_string(reader.data, 0).strip()
            player_mgr = world_session.player_mgr
            GuildManager.create_guild(player_mgr, guild_name)

        return 0
Ejemplo n.º 5
0
    def load_guilds():
        guilds = RealmDatabaseManager.guild_get_all()
        length = len(guilds)
        count = 0

        for guild in guilds:
            if guild.name not in GuildManager.GUILDS:
                GuildManager.load_guild(guild)

                count += 1
                Logger.progress('Loading guilds...', count, length)

        return length
Ejemplo n.º 6
0
    def handle(world_session, socket, reader):
        player_mgr = world_session.player_mgr

        if not player_mgr.guild_manager:
            GuildManager.send_guild_command_result(player_mgr, GuildTypeCommand.GUILD_CREATE_S, '',
                                                   GuildCommandResults.GUILD_PLAYER_NOT_IN_GUILD)
        elif player_mgr.guild_manager.get_rank(player_mgr.guid) != GuildRank.GUILDRANK_GUILD_MASTER:
            GuildManager.send_guild_command_result(player_mgr, GuildTypeCommand.GUILD_FOUNDER_S, '',
                                                   GuildCommandResults.GUILD_PERMISSIONS)
        else:
            player_mgr.guild_manager.disband()

        return 0
    def handle(world_session, socket, reader):
        player_mgr = world_session.player_mgr

        if player_mgr.guid in GuildManager.PENDING_INVITES:
            inviter = GuildManager.PENDING_INVITES[player_mgr.guid].inviter
            GuildManager.PENDING_INVITES.pop(player_mgr.guid)
            if inviter and inviter.guild_manager:  # Invited could have left right after sending the invite.
                inviter.guild_manager.add_new_member(player_mgr)
        else:
            GuildManager.send_guild_command_result(
                player_mgr, GuildTypeCommand.GUILD_INVITE_S, '',
                GuildCommandResults.GUILD_INTERNAL)

        return 0
Ejemplo n.º 8
0
    def handle(world_session, socket, reader):
        player = world_session.player_mgr

        if not player.guild_manager:
            GuildManager.send_guild_command_result(player, GuildTypeCommand.GUILD_INVITE_S, '',
                                                   GuildCommandResults.GUILD_PLAYER_NOT_IN_GUILD)
        elif player.guild_manager.get_rank(player.guid) == GuildRank.GUILDRANK_GUILD_MASTER and player.guild_manager.has_members():  # GM should use disband.
            GuildManager.send_guild_command_result(player, GuildTypeCommand.GUILD_QUIT_S, '',
                                                   GuildCommandResults.GUILD_LEADER_LEAVE)
        elif player.guild_manager.get_rank(player.guid) == GuildRank.GUILDRANK_GUILD_MASTER and not player.guild_manager.has_members():
            player.guild_manager.disband()
        else:
            player.guild_manager.leave(player.guid)

        return 0
Ejemplo n.º 9
0
 def turn_in_petition(player_mgr, petition_owner, petition):
     if petition and petition_owner:
         if petition_owner != player_mgr.guid:
             PetitionManager.send_petition_sign_result(
                 player_mgr, PetitionError.PETITION_CHARTER_CREATOR)
         elif len(petition.characters) < 9:
             PetitionManager.send_petition_sign_result(
                 player_mgr, PetitionError.PETITION_NOT_ENOUGH_SIGNATURES)
         elif player_mgr.guild_manager:
             PetitionManager.send_petition_sign_result(
                 player_mgr, PetitionError.PETITION_ALREADY_IN_GUILD)
         else:
             # If not able to create a guild, GuildManager will report the error.
             if GuildManager.create_guild(player_mgr,
                                          petition.name,
                                          petition=petition):
                 data = pack('<I', PetitionError.PETITION_SUCCESS)
                 packet = PacketWriter.get_packet(
                     OpCode.SMSG_TURN_IN_PETITION_RESULTS, data)
                 player_mgr.enqueue_packet(packet)
                 player_mgr.inventory.remove_item(
                     PetitionManager.CHARTER_ENTRY, 1)
                 RealmDatabaseManager.guild_petition_destroy(petition)
     else:
         PetitionManager.send_petition_sign_result(
             player_mgr, PetitionError.PETITION_UNKNOWN_ERROR)
Ejemplo n.º 10
0
    def handle(world_session, socket, reader):
        if reader.data:  # Handle null data.
            motd = PacketReader.read_string(reader.data, 0).strip()
            player_mgr = world_session.player_mgr

            if not player_mgr.guild_manager:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, '',
                    GuildCommandResults.GUILD_PLAYER_NOT_IN_GUILD)
            elif player_mgr.guild_manager.get_rank(
                    player_mgr.guid) > GuildRank.GUILDRANK_OFFICER:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, '',
                    GuildCommandResults.GUILD_PERMISSIONS)
            else:
                player_mgr.guild_manager.set_motd(motd)
        elif world_session.player_mgr.guild_manager:
            world_session.player_mgr.guild_manager.send_motd(
                world_session.player_mgr)

        return 0
Ejemplo n.º 11
0
    def handle(world_session, socket, reader):
        if len(reader.data) >= 16:  # Avoid handling empty petition offer packet.
            petition_item_guid, target_player_guid = unpack('<2Q', reader.data[:16])
            target_player_mgr = WorldSessionStateHandler.find_player_by_guid(target_player_guid)
            if petition_item_guid > 0:
                if not target_player_mgr:
                    GuildManager.send_guild_command_result(world_session.player_mgr, GuildTypeCommand.GUILD_INVITE_S,
                                                           'Player',
                                                           GuildCommandResults.GUILD_PLAYER_NOT_FOUND)
                elif target_player_mgr.guild_manager:
                    GuildManager.send_guild_command_result(world_session.player_mgr, GuildTypeCommand.GUILD_INVITE_S,
                                                           target_player_mgr.player.name,
                                                           GuildCommandResults.GUILD_ALREADY_IN_GUILD)
                if target_player_mgr.team != world_session.player_mgr.team:
                    GuildManager.send_guild_command_result(world_session.player_mgr, GuildTypeCommand.GUILD_INVITE_S,
                                                           '',
                                                           GuildCommandResults.GUILD_NOT_ALLIED)
                else:
                    petition = PetitionManager.get_petition(petition_item_guid)
                    if petition:
                        packet = PetitionManager.build_signatures_packet(petition)
                        target_player_mgr.enqueue_packet(packet)
                    else:
                        PetitionManager.send_petition_sign_result(world_session.player_mgr, PetitionError.PETITION_UNKNOWN_ERROR)

        return 0
Ejemplo n.º 12
0
    def handle(world_session, socket, reader):
        # TODO: TabardVendor wont allow you to define a new emblem after you have already one. Intended?
        if len(reader.data
               ) >= 20:  # Avoid handling empty guild save emblem packet.
            style, color, border_style, border_color, background_color = unpack(
                '<5I', reader.data[:20])

            if not world_session.player_mgr.guild_manager:
                GuildManager.send_emblem_result(
                    world_session.player_mgr,
                    GuildEmblemResult.ERR_GUILDEMBLEM_NOGUILD)
            elif world_session.player_mgr.guild_manager.get_rank(
                    world_session.player_mgr.guid
            ) != GuildRank.GUILDRANK_GUILD_MASTER:
                GuildManager.send_emblem_result(
                    world_session.player_mgr,
                    GuildEmblemResult.ERR_GUILDEMBLEM_NOTGUILDMASTER)
            elif world_session.player_mgr.coinage <= EMBLEM_COST:
                GuildManager.send_emblem_result(
                    world_session.player_mgr,
                    GuildEmblemResult.ERR_GUILDEMBLEM_NOTENOUGHMONEY)
            else:
                world_session.player_mgr.guild_manager.modify_emblem(
                    world_session.player_mgr, style, color, border_style,
                    border_color, background_color)
                world_session.player_mgr.mod_money(-EMBLEM_COST)
                world_session.player_mgr.set_dirty_inventory()

        return 0
Ejemplo n.º 13
0
    def handle(world_session, socket, reader):
        if reader.data:  # Handle null data.
            motd = PacketReader.read_string(reader.data, 0).strip()
            player_mgr = world_session.player_mgr

            if not player_mgr.guild_manager:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, '',
                    GuildCommandResults.GUILD_PLAYER_NOT_IN_GUILD)
            # Only Guild Masters could set the Guild MotD in 0.5.3.
            # 0.5.4 patch notes: "Guild officers are now able to set a "Guild Message of the Day.""
            elif player_mgr.guild_manager.get_rank(
                    player_mgr.guid) > GuildRank.GUILDRANK_GUILD_MASTER:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, '',
                    GuildCommandResults.GUILD_PERMISSIONS)
            else:
                player_mgr.guild_manager.set_motd(motd)
        elif world_session.player_mgr.guild_manager:
            world_session.player_mgr.guild_manager.send_motd(
                world_session.player_mgr)

        return 0
Ejemplo n.º 14
0
    def handle(world_session, socket, reader):
        player = world_session.player_mgr

        if not player.guild_manager:
            GuildManager.send_guild_command_result(
                player, GuildTypeCommand.GUILD_CREATE_S, '',
                GuildCommandResults.GUILD_PLAYER_NOT_IN_GUILD)
        else:
            # Guild name
            name_bytes = PacketWriter.string_to_bytes(
                player.guild_manager.guild.name)
            data = pack(f'<{len(name_bytes)}s', name_bytes)

            accounts = RealmDatabaseManager.guild_get_accounts(
                guild_id=player.guild_manager.guild.guild_id)
            creation_date = player.guild_manager.guild.creation_date
            # Day, Month, Years, Players, Nº Accounts
            data += pack('<5I', creation_date.day, creation_date.month,
                         creation_date.year, len(player.guild_manager.members),
                         len(accounts))
            player.enqueue_packet(
                PacketWriter.get_packet(OpCode.SMSG_GUILD_INFO, data))

        return 0
Ejemplo n.º 15
0
    def handle(world_session, socket, reader):
        if len(reader.data) >= 28:  # Avoid handling empty petition buy packet.
            npc_guid = unpack('<Q', reader.data[:8])[0]
            guild_name = PacketReader.read_string(reader.data, 20)

            if npc_guid > 0:
                if world_session.player_mgr.guild_manager:
                    GuildManager.send_guild_command_result(
                        world_session.player_mgr,
                        GuildTypeCommand.GUILD_CREATE_S, '',
                        GuildCommandResults.GUILD_ALREADY_IN_GUILD)
                elif not TextChecker.valid_text(guild_name, is_guild=True):
                    GuildManager.send_guild_command_result(
                        world_session.player_mgr,
                        GuildTypeCommand.GUILD_CREATE_S, '',
                        GuildCommandResults.GUILD_NAME_INVALID)
                elif guild_name in GuildManager.GUILDS or RealmDatabaseManager.guild_petition_get_by_name(
                        guild_name):
                    GuildManager.send_guild_command_result(
                        world_session.player_mgr,
                        GuildTypeCommand.GUILD_CREATE_S, guild_name,
                        GuildCommandResults.GUILD_NAME_EXISTS)
                elif world_session.player_mgr.inventory.get_item_count(
                        PetitionManager.CHARTER_ENTRY) > 0:
                    world_session.player_mgr.inventory.send_buy_error(
                        BuyResults.BUY_ERR_CANT_CARRY_MORE,
                        PetitionManager.CHARTER_ENTRY, npc_guid, 1)
                elif world_session.player_mgr.coinage <= PetitionManager.CHARTER_COST:
                    world_session.player_mgr.inventory.send_buy_error(
                        BuyResults.BUY_ERR_NOT_ENOUGH_MONEY,
                        PetitionManager.CHARTER_ENTRY, npc_guid, 1)
                elif world_session.player_mgr.inventory.add_item(
                        PetitionManager.CHARTER_ENTRY, handle_error=False):
                    petition_item = world_session.player_mgr.inventory.get_first_item_by_entry(
                        PetitionManager.CHARTER_ENTRY)
                    petition = PetitionManager.create_petition(
                        world_session.player_mgr.guid, guild_name,
                        petition_item.guid)
                    # We bind this petition to the charter guild item, else its just a dummy item for the client.
                    petition_item.set_enchantment(
                        EnchantmentSlots.PermanentSlot, petition.petition_id,
                        0, 0)
                    world_session.player_mgr.mod_money(
                        -PetitionManager.CHARTER_COST)

        return 0
Ejemplo n.º 16
0
    def handle(world_session, socket, reader):
        if len(reader.data) > 1:  # Avoid handling empty Guild Invite packet.
            target_name = PacketReader.read_string(reader.data, 0).strip()
            target_player_mgr = WorldSessionStateHandler.find_player_by_name(
                target_name)
            player_mgr = world_session.player_mgr

            if not player_mgr.guild_manager:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, '',
                    GuildCommandResults.GUILD_PLAYER_NOT_IN_GUILD)
            elif player_mgr.guild_manager.get_rank(
                    player_mgr.guid) > GuildRank.GUILDRANK_OFFICER:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, '',
                    GuildCommandResults.GUILD_PERMISSIONS)
            elif not target_player_mgr:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, target_name,
                    GuildCommandResults.GUILD_PLAYER_NOT_FOUND)
            elif target_player_mgr.guild_manager:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, target_name,
                    GuildCommandResults.GUILD_ALREADY_IN_GUILD)
            elif target_player_mgr.team != player_mgr.team:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, '',
                    GuildCommandResults.GUILD_NOT_ALLIED)
            else:
                if player_mgr.guild_manager.invite_member(
                        player_mgr, target_player_mgr):
                    GuildManager.send_guild_command_result(
                        player_mgr, GuildTypeCommand.GUILD_INVITE_S,
                        target_name, GuildCommandResults.GUILD_U_HAVE_INVITED)

                    name_bytes = PacketWriter.string_to_bytes(
                        player_mgr.player.name)
                    data = pack(f'<{len(name_bytes)}s', name_bytes)

                    guild_name_bytes = PacketWriter.string_to_bytes(
                        player_mgr.guild_manager.guild.name)
                    data += pack(f'<{len(guild_name_bytes)}s',
                                 guild_name_bytes)

                    target_player_mgr.enqueue_packet(
                        PacketWriter.get_packet(OpCode.SMSG_GUILD_INVITE,
                                                data))

        return 0
Ejemplo n.º 17
0
    def handle(world_session, socket, reader: PacketReader) -> int:
        if len(reader.data) < 8:  # Avoid handling wrong player login packet.
            return -1

        guid = unpack('<Q', reader.data[:8])[0]

        world_session.player_mgr = PlayerManager(
            RealmDatabaseManager.character_get_by_guid(guid), world_session)

        if not world_session.player_mgr.player:
            Logger.anticheat(
                f'Character with wrong guid ({guid}) tried to login.')
            return -1
        else:
            WorldSessionStateHandler.push_active_player_session(world_session)

        # Disabled race & class checks (only if not a GM).
        if not world_session.player_mgr.is_gm:
            disabled_race_mask = config.Server.General.disabled_race_mask
            disabled = disabled_race_mask & world_session.player_mgr.race_mask == world_session.player_mgr.race_mask

            if not disabled:
                disabled_class_mask = config.Server.General.disabled_class_mask
                disabled = disabled_class_mask & world_session.player_mgr.class_mask == world_session.player_mgr.class_mask

            if disabled:
                # Not 100% sure if CHAR_LOGIN_DISABLED matters here, but I don't know where else to send it.
                data = pack('<B', CharLogin.CHAR_LOGIN_DISABLED)
                world_session.enqueue_packet(
                    PacketWriter.get_packet(OpCode.SMSG_CHARACTER_LOGIN_FAILED,
                                            data))
                return 0

        # Class & race allowed, continue with the login process.

        world_session.enqueue_packet(
            PacketWriter.get_packet(OpCode.SMSG_LOGIN_SETTIMESPEED,
                                    PlayerLoginHandler._get_login_timespeed()))

        world_session.player_mgr.skill_manager.load_proficiencies()
        world_session.player_mgr.skill_manager.load_skills()
        world_session.player_mgr.spell_manager.load_spells()

        world_session.player_mgr.deathbind = RealmDatabaseManager.character_get_deathbind(
            world_session.player_mgr.guid)
        world_session.player_mgr.friends_manager.load_from_db(
            RealmDatabaseManager.character_get_social(
                world_session.player_mgr.guid))

        # Only send the deathbind packet if it's a Binder NPC what bound the player.
        if world_session.player_mgr.deathbind.creature_binder_guid > 0:
            world_session.enqueue_packet(
                world_session.player_mgr.get_deathbind_packet())
        # Tutorials aren't implemented in 0.5.3.
        # world_session.enqueue_packet(world_session.player_mgr.get_tutorial_packet())
        world_session.enqueue_packet(
            world_session.player_mgr.spell_manager.get_initial_spells())
        world_session.enqueue_packet(
            world_session.player_mgr.get_action_buttons())

        # MotD.
        ChatManager.send_system_message(world_session,
                                        config.Server.General.motd)

        world_session.player_mgr.inventory.load_items()

        # Initialize stats first to have existing base stats for further calculations.
        world_session.player_mgr.stat_manager.init_stats()

        # Passive spells contain skill and proficiency learning.
        # Perform passive spell casts after loading skills to avoid duplicate database entries.
        world_session.player_mgr.spell_manager.cast_passive_spells()
        world_session.player_mgr.spell_manager.apply_cast_when_learned_spells()
        world_session.player_mgr.skill_manager.init_proficiencies()

        world_session.player_mgr.quest_manager.load_quests()
        world_session.player_mgr.reputation_manager.load_reputations()
        GuildManager.set_character_guild(world_session.player_mgr)
        GroupManager.set_character_group(world_session.player_mgr)
        PetitionManager.load_petition(world_session.player_mgr)

        first_login = world_session.player_mgr.player.totaltime == 0
        # Send cinematic.
        if first_login:
            PlayerLoginHandler._send_cinematic(world_session,
                                               world_session.player_mgr.player,
                                               socket)

        world_session.player_mgr.complete_login(first_login=first_login)

        return 0
Ejemplo n.º 18
0
    def handle(world_session, socket, reader):
        if len(reader.data) > 1:  # Avoid handling empty Guild Remove packet.
            target_name = PacketReader.read_string(reader.data, 0).strip()
            target_player_mgr = RealmDatabaseManager.character_get_by_name(
                target_name)
            player_mgr = world_session.player_mgr

            if not player_mgr.guild_manager:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_QUIT_S, '',
                    GuildCommandResults.GUILD_PLAYER_NOT_IN_GUILD)
            # Player does not exist.
            if not target_player_mgr:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_QUIT_S, target_name,
                    GuildCommandResults.GUILD_PLAYER_NOT_FOUND)
            # Member does not exist in the Guild.
            elif not player_mgr.guild_manager.has_member(
                    target_player_mgr.guid):
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_QUIT_S, target_name,
                    GuildCommandResults.GUILD_PLAYER_NOT_IN_GUILD)
            # Any rank below Officer is not allowed to kick another guild member.
            elif player_mgr.guild_manager.get_rank(
                    player_mgr.guid) > GuildRank.GUILDRANK_OFFICER:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, '',
                    GuildCommandResults.GUILD_PERMISSIONS)
            # Officers can't kick the Guild Master or another Officer.
            elif player_mgr.guild_manager.get_rank(
                    target_player_mgr.guid
            ) == GuildRank.GUILDRANK_OFFICER and player_mgr.guild_manager.get_rank(
                    player_mgr.guid) <= GuildRank.GUILDRANK_OFFICER:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_INVITE_S, '',
                    GuildCommandResults.GUILD_PERMISSIONS)
            # GM self kick attempt.
            elif player_mgr.guild_manager.get_rank(
                    target_player_mgr.guid
            ) == GuildRank.GUILDRANK_GUILD_MASTER and player_mgr.guild_manager.get_rank(
                    player_mgr.guid) == GuildRank.GUILDRANK_GUILD_MASTER:
                GuildManager.send_guild_command_result(
                    player_mgr, GuildTypeCommand.GUILD_QUIT_S, '',
                    GuildCommandResults.GUILD_LEADER_LEAVE)
            else:
                player_mgr.guild_manager.remove_member(target_player_mgr.guid)

        return 0
Ejemplo n.º 19
0
    def guildcreate(world_session, args):
        GuildManager.create_guild(world_session.player_mgr, args)

        return 0, ''