Ejemplo n.º 1
0
        /// <summary>
        /// Internal method used to serialize and send match messages on another thread
        /// </summary>
        private void MatchSend()
        {
            MatchData match = new MatchData
            {
                matchName   = man.ServerName,
                playerCount = man.ConnectedClients.Count
            };

            IPEndPoint target = new IPEndPoint(IPAddress.Broadcast, NetworkManager.LANBroadcastPort);

            byte[] packet;

            try
            {
                packet = man.prepSend(match);
            }

            catch (Exception ex)
            {
                string message = "Recieved exception from prepSend: " + ex.ToString();
                Debug.LogError(message + ", MSG: " + match);
                return;
            }

            LANMatchSocket.SendTo(packet, target);

            Thread.Sleep(matchBroadcastInterval);
            MatchSend();
        }
Ejemplo n.º 2
0
 private void MatchRequest(byte[] packet, EndPoint e)
 {
     LANMatchSocket.SendTo(packet, e);
 }