Beispiel #1
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_GUILD_SEARCH packet = (GC_GUILD_SEARCH)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            if (GuildSearchLogic.Instance() != null)
            {
                GuildSearchLogic.Instance().RefreshSearchResult(packet);
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Beispiel #2
0
    public void RefreshSearchResult(GC_GUILD_SEARCH pak)
    {
        if (pak.NoneResult == 1)
        {
            m_NoneResultLabel.SetActive(true);
        }
        else
        {
            m_NoneResultLabel.SetActive(false);

            for (int i = 0; i < pak.guildGuidCount; ++i)
            {
                GuildPreviewInfo info = new GuildPreviewInfo();
                info.GuildGuid = pak.GetGuildGuid(i);
                if (info.GuildGuid == GlobeVar.INVALID_GUID)
                {
                    continue;
                }

                if (i < pak.guildNameCount)
                {
                    info.GuildName = pak.GetGuildName(i);
                }

                if (i < pak.guildLevelCount)
                {
                    info.GuildLevel = pak.GetGuildLevel(i);
                }

                if (i < pak.guildChiefNameCount)
                {
                    info.GuildChiefName = pak.GetGuildChiefName(i);
                }

                if (i < pak.guildMemberNumCount)
                {
                    info.GuildCurMemberNum = pak.GetGuildMemberNum(i);
                }
                if (i < pak.guildCombatCount)
                {
                    info.GuildCombatValue = pak.GetGuildCombat(i);
                }
                if (i < pak.isEnemyGuildCount)
                {
                    info.IsEnemyGuild = (pak.GetIsEnemyGuild(i) == 1);
                }
                if (i < pak.guildApplyNumCount)
                {
                    info.GuildCurApplyNum = pak.GetGuildApplyNum(i);
                }
                if (i < pak.guildApplyMaxNumCount)
                {
                    info.GuildMaxApplyNum = pak.GetGuildApplyMaxNum(i);
                }
                if (i < pak.GuildDeclarationCount)
                {
                    info.GuildDeclaration = pak.GetGuildDeclaration(i);
                }

                string     szItemName    = i < 10 ? "0" + i.ToString() : i.ToString();
                GameObject GuildListItem = Utils.BindObjToParent(m_GuildListItem, m_GuildListGrid, szItemName);
                if (GuildListItem != null && GuildListItem.GetComponent <GuildListItemLogic>() != null)
                {
                    GuildListItem.GetComponent <GuildListItemLogic>().Init(info);
                }
            }

            if (m_GuildListGrid.GetComponent <UIGrid>() != null)
            {
                m_GuildListGrid.GetComponent <UIGrid>().Reposition();
            }
        }
    }