예제 #1
0
        public void UpdateTimedPropsData(long nowTicks, long startTicks, int bufferTicks, int propsType, int propsIndex, double propsValue, int skillId, int tag)
        {
            TimedPropsData data;
            long           key = (((long)skillId) << 32) + (propsType << 24) + propsIndex;

            lock (mutex)
            {
                if (!bufferDataDict.TryGetValue(key, out data))
                {
                    data = new TimedPropsData(startTicks, bufferTicks, propsType, propsIndex, propsValue, tag, skillId);
                    bufferDataDict[key] = data;
                }
                else
                {
                    data.startTicks  = startTicks;
                    data.bufferTicks = bufferTicks;
                    data.propsType   = propsType;
                    data.propsIndex  = propsIndex;
                    data.propsValue  = propsValue;
                    data.tag         = tag;
                    data.skillId     = skillId;
                    data.endTicks    = startTicks + bufferTicks;
                }

                //设置属性
                UpdateTimedProps(data, true);

                //重置以便重新计算最小超时时间
                TimerUpdateProps(nowTicks, true);
            }
        }
예제 #2
0
        public void UpdateTimedPropsData(long nowTicks, long startTicks, int bufferTicks, int propsType, int propsIndex, double propsValue, int skillId, int tag)
        {
            long key = ((long)skillId << 32) + (long)((long)propsType << 24) + (long)propsIndex;

            lock (this.mutex)
            {
                TimedPropsData data;
                if (!this.bufferDataDict.TryGetValue(key, out data))
                {
                    data = new TimedPropsData(startTicks, bufferTicks, propsType, propsIndex, propsValue, tag, skillId);
                    this.bufferDataDict[key] = data;
                }
                else
                {
                    data.startTicks  = startTicks;
                    data.bufferTicks = bufferTicks;
                    data.propsType   = propsType;
                    data.propsIndex  = propsIndex;
                    data.propsValue  = propsValue;
                    data.tag         = tag;
                    data.skillId     = skillId;
                    data.endTicks    = startTicks + (long)bufferTicks;
                }
                this.UpdateTimedProps(data, true);
                this.TimerUpdateProps(nowTicks, true);
            }
        }
예제 #3
0
        private void UpdateTimedProps(TimedPropsData data, bool enable)
        {
            double propsValue = 0.0;

            if (enable)
            {
                propsValue = data.propsValue;
            }
            if (data.propsType == 1)
            {
                this.propCacheManager.SetExtPropsSingle(new object[]
                {
                    PropsSystemTypes.BufferPropsManager,
                    data.skillId,
                    data.propsType,
                    data.propsIndex,
                    propsValue
                });
            }
            else if (data.propsType == 0)
            {
                this.propCacheManager.SetBasePropsSingle(new object[]
                {
                    PropsSystemTypes.BufferPropsManager,
                    data.skillId,
                    data.propsType,
                    data.propsIndex,
                    propsValue
                });
            }
        }
예제 #4
0
        private void UpdateTimedProps(TimedPropsData data, bool enable)
        {
            double propsValue = 0;

            if (enable)
            {
                propsValue = data.propsValue;
            }

            if (data.propsType == (int)PropsTypes.ExtProps)
            {
                propCacheManager.SetExtPropsSingle(PropsSystemTypes.BufferPropsManager, data.skillId, data.propsType, data.propsIndex, propsValue);
            }
            else if (data.propsType == (int)PropsTypes.BaseProps)
            {
                propCacheManager.SetBasePropsSingle(PropsSystemTypes.BufferPropsManager, data.skillId, data.propsType, data.propsIndex, propsValue);
            }
        }