private void SendLiveSystemInfoToManagingSystem(ConnectionInfo connectionInfo) { LiveSystemInfo lsi = new LiveSystemInfo(); foreach (InternalClientStatus ics in _internalClientStatus) { TimeSpan timeLeft = new TimeSpan(0, 0, 0); if (ics.ClientRunningModeSetup.RunningMode == VRGameSelectorDTO.Enums.ClientRunningMode.TIMING_ON) { timeLeft = (ics.ClientRunningModeSetup.StartTime != DateTime.MinValue) ? ics.ClientRunningModeSetup.StartTime.AddMinutes(ics.ClientRunningModeSetup.Duration).Subtract(DateTime.Now) : timeLeft; } else if (ics.ClientRunningModeSetup.RunningMode == VRGameSelectorDTO.Enums.ClientRunningMode.NO_TIMING_ON) { timeLeft = (ics.ClientRunningModeSetup.StartTime != DateTime.MinValue) ? DateTime.Now.Subtract(ics.ClientRunningModeSetup.StartTime) : timeLeft; } lsi.LiveClientStatus.Add(new LiveClientStatus() { ClientID = ics.ClientID, ClientIP = ics.ClientIP, ClientName = string.IsNullOrEmpty(ics.ClientName) ? ics.ClientIP : ics.ClientName, AdditionalInfo = ics.AdditionalInfo, ClientStatus = ics.ClientStatus ?? default(VRGameSelectorServerDTO.Enums.LiveClientStatus), IsAssistanceRequested = ics.IsRequireAssistance ?? default(bool), TimeLeft = timeLeft, Mode = ics.ClientRunningModeSetup.RunningMode.ToString() }); } VRCommandServer vcs = new VRCommandServer(VRGameSelectorServerDTO.Enums.ControlMessage.GET_LIVE_SYSTEM_INFO, lsi); SendCommandToPeer(connectionInfo, vcs); }
private void GetConfiguredClientList(ConnectionInfo connectionInfo) { using (VRArcadeDataAccessModel m = new VRArcadeDataAccessModel()) { List <VRClient> vc = m.VRClients.Where(x => !x.IsDeleted).ToList(); List <Client> lc = new List <Client>(); foreach (VRClient item in vc) { string tcsName = ""; if (item.Tileconfigset != null) { tcsName = item.Tileconfigset.Name; } lc.Add(new Client(item.ID, item.IPAddress, item.DashboardModuleIP, item.MachineName, item.TileConfigSetID, tcsName)); } VRCommandServer vcs = new VRCommandServer(VRGameSelectorServerDTO.Enums.ControlMessage.GET_CONFIGED_CLIENT_LIST, lc); SendCommandToPeer(connectionInfo, vcs); } }
private void GetSysConfig(ConnectionInfo connectionInfo, List <SystemConfig> systemConfig) { using (VRArcadeDataAccessModel m = new VRArcadeDataAccessModel()) { List <SystemConfig> lsc = new List <SystemConfig>(); foreach (SystemConfig sc in systemConfig) { VRConfiguration vc = m.VRConfigurations.Where(x => x.Type == Enum.GetName(typeof(VRGameSelectorServerDTO.Enums.SysConfigType), sc.Type)).FirstOrDefault(); if (vc != null) { lsc.Add(new SystemConfig((VRGameSelectorServerDTO.Enums.SysConfigType)Enum.Parse(typeof(VRGameSelectorServerDTO.Enums.SysConfigType), vc.Type, true), vc.Value)); } else { lsc.Add(new SystemConfig(sc.Type, "")); } } VRCommandServer vcs = new VRCommandServer(VRGameSelectorServerDTO.Enums.ControlMessage.GET_SYSCONFIG, lsc); SendCommandToPeer(connectionInfo, vcs); } }
private void GetBookingReferenceSetting(ConnectionInfo connectionInfo, BookingReference bookingReference) { using (VRArcadeDataAccessModel m = new VRArcadeDataAccessModel()) { VRBookingReference vbr = m.VRBookingReferences.Where(x => x.Reference == bookingReference.Reference && x.BookingDeleted == null && x.NumberOfBookingLeft > 0).FirstOrDefault(); if (vbr != null) { bookingReference.IsNonTimedTiming = vbr.IsNonTimedTiming; bookingReference.IsTimedTiming = vbr.IsTimedTiming; bookingReference.Duration = vbr.Duration; bookingReference.NumberOfBookingLeft = vbr.NumberOfBookingLeft; bookingReference.NumberOfBookingTotal = vbr.NumberOfBookingTotal; bookingReference.BookingStartTime = (vbr.BookingStartTime != null) ? (DateTime)vbr.BookingStartTime : DateTime.MinValue; bookingReference.BookingEndTime = (vbr.BookingEndTime != null) ? (DateTime)vbr.BookingEndTime : DateTime.MinValue; } else { bookingReference.Reference = ""; } VRCommandServer vcs = new VRCommandServer(VRGameSelectorServerDTO.Enums.ControlMessage.GET_BOOKING_REF_SETTING, bookingReference); SendCommandToPeer(connectionInfo, vcs); } }
public static void GetGamePlayHistory(int clientID) { List <ClientParm> cp = new List <ClientParm>(); cp.Add(new ClientParm(clientID)); VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.GET_GAME_PLAY_HISTORY, cp); SendCommandToServer(cmd); }
public static void SetSystemConfig(SystemConfig systemConfig) { List <SystemConfig> lsc = new List <SystemConfig>(); lsc.Add(systemConfig); VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.SET_SYSCONFIG, lsc); SendCommandToServer(cmd); }
public static void GetTileConfig(int tileConfigSetID) { TileConfig tc = new TileConfig() { TileConfigSetID = tileConfigSetID }; VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.GET_TILE_CONFIG, tc); SendCommandToServer(cmd); }
private void GetGamePlayHistory(ConnectionInfo connection, List <ClientParm> clientParm) { ClientParm cp = clientParm.FirstOrDefault(); System.IO.StringWriter output = new System.IO.StringWriter(); if (cp != null) { using (VRArcadeDataAccessModel m = new VRArcadeDataAccessModel()) { List <VRClienthistory> lvch = m.VRClienthistories.Where(x => x.VRClientID == cp.ClientID).OrderByDescending(y => y.ID).Take(500).ToList(); List <GamePlayHistory> lgph = new List <GamePlayHistory>(); foreach (VRClienthistory vch in lvch) { GamePlayHistory gph = new GamePlayHistory(); gph.TileID = vch.TileConfigID; gph.StartTime = vch.StartTime ?? DateTime.MinValue; gph.EndTime = vch.EndTime ?? DateTime.MinValue; if (vch.TileConfigID != -1) { VRTileconfig vtc = m.VRTileconfigs.Where(x => x.ID == vch.TileConfigID).FirstOrDefault(); gph.TileName = (vtc != null) ? vtc.TileTitle : "ERROR!"; } else { gph.TileName = "VR Game Selector Interface"; } lgph.Add(gph); } VRCommandServer vrc = new VRCommandServer(VRGameSelectorServerDTO.Enums.ControlMessage.GET_GAME_PLAY_HISTORY, lgph); SendCommandToPeer(connection, vrc); } } }
private void GetConfigSetList(ConnectionInfo connectionInfo) { using (VRArcadeDataAccessModel m = new VRArcadeDataAccessModel()) { List <VRTileconfigset> lvrcs = m.VRTileconfigsets.Where(x => !x.IsDeleted).ToList(); List <ConfigSet> lcs = new List <ConfigSet>(); foreach (VRTileconfigset item in lvrcs) { lcs.Add(new ConfigSet() { ID = item.ID, Name = item.Name }); } VRCommandServer vcs = new VRCommandServer(VRGameSelectorServerDTO.Enums.ControlMessage.GET_CONFIG_SET_LIST, lcs); SendCommandToPeer(connectionInfo, vcs); } }
private void GetKeyType(ConnectionInfo connectionInfo) { using (VRArcadeDataAccessModel m = new VRArcadeDataAccessModel()) { List <VRTicketType> lvrTicketType = m.VRTicketTypes.Where(x => x.Type.StartsWith("KEY-")).ToList(); List <KeyTypeInfo> keyTypeInfo = new List <KeyTypeInfo>(); foreach (VRTicketType vrTicketType in lvrTicketType) { keyTypeInfo.Add(new KeyTypeInfo() { KeyTypeID = vrTicketType.ID, KeyTypeName = vrTicketType.Type }); } VRCommandServer vcs = new VRCommandServer(VRGameSelectorServerDTO.Enums.ControlMessage.GET_KEY_TYPE, keyTypeInfo); SendCommandToPeer(connectionInfo, vcs); } }
private void GetTileConfigList(ConnectionInfo connectionInfo, int tileConfigSetID) { using (VRArcadeDataAccessModel m = new VRArcadeDataAccessModel()) { List <VRTileconfig> lvrtc = m.VRTileconfigs.Where(x => x.TileConfigSetID == tileConfigSetID && !x.IsDeleted).ToList(); List <VRGameSelectorServerDTO.TileConfig> ltc = new List <VRGameSelectorServerDTO.TileConfig>(); foreach (VRTileconfig item in lvrtc) { ltc.Add(new VRGameSelectorServerDTO.TileConfig() { ID = item.ID, TileGUID = item.TileGUID, TileTitle = item.TileTitle, TileHeight = item.TileHeight, TileWidth = item.TileWidth, TileDesc = item.TileDesc, Command = item.Command, Arguments = item.Arguments, WorkingPath = item.WorkingPath, Order = item.Order, TileRowNumber = item.TileRowNumber, TileConfigSetID = item.TileConfigSetID, TileconfigID = item.VRTileconfigID, AgeRequire = item.AgeRequire, VideoURL = item.VideoURL, TileImage = new VRGameSelectorServerDTO.ImageInfo(item.ImageData) }); } VRCommandServer vcs = new VRCommandServer(VRGameSelectorServerDTO.Enums.ControlMessage.GET_TILE_CONFIG, ltc); SendCommandToPeer(connectionInfo, vcs); } }
private void GetKey(ConnectionInfo connectionInfo) { using (VRArcadeDataAccessModel m = new VRArcadeDataAccessModel()) { List <VRTicket> lvrTicket = m.VRTickets.Where(x => x.VRTicketType.Type.StartsWith("KEY-") && !x.IsDeleted).ToList(); List <KeyInfo> keyInfo = new List <KeyInfo>(); foreach (VRTicket vrTicket in lvrTicket) { keyInfo.Add(new KeyInfo() { Key = vrTicket.GUID, KeyTypeID = vrTicket.VRTicketTypeID ?? 0, KeyTypeName = vrTicket.VRTicketType.Type, Minutes = vrTicket.Minutes, CreateDate = vrTicket.TimeStampCreate }); } VRCommandServer vcs = new VRCommandServer(VRGameSelectorServerDTO.Enums.ControlMessage.GET_KEY, keyInfo); SendCommandToPeer(connectionInfo, vcs); } }
public static void TurnOffCleaningFlag(List <ClientParm> clientParm) { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.CLEANING_PROVIDED, clientParm); SendCommandToServer(cmd); }
public static void SendTurnOnKMU(List <ClientParm> clientParm) { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.TURN_ON_KMU, clientParm); SendCommandToServer(cmd); }
public static void SendReboot(List <ClientParm> clientParm) { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.REBOOT, clientParm); SendCommandToServer(cmd); }
public static void SendEndNow(List <ClientParm> clientParm) { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.END_NOW, clientParm); SendCommandToServer(cmd); }
public static void MarkWaiverReceived(List <WaiverInfo> listWaverInfo) { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.MARK_WAIVER_RECEIVED, listWaverInfo); SendCommandToServer(cmd); }
public static void DeleteKey(List <KeyInfo> keyInfo) { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.DELETE_KEY, keyInfo); SendCommandToServer(cmd); }
public static void GetKey() { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.GET_KEY); SendCommandToServer(cmd); }
public static void GenerateBarcode(BarcodeInfo barcodeInfo) { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.GENERATE_BARCODE, barcodeInfo); SendCommandToServer(cmd); }
public static void ReOrderDownTileConfig(TileConfig tileConfig) { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.REORDER_DOWN_TILE_CONFIG, tileConfig); SendCommandToServer(cmd); }
public static void GetBookingReferenceSetting(BookingReference bookingReference) { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.GET_BOOKING_REF_SETTING, bookingReference); SendCommandToServer(cmd); }
public static void AddKey(List <KeyInfo> keyInfo) { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.ADD_KEY, keyInfo); SendCommandToServer(cmd); }
public static void SyncTileConfig() { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.SYNC_TILE_CONFIG); SendCommandToServer(cmd); }
public static void GetPendingWaiver() { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.GET_PENDING_WAIVER); SendCommandToServer(cmd); }
public static void ReInitClientSetting() { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.REINIT_CLIENT_SETTING); SendCommandToServer(cmd); }
public static void DeletePendingWaiver(List <WaiverInfo> listWaverInfo) { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.DELETE_PENDING_WAIVER, listWaverInfo); SendCommandToServer(cmd); }
public static void GetLiveSystemInfo() { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.GET_LIVE_SYSTEM_INFO); SendCommandToServer(cmd); }
private static void HandleGlobalIncomingCommand(PacketHeader packetHeader, Connection connection, VRCommandServer vrCommandServer) { switch (vrCommandServer.ControlMessage) { case Enums.ControlMessage.NONE: break; case Enums.ControlMessage.GET_SYSCONFIG: SystemConfigEvent sce = new SystemConfigEvent() { SystemConfig = vrCommandServer.SystemConfig.Clone() }; OnIncommingSystemConfig(null, sce); break; case Enums.ControlMessage.GET_CONFIGED_CLIENT_LIST: ClientEvent ce = new ClientEvent() { ListClients = vrCommandServer.ListClients.Clone() }; OnIncommingConfigerClientList(null, ce); break; case Enums.ControlMessage.GET_CONFIG_SET_LIST: ConfigSetEvent cse = new ConfigSetEvent() { ListConfigSets = vrCommandServer.ListConfigSet.Clone() }; OnIncommingConfigSetList(null, cse); break; case Enums.ControlMessage.GET_TILE_CONFIG: TileConfigEvent tce = new TileConfigEvent() { ListTileConfigs = vrCommandServer.ListTileConfig.Clone() }; OnIncommingTileConfigList(null, tce); break; case Enums.ControlMessage.GET_LIVE_SYSTEM_INFO: LiveSystemInfoEvent lsie = new LiveSystemInfoEvent() { LiveSystemInfo = vrCommandServer.LiveSystemInfo.Clone() }; OnIncommingLiveSystemInfo(null, lsie); if (_lastRefreshTime != DateTime.MinValue) { _secondSinceRefresh = DateTime.Now.Subtract(_lastRefreshTime).TotalSeconds; } _lastRefreshTime = DateTime.Now; break; case Enums.ControlMessage.GET_GAME_PLAY_HISTORY: GamePlayHistoryEvent gphe = new GamePlayHistoryEvent() { ListGamePlayHistory = vrCommandServer.GamePlayHistory.Clone() }; OnIncommingGamePlayHistory(null, gphe); break; case Enums.ControlMessage.GENERATE_BARCODE: BarcodeInfoEvent bie = new BarcodeInfoEvent() { BarcodeInfo = vrCommandServer.BarcodeInfo }; OnIncommingBarcodeInfo(null, bie); break; case Enums.ControlMessage.GET_KEY: KeyInfoEvent kie = new KeyInfoEvent() { ListKeyInfo = vrCommandServer.ListKeyInfo }; OnIncommingKeyInfoList(null, kie); break; case Enums.ControlMessage.GET_KEY_TYPE: KeyTypeInfoEvent ktie = new KeyTypeInfoEvent() { ListKeyTypeInfo = vrCommandServer.ListKeyTypeInfo }; OnIncommingKeyTypeInfoList(null, ktie); break; case Enums.ControlMessage.GET_PENDING_WAIVER: WaiverInfoEvent wie = new WaiverInfoEvent() { ListWaiverInfo = vrCommandServer.ListWaiverInfo }; OnIncommingWaiverInfoList(null, wie); break; case Enums.ControlMessage.GET_BOOKING_REF_SETTING: BookingReferenceEvent bre = new BookingReferenceEvent() { BookingReference = vrCommandServer.BookingReference }; OnIncommingBookingReference(null, bre); break; default: break; } }
public static void SendStartTiming(List <ClientParm> clientParm) { VRCommandServer cmd = new VRCommandServer(Enums.ControlMessage.START_TIMING, clientParm); SendCommandToServer(cmd); }