Ejemplo n.º 1
0
 public void Initialize()
 {
     if (maps != null)
     {
         return;
     }
     if (rawManager.TryWaitRawRequest(new Request {
         AvailableMaps = new RequestAvailableMaps {
         }
     }, out var response))
     {
         maps = new List <string>(response.AvailableMaps.BattlenetMapNames);
     }
     else
     {
         throw new TimeoutException();
     }
 }
Ejemplo n.º 2
0
 void IModule.OnStart()
 {
     if (rawManager.TryWaitRawRequest(NydusNetwork.Model.ClientConstant.RequestGameInfo, out var info, int.MaxValue))
     {
         GameMap.Initialize(info.GameInfo, this);
     }
     if (rawManager.TryWaitObservationRequest(out var obs, GameLoop))
     {
         InitialIntel(obs.Observation.Observation);
         UpdateIntel(obs.Observation.Observation);
         if (GameConstants.ParticipantRace == Race.Random || GameConstants.ParticipantRace == Race.NoRace)
         {
             GameConstants.ParticipantRace = unitTypeRepository.Get(StructuresSelf.Values.FirstOrDefault().UnitType).Race;
         }
     }
     GenerateColonies(info.GameInfo.StartRaw);
     Handler.RegisterHandler(Case.WorkerAddedSelf, u => AddWorkerSelfToColony(u));
     Handler.RegisterHandler(Case.StructureAddedSelf, u => AddStructureSelfToColony(u));
 }