void CreateSkillList()
    {
        DropDownListSkill.Items.Clear();

        DropDownListSkill.Items.Add(new ListItem(StringDef.Unspecified, "0"));
        FS2SkillData[] skillDatas = FS2GameDataManager.TheInstance.GetAllSkillData();
        int            page       = 0;

        try
        {
            page = int.Parse(DropDownListPage.SelectedValue);
        }
        catch (Exception)
        {
        }
        int startIndex = _maxSkillPerPage * page;
        int endIndex   = _maxSkillPerPage * (page + 1);

        if (endIndex > skillDatas.Length)
        {
            endIndex = skillDatas.Length;
        }
        for (int i = startIndex; i < endIndex; i++)
        {
            FS2SkillData skillData = skillDatas[i];
            if (skillData != null)
            {
                DropDownListSkill.Items.Add(new ListItem(skillData.ToString(), skillData.TemplateId.ToString()));
            }
        }
    }
Example #2
0
    private void RenderAll(FS2RoleDataInfo roleInfo)
    {
        StringBuilder content = new StringBuilder();

        content.Append("<table class='TN' >");
        for (int index = 0; index != roleInfo.SkillList.Count; ++index)
        {
            FS2SkillDataInfo skillInfo = roleInfo.SkillList[index] as FS2SkillDataInfo;
            if (skillInfo == null)
            {
                return;
            }

            FS2SkillData skillData = FS2GameDataManager.TheInstance.GetSkillData(skillInfo.SkillId);
            if (skillData != null)
            {
                //31,32,33为普通攻击,忽略。
                if (skillData.TemplateId == 31 || skillData.TemplateId == 32 || skillData.TemplateId == 33)
                {
                    continue;
                }
                //SkillSeries为0的是主技能,如异术、玄女等。
                if (skillData.SkillSeries == 0)
                {
                    content.AppendFormat("<tr>");
                    content.AppendFormat("<td class='TCH' align='center'>{0}</td>", skillData.Name);
                    IList <int> subSkills = FS2GameDataManager.TheInstance.GetSubSkill(skillData.TemplateId);
                    if (subSkills != null)
                    {
                        foreach (FS2SkillDataInfo info in roleInfo.SkillList)
                        {
                            if (subSkills.Contains(info.SkillId))
                            {
                                //技能列表中技能包含在此主技能中则显示
                                FS2SkillData subSkillData = FS2GameDataManager.TheInstance.GetSkillData(info.SkillId);
                                //Level用从RoleInfo里面解析出来的
                                if (subSkillData != null)
                                {
                                    content.Append(GameDataRender.RenderSkillCell(subSkillData.Name, info.SkillLevel.ToString(), string.Empty, string.Format("updateRoleSkillInfo(\"{0}\")", subSkillData.TemplateId)));
                                }
                            }
                        }
                    }
                    content.AppendFormat("</tr>");
                }
            }
        }
        content.Append("</table>");
        DivSkillInfo.InnerHtml = content.ToString();
    }
Example #3
0
    void CreateTableC2SNetMsg(ArrayList c2sNetMsgInfoList)
    {
        if (c2sNetMsgInfoList == null)
        {
            return;
        }

        foreach (PlayerActionInfo info in c2sNetMsgInfoList)
        {
            TableRow  row  = new TableRow();
            TableCell cell = new TableCell();
            cell.Text = info.Id.ToString();
            row.Cells.Add(cell);

            cell      = new TableCell();
            cell.Text = info.RecordTime.ToString();
            row.Cells.Add(cell);

            cell      = new TableCell();
            cell.Text = info.Action.ToString();
            row.Cells.Add(cell);

            cell = new TableCell();
            if (info.Desc.Contains("skill"))
            {
                string       skillDesc       = info.Desc.Trim('<', '>');
                int          skillTemplateId = int.Parse(skillDesc.Substring(skillDesc.IndexOf('_') + 1));
                FS2SkillData skillData       = FS2GameDataManager.TheInstance.GetSkillData(skillTemplateId);
                if (skillData != null)
                {
                    cell.Text = info.Desc.Substring(0, info.Desc.IndexOf('<')) + string.Format("&lt;<span onclick='{0}'>{1}</span>>",
                                                                                               string.Format("updateRoleSkillInfo(\"{0}\")", skillData.TemplateId),
                                                                                               skillData.Name);
                }
                else
                {
                    cell.Text = info.Desc.Substring(0, info.Desc.IndexOf('<')) + info.Desc.Replace("<", "&lt;");
                }
            }
            else
            {
                cell.Text = info.Desc;
            }
            row.Cells.Add(cell);

            TableC2SNetMsg.Rows.Add(row);
        }
    }
    protected void LinkButtonStatistic_Click(object sender, EventArgs e)
    {
        ClearAllCacheData();

        try
        {
            GameServer server = ServerDropDownList.SelectedGameServer;
            if (server == null)
            {
                LabelOpMsg.Text = string.Format(StringDef.MsgCannotBeNone, StringDef.GameServer);
                return;
            }
            if (!server.IsConnected)
            {
                LabelOpMsg.Text = StringDef.NoConnectionAlert;
                return;
            }
            _startDate = StartDate.SelectedDate;
            if (_startDate == DateTime.MinValue)
            {
                LabelOpMsg.Text = StringDef.ParameterInputError + StringDef.Colon + StringDef.StartDate;
                return;
            }
            _endDate = EndDate.SelectedDate;
            if (_endDate == DateTime.MinValue)
            {
                LabelOpMsg.Text = StringDef.ParameterInputError + StringDef.Colon + StringDef.StartDate;
                return;
            }
            if (_startDate > _endDate)
            {
                LabelOpMsg.Text = StringDef.EndTimeError;
                return;
            }

            string roleName = TextBoxRoleName.Text.Trim();
            if (roleName.Length != 0)
            {
                _roleGuid = WebUtil.FindRoleGuidByName(CurrentUser.Id, server, roleName);
                if (_roleGuid == null || _roleGuid.Length == 0)
                {
                    LabelOpMsg.Text = string.Format(StringDef.RoleWithNameNotExist, roleName);
                    return;
                }
                _statisticDesc = String.Format(StringDef.RoleWithName, roleName);
            }
            else
            {
                _statisticDesc = StringDef.AllRoles;
            }

            switch (this._viewContent)
            {
            case ViewContent.Exp:
                AnalyseResult expResult = AnalyseData(server, 13, string.Empty);
                if (expResult != null)
                {
                    _analyseResultList.Add(expResult);
                }
                break;

            case ViewContent.Item:
                string itemTemplateIdFilter = null;
                if (TextBoxItemTemplateId.Text.Trim().Length > 0)
                {
                    itemTemplateIdFilter = string.Format("LogKey2='{0}'", TextBoxItemTemplateId.Text.Trim());
                }

                for (int i = 0; i < ItemCountTypes.Length; i++)
                {
                    ListItem item = CheckBoxListShowItemCount.Items[i];
                    if (item.Selected)
                    {
                        AnalyseResult itemResult = AnalyseData(server, ItemCountEventIds[i], itemTemplateIdFilter);
                        if (itemResult != null)
                        {
                            _analyseResultList.Add(itemResult);
                        }
                    }
                }
                break;

            case ViewContent.Money:
                AnalyseResult addMoneyResult    = null;
                AnalyseResult removeMoneyResult = null;
                if (CheckBoxShowAddMoney.Checked || CheckBoxShowChangeMoney.Checked)
                {
                    addMoneyResult = AnalyseData(server, EventIdAddMoney, null);
                }
                if (CheckBoxShowRemoveMoney.Checked || CheckBoxShowChangeMoney.Checked)
                {
                    removeMoneyResult = AnalyseData(server, EventIdRemoveMoney, null);
                }
                if (addMoneyResult != null)
                {
                    _analyseResultList.Add(addMoneyResult);
                }
                if (removeMoneyResult != null)
                {
                    _analyseResultList.Add(removeMoneyResult);
                }
                break;

            case ViewContent.PlayerDeath:
                AnalyseResult playerKillDeathResult = AnalyseData(server, EventIdPlayerDeath, "LENGTH(LogKey2)>=32");
                AnalyseResult npcKillDeathResult    = AnalyseData(server, EventIdPlayerDeath, "LENGTH(LogKey2)<32");
                if (playerKillDeathResult != null)
                {
                    _analyseResultList.Add(playerKillDeathResult);
                    Session["AdvancedStatistic_PlayerDeathStatistic_PlayerKill"] = playerKillDeathResult;
                    Session["AdvancedStatistic_CanUseCache"] = true;
                }
                if (npcKillDeathResult != null)
                {
                    _analyseResultList.Add(npcKillDeathResult);
                    Session["AdvancedStatistic_PlayerDeathStatistic_NpcKill"] = npcKillDeathResult;
                    Session["AdvancedStatistic_CanUseCache"] = true;
                }
                break;

            case ViewContent.Quest:
                string questFilter = null;

                if (TextBoxQuestId.Text.Trim().Length > 0)
                {
                    try
                    {
                        int questId = int.Parse(TextBoxQuestId.Text.Trim());
                        if (questId < 0)
                        {
                            throw new Exception();
                        }

                        questFilter = string.Format("LogKey2='{0}'", questId);
                    }
                    catch (Exception)
                    {
                        LabelOpMsg.Text = StringDef.ParameterInputError;
                        return;
                    }
                }
                for (int i = 0; i < QuestCountTypes.Length; i++)
                {
                    ListItem item = CheckBoxListShowQuestCount.Items[i];
                    if (item.Selected)
                    {
                        AnalyseResult questResult = AnalyseData(server, QuestCountEventIds[i], questFilter);
                        if (questResult != null)
                        {
                            _analyseResultList.Add(questResult);
                            Session[string.Format("AdvancedStatistic_QuestStatistic_{0}", i)] = questResult;
                            Session["AdvancedStatistic_CanUseCache"] = true;
                        }
                    }
                }
                break;

            case ViewContent.UseSkill:
                string skillFilter = null;
                try
                {
                    FS2SkillData selectedSkill = SkillDropDownList1.SelectedSkill;
                    if (selectedSkill != null)
                    {
                        skillFilter = string.Format("LogKey2='{0}'", selectedSkill.TemplateId);
                    }
                }
                catch (Exception)
                {
                    LabelOpMsg.Text = StringDef.ParameterInputError;
                    return;
                }
                AnalyseResult useSkillResult = AnalyseData(server, EventIdUseSkill, skillFilter);
                if (useSkillResult != null)
                {
                    _analyseResultList.Add(useSkillResult);
                }
                break;
            }
            if (_analyseResultList != null && _analyseResultList.Count != 0)
            {
                ZedGraphWebExpStatistic.Visible = true;
            }
            else
            {
                LabelOpMsg.Text = StringDef.OperationFail;
            }
        }
        catch (Exception ex)
        {
            LabelOpMsg.Text = ex.Message;
        }
    }