Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
 protected void Answer(NetIncomingMessage msg)
 {
     SpaceWar2006.GameSystem.GameServerInfo info;
     {
         string p = msg.ReadString();
         info = new SpaceWar2006.GameSystem.GameServerInfo(p);
         infos.Add(info);
     }
 }
Esempio n. 3
0
 protected void Answer(NetIncomingMessage msg)
 {
     SpaceWar2006.GameSystem.GameServerInfo info;
     {
         string p = msg.ReadString();
         info = new SpaceWar2006.GameSystem.GameServerInfo(p);
         infos.Add(info);
     }
 }
Esempio n. 4
0
        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);
            }
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 public static void Answer(Lidgren.Network.NetIncomingMessage msg)
 {
     GameSystem.GameServerInfo info = new SpaceWar2006.GameSystem.GameServerInfo(msg.ReadString());
     servers[msg.SenderEndpoint] = info;
 }
Esempio n. 7
0
 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);
     }
 }
Esempio n. 8
0
 public static void Answer(Lidgren.Network.NetIncomingMessage msg)
 {
     GameSystem.GameServerInfo info = new SpaceWar2006.GameSystem.GameServerInfo(msg.ReadString());
     servers[msg.SenderEndpoint] = info;
 }