コード例 #1
0
ファイル: PacketLogger.cs プロジェクト: Pecneb/AQW_Grimoire
 private void PacketCaptured(Message msg)
 {
     if (msg.RawContent != null && msg.RawContent.Contains("%xt%zm%"))
     {
         txtPackets.Invoke(new Action(() => txtPackets.AppendText(msg.RawContent + Environment.NewLine)));
     }
 }
コード例 #2
0
ファイル: Main.cs プロジェクト: dwiki08/grimli
        private void ReceivedFromServer(Grimoire.Networking.Message message)
        {
            string msg = message.ToString();

            if (chkStart.Checked && msg.Contains("{\"t\":\"xt\",\"b\":{\"r\":-1,\"o\":{\"cmd\":\"uotls\",\"o\":"))
            {
                string guest = getBetweenList(msg, "\"strUsername\":\"", "\"");
                SendMessage(guest, txtMessager.Text, listException);
            }
        }
コード例 #3
0
ファイル: PacketLogger.cs プロジェクト: dwiki08/grimli
 private void PacketCaptured(Grimoire.Networking.Message msg)
 {
     if (msg.RawContent != null && msg.RawContent.Contains("%xt%zm%"))
     {
         this.txtPackets.Invoke(new Action(delegate()
         {
             this.txtPackets.AppendText(msg.RawContent + Environment.NewLine);
         }));
     }
 }
コード例 #4
0
        private void ReceivedFromServer(Grimoire.Networking.Message message)
        {
            string text = message.RawContent;

            if (text.Contains(tbFilter.Text))
            {
                this.txtSend.Invoke(new Action(delegate()
                {
                    this.Append("From server: " + text);
                }));
            }
        }
コード例 #5
0
ファイル: Main.cs プロジェクト: dwiki08/grimli
        private void ReceivedFromServer2(Grimoire.Networking.Message message)
        {
            string msg = message.ToString();

            if (chkAutoRep.Checked && msg.Contains("%xt%chatm%"))
            {
                string chat = msg.Split('%')[4].Substring(5);
                string nick = msg.Split('%')[5].ToLower();

                if (nick == "remake")
                {
                    if (chat == "cuki")
                    {
                        SendMessage("", "pukii", new List <string>());
                    }
                    else if (chat == "remake kawaii")
                    {
                        SendMessage("", "WANGY WANGY WANGYYY >//<", new List <string>());
                    }
                    else
                    {
                        for (int i = 0; i < listTrigger.Count; i++)
                        {
                            if (listTrigger[i] == chat)
                            {
                                SendMessage(nick, listResponse[i], listException2);
                            }
                        }
                    };
                }
                else
                {
                    for (int i = 0; i < listTrigger.Count; i++)
                    {
                        if (listTrigger[i] == chat)
                        {
                            SendMessage(nick, listResponse[i], listException2);
                        }
                    }
                }
            }
        }
コード例 #6
0
        private void CapturePlayerData(Grimoire.Networking.Message message)
        {
            string msg = message.ToString();

            try
            {
                //"cmd": "initUserData"
                if (msg.Contains("\"cmd\":\"initUserData\""))
                {
                    JObject packet      = (JObject)JObject.Parse(msg)["b"]["o"];
                    JObject data        = (JObject)packet["data"];
                    JValue  accessLevel = (JValue)data["intAccessLevel"];
                    JValue  username    = (JValue)data["strUsername"];

                    this.accessLevel = accessLevel?.ToString();
                    this.username    = username?.ToString();
                    showLog(this.username, this.accessLevel);

                    Console.WriteLine($"Log1: {this.username} | {this.accessLevel}");
                }

                //"cmd": "initUserDatas"
                if (msg.Contains("\"cmd\":\"initUserDatas\""))
                {
                    JObject packet = (JObject)JObject.Parse(msg)["b"]["o"];
                    JArray  datas  = (JArray)packet["a"];

                    foreach (JObject data in datas)
                    {
                        JObject _data       = (JObject)data["data"];
                        string  accessLevel = _data.GetValue("intAccessLevel")?.ToString();
                        string  username    = _data.GetValue("strUsername")?.ToString();

                        this.accessLevel = accessLevel;
                        this.username    = username;
                        showLog(this.username, this.accessLevel);

                        Console.WriteLine($"Log2: {this.username} | {this.accessLevel}");
                    }
                }

                //"cmd":"moveToArea"
                if (msg.Contains("\"cmd\":\"moveToArea\""))
                {
                    if (this.tbLogs.Lines.Length > 30)
                    {
                        clearTextLog();
                    }

                    JObject packet   = (JObject)JObject.Parse(msg)["b"]["o"];
                    string  areaName = packet.GetValue("areaName")?.ToString();

                    if (map != "")
                    {
                        setTextLog(Environment.NewLine);
                    }

                    this.map = areaName;
                    setTextLog($"MAP : {map.ToUpper()} {Environment.NewLine}");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("MyMsg: " + msg);
                Console.WriteLine("MyError: " + e.Message);
            }
        }