Exemple #1
0
        private void sendUpdatePacmans()
        {
            for (int i = 0; i < players.Count; i++)
            {
                pacmans[i][0] = i;
                pacmans[i][1] = players[i].getLeft();
                pacmans[i][2] = players[i].getTop();
                pacmans[i][3] = players[i].getScore();
            }

            for (int i = 0; i < players.Count; i++)
            {
                try
                {
                    ClientInterface c = (ClientInterface)Activator.GetObject(typeof(ClientInterface), players[i].getUrl());
                    c.updatePacmans(pacmans, round);
                }
                catch (Exception e)
                {
                    Console.WriteLine("ERRO3" + i);
                    failureDetector.getKnownProcessById(i.ToString()).addFail(new Fail());
                    players[i].setAlive(false);
                }
            }
        }