Beispiel #1
0
        private void BuildInternalClientStatus()
        {
            if (_internalClientStatus == null)
            {
                _internalClientStatus = new List <InternalClientStatus>();
            }
            else
            {
                _internalClientStatus.Clear();
            }


            using (VRArcadeDataAccessModel m = new VRArcadeDataAccessModel())
            {
                foreach (VRClient vc in m.VRClients.Where(x => !x.IsDeleted).ToList())
                {
                    ClientRunningMode cs = new ClientRunningMode(vc.ID, vc.IPAddress, DateTime.MinValue, 0, 0, VRGameSelectorDTO.Enums.ClientRunningMode.ENDED_TIMING, null, 0);

                    InternalClientStatus ics = new InternalClientStatus()
                    {
                        ClientID                        = vc.ID,
                        ClientIP                        = vc.IPAddress,
                        DashboardModuleIP               = vc.DashboardModuleIP,
                        ClientName                      = vc.MachineName,
                        AdditionalInfo                  = "",
                        IsRequireAssistance             = false,
                        ClientStatus                    = VRGameSelectorServerDTO.Enums.LiveClientStatus.NONE,
                        LastPingTimeStamp               = DateTime.MinValue,
                        LastTileConfigDownloadTimestamp = DateTime.MinValue,
                        ClientRunningModeSetup          = cs
                    };

                    _internalClientStatus.Add(ics);
                }
            }

            isManageSystemPushRequired = true;

            foreach (ConnectionInfo cInfo in _targetClientDaemonConnection)
            {
                string ipAdd = ((IPEndPoint)cInfo.RemoteEndPoint).Address.MapToIPv4().ToString();

                InternalClientStatus iClientStatus = _internalClientStatus.Where(x => x.ClientIP == ipAdd).FirstOrDefault();

                if (iClientStatus != null)
                {
                    UpdateInternalClientSetup(iClientStatus.ClientID, DateTime.Now, VRGameSelectorDTO.Enums.ClientRunningMode.ENDED_MANUAL);

                    VRCommand vrc = new VRCommand(VRGameSelectorDTO.Enums.ControlMessage.END_NOW);

                    SendCommandToPeer(cInfo, vrc);
                }
            }
        }
Beispiel #2
0
 private void SetClientCurrentRunningMode(ClientRunningMode clientRunningMode)
 {
     _internalClientRunningMode = clientRunningMode;
 }