Beispiel #1
0
        private void CheckLostUids()
        {
            AddLog("Start CheckLostUids", "debug");

            string buffer;

            buffer = GetDataFromBrowser("http://schistory.space/api/v1/getlostuids.php");
            Uids uids = JsonConvert.DeserializeObject <Uids>(buffer);

            foreach (Int64 uid in uids.data.uid.Distinct())
            {
                buffer = GetDataFromBrowser("http://schistory.space/api/v1/userinfo.php?uid=" + uid + "&limit=1");
                Space space = JsonConvert.DeserializeObject <Space>(buffer);
                if (space.bigdata.Count == 1 && GetDataFromSC(space.bigdata[0].nickname).code == 0 && GetDataFromSC(space.bigdata[0].nickname).data.uid == uid)
                {
                    AddLog("uid: " + uid + " is correct");
                    continue;
                }
                AddLog("ping uid: " + uid, "debug");

                ChatBlock();
                EmulSendText("/w #" + uid + " ping");
                Thread.Sleep(1000);
                EmulSendText("/w #" + uid + " pong");
                Thread.Sleep(2000);
                ChatUnlock();
            }

            TcpClient     tcpClient = new TcpClient(host, port);
            NetworkStream stream    = tcpClient.GetStream();

            string[] bufferArr = nicknameList.ToArray();
            nicknameList.Clear();
            foreach (string item in bufferArr)
            {
                string message = "<nickname>" + item + "</nickname>";
                TcpSend(message, stream);
            }

            stream.Close();
            tcpClient.Close();
            AddLog("Find nicknames: " + String.Join(", ", bufferArr));
        }
Beispiel #2
0
        private void Census()
        {
            AddLog("Start Census mod");

            Thread.Sleep(5000);
            while (true)
            {
                // Получить пачку uid's
                string buffer;
                buffer = GetDataFromBrowser("http://ts2.scorpclub.ru/api/v1/getuids.php");
                Uids uids = JsonConvert.DeserializeObject <Uids>(buffer);

                // Пропинговать каждый uid
                foreach (Int64 uid in uids.data.uid.Distinct())
                {
                    AddLog("ping uid: " + uid, "debug");

                    ChatBlock();
                    EmulSendText("/w #" + uid + " ping");
                    Thread.Sleep(1000);
                    EmulSendText("/w #" + uid + " pong");
                    Thread.Sleep(2000);
                    ChatUnlock();
                }

                // Полученные ники отправить на ts2.scorpclub.ru
                string[] bufferArr = nicknameList.ToArray();
                nicknameList.Clear();
                foreach (string nickname in bufferArr)
                {
                    AddLog("Send nickname: " + nickname + " --> [ts2.scorpclub.ru]");
                    string url = "http://ts2.scorpclub.ru/api/v1/addnickname.php?nickname=" + nickname + "&searcher=" + textBox1.Text;
                    buffer = GetDataFromBrowser(url);
                }
            }
        }