Esempio n. 1
0
 public override void SetLifeData()
 {
     if (m_Core == null)
     {
         return;
     }
     if (m_Parent != null)
     {
         PetAttribute Attr = new PetAttribute();
         Attr.GetAttrData(m_Parent.m_Attr, m_Core);
         m_Attr = Attr;
         m_Attr.Init(SceneID, m_Core, this);
         //
         m_Status = new Status();
         m_Status.Init(SceneID);
         //宠物出生产生状态。
         List <SkillStatusInfo> l = (m_Attr as PetAttribute).GetStatusInfo();
         if (l != null && l.Count > 0)
         {
             for (int i = 0; i < l.Count; i++)
             {
                 if (l[i] != null)
                 {
                     m_Status.AddStatus(SceneID, 0, l[i]);
                 }
             }
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Add a bulk copy thread
        /// </summary>
        /// <param name="tempTableName">temporary tablename</param>
        /// <param name="dt">Datatable (buffer with rows to write to the temporary table)</param>
        /// <param name="useTableLock">Use tablock?</param>
        public void AddBulkCopyThread(string tempTableName, DataTable dt, bool useTableLock)
        {
            //Logging.Log(IsagEvents.IsagEventType.BulkInsert, string.Format("DataTable {0} created with {1} rows.", (_createdBulkCopyThreads + 1).ToString(), dt.Rows.Count.ToString()));
            _status.AddStatus(_createdBulkCopyThreads + 1, dt.Rows.Count, Status.StatusType.dataTableCreated, IsagEvents.IsagEventType.Status);
            UpdateStatus();

            string         templateCreateTempTable = SqlCreator.GetCreateTempTable(_isagCustomProperties, Constants.TEMP_TABLE_PLACEHOLDER_BRACKETS);
            ThreadBulkCopy thread = new ThreadBulkCopy(_dbCmdThread, tempTableName, dt, templateCreateTempTable, _timeoutDb, _reattempts, (_createdBulkCopyThreads + 1).ToString(),
                                                       _cstr, _conn, useTableLock, _isagCustomProperties.UseBulkInsert);
            bool showWaitMessage = true;

            while (WaitForFreeBulkCopyThread())
            {
                if (showWaitMessage)
                {
                    _events.Fire(IsagEvents.IsagEventType.BulkInsert, "Waiting ... Max Threat Count for BulkCopys has been reached. " + DateTime.Now.ToString());
                }
                showWaitMessage = false;
                Thread.Sleep(180); //TODO: Timeout?
                UpdateStatus();
            }

            if (!showWaitMessage)
            {
                _events.Fire(IsagEvents.IsagEventType.BulkInsert, "Waiting for free Bulkcopy Thread finished. " + DateTime.Now.ToString());
            }

            if (!HasError())
            {
                _bulkCopyThreads.Add(thread);
                _createdBulkCopyThreads++;

                _status.AddStatus(_createdBulkCopyThreads, dt.Rows.Count, Status.StatusType.bulkCopyThreadCreated, IsagEvents.IsagEventType.Status);
                //Logging.Log(IsagEvents.IsagEventType.BulkInsert, string.Format("BulkCopy Thread {0} created [Datatable {1}: {2} rows]",
                //    _createdBulkCopyThreads.ToString(), _createdBulkCopyThreads.ToString(), dt.Rows.Count.ToString()));

                thread.Start();
                Logging.Log(IsagEvents.IsagEventType.BulkInsert, string.Format("BulkCopyThread Status: {0} finished, {1} created",
                                                                               _finishedBulkCopyThreads.ToString(), _createdBulkCopyThreads.ToString()));
            }
        }
Esempio n. 3
0
    public bool LvUp(int var = 10, int maxexp = 100)
    {
        if (m_nExp > maxexp)
        {
            m_cStatus.AddStatus(var);
            m_nExp   -= maxexp;
            m_nMaxHP += var;
            m_nMaxMP += var;
            return(true);
        }

        return(false);
    }
        private void OnTriggerEnter2D(Collider2D other)
        {
            foreach (string s in TriggerTags)
            {
                if (other.CompareTag(s))
                {
                    count++;
                    if (ActivationKey == KeyCode.None)
                    {
                        UpdateSignal(Signal.PowerOn, Convert.ToSingle(true));
                    }

                    Status status = other.GetComponent <Status>();
                    if (status != null)
                    {
                        status.AddStatus(TriggerStatus);
                    }
                    break;
                }
            }
        }