private MonMsg_H2G GetInstantPeriodicEntity(MonMsg_H2G response) { try { if (response.Targets.Count <= 0) { return(null); } MonTgt_H2G_LP_InstantPeriodic monTgt = response.Targets[0] as MonTgt_H2G_LP_InstantPeriodic; if (monTgt == null) { return(null); } int gmuTimeout = HandlerHelper.Current.GMUTimeOut / 1000; int instantPeriodicValue = (HandlerHelper.Current.InsPerDelay * (response.InstallationNo % HandlerHelper.Current.TotInstGrp)); Log.Info(" Calculated TimeOut Value :" + instantPeriodicValue.ToString()); int instantPeriodicInterval = instantPeriodicValue <= gmuTimeout ? gmuTimeout + 5 : instantPeriodicValue; monTgt.ConfiguredInterval = Convert.ToByte(instantPeriodicValue); monTgt.LowerOrderInterval = Convert.ToByte(instantPeriodicValue & 0xFF00 >> 8); monTgt.HigherOrderInterval = Convert.ToByte(instantPeriodicValue & 0xFF); response.Targets[0] = monTgt; } catch (Exception ex) { ExceptionManager.Publish(ex); } return(response); }
bool IExMonServer4MonProcessorProxy.ProcessH2GMessage(MonMsg_H2G request) { using (ILogMethod method = Log.LogMethod("IExMonServer4MonProcessorProxy", "ProcessH2GMessage")) { bool result = default(bool); try { if (_monProcessorProxy == null) { lock (_monProcessorProxyLock) { if (_monProcessorProxy == null) { _monProcessorProxy = ExMonServer4MonProcessorProxyFactory.Get(this); } } } result = _monProcessorProxy.ProcessH2GMessage(request); } catch (Exception ex) { method.Exception(ex); } return(result); } }
// private int DisableTITO(int installation_no) { try { /*Send Tito Enable/Disable*/ m_SectorData.Command = 0x82; byte[] bData = { 0 }; /*0-disable , 1 - enable*/ m_SectorData.PutCommandDataVB(bData); #if !NEW_EXCOMMS _exchangeClientTITOEnDis.RequestExWriteSector(installation_no, 203, m_SectorData); return(_iExchangeAdminTITOEnDis.LastMessageID); #else MonMsg_H2G monMsg_H2G = new MonMsg_H2G() { InstallationNo = installation_no, }; monMsg_H2G.Targets.Add(new MonTgt_H2G_EnableDisableTITONW { EnableDisable = false }); return(ExMonServer4MonClientProxyFactory.Get().ProcessH2GMessage(monMsg_H2G) ? 0 : -1); #endif } catch (Exception ex) { LogManager.WriteLog(string.Format("Failed TITO Disable", ex.Message), LogManager.enumLogLevel.Info); ExceptionManager.Publish(ex); return(-1); } }
bool IExMonServer4CommsServerCallback.ProcessH2GMessage(MonMsg_H2G request) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "ProcessH2GMessage")) { bool result = default(bool); try { if (request == null) { method.Info("Invalid method received from monitor server"); return(false); } FFMsg_H2G h2gMessage = MonitorEntityFactory.CreateEntity(request); if (h2gMessage == null) { method.Info("Unable to convert the freeform message from monitor message"); return(false); } method.Info("Processing H2G Message for : " + h2gMessage.IpAddress); ExCommsExecutorFactory.ProcessMessage(h2gMessage); result = true; } catch (Exception ex) { method.Exception(ex); } return(result); } }
private int SetSiteCode(int nInstallationNo) { try { /*Send OPtParam*/ m_SectorData.Command = 0x81; byte[] bData = { }; m_SectorData.PutCommandDataVB(bData); #if !NEW_EXCOMMS _exchangeClientSiteCode.RequestExWriteSector(nInstallationNo, 203, m_SectorData); return(_iExchangeAdminSiteCode.LastMessageID); #else MonMsg_H2G monMsg_H2G = new MonMsg_H2G() { InstallationNo = nInstallationNo, }; monMsg_H2G.Targets.Add(new MonTgt_H2G_SetSiteCodeNW { }); return(ExMonServer4MonClientProxyFactory.Get().ProcessH2GMessage(monMsg_H2G) ? 0 : -1); #endif } catch (Exception ex) { LogManager.WriteLog("SetSiteCode | Exception Occured." + ex.Message, LogManager.enumLogLevel.Info); ExceptionManager.Publish(ex); return(-1); } }
public int SetTicketExpire(int installation_no, int TicketExpireDays) { try { m_SectorData.Command = 0x83; byte[] bData = { }; m_SectorData.PutCommandDataVB(bData); #if !NEW_EXCOMMS _exchangeClientTITOEXP.RequestExWriteSector(installation_no, 203, m_SectorData); return(_iExchangeAdminTITOEXP.LastMessageID); #else MonMsg_H2G monMsg_H2G = new MonMsg_H2G() { InstallationNo = installation_no, }; monMsg_H2G.Targets.Add(new MonTgt_H2G_SetTicketExpireNW { NoOfDays = TicketExpireDays }); return(ExMonServer4MonClientProxyFactory.Get().ProcessH2GMessage(monMsg_H2G) ? 0 : -1); #endif } catch (Exception ex) { LogManager.WriteLog("SetTicketExpire | Exception Occured." + ex.Message, LogManager.enumLogLevel.Info); ExceptionManager.Publish(ex); return(-1); } }
protected override bool ProcessH2GMessageInternal(MonMsg_H2G request) { MonTgt_G2H_GameCapping_StartEnd tgt_G2H_GameCapping_Start = request.Targets[0] as MonTgt_G2H_GameCapping_StartEnd; IGameCapping gameCapping = GameCapping.GetInstance(); gameCapping.Process_GameCapping(request.SiteCode, request.InstallationNo, tgt_G2H_GameCapping_Start, this.IsGameUnCapping); return(true); }
public void SetInstantPeriodicConfig(MonMsg_H2G response) { try { this.ProcessH2GMessage(GetInstantPeriodicEntity(response)); } catch (Exception ex) { ExceptionManager.Publish(ex); } }
void OnProcessH2GMessageFromWorker(MonMsg_H2G request) { if (!_isMonProcessorStandalone) { ((IExMonServer4MonProcessor)_monitorServer).ProcessH2GMessage(request); } else { _monitorServer.MonitorProcessorProxy.ProcessH2GMessage(request); } }
public virtual bool ProcessH2GMessage(MonMsg_H2G response) { bool result = false; try { result = _monitorServer._transceiver.ProcessH2GMessage(response); } catch (Exception ex) { Log.Exception(ex); } return(result); }
bool IExMonServer4MonProcessorProxy.ProcessH2GMessage(MonMsg_H2G request) { using (ILogMethod method = Log.LogMethod("IExMonServer4MonProcessorProxy", "ProcessH2GMessage")) { bool result = default(bool); try { result = this.MonitorProcessorProxy.ProcessH2GMessage(request); } catch (Exception ex) { method.Exception(ex); } return(result); } }
public int AFTDisable(int _installation_no) { m_SectorData.Command = 0x4D; byte[] bData = { }; m_SectorData.PutCommandDataVB(bData); #if !NEW_EXCOMMS _exchangeClient.RequestExWriteSector(_installation_no, 203, m_SectorData); return _iExchangeAdmin.LastMessageID; #else MonMsg_H2G monMsg_H2G = new MonMsg_H2G() { InstallationNo = _installation_no, }; monMsg_H2G.Targets.Add(new MonTgt_H2G_SystemDisbale { }); return ExMonServer4MonClientProxyFactory.Get().ProcessH2GMessage(monMsg_H2G) ? 0 : -1; #endif }
public int EmployeecardSend(string EmpCardNo, string EmployeeFlags, int InstallationNo) { try { m_SectorData.Command = 0x84; string EmpFlags = EmployeeFlags.Substring(2); List <byte> enumver = Enumerable.Range(0, EmpFlags.Length) .Where(x => x % 2 == 0) .Select(x => Convert.ToByte(EmpFlags.Substring(x, 2), 16)).ToList(); List <byte> cardno = Enumerable.Range(0, EmpCardNo.PadLeft(10, '0').Length) .Where(x => x % 2 == 0) .Select(x => Convert.ToByte(EmpCardNo.PadLeft(10, '0').Substring(x, 2), 16)).ToList(); enumver.Insert(0, Convert.ToByte(EmployeeFlags.Substring(0, 1))); enumver.Insert(1, Convert.ToByte(EmployeeFlags.Substring(1, 1))); enumver.InsertRange(0, cardno); byte[] bData = enumver.ToArray(); m_SectorData.PutCommandDataVB(bData); #if !NEW_EXCOMMS _exchangeClient.RequestExWriteSector(InstallationNo, 203, m_SectorData); return(_iExchangeAdmin.LastMessageID); #else MonMsg_H2G monMsg_H2G = new MonMsg_H2G() { InstallationNo = InstallationNo, }; monMsg_H2G.Targets.Add(new MonTgt_H2G_EmployeeCard { Message = "" }); return(ExMonServer4MonClientProxyFactory.Get().ProcessH2GMessage(monMsg_H2G) ? 0 : -1); #endif } catch (Exception ex) { ExceptionManager.Publish(ex); return(0); } }
/// <summary> /// Disable Machine- Call to Disable a Specific Installation /// </summary> /// <param name="datapak">Installation No/Datapak No</param> /// <returns>Unique Message ID</returns> /// internal int DisableMachine(int InstallationNo) { byte[] bData = { 1 }; sector203Data.Command = Convert.ToByte(0x80); sector203Data.PutCommandDataVB(bData); #if !NEW_EXCOMMS _exchangeClient.RequestExWriteSector(InstallationNo, 203, sector203Data); return(_iExchangeAdmin.LastMessageID); #else MonMsg_H2G monMsg_H2G = new MonMsg_H2G() { InstallationNo = InstallationNo, }; monMsg_H2G.Targets.Add(new MonTgt_H2G_EnableDisableMachineNW { }); return(ExMonServer4MonClientProxyFactory.Get().ProcessH2GMessage(monMsg_H2G) ? 0 : -1); #endif }
public void SendCommand(int installationNo, MonitorEntity_MsgTgt target) { try { target.InstallationNo = installationNo; MonMsg_H2G msg = new MonMsg_H2G(); msg.AddTarget(target); MonitorExecutionContext ctx = new MonitorExecutionContext() { H2GMessage = msg }; MonitorHandlerFactory.Current.Execute(ctx); } catch (Exception ex) { Log.Exception(ex); } }
public void Mon2FF_GIM_GameIDInfo_H2G() { MonMsg_H2G monMsg = new MonMsg_H2G()//(FaultSource.GIM_Event, (int)FaultType_GIM.Game_Id_Info_H2G) { InstallationNo = 4, }; monMsg.Targets.Add(new MonTgt_H2G_GIM_GameIDInfo() { AssetNumberInt = 111, EnableNetworkMessaging = true, PokerGamePrefix = "A", SourceAddress = Extensions.GetIpAddress(-1), }); IFreeformEntity ff = MonitorEntityFactory.CreateEntity(monMsg); Assert.IsNotNull(ff); byte[] buffer2 = FreeformEntityFactory.CreateBuffer(FF_FlowDirection.H2G, ff); string sBuffer2 = buffer2.GetConvertBytesToHexString(string.Empty); }
public bool ProcessH2GMessage(MonMsg_H2G request) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "ProcessH2GMessage")) { bool result = false; try { // find the queue executor by fault source and type IThreadPoolExecutor <MonMsg_H2G> executor = this.GetExecutorH2G(request); executor.QueueWorkerItem(request); result = true; } catch (Exception ex) { method.Exception(ex); } return(result); } }
/// <summary> /// TO process GameIdInfo message /// </summary> /// <param name="request"></param> /// <returns></returns> private bool ProcessGameIdInfoMessage(MonMsg_G2H request) { try { MonTgt_G2H_GIM_GameIDInfo monTgtMsg = request.Targets[0] as MonTgt_G2H_GIM_GameIDInfo; if (monTgtMsg == null) { return(false); } int? installationNo = 0; string assetNo = string.Empty; char? gamePrefix = '\0'; if (GIM_DataAccess.GetInstance().InsertGMULogin(monTgtMsg, request.IpAddress, ref installationNo, ref assetNo, ref gamePrefix)) { MonMsg_H2G monH2G_Msg = new MonMsg_H2G(); MonTgt_H2G_GIM_GameIDInfo monH2G_GameIdInfo_Msg = new MonTgt_H2G_GIM_GameIDInfo(); monH2G_Msg.FaultSource = Convert.ToInt32(FaultSource.GIM_Event); monH2G_Msg.FaultType = Convert.ToInt32(FaultType_GIM.Game_Id_Info_H2G); monH2G_Msg.IpAddress = request.IpAddress; monH2G_Msg.InstallationNo = installationNo.GetValueOrDefault(); monH2G_GameIdInfo_Msg.SourceAddress = new System.Net.IPAddress(Convert.ToByte(request.IpAddress)); monH2G_GameIdInfo_Msg.AssetNumber = assetNo; monH2G_GameIdInfo_Msg.PokerGamePrefix = gamePrefix.ToString(); monH2G_Msg.AddTarget(monH2G_GameIdInfo_Msg); this.ProcessH2GMessage(monH2G_Msg); return(true); } return(false); } catch (Exception ex) { Log.Exception(ex); return(false); } }
public bool ProcessH2GMessage(MonMsg_H2G request) { return(this.InvokeMethod((i) => i.ProcessH2GMessage(request))); }
internal int SendSectorCommand() { if (mEvent.WaitOne(NetworkServiceSettings.RequestWaitTime)) { return(-1); } DataTable dt = DBBuilder.GetInstallationsForInstantPeriodicInterval(); if (dt == null || dt.Rows.Count == 0) { return(-1); } byte[] bData = { }; m_SectorData.Command = Convert.ToByte(0x71); m_SectorData.PutCommandDataVB(bData); foreach (DataRow dr in dt.Rows) { int installationNo = 0; try { if (mEvent.WaitOne(NetworkServiceSettings.RequestWaitTime)) { break; } if (Int32.TryParse(dr["Installation_No"].ToString(), out installationNo)) { #if !NEW_EXCOMMS _exchangeClient.RequestExWriteSector(installationNo, 203, m_SectorData); #else MonMsg_H2G monMsg_H2G = new MonMsg_H2G() { InstallationNo = installationNo, }; monMsg_H2G.Targets.Add(new MonTgt_H2G_InstantPeriodicNW { }); return(ExMonServer4MonClientProxyFactory.Get().ProcessH2GMessage(monMsg_H2G) ? 0 : -1); #endif LogManager.WriteLog("|##> Successfully sent the details for installation : " + installationNo.ToString(), LogManager.enumLogLevel.Info); } else { LogManager.WriteLog("|##> Unable to get the installation from database for installation : " + installationNo.ToString(), LogManager.enumLogLevel.Error); } } catch (Exception ex) { LogManager.WriteLog("|##> Unable to send command for Installation : " + installationNo.ToString(), LogManager.enumLogLevel.Error); ExceptionManager.Publish(ex); } } return(0); }
protected virtual bool ProcessH2GMessageInternal(MonMsg_H2G request) { return(_monitorServer._transceiver.ProcessH2GMessage(request)); }
public bool ProcessH2GMessage(MonMsg_H2G request) { return(false); }
bool IExMonitorServerImpl.ProcessH2GMessage(MonMsg_H2G request) { return(((IExMonServer4MonProcessor)this).ProcessH2GMessage(request)); }