Ejemplo n.º 1
0
 public void ResetFlags()
 {
     m_SpinResult.ResetFlags();
 }
Ejemplo n.º 2
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();
            }
        }