public TdrError.ErrorType pack(ref byte[] buffer, int size, ref int usedSize, uint cutVer)
        {
            if (buffer == null || buffer.GetLength(0) == 0 || size > buffer.GetLength(0))
            {
                return(TdrError.ErrorType.TDR_ERR_INVALID_BUFFER_PARAMETER);
            }
            TdrWriteBuf tdrWriteBuf = ClassObjPool <TdrWriteBuf> .Get();

            tdrWriteBuf.set(ref buffer, size);
            TdrError.ErrorType errorType = this.pack(ref tdrWriteBuf, cutVer);
            if (errorType == TdrError.ErrorType.TDR_NO_ERROR)
            {
                buffer   = tdrWriteBuf.getBeginPtr();
                usedSize = tdrWriteBuf.getUsedSize();
            }
            tdrWriteBuf.Release();
            return(errorType);
        }
Beispiel #2
0
        public TdrError.ErrorType pack(long selector, ref byte[] buffer, int size, ref int usedSize, uint cutVer)
        {
            if ((buffer.GetLength(0) == 0) || (size > buffer.GetLength(0)))
            {
                return(TdrError.ErrorType.TDR_ERR_INVALID_BUFFER_PARAMETER);
            }
            TdrWriteBuf destBuf = ClassObjPool <TdrWriteBuf> .Get();

            destBuf.set(ref buffer, size);
            TdrError.ErrorType type = this.pack(selector, ref destBuf, cutVer);
            if (type == TdrError.ErrorType.TDR_NO_ERROR)
            {
                buffer   = destBuf.getBeginPtr();
                usedSize = destBuf.getUsedSize();
            }
            destBuf.Release();
            return(type);
        }
Beispiel #3
0
        public PoolObjHandle <BulletSkill> SpawnBullet(SkillUseContext context, string _actionName, bool _bDeadRemove, bool _bAgeImmeExcute = false)
        {
            PoolObjHandle <BulletSkill> handle = new PoolObjHandle <BulletSkill>();

            if (context != null)
            {
                BulletSkill item = ClassObjPool <BulletSkill> .Get();

                item.Init(_actionName, _bDeadRemove);
                item.bAgeImmeExcute = _bAgeImmeExcute;
                if (item.Use(base.actorPtr, context))
                {
                    this.SpawnedBullets.Add(item);
                    return(new PoolObjHandle <BulletSkill>(item));
                }
                item.Release();
            }
            return(handle);
        }
Beispiel #4
0
        public bool SpawnBuff(PoolObjHandle <ActorRoot> inTargetActor, ref SkillUseParam inParam, int inSkillCombineId, bool bExtraBuff = false)
        {
            if ((inTargetActor == 0) || (inSkillCombineId <= 0))
            {
                return(false);
            }
            BuffSkill skill = ClassObjPool <BuffSkill> .Get();

            skill.Init(inSkillCombineId);
            skill.bExtraBuff    = bExtraBuff;
            inParam.TargetActor = inTargetActor;
            inParam.Instigator  = base.actor;
            bool flag = skill.Use(base.actorPtr, ref inParam);

            if (!flag)
            {
                skill.Release();
            }
            return(flag);
        }
Beispiel #5
0
        public bool Use()
        {
            BuffSkill inBuff = ClassObjPool <BuffSkill> .Get();

            inBuff.Init(this.BuffID);
            if (inBuff.cfgData == null)
            {
                inBuff.Release();
                return(false);
            }
            SkillUseContext context = new SkillUseContext(SkillSlotType.SLOT_SKILL_VALID, this.TargetActor.handle.ObjID);

            context.SetOriginator(this.SrcActor);
            if (!inBuff.Use(this.SrcActor, context))
            {
                inBuff.Release();
                return(false);
            }
            this.buffSkill = new BuffFense(inBuff);
            return(true);
        }
Beispiel #6
0
        public Track Clone()
        {
            Track track = ClassObjPool <Track> .Get();

            track.CopyData(this);
            int count = this.trackEvents.Count;

            for (int i = 0; i < count; i++)
            {
                BaseEvent item = this.trackEvents[i].Clone();
                item.track = track;
                track.trackEvents.Add(item);
            }
            track.waitForConditions     = this.waitForConditions;
            track.enabled               = this.enabled;
            track.color                 = this.color;
            track.trackName             = this.trackName;
            track.execOnActionCompleted = this.execOnActionCompleted;
            track.execOnForceStopped    = this.execOnForceStopped;
            return(track);
        }
Beispiel #7
0
        public bool SpawnBuff(PoolObjHandle <ActorRoot> inTargetActor, SkillUseContext inContext, int inSkillCombineId, bool bExtraBuff = false)
        {
            if (((inTargetActor == 0) || (inContext == null)) || (inSkillCombineId <= 0))
            {
                return(false);
            }
            BuffSkill skill = ClassObjPool <BuffSkill> .Get();

            skill.Init(inSkillCombineId);
            skill.bExtraBuff = bExtraBuff;
            skill.skillContext.Copy(inContext);
            skill.skillContext.TargetActor = inTargetActor;
            skill.skillContext.Instigator  = base.actor;
            bool flag = skill.Use(base.actorPtr);

            if (!flag)
            {
                skill.Release();
            }
            return(flag);
        }
Beispiel #8
0
        public bool Use()
        {
            BuffSkill buffSkill = ClassObjPool <BuffSkill> .Get();

            buffSkill.Init(this.BuffID);
            if (buffSkill.cfgData == null)
            {
                buffSkill.Release();
                return(false);
            }
            SkillUseParam skillUseParam = default(SkillUseParam);

            skillUseParam.Init(SkillSlotType.SLOT_SKILL_VALID, this.TargetActor.get_handle().ObjID);
            skillUseParam.SetOriginator(this.SrcActor);
            if (!buffSkill.Use(this.SrcActor, ref skillUseParam))
            {
                buffSkill.Release();
                return(false);
            }
            this.buffSkill = new BuffFense(buffSkill);
            return(true);
        }
        public bool SpawnBuff(PoolObjHandle <ActorRoot> inTargetActor, SkillUseContext inContext, int inSkillCombineId, ref BuffSkill newSkill, bool bExtraBuff = false)
        {
            if (!inTargetActor || inContext == null || inSkillCombineId <= 0)
            {
                newSkill = null;
                return(false);
            }
            BuffSkill buffSkill = ClassObjPool <BuffSkill> .Get();

            buffSkill.Init(inSkillCombineId);
            buffSkill.bExtraBuff = bExtraBuff;
            buffSkill.skillContext.Copy(inContext);
            buffSkill.skillContext.TargetActor = inTargetActor;
            buffSkill.skillContext.Instigator  = this.actor;
            newSkill = buffSkill;
            bool flag = buffSkill.Use(this.actorPtr);

            if (!flag)
            {
                buffSkill.Release();
                newSkill = null;
            }
            return(flag);
        }
        public PoolObjHandle <BulletSkill> SpawnBullet(SkillUseContext context, string _actionName, bool _bDeadRemove, bool _bAgeImmeExcute = false, int _bulletTypeId = 0, int _bulletUpperLimit = 0)
        {
            PoolObjHandle <BulletSkill> result = default(PoolObjHandle <BulletSkill>);

            if (context == null)
            {
                return(result);
            }
            BulletSkill bulletSkill = ClassObjPool <BulletSkill> .Get();

            bulletSkill.Init(_actionName, _bDeadRemove, _bulletTypeId);
            bulletSkill.bAgeImmeExcute = _bAgeImmeExcute;
            this.RecycleOverLimitBullte(_bulletTypeId, _bulletUpperLimit);
            if (bulletSkill.Use(this.actorPtr, context))
            {
                this.SpawnedBullets.Add(bulletSkill);
                result = new PoolObjHandle <BulletSkill>(bulletSkill);
            }
            else
            {
                bulletSkill.Release();
            }
            return(result);
        }
Beispiel #11
0
 public override BaseEvent Clone()
 {
     SetObjActiveTick tick = ClassObjPool<SetObjActiveTick>.Get();
     tick.CopyData(this);
     return tick;
 }
		public override BaseEvent Clone()
		{
			SetObjBehaviourModeTick setObjBehaviourModeTick = ClassObjPool<SetObjBehaviourModeTick>.Get();
			setObjBehaviourModeTick.CopyData(this);
			return setObjBehaviourModeTick;
		}
Beispiel #13
0
 static public FOWRevealer Get()
 {
     return(ClassObjPool <FOWRevealer> .Get());
 }
Beispiel #14
0
 static public new FOWCharactorRevealer Get()
 {
     return(ClassObjPool <FOWCharactorRevealer> .Get());
 }
 static public new FOWTempRevealer Get()
 {
     return(ClassObjPool <FOWTempRevealer> .Get());
 }
 public override BaseEvent Clone()
 {
     TriggerParticleTick tick = ClassObjPool<TriggerParticleTick>.Get();
     tick.CopyData(this);
     return tick;
 }
Beispiel #17
0
        public void CollectExplorer(bool bForce)
        {
            GameObjMgr instance = Singleton <GameObjMgr> .get_instance();

            GameFowManager instance2 = Singleton <GameFowManager> .get_instance();

            uint num = Singleton <FrameSynchr> .get_instance().CurFrameNum % instance2.InterpolateFrameInterval;

            uint num2 = Singleton <FrameSynchr> .get_instance().CurFrameNum % instance2.InterpolateFrameIntervalBullet;

            uint num3 = Singleton <FrameSynchr> .get_instance().CurFrameNum % instance2.InterpolateFrameIntervalHero;

            this.ClearExplorerPosList();
            int count = instance.GameActors.get_Count();

            for (int i = 0; i < count; i++)
            {
                PoolObjHandle <ActorRoot> poolObjHandle = instance.GameActors.get_Item(i);
                if (poolObjHandle)
                {
                    ActorRoot    handle    = poolObjHandle.get_handle();
                    ActorTypeDef actorType = handle.TheActorMeta.ActorType;
                    if (actorType == ActorTypeDef.Actor_Type_Hero)
                    {
                        if (handle.ObjID % instance2.InterpolateFrameIntervalHero != num3 && !bForce)
                        {
                            goto IL_186;
                        }
                    }
                    else if (handle.ObjID % instance2.InterpolateFrameInterval != num && !bForce)
                    {
                        goto IL_186;
                    }
                    if (actorType != ActorTypeDef.Actor_Type_Organ && (!handle.ActorControl.IsDeadState || handle.TheStaticData.TheBaseAttribute.DeadControl))
                    {
                        VInt3 vInt = new VInt3(handle.location.x, handle.location.z, 0);
                        if (handle.HorizonMarker != null)
                        {
                            int[]      exposedCamps = handle.HorizonMarker.GetExposedCamps();
                            ACTOR_INFO aCTOR_INFO   = ClassObjPool <ACTOR_INFO> .Get();

                            aCTOR_INFO.camps    = exposedCamps;
                            aCTOR_INFO.location = handle.HorizonMarker.GetExposedPos();
                            this.m_explorerPosList.Add(aCTOR_INFO);
                        }
                    }
                }
                IL_186 :;
            }
            this.ClearExplorerBulletList();
            for (int j = 1; j < 3; j++)
            {
                List <PoolObjHandle <ActorRoot> > campBullet = Singleton <GameObjMgr> .get_instance().GetCampBullet(j);

                int count2 = campBullet.get_Count();
                for (int k = 0; k < count2; k++)
                {
                    PoolObjHandle <ActorRoot> poolObjHandle2 = campBullet.get_Item(k);
                    if (poolObjHandle2)
                    {
                        ActorRoot     handle2       = poolObjHandle2.get_handle();
                        BulletWrapper bulletWrapper = handle2.ActorControl as BulletWrapper;
                        if (0 < bulletWrapper.SightRadius)
                        {
                            if (handle2.ObjID % instance2.InterpolateFrameIntervalBullet == num2 || bForce)
                            {
                                VInt3       location    = new VInt3(handle2.location.x, handle2.location.z, 0);
                                BULLET_INFO bULLET_INFO = ClassObjPool <BULLET_INFO> .Get();

                                bULLET_INFO.radius   = bulletWrapper.SightRange;
                                bULLET_INFO.location = location;
                                this.m_explorerBulletList[j - 1].Add(bULLET_INFO);
                            }
                        }
                    }
                }
            }
        }