Ejemplo n.º 1
0
    public void init(Guild guild, List <GuildMember> memebers)
    {
        this.guild    = guild;
        this.memebers = memebers;

        labelName.text      = guild.name;
        labelPresident.text = guild.presidentName;
        labelLive.text      = guild.livenessing + "/" + guild.livenessed;
        labelCount.text     = LanguageConfigManager.Instance.getLanguage("s0412") + " : " + guild.membership + "/" + guild.membershipMax;

        if (UserManager.Instance.self.getUserLevel() < 21 || GuildManagerment.Instance.getGuild() != null)
        {
            buttonApply.gameObject.SetActive(false);
        }
        else
        {
            GuildRankInfo guildRankInfo = GuildManagerment.Instance.getGuildByUid(guild.uid);
            if (guildRankInfo == null)
            {
                guildRankInfo = new GuildRankInfo(guild.uid, guild.level, guild.name, guild.membership, guild.membershipMax, guild.declaration, guild.livenessing);
                GuildManagerment.Instance.createGuildList(guildRankInfo);
            }
            buttonApply.initInfo(guildRankInfo);
        }
    }
Ejemplo n.º 2
0
    public override void read(ErlKVMessage message)
    {
        base.read(message);
        ErlType type = message.getValue("msg") as ErlType;

        if (type.getValueString() == "none_guild")
        {
            if (callBack != null)
            {
                callBack(null);
            }
        }
        else if (type.getValueString() == "none_name")
        {
            //Name is space!!
        }
        else
        {
            ErlArray      array         = type as ErlArray;
            ErlArray      temp          = array.Value[0] as ErlArray;
            int           index         = 0;
            string        uid           = temp.Value[index++].getValueString();
            int           level         = StringKit.toInt(temp.Value[index++].getValueString());
            string        name          = temp.Value[index++].getValueString();
            string        declaration   = temp.Value[index++].getValueString();
            int           membership    = StringKit.toInt(temp.Value[index++].getValueString());
            int           membershipMax = StringKit.toInt(temp.Value[index++].getValueString());
            int           liveness      = StringKit.toInt(temp.Value[index++].getValueString());
            GuildRankInfo info          = new GuildRankInfo(uid, level, name, membership, membershipMax, declaration, liveness);
            if (callBack != null)
            {
                callBack(info);
            }
        }
    }
Ejemplo n.º 3
0
    //获取公会邀请列表,按活跃度排序,只取前10个
    public List <GuildRankInfo> getGuildInviteList()
    {
        if (guildInviteList == null)
        {
            return(null);
        }
        if (guildInviteList.Count == 0)
        {
            return(guildInviteList);
        }
        for (int i = 0; i < guildInviteList.Count - 1; i++)
        {
            for (int j = 0; j < guildInviteList.Count - 1 - i; j++)
            {
                if (guildInviteList [j].liveness < guildInviteList [j + 1].liveness)
                {
                    GuildRankInfo temp = guildInviteList [j];
                    guildInviteList [j]     = guildInviteList [j + 1];
                    guildInviteList [j + 1] = temp;
                }
            }
        }
        List <GuildRankInfo> tempList = new List <GuildRankInfo> ();

        for (int i = 0; i < guildInviteList.Count; i++)
        {
            tempList.Add(guildInviteList [i]);
            if (i == 9)
            {
                break;
            }
        }
        return(tempList);
    }
Ejemplo n.º 4
0
 //创建公会邀请列表
 public void createGuildInviteList(GuildRankInfo temp)
 {
     if (guildInviteList == null)
     {
         guildInviteList = new List <GuildRankInfo> ();
     }
     guildInviteList.Add(temp);
 }
Ejemplo n.º 5
0
 public void updateActive(GuildRankInfo guild)
 {
     this.guild     = guild;
     level.text     = "Lv." + guild.level;
     member.text    = guild.membership + "/" + guild.membershipMax;
     guildName.text = guild.name;
     button.initInfo(guild);
 }
Ejemplo n.º 6
0
 public void updateActive(GuildRankInfo guild, GuildInviteWindow win)
 {
     this.guild       = guild;
     level.text       = LanguageConfigManager.Instance.getLanguage("Guild_108l") + "LV " + guild.level;
     member.text      = LanguageConfigManager.Instance.getLanguage("Guild_109l") + guild.membership + "/" + guild.membershipMax;
     guildName.text   = guild.name;
     declaration.text = guild.declaration;
     buttonAccept.initInfo(guild, win);
     buttonCancel.initInfo(guild, win);
 }
Ejemplo n.º 7
0
 //更新申请按钮状态
 public void updateApplyState(GuildRankInfo info, bool isApply)
 {
     for (int i = 0; i < guildList.Count; i++)
     {
         if (guildList [i].name == info.name)
         {
             guildList [i].isApply = isApply;
         }
     }
 }
Ejemplo n.º 8
0
 public void initInfo(GuildRankInfo guild)
 {
     this.guild = guild;
     if (GuildManagerment.Instance.getIds() != null && GuildManagerment.Instance.getIds().Contains(guild.uid))
     {
         textLabel.text = LanguageConfigManager.Instance.getLanguage("Guild_11");
     }
     else
     {
         textLabel.text = LanguageConfigManager.Instance.getLanguage("Guild_10");;
     }
 }
Ejemplo n.º 9
0
    public override void read(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;

        if (type is ErlArray)
        {
            GuildManagerment.Instance.clearGuildList();
            ErlArray array = type as ErlArray;
            ErlArray list  = array.Value[0] as ErlArray;
            for (int i = 0; i < list.Value.Length; i++)
            {
                ErlArray temp = list.Value[i] as ErlArray;
                if (temp != null)
                {
                    int           index         = 0;
                    string        uid           = temp.Value[index++].getValueString();
                    int           level         = StringKit.toInt(temp.Value[index++].getValueString());
                    string        name          = temp.Value[index++].getValueString();
                    string        declaration   = temp.Value[index++].getValueString();
                    int           membership    = StringKit.toInt(temp.Value[index++].getValueString());
                    int           membershipMax = StringKit.toInt(temp.Value[index++].getValueString());
                    int           liveness      = StringKit.toInt(temp.Value[index++].getValueString());
                    GuildRankInfo info          = new GuildRankInfo(uid, level, name, membership, membershipMax, declaration, liveness);
                    GuildManagerment.Instance.createGuildList(info);
                }
            }
            int  startIndex = StringKit.toInt(array.Value[1].getValueString());
            bool isMax      = array.Value[1].getValueString().ToLower() == "true"?true:false;
            if (callback1 != null)
            {
                callback1(isMax);
            }
            if (callback != null)
            {
                callback(startIndex);
            }
        }
        else if (type.getValueString() == "none_guild")
        {
            if (callback1 != null)
            {
                callback1(true);
            }
            if (callback != null)
            {
                callback(1);
            }
        }
    }
Ejemplo n.º 10
0
 private void searchGuildCallBack(GuildRankInfo searchResult)
 {
     if (searchResult == null)
     {
         UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("Guild_109", inputFind.value));
     }
     else
     {
         resetData();
         currentGuildList.Clear();
         GuildManagerment.Instance.createGuildList(searchResult);
         currentGuildList.Add(searchResult);
         dynamicContent.maxCount = getPageCount();
         dynamicContent.init();
     }
     MaskWindow.UnlockUI();
 }
Ejemplo n.º 11
0
    public override void read(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;

        if (type.getValueString() == "non_mem")
        {
            UiManager.Instance.openDialogWindow <MessageWindow>((win) => {
                win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, LanguageConfigManager.Instance.getLanguage("Guild_90"), GuildManagerment.Instance.closeAllGuildWindow);
            });
        }
        else if (type is ErlArray)
        {
            GuildManagerment.Instance.clearGuildInviteList();
            ErlArray array = type as ErlArray;
            for (int i = 0; i < array.Value.Length; i++)
            {
                ErlArray temp = array.Value[i] as ErlArray;
                if (temp != null)
                {
                    int           index         = 0;
                    string        uid           = temp.Value[index++].getValueString();
                    int           level         = StringKit.toInt(temp.Value[index++].getValueString());
                    string        name          = temp.Value[index++].getValueString();
                    string        declaration   = temp.Value[index++].getValueString();
                    int           membership    = StringKit.toInt(temp.Value[index++].getValueString());
                    int           membershipMax = StringKit.toInt(temp.Value[index++].getValueString());
                    int           liveness      = StringKit.toInt(temp.Value[index++].getValueString());
                    GuildRankInfo info          = new GuildRankInfo(uid, level, name, membership, membershipMax, declaration, liveness);
                    GuildManagerment.Instance.createGuildInviteList(info);
                }
            }
        }

        if (callback != null)
        {
            callback();
        }
    }
Ejemplo n.º 12
0
 public void initInfo(GuildRankInfo guild, GuildInviteWindow win)
 {
     this.guild   = guild;
     this.win     = win;
     fatherWindow = win;
 }