Exemple #1
0
        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);
            }
        }
Exemple #2
0
        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);
                        }
                    }
                }
            }
        }
Exemple #3
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);
            }
        }