protected static void Answer(NetIncomingMessage msg) { SpaceWar2006.GameSystem.GameServerInfo info; { string p = msg.ReadString(); info = new SpaceWar2006.GameSystem.GameServerInfo(p); infos.Add(msg.SenderEndpoint.Address.ToString() + ":" + msg.SenderEndpoint.Port, info); } }
protected void Answer(NetIncomingMessage msg) { SpaceWar2006.GameSystem.GameServerInfo info; { string p = msg.ReadString(); info = new SpaceWar2006.GameSystem.GameServerInfo(p); infos.Add(info); } }
protected void OnServerAnswer(Lidgren.Network.NetIncomingMessage msg) { //SpaceWar2006.GameSystem.GameServerInfo info = p as SpaceWar2006.GameSystem.GameServerInfo; SpaceWar2006.GameSystem.GameServerInfo info; //if (info == null) { string p = msg.ReadString(); info = new SpaceWar2006.GameSystem.GameServerInfo(p); } ListViewItem lvi = FindServer(msg.SenderEndpoint); bool add = false; string[] subitems = new string[5]; if (lvi == null) { lvi = new ListViewItem(); lvi.Tag = msg.SenderEndpoint.ToString(); add = true; } //subitems[1] = msg.SenderEndpoint.ToString(); if (info != null) { subitems[0] = msg.SenderEndpoint.ToString(); subitems[1] = info.Map; subitems[2] = info.GameType; subitems[3] = info.NumPlayers.ToString() + "/" + info.MaxPlayers.ToString(); subitems[4] = info.Password.ToString(); lvi.Text = info.ServerName; } lvi.SubItems.Clear(); lvi.SubItems.AddRange(subitems); if (info != null) { lvi.Text = info.ServerName; } else { lvi.Text = "???"; } if (add) { ServerList.Items.Add(lvi); } }
protected void OnServerAnswer(Lidgren.Network.NetIncomingMessage msg) { //SpaceWar2006.GameSystem.GameServerInfo info = p as SpaceWar2006.GameSystem.GameServerInfo; SpaceWar2006.GameSystem.GameServerInfo info; //if (info == null) { string p = msg.ReadString(); info = new SpaceWar2006.GameSystem.GameServerInfo(p); } ListViewItem lvi=FindServer(msg.SenderEndpoint); bool add = false; string[] subitems = new string[5]; if (lvi == null) { lvi = new ListViewItem(); lvi.Tag = msg.SenderEndpoint.ToString(); add = true; } //subitems[1] = msg.SenderEndpoint.ToString(); if (info != null) { subitems[0] = msg.SenderEndpoint.ToString(); subitems[1] = info.Map; subitems[2] = info.GameType; subitems[3] = info.NumPlayers.ToString() + "/" + info.MaxPlayers.ToString(); subitems[4] = info.Password.ToString(); lvi.Text = info.ServerName; } lvi.SubItems.Clear(); lvi.SubItems.AddRange(subitems); if (info != null) { lvi.Text = info.ServerName; } else { lvi.Text = "???"; } if(add) ServerList.Items.Add(lvi); }
public static void Answer(Lidgren.Network.NetIncomingMessage msg) { GameSystem.GameServerInfo info = new SpaceWar2006.GameSystem.GameServerInfo(msg.ReadString()); servers[msg.SenderEndpoint] = info; }
protected static void Answer(NetIncomingMessage msg) { SpaceWar2006.GameSystem.GameServerInfo info; { string p = msg.ReadString (); info = new SpaceWar2006.GameSystem.GameServerInfo (p); infos.Add (msg.SenderEndpoint.Address.ToString () + ":" + msg.SenderEndpoint.Port, info); } }