private void button1_Click(object sender, EventArgs e) { playerS rs; this.listView1.Items.Clear(); if (World.Players.TryGetValue(this.textBox1.Text, out rs)) { string[] items = new string[] { rs.UserId.ToString(), rs.UserIp, RxjhClass.GetUserIpadds(rs.UserIp), rs.ServerID, rs.TimeSpan_0.ToString().Remove(rs.TimeSpan_0.ToString().Length - 8, 8), rs.conn.ToString() }; this.listView1.Items.Insert(this.listView1.Items.Count, new ListViewItem(items)); } }
private void method_7(SocketAsyncEventArgs e) { Form1.WriteLine(3, "LS客户正常进入"); IoServer userToken = e.UserToken as IoServer; try { string str; DateTime ljtime; if (World.int_6 != 1) { goto Label_0486; } IPAddress item = ((IPEndPoint)e.AcceptSocket.RemoteEndPoint).Address; if (World.BipList.Contains(item)) { if (World.bool_1) { try { e.AcceptSocket.Shutdown(SocketShutdown.Both); } catch { } try { e.AcceptSocket.Close(); } catch { } } if (World.bool_3) { try { userToken.b(); return; } catch { return; } } using (SocketAsyncEventArgs args = new SocketAsyncEventArgs()) { args.UserToken = this; args.Completed += new EventHandler <SocketAsyncEventArgs>(this.method_6); this.listenSocket.AcceptAsync(args); } return; } if (World.string_3 != "") { str = RxjhClass.GetUserIpadds(item.ToString()).Replace(" ", "").Trim(); bool flag = false; string[] strArray = World.string_3.Split(new char[] { ',' }); for (int i = 0; i < strArray.Length; i++) { if (str.IndexOf(strArray[i]) != -1) { string[] strArray2 = World.string_7.Split(new char[] { ',' }); for (int j = 0; j < strArray2.Length; j++) { if (str.IndexOf(strArray2[j]) != -1) { flag = true; } } if (!flag) { goto Label_01FC; } } } } goto Label_0296; Label_01FC: try { e.AcceptSocket.Shutdown(SocketShutdown.Both); } catch { } try { e.AcceptSocket.Close(); } catch { } Form1.WriteLine(1, "用户登陆[" + item.ToString() + "]被封 " + str); using (SocketAsyncEventArgs args2 = new SocketAsyncEventArgs()) { args2.UserToken = this; args2.Completed += new EventHandler <SocketAsyncEventArgs>(this.method_6); this.listenSocket.AcceptAsync(args2); } return; Label_0296: ljtime = DateTime.Now; int num3 = 0; foreach (NetState state in World.list.Values) { if (state.ToString() == item.ToString()) { ljtime = state.Ljtime; num3++; } } if (num3 > World.int_4) { int totalMilliseconds = (int)DateTime.Now.Subtract(ljtime).TotalMilliseconds; if (totalMilliseconds >= World.int_5) { return; } Form1.WriteLine(1, "到达IP最大连接数" + item.ToString()); if (!(!World.bool_2 || World.BipList.Contains(item))) { World.BipList.Add(item); } try { e.AcceptSocket.Shutdown(SocketShutdown.Both); } catch { } try { e.AcceptSocket.Close(); } catch { } try { System.Collections.Queue queue = System.Collections.Queue.Synchronized(new System.Collections.Queue()); foreach (NetState state2 in World.list.Values) { if (state2.ToString() == item.ToString()) { queue.Enqueue(state2); } } while (queue.Count > 0) { ((NetState)queue.Dequeue()).Dispose(); } return; } catch { return; } } if (e.AcceptSocket != null) { new NetState(e.AcceptSocket).Start(); } return; Label_0486: if (e.AcceptSocket != null) { new NetState(e.AcceptSocket).Start(); } } catch (Exception) { } finally { try { using (SocketAsyncEventArgs args3 = new SocketAsyncEventArgs()) { args3.UserToken = this; args3.Completed += new EventHandler <SocketAsyncEventArgs>(this.method_6); this.listenSocket.AcceptAsync(args3); } } catch (Exception) { } } }
private void userlist_Load(object sender, EventArgs e) { try { this.listView1.ListViewItemSorter = new ListViewColumnSorter(); this.listView1.ColumnClick += new ColumnClickEventHandler(ListViewHelper.ListView_ColumnClick); lock (World.Players) { foreach (playerS rs in World.Players.Values) { if (rs != null) { string[] items = new string[] { rs.UserId.ToString(), rs.UserIp, RxjhClass.GetUserIpadds(rs.UserIp), rs.ServerID, rs.TimeSpan_0.ToString().Remove(rs.TimeSpan_0.ToString().Length - 8, 8), rs.conn.ToString() }; this.listView1.Items.Insert(this.listView1.Items.Count, new ListViewItem(items)); } } } } catch (Exception) { } }
public void method_0(byte[] data, int length) { bool flag = false; byte[] toSendBuff = Converter.hexStringToByte("018004000A000300"); Converter.hexStringToByte("018004000B000300"); Converter.hexStringToByte("0180040009000300"); try { string[] strArray; int num; byte[] buffer2; string[] strArray2; int num2; byte[] buffer3; KillClass class2; KillClass class3; KillClass class4; string str = RxjhClass.GetUserIpadds(this.Client.ToString()).Replace(" ", "").Trim(); if (World.string_3 != "") { bool flag2 = false; strArray = World.string_3.Split(new char[] { ',' }); num = 0; while (num < strArray.Length) { if (str.IndexOf(strArray[num]) != -1) { if (World.string_7 != "") { string[] strArray3 = World.string_7.Split(new char[] { ',' }); for (int i = 0; i < strArray3.Length; i++) { if (str.IndexOf(strArray3[i]) != -1) { flag2 = true; } } } if (!flag2) { goto Label_012F; } } num++; } } goto Label_0197; Label_012F: buffer2 = this.SetMsg("请重新登陆"); Form1.WriteLine(1, str + "用户登陆[" + this.Client.ToString() + "]被封" + strArray[num]); this.Client.Send(buffer2, buffer2.Length); return; Label_0197: if (World.string_4 != "") { strArray2 = World.string_4.Split(new char[] { ',' }); num2 = 0; while (num2 < strArray2.Length) { if (this.Client.ToString().IndexOf(strArray2[num2]) != -1) { goto Label_020B; } num2++; } } goto Label_0275; Label_020B: buffer3 = this.SetMsg("你的IP以被管理员停封"); Form1.WriteLine(1, str + "用户登陆[" + this.Client.ToString() + "]被封" + strArray2[num2]); this.Client.Send(buffer3, buffer3.Length); return; Label_0275: if (RxjhClass.GetUserIP(this.Client.ToString()) == -1) { byte[] buffer4 = this.SetMsg("你的IP以被管理员停封"); Form1.WriteLine(2, "用户登陆[" + this.Client.ToString() + "]被封"); this.Client.Send(buffer4, buffer4.Length); return; } string webString = ""; string pwd = ""; try { byte[] dst = new byte[data[4]]; Buffer.BlockCopy(data, 6, dst, 0, dst.Length); webString = Encoding.Default.GetString(dst).Trim(); if (webString.Length > 14) { return; } } catch (Exception exception) { byte[] buffer6 = this.SetMsg("系统错误,请联系客服人员1"); Form1.WriteLine(1, "getid_得到ID 系统错误" + exception.Message); this.Client.Send(buffer6, buffer6.Length); return; } try { byte[] buffer7 = new byte[data[6 + data[4]]]; Buffer.BlockCopy(data, 8 + data[4], buffer7, 0, buffer7.Length); pwd = Encoding.Default.GetString(buffer7).Trim(); } catch (Exception exception2) { byte[] buffer8 = this.SetMsg("系统错误,请联系客服人员2"); Form1.WriteLine(1, "getid_得到pwd 系统错误" + exception2.Message); this.Client.Send(buffer8, buffer8.Length); return; } if (webString == "getver123") { byte[] buffer9 = this.SetMsg(Assembly.GetExecutingAssembly().GetName().Version.ToString()); this.Client.Send(buffer9, buffer9.Length); return; } if (RxjhClass.ReplaceComma(webString) == -1) { byte[] buffer10 = this.SetMsg("检查到你输入了非法字符,请重新填写"); this.Client.Send(buffer10, buffer10.Length); return; } if (World.KillList.TryGetValue(webString, out class2) && (class2.conn >= 5)) { Form1.WriteLine(2, "用户登陆[" + webString + "]-密码错误多次"); byte[] buffer11 = this.SetMsg("你输入的帐号密码错误多次,请5分钟以后再试。"); this.Client.Send(buffer11, buffer11.Length); return; } int num4 = -2; try { num4 = RxjhClass.GetUserId(webString, pwd, this.Client.ToString()); } catch (Exception exception3) { string str4 = Converter.ToString(data); Console.WriteLine(str4); Form1.WriteLine(1, str4); Form1.WriteLine(1, exception3.Message); } switch (num4) { case -2: { byte[] buffer13 = this.SetMsg("系统错误,请联系客服人员8"); this.Client.Send(buffer13, buffer13.Length); return; } case -1: { byte[] buffer12 = this.SetMsg("你输入的帐号[" + webString + "]不存在\r\n请到" + World.string_6 + "重新注册帐号"); Form1.WriteLine(2, "用户登陆[" + webString + "]账号不存在"); this.Client.Send(buffer12, buffer12.Length); return; } case 0: if (!World.KillList.TryGetValue(webString, out class3)) { goto Label_06E6; } if (class3.conn >= 5) { break; } class3.conn++; Form1.WriteLine(2, "用户登陆[" + webString + "]-[" + pwd + "]密码错误"); this.Client.Send(toSendBuff, toSendBuff.Length); return; case 2: { byte[] buffer15 = this.SetMsg("你输入的帐号以被停封。"); Form1.WriteLine(2, "用户登陆[" + webString + "]账号以被停封"); this.Client.Send(buffer15, buffer15.Length); return; } default: goto Label_07A4; } class3.time = DateTime.Now.AddMinutes(5.0); Form1.WriteLine(2, "用户登陆[" + webString + "]-[" + pwd + "]密码错误"); byte[] buffer14 = this.SetMsg("你输入的帐号密码错误多次,请5分钟以后再试。"); this.Client.Send(buffer14, buffer14.Length); return; Label_06E6: class4 = new KillClass(); class4.UserId = webString; class4.conn = 1; class3 = class4; World.KillList.Add(webString, class3); Form1.WriteLine(2, "用户登陆[" + webString + "]-[" + pwd + "]密码错误"); this.Client.Send(toSendBuff, toSendBuff.Length); return; Label_07A4: if (num4 == 1) { if (World.KillList.ContainsKey(webString)) { World.KillList.Remove(webString); } byte[] buffer16 = new byte[((11 + webString.Length) + webString.Length) + 3]; byte[] src = Converter.hexStringToByte("01800C0000003300"); try { Buffer.BlockCopy(src, 0, buffer16, 0, src.Length); } catch (Exception exception4) { byte[] buffer18 = this.SetMsg("系统错误,请联系客服人员3"); Form1.WriteLine(1, string.Concat(new object[] { "getid_bySend 1错误", buffer16.Length, " ", src.Length, exception4.Message })); this.Client.Send(buffer18, buffer18.Length); return; } byte[] bytes = new byte[0]; try { Buffer.BlockCopy(BitConverter.GetBytes(webString.Length), 0, buffer16, 8, 1); Buffer.BlockCopy(BitConverter.GetBytes(webString.Length), 0, buffer16, (8 + webString.Length) + 3, 1); Buffer.BlockCopy(BitConverter.GetBytes((int)(((7 + webString.Length) + webString.Length) + 2)), 0, buffer16, 2, 1); bytes = Encoding.Default.GetBytes(webString); } catch (Exception exception5) { byte[] buffer20 = this.SetMsg("系统错误,请联系客服人员4"); Form1.WriteLine(1, string.Concat(new object[] { "getid_bySend 2错误", buffer16.Length, " ", bytes.Length, exception5.Message })); this.Client.Send(buffer20, buffer20.Length); return; } try { Buffer.BlockCopy(bytes, 0, buffer16, 10, bytes.Length); Buffer.BlockCopy(bytes, 0, buffer16, (10 + webString.Length) + 3, bytes.Length); } catch (Exception exception6) { byte[] buffer21 = this.SetMsg("系统错误,请联系客服人员5"); Form1.WriteLine(1, string.Concat(new object[] { "getid_bySend 错误", buffer16.Length, " ", bytes.Length, exception6.Message })); this.Client.Send(buffer21, buffer21.Length); return; } try { string[] strArray4 = World.string_2.Split(new char[] { ';' }); if (strArray4.Length > 1) { for (int j = 0; j < strArray4.Length; j++) { if (RxjhClass.GetFq(webString) == strArray4[j]) { flag = true; } } } } catch { byte[] buffer22 = this.SetMsg("系统错误,未设置正确的登陆分区,请联系管理员6"); this.Client.Send(buffer22, buffer22.Length); return; } if (!flag) { byte[] buffer23 = this.SetMsg("帐号未激活或进错分区,请联系管理员7"); this.Client.Send(buffer23, buffer23.Length); } else if (!World.smethod_1(webString)) { byte[] buffer24 = this.SetMsg("系统错误,请联系客服人员,请重新登陆6"); this.Client.Send(buffer24, buffer24.Length); } else { Form1.WriteLine(2, "用户登陆[" + webString + "]-[" + pwd + "]登陆成功 " + str + " " + this.Client.ToString()); this.Client.Send(buffer16, buffer16.Length); } } } catch (Exception exception7) { byte[] buffer25 = this.SetMsg("系统错误,请联系客服人员7"); Form1.WriteLine(1, "getid系统错误" + exception7.Message); this.Client.Send(buffer25, buffer25.Length); } }