private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { int n = listBox1.SelectedIndex; if (n == -1) { return; } string s = ""; Player.PlayerInfo p = Player.AllPlayers[Indexes[n]]; s += "Name: " + p.Name + "\n"; s += "ID: " + p.ID + "\n"; s += "Game State: " + p.GameState + "\n"; s += "Authstring: " + p.AuthString + "\n"; s += "Player ID: " + p.PlayerID.ToString("X") + "\n"; s += "User ID: " + p.UserID.ToString("X") + "\n"; s += "External IP: " + IPtoString(p.EXIP.IP) + "\n"; s += "External Port: " + p.EXIP.PORT + "\n"; s += "Internal IP: " + IPtoString(p.INIP.IP) + "\n"; s += "Internal Port: " + p.INIP.PORT + "\n"; s += "\nSettings (" + p.Settings.Count + ") : \n"; s += p.GetSettings(); rtb1.Text = s; }
public static void DumpPacket(byte[] buff, Player.PlayerInfo player) { Thread t = new Thread(ThreadPacketDump); DumpStruct d = new DumpStruct(); d.buff = buff; d.player = player; t.Start(d); }
private string CreatePlayerSummary(Player.PlayerInfo player) { string s = ""; s += " Player Name : " + player.Name + "\n"; s += " Player ID : 0x" + player.ID.ToString("X") + "\n"; s += " Player PID : 0x" + player.PlayerID.ToString("X") + "\n"; s += " Player UID : 0x" + player.UserID.ToString("X") + "\n"; s += " EXIP IP : 0x" + player.EXIP.IP.ToString("X") + "\n"; s += " EXIP PORT : 0x" + player.EXIP.PORT.ToString("X") + "\n"; s += " INIP IP : 0x" + player.INIP.IP.ToString("X") + "\n"; s += " INIP PORT : 0x" + player.INIP.PORT.ToString("X") + "\n"; s += "\n"; return(s); }
public static GameInfo CreateGame(Player.PlayerInfo player) { GameInfo res = new GameInfo(); res.Creator = player; res.ID = (uint)(AllGames.Count + 0x5DC695); res.MID = (uint)(AllGames.Count + 0x1129DA20); res.isActive = true; res.Update = true; res.OtherPlayers = new List <Player.PlayerInfo>(); res.Attributes = new List <Attribut>(); res.GAMESETTING = 0; res.GAMESTATE = 0; AllGames.Add(res); return(res); }
private string GetInfo(Player.PlayerInfo player) { string s = ""; s += player.ID + " : "; s += "IP(" + player.IP + ") "; s += "GameState(" + player.GameState + ") "; if (player.UserID != 0) { s += "UserID(" + player.PlayerID.ToString("X") + ") "; } if (player.Name != null && player.Name != "") { s += "Name(" + player.Name + ") "; } return(s); }
private void editSettingsToolStripMenuItem_Click(object sender, EventArgs e) { int n = listBox1.SelectedIndex; if (n == -1) { return; } Player.PlayerInfo p = Player.AllPlayers[Indexes[n]]; GUI_PlayerSettings gui = new GUI_PlayerSettings(); gui.player = p; gui.FreshList(); gui.MdiParent = this.MdiParent; gui.Show(); gui.WindowState = FormWindowState.Maximized; }
private void timer1_Tick(object sender, EventArgs e) { if (Player.AllPlayers == null) { return; } int count = 0; bool update = false; foreach (Player.PlayerInfo p in Player.AllPlayers) { if (p.isActive) { count++; } if (p.Update) { update = true; p.Update = false; } } if (count != listBox1.Items.Count || update) { Indexes = new List <int>(); int n = listBox1.SelectedIndex; listBox1.Items.Clear(); for (int i = 0; i < Player.AllPlayers.Count; i++) { Player.PlayerInfo player = Player.AllPlayers[i]; if (player.isActive) { listBox1.Items.Add(GetInfo(player)); Indexes.Add(i); } } if (n < listBox1.Items.Count) { listBox1.SelectedIndex = n; } } }