Exemplo n.º 1
0
 public TournamentPlayer(IMessagingClient client, ConfigurationProposal configProposal,
     IWorldState preferredWorldState)
 {
     this.client = client;
     this.configProposal = configProposal;
     this.preferredWorldState = preferredWorldState;
 }
Exemplo n.º 2
0
 static void InitConnection()
 {
     var client = new TestingClient();
     var configs = new ConfigurationProposal
     {
         LoadingData = new LoadingData { AssemblyName = ToolConstants.AssemblyName, Level = ToolConstants.Level },
         SettingsProposal = ToolConstants.Settings
     };
     try
     {
         client.Configurate(ToolConstants.ServicePort, configs, ToolConstants.WorldState, ToolConstants.Ip);
     }
     catch (Exception e)
     {
         Console.WriteLine("maybe error while sending settings: " + e.Message);
     }
     client.Exit();
 }
Exemplo n.º 3
0
 public static void AddPlayerToPool(CvarcClient client, Configuration configuration, IWorldState worldState, ConfigurationProposal configProposal)
 {
     if (haveForceGame)
     {
         if (UnityConstants.OnlyGamesThroughServicePort)
             HttpWorker.SendInfoToLocal(configProposal.SettingsProposal.CvarcTag);
         if (forceRunner.AddPlayerAndCheck(new TournamentPlayer(client, configProposal, worldState)))
             haveForceGame = false;
         return;
     }
     lock (pool)
     {
         if (!pool.ContainsKey(configuration.LoadingData))
         {
             pool.Add(configuration.LoadingData, new TournamentRunner(worldState, configuration));
             Dispatcher.AddRunner(pool[configuration.LoadingData]);
         }
         if (pool[configuration.LoadingData].AddPlayerAndCheck(new TournamentPlayer(client, configProposal, worldState)))
             pool.Remove(configuration.LoadingData);
     }
 }