Exemple #1
0
        public string getBaseDefaultReelStops()
        {
            SpinResult result = m_CurrentSlotReel.PlayGame();

            while (result.getWinAmount() != 0)
            {
                result = m_CurrentSlotReel.PlayGame();
            }
            string sReels = "";

            int[] reels = result.getReelStops();
            for (int i = 0; i < reels.Length; i++)
            {
                if (i != 0)
                {
                    sReels += " ";
                }
                sReels += reels[i];
            }
            return(sReels);
        }
Exemple #2
0
        public virtual void PlayGameSimulator(int betAmount = 1)
        {
            m_iBetLevel = 1;
            if (m_Stage == STAGE.STAGE_IDLE || m_Stage == STAGE.STAGE_IDLE)
            {
                //m_FSReelStops.Clear();
                m_SpinResult.ClearTiggerLine();
                m_TriggeredSlotFeatures.Clear();
                m_SpinResult.ResetFlags();

                if (m_sForceStop != "" && m_bForceSpin)
                {
                    try
                    {
                        m_CurrentSlotReel.SetForceSpin(m_sForceStop, true);
                    }
                    catch (Exception e)
                    {
                        ThrowError("GAME ENGINE ERROR! Force Ticket ");
                        Log("GameEngine Error! SlotEngine::PlayThread() - Parse ticket error " + e.Message);
                    }
                }

                else if (m_sFSForceStop != "" && m_bFSForceSpin)
                {
                    try
                    {
                        m_CurrentSlotReel.SetForceSpin(m_sFSForceStop, true);
                    }
                    catch (Exception e)
                    {
                        ThrowError("GAME ENGINE ERROR! Force Ticket ");
                        Log("GameEngine Error! SlotEngine::PlayThread() - Parse ticket error " + e.Message);
                    }
                }

                m_SpinResult = m_CurrentSlotReel.PlayGame(betAmount);
                int[] spinResults = m_SpinResult.getReelStops();

                m_Stage = STAGE.STAGE_STARTGAME;
                m_SpinResult.BaseWinAmount = m_SpinResult.getWinAmount();
                // m_iBaseWinAmount = m_SpinResult.BaseWinAmount;
                m_Stage = STAGE.STAGE_IDLE;
                if (!m_SpinResult.FreePlay)
                {
                    m_Stage = STAGE.STAGE_IDLE;
                    m_SpinResult.FreePlay = false;
                }
                else
                {
                    m_Stage = STAGE.STAGE_FREESPIN;
                }
                m_SpinResult.ReadyForSpin = true;


                PlaySlotFeatures();
                PlayBonusGame();

                GameResults(m_SpinResult);
#if _SIMULATOR
                m_CurrentSlotReel.CollectStatistics();  //NEED TO RECHECK THIS
#endif
            }

            /*       else if (m_Stage == STAGE.STAGE_FREESPIN)
             *     {
             *         m_SpinResult = m_FreespinSlot.PlayGame((int)betAmount, true);
             *         List<int> reelStops = new List<int>();
             *
             *         if (!m_SpinResult.FreePlay)
             *         {
             *             m_Stage = STAGE.STAGE_IDLE;
             *             m_SpinResult.FreePlay = false;
             *         }
             *         m_SpinResult.ReadyForSpin = true;
             *         GameResults(m_SpinResult);
             *     }*/
        }
Exemple #3
0
        /* public virtual void ParseTicket(string sTicket)
         * {
         *   XmlDocument doc = new XmlDocument();
         *   doc.LoadXml(sTicket);
         *   XmlNode playNode = doc.SelectSingleNode("PLAY");
         *   string sReelStops = playNode.Attributes["RS"].Value;
         *   int[] reelStops = StringUtility.StringToIntArray(sReelStops, ' ');
         *   m_iTotalWinAmount = int.Parse(playNode.Attributes["TotalWin"].Value) * m_iBetLevel;
         *
         *   m_SpinResult = m_BaseSlot.PlayTicket(reelStops, m_iBetLevel);
         *   for (int i = 0; i < playNode.ChildNodes.Count; i++)
         *   {
         *       XmlNode childNode = playNode.ChildNodes[i];
         *       if (childNode.Name == "BONUS")
         *       {
         *           int iBonusId = int.Parse(childNode.Attributes["Type"].Value);
         *           Bonus bonusTicket = m_BonusList[iBonusId];
         *           bonusTicket.setBetLevel(m_iBetLevel);
         *           bonusTicket.InitTicket(childNode);
         *       }
         *       else if (childNode.Name == "FREESPINS")
         *       {
         *           m_FreespinSlot.InitFreeStopsTickets(childNode);
         *       }
         *   }
         * }*/

        public virtual void PlayThread(object betAmount)
        {
            //m_Stage = STAGE.STAGE_STARTGAME;
            m_TriggeredSlotFeatures.Clear();
            m_SpinResult.ResetFlags();
            m_CurrentSlotReel.ResetFlags();
            m_iBetLevel = (int)betAmount;

            /* if (m_ePlayType == ePlayType.PullTab || m_ePlayType == ePlayType.Bingo)
             * {
             *   try
             *   {
             *       ParseTicket(m_sTicket);
             *   }
             *   catch (Exception e)
             *   {
             *       ThrowError("GAME ENGINE ERROR! Parse Ticket ");
             *       Log("GameEngine Error! SlotEngine::PlayThread() - Parse ticket error " + e.Message);
             *   }
             * }*/

            if (m_ePlayType == ePlayType.Local)
            {
                Log("GameEngine Error! IGameEngine::PlayGame() - Inside play thread ");
                if (!string.IsNullOrEmpty(m_sTicket))
                {
                    try
                    {
                        m_CurrentSlotReel.SetForceSpin(m_sTicket);
                    }
                    catch (Exception e)
                    {
                        ThrowError("GAME ENGINE ERROR! Force Ticket ");
                        Log("GameEngine Error! SlotEngine::PlayThread() - Parse ticket error " + e.Message);
                    }
                }

                try
                {
                    Log("GameEngine Error! IGameEngine::PlayThread() - Call PlayGame ");
                    m_SpinResult = m_CurrentSlotReel.PlayGame((int)betAmount, m_Stage == STAGE.STAGE_FREESPIN ? true : false);
                }
                catch (Exception e)
                {
                    ThrowError("GameEngine ERROR! slot reel play game: " + e.Message);
                }

                try
                {
                    string sReelStops = "";
                    int[]  reelStops  = m_SpinResult.getReelStops();
                    for (int i = 0; i < reelStops.Length; i++)
                    {
                        if (i != 0)
                        {
                            sReelStops += " ";
                        }
                        sReelStops += reelStops[i].ToString();
                    }
                    setRecoveryData("BGRS", sReelStops);
                    setRecoveryData("ENGINESTAGE", m_Stage.ToString());
                }
                catch (Exception e)
                {
                    ThrowError("GameEngine ERROR! slot reel play game: " + e.Message);
                    Log("Game Engine Error! " + e.Message + " " + e.StackTrace);
                }
            }

            try
            {
                m_SpinResult.BaseWinAmount = m_SpinResult.getWinAmount();
                setRecoveryData("BGWINAMOUNT", m_SpinResult.BaseWinAmount.ToString());
                // m_iBaseWinAmount = m_SpinResult.BaseWinAmount;
                //m_Stage = STAGE.STAGE_IDLE;
                //m_SpinResult.ReadyForSpin = true;
                //m_SpinResult.FreePlay = false;
            }
            catch (Exception e)
            {
                ThrowError("GameEngine ERROR! BGWINAMOUNT: " + e.Message);
                Log("Game Engine Error! " + e.Message + " " + e.StackTrace);
            }


            try
            {
                PlaySlotFeatures();
            }
            catch (Exception e)
            {
                ThrowError("GameEngine ERROR! In feature");
                Log("SlotEngine::PlayThread() - Error!! " + e.Message);
            }

            Log("GameEngine Error! IGameEngine::PlayThread() - Sending results ");
            GameResults(m_SpinResult);
            //GC.Collect();
#if _SIMULATOR
            m_CurrentSlotReel.CollectStatistics();  //NEED TO RECHECK THIS
#endif

            if (m_BaseThread != null && m_BaseThread.IsAlive)
            {
                m_BaseThread.Join();
            }
        }