Esempio n. 1
0
    void SendChatMessage(string message)
    {
        // tempTest for hyperLink
        if (message.IndexOf("testskill") == 0)
        {
            string[] skillIDArray = message.Split(new string[1] {
                " "
            }, StringSplitOptions.None);
            if (skillIDArray.Length == 3)
            {
                int skillID     = Convert.ToInt32(skillIDArray[1]);
                int isDirectUse = Convert.ToInt32(skillIDArray[2]);
                Dictionary <int, SCLIENT_SKILL> mapSkill = CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_Skill();
                foreach (KeyValuePair <int, SCLIENT_SKILL> skill in mapSkill)
                {
                    if (skill.Value.m_pDefine.m_nID == skillID)
                    {
                        int defineID = skill.Value.m_pDefine.m_nID * 100 + skill.Value.m_nLevel;
                        CActionItem_Skill curSkill = CActionSystem.Instance.GetAction_SkillID(defineID);
                        if (isDirectUse != 0)
                        {
                            curSkill.DoAction();
                        }
                        else
                        {
                            CObjectManager.Instance.getPlayerMySelf().SetActiveSkill(curSkill);
                        }
                        break;
                    }
                }
            }
            return;
        }
//      if(field.Content == "testPos")
//      {
//             SendCommonTalk("测试坐标超链接{#pos[50,50]坐标超链接}asd测试物品超链接123{#item[100000]物品超链接}");
//          txtField.Text = "";
//          return;
//      }

        if (message.IndexOf("!!") == -1)
        {
            SendCommonTalk(message);
        }
        else
        {
            SendGmCommand(message.Substring(2, message.Length - 2));
        }
    }