Example #1
0
        private void HandleRegisteredMessage(int bibNumber, double time, string firstName,
                                             string lastName, char gender, int age)
        {
            Athlete athlete = new Athlete(bibNumber, firstName, lastName, gender, age, time, 0, 0);

            Athletes.Add(athlete);
            foreach (Client c in Clients)
            {
                SendAthleteMessage(athlete, c.EndPoint);
            }
        }
Example #2
0
        private void SendStatus(Athlete a)
        {
            List <IPEndPoint> targetClients = new List <IPEndPoint>();

            foreach (Client c in Clients)
            {
                if (c.SubbedAthletes != null)
                {
                    foreach (int b in c.SubbedAthletes)
                    {
                        if (b == a.BibNumber)
                        {
                            targetClients.Add(c.EndPoint);
                        }
                    }
                }
            }

            foreach (IPEndPoint c in targetClients)
            {
                CommsBoi.Send("Status," + a.BibNumber + "," + STATUS_LOOKUP[a.Status.CurrStatus] + "," + a.Status.StartTime +
                              "," + a.Status.Distance + "," + a.Status.LastUpdateTime + "," + a.Status.LastUpdateTime, c);
            }
        }
Example #3
0
 private void SendAthleteMessage(Athlete newAthlete, IPEndPoint clientEndPoint)
 {
     CommsBoi.Send("Athlete," + newAthlete.BibNumber + "," + newAthlete.FirstName + "," +
                   newAthlete.LastName + "," + newAthlete.Gender + "," + newAthlete.Age, clientEndPoint);
 }