Ejemplo n.º 1
0
        void SendNewTick(RealmTime time)
        {
            var sendEntities = new List <Entity>();

            try
            {
                foreach (var i in clientEntities)
                {
                    if (i.UpdateCount > lastUpdate[i])
                    {
                        sendEntities.Add(i);
                        lastUpdate[i] = i.UpdateCount;
                    }
                }
            }
            catch
            {
            }
            NewTickPacket p = new NewTickPacket();

            tickId++;
            p.TickId         = tickId;
            p.TickTime       = time.thisTickTimes;
            p.UpdateStatuses = sendEntities.Select(_ => _.ExportStats()).ToArray();
            psr.SendPacket(p);
            SaveToCharacter();
        }
Ejemplo n.º 2
0
        private void OnTick(Client client, Packet packet)
        {
            NewTickPacket ntp = (NewTickPacket)packet;

            if (_Enabled[client] && _Started[client])
            {
                if (ntp.TickId % 4 == 0 && !CurrentTrades[client].isTrading)
                {
                    SendMessage(client);
                }

                // If its been more then 60 seconds
                //if (idelTimer[client].ElapsedMilliseconds > 60000)
                //{
                //blockGotoAck[client] = true;
                //GotoPacket go = (GotoPacket)Packet.Create(PacketType.GOTO);
                //go.ObjectId = client.ObjectId;
                //go.Location = new Location();
                //if (hasMoved[client])
                //{
                //	go.Location.X = client.PlayerData.Pos.X - 0.83f;
                //	go.Location.Y = client.PlayerData.Pos.Y - 0.13f;
                //}
                //else
                //{
                //	go.Location.X = client.PlayerData.Pos.X + 0.83f;
                //	go.Location.Y = client.PlayerData.Pos.Y + 0.13f;
                //}
                //client.SendToClient(go);
                //hasMoved[client] = !hasMoved[client];
                //idelTimer[client].Restart();
                //}
            }
        }
Ejemplo n.º 3
0
        private void OnNewTick(Client client, NewTickPacket p)
        {
            map?.ProcessPacket(p);

            // Heal the player if:
            if (
                // Auto-heal hasn't been triggered the last tick
                autoHealReady &&
                // playing priest
                client.PlayerData.Class == Classes.Priest &&
                // does not have Sick debuff (an attempt to heal with Sick would be a waste of mana)
                !client.PlayerData.HasConditionEffect(ConditionEffects.Sick) &&
                // health is below threshold
                (double)client.PlayerData.Health / client.PlayerData.MaxHealth < AUTOHEAL_THRESHOLD &&
                // has an ability item equipped
                map.PlayerAbility != null &&
                // has enough MP to use the ability
                client.PlayerData.Mana >= map.PlayerAbility.MpCost)
            {
                map?.UsePlayerAbility(client);
                autoHealReady = false;
                Log("Auto-heal triggered!");
            }
            else
            {
                autoHealReady = true;
            }
        }
Ejemplo n.º 4
0
        void SendNewTick(RealmTime time)
        {
            var sendEntities = new List <Entity>();

            try
            {
                foreach (var i in clientEntities)
                {
                    if (i.UpdateCount > lastUpdate[i])
                    {
                        sendEntities.Add(i);
                        lastUpdate[i] = i.UpdateCount;
                    }
                }
            }

            catch { Console.ForegroundColor = ConsoleColor.DarkRed;
                    Console.Out.WriteLine("Crash halted - Nobody likes death...");
                    Console.ForegroundColor = ConsoleColor.White; }
            if (questEntity != null && (!lastUpdate.ContainsKey(questEntity) || questEntity.UpdateCount > lastUpdate[questEntity]))
            {
                sendEntities.Add(questEntity);
                lastUpdate[questEntity] = questEntity.UpdateCount;
            }
            NewTickPacket p = new NewTickPacket();

            tickId++;
            p.TickId         = tickId;
            p.TickTime       = time.thisTickTimes;
            p.UpdateStatuses = sendEntities.Select(_ => _.ExportStats()).ToArray();
            psr.SendPacket(p);

            SaveToCharacter();
        }
Ejemplo n.º 5
0
        void SendNewTick(RealmTime time)
        {
            var sendEntities = new List <Entity>();

            foreach (var i in clientEntities)
            {
                if (i.UpdateCount > lastUpdate[i])
                {
                    sendEntities.Add(i);
                    lastUpdate[i] = i.UpdateCount;
                }
            }
            if (questEntity != null && (!lastUpdate.ContainsKey(questEntity) || questEntity.UpdateCount > lastUpdate[questEntity]))
            {
                sendEntities.Add(questEntity);
                lastUpdate[questEntity] = questEntity.UpdateCount;
            }
            NewTickPacket p = new NewTickPacket();

            tickId++;
            p.TickId         = tickId;
            p.TickTime       = time.thisTickTimes;
            p.UpdateStatuses = sendEntities.Select(_ => _.ExportStats()).ToArray();
            client.SendPacket(p);

            SaveToCharacter();
        }
Ejemplo n.º 6
0
    // Token: 0x06000471 RID: 1137 RVA: 0x00017820 File Offset: 0x00015A20
    public void NewTick(NewTickPacket newTick)
    {
        if (!Settings.Default.EnableAntiDebuffs)
        {
            return;
        }
        Status status = null;

        foreach (Status status2 in newTick.Statuses)
        {
            if (status2.ObjectId == this.client.Player.ObjectId)
            {
                status = status2;
                break;
            }
        }
        if (status == null)
        {
            status = new Status
            {
                Data     = new List <StatData>(),
                ObjectId = this.client.PlayerId,
                Position = this.client.Player.ServerPosition
            };
            status.Data.Add(this.PlayerCondition1Stat());
            status.Data.Add(this.PlayerCondition2Stat());
            newTick.Statuses.Add(status);
        }
        this.FixPlayerDebuffs(status.Data);
    }
Ejemplo n.º 7
0
        private void SendNewTick(RealmTime time)
        {
            var sendEntities = new List <Entity>();

            try
            {
                foreach (var i in clientEntities)
                {
                    if (i.UpdateCount > lastUpdate[i])
                    {
                        sendEntities.Add(i);
                        lastUpdate[i] = i.UpdateCount;
                    }
                }
            }
            catch
            {
                Program.logger.Error("Crash halted - Nobody likes death...");
            }
            if (questEntity != null && (!lastUpdate.ContainsKey(questEntity) || questEntity.UpdateCount > lastUpdate[questEntity]))
            {
                sendEntities.Add(questEntity);
                lastUpdate[questEntity] = questEntity.UpdateCount;
            }
            NewTickPacket p = new NewTickPacket();

            tickId++;
            p.TickId         = tickId;
            p.TickTime       = time.thisTickTimes;
            p.UpdateStatuses = sendEntities.Select(_ => _.ExportStats()).ToArray();
            client.SendPacket(p);

            SaveToCharacter();
        }
Ejemplo n.º 8
0
        private void OnNewTick(NewTickPacket newTick)
        {
            _lastTickTime = _currentTickTime;
            int time = GetTime();

            _currentTickTime = time;
            if (_request != null && time - _request.Start > _request.Timeout)
            {
                _request.OnTimeout?.Invoke();
                _request = null;
            }
            if (_moveQueue.Count > 0)
            {
                MoveEvent e = _moveQueue.Peek();
                MoveTo(e.X, e.Y);
            }
            _net.SendPacket(new MovePacket
            {
                TickId      = newTick.TickId,
                NewPosition = position,
                Time        = GetTime(),
                Records     = _records
            });
            foreach (var status in newTick.Statuses)
            {
                if (Players.ContainsKey(status.ObjectId))
                {
                    PlayerData.processStatData(status.Stats, Players[status.ObjectId]);
                }
            }
        }
Ejemplo n.º 9
0
        private void SendNewTick(RealmTime time)
        {
            var sendEntities = new List <Entity>();

            try
            {
                foreach (var i in clientEntities.Where(i => i.UpdateCount > lastUpdate[i]))
                {
                    sendEntities.Add(i);
                    lastUpdate[i] = i.UpdateCount;
                }
            }
            catch (Exception e)
            {
                log.Error(e);
            }
            if (Quest != null &&
                (!lastUpdate.ContainsKey(Quest) || Quest.UpdateCount > lastUpdate[Quest]))
            {
                sendEntities.Add(Quest);
                lastUpdate[Quest] = Quest.UpdateCount;
            }
            var p = new NewTickPacket();

            tickId++;
            p.TickId         = tickId;
            p.TickTime       = time.thisTickTimes;
            p.UpdateStatuses = sendEntities.Select(_ => _.ExportStats()).ToArray();
            Client.SendPacket(p);
        }
Ejemplo n.º 10
0
        public void OnNewTick(Client client, Packet packet)
        {
            NewTickPacket ntp = (NewTickPacket)packet;

            if (_enabled && listOfClients[client].Slave)
            {
                // Distance to Master
                double Distance = Math.Sqrt(Math.Pow(master.PlayerData.Pos.X - client.PlayerData.Pos.X, 2) + Math.Pow(master.PlayerData.Pos.Y - client.PlayerData.Pos.Y, 2));
                // Will hold the angle
                float Angle = 0;
                // Get the total milliseconds since the last NewTick
                long timeElapsed = listOfClients[client].sw.ElapsedMilliseconds;
                // This will be used as a multiplier, ive capped it at 250
                timeElapsed = timeElapsed >= 200 ? 200 : timeElapsed;

                // The formula from the client is (MIN_MOVE_SPEED + this.speed_ / 75 * (MAX_MOVE_SPEED - MIN_MOVE_SPEED)) * this.moveMultiplier_
                // this.moveMultiplier_ = the tile movement speed (1 by default)
                // MIN_MOVE_SPEED = 0.004 * this.moveMultiplier_
                // MAX_MOVE_SPEED = 0.0096
                // I dont take into account tile movement speed i justed used the default value of 1
                // I also decreased the max movement speed to avoid disconnect
                float moveMultiplier = GameData.Tiles.ByID(listOfClients[client].CurrentTileType()).Speed;
                float min_speed      = 0.004f * moveMultiplier;
                float speed          = ((min_speed + (client.PlayerData.Speed / 75.0f * (0.007f - min_speed))) * moveMultiplier) * (timeElapsed);
                Console.WriteLine("SW: {0}ms, Dist: {1}, Spd: {2}, TPT: {3}", listOfClients[client].sw.ElapsedMilliseconds, Distance, speed, client.PlayerData.TilesPerTick());

                //speed = client.PlayerData.TilesPerTick();


                Location NewLoc = new Location();
                // Check if the distance to the master is greater then the distance the slave can move
                if (Distance > speed)
                {
                    // Calculate the angle
                    Angle = (float)Math.Atan2(master.PlayerData.Pos.Y - client.PlayerData.Pos.Y, master.PlayerData.Pos.X - client.PlayerData.Pos.X);
                    // Calculate the new location
                    NewLoc.X = client.PlayerData.Pos.X + (float)Math.Cos(Angle) * speed;
                    NewLoc.Y = client.PlayerData.Pos.Y + (float)Math.Sin(Angle) * speed;
                }
                else
                {
                    // Set the move location as the master location
                    NewLoc.X = master.PlayerData.Pos.X;
                    NewLoc.Y = master.PlayerData.Pos.Y;
                }
                // Send the GOTO packet
                GotoPacket go = (GotoPacket)Packet.Create(PacketType.GOTO);
                go.ObjectId = client.ObjectId;
                go.Location = new Location();
                go.Location = NewLoc;
                client.SendToClient(go);
            }

            if (listOfClients[client].Slave)
            {
                // This is used to get the number of milliseconds between each NewTick
                listOfClients[client].UpdateTick();
            }
        }
Ejemplo n.º 11
0
 // Token: 0x0600050D RID: 1293 RVA: 0x0001E0B4 File Offset: 0x0001C2B4
 public void NewTick(NewTickPacket newTick)
 {
     foreach (Status seOURj9wT08Ssc6bZOctUjk0KXi in newTick.Statuses)
     {
         if (this._W6Ov6AArxzTTDnCyBtZPqkqNaKf.Objects.ContainsKey(seOURj9wT08Ssc6bZOctUjk0KXi.ObjectId))
         {
             this._W6Ov6AArxzTTDnCyBtZPqkqNaKf.Objects[seOURj9wT08Ssc6bZOctUjk0KXi.ObjectId].ParseStatus(seOURj9wT08Ssc6bZOctUjk0KXi, newTick.TickTime, newTick.TickId, newTick.TickId, (long)this._y197qHnAdnQHPqX30R0Bq0tjIOcA, false);
         }
     }
 }
        private void OnNewTick(IncomingPacket p)
        {
            NewTickPacket newTick = (NewTickPacket)p;

            Move(newTick.TickId, _player);

            foreach (var statusData in newTick.Statuses)
            {
                ProcessObjectStatus(statusData, newTick.TickTime, newTick.TickId);
            }
        }
Ejemplo n.º 13
0
 // Token: 0x060004B3 RID: 1203 RVA: 0x0001AB5C File Offset: 0x00018D5C
 public void NewTick(NewTickPacket newTick)
 {
     foreach (Status seOURj9wT08Ssc6bZOctUjk0KXi in newTick.Statuses)
     {
         if (seOURj9wT08Ssc6bZOctUjk0KXi.ObjectId == this._W6Ov6AArxzTTDnCyBtZPqkqNaKf._7w6u8taiwfZruB2OdFEa2AmzJaA)
         {
             this._BwUEkSS32j3v8tc5v3r4RiE6eiD(seOURj9wT08Ssc6bZOctUjk0KXi, false);
             break;
         }
     }
     this._L9Sq7ilWPAc2XkNbriRGfXQBoeh();
 }
Ejemplo n.º 14
0
 private void Update(NewTickPacket packet)
 {
     foreach (var i in packet.UpdateStats)
     {
         Entity entity = this[i.Id];
         entity.Position = i.Position;
         foreach (var stats in i.Stats)
         {
             entity.Stats[stats.Item1] = stats.Item2;
         }
         entity.OnUpdated();
     }
 }
Ejemplo n.º 15
0
 // Token: 0x06000505 RID: 1285 RVA: 0x0001DAC4 File Offset: 0x0001BCC4
 public void NewTick(NewTickPacket newTick)
 {
     if (!this._vb0DX76k2oGNsxzar6rSoSPQjNG)
     {
         return;
     }
     foreach (Status seOURj9wT08Ssc6bZOctUjk0KXi in newTick.Statuses)
     {
         if (seOURj9wT08Ssc6bZOctUjk0KXi.ObjectId == this._ZNtO3Z5ZBTYgV6mEURWJLnX7IAE)
         {
             this._gwQbCyGjOqugc22uFkNNeJgLuvV(seOURj9wT08Ssc6bZOctUjk0KXi);
         }
     }
 }
Ejemplo n.º 16
0
 public void Parse(NewTickPacket newTick)
 {
     foreach (Status status in newTick.Statuses)
     {
         if (status.ObjectId == OwnerObjectId)
         {
             foreach (StatData data in status.Data)
             {
                 Pos = status.Position;
                 Parse(data.Id, data.IntValue, data.StringValue);
             }
         }
     }
 }
Ejemplo n.º 17
0
 // Token: 0x0600028E RID: 654 RVA: 0x000118F8 File Offset: 0x0000FAF8
 public void Parse(NewTickPacket newTick)
 {
     foreach (Status status in newTick.Statuses)
     {
         if (status.ObjectId == this.OwnerObjectId)
         {
             foreach (StatData statData in status.Data)
             {
                 this.Pos = status.Position;
                 this.Parse(StatsType.Id, statData.IntValue, statData.StringValue);
             }
         }
     }
 }
Ejemplo n.º 18
0
 private void OnNewTickPacket(Client client, NewTickPacket packet)
 {
     if (this.m_currentGameId != -5)
     {
         return;
     }
     for (int i = 0; i < packet.Statuses.Length; i++)
     {
         if (this.m_chests.ContainsKey(packet.Statuses[i].ObjectId))
         {
             UpdateStats(ref packet.Statuses[i]);
         }
     }
 }
Ejemplo n.º 19
0
        public void Parse(NewTickPacket packet)
        {
            foreach (Status status in packet.Statuses)
            {
                var thing = Players.FirstOrDefault(x => x.PlayerData.OwnerObjectId == status.ObjectId);
                if (thing != null)
                {
                    thing.Parse(status);
                }
                Entity entity = Client.GetEntity(status.ObjectId);
                if (entity == null)
                {
                    continue;
                }
                if (!EntityPaths.ContainsKey(entity))
                {
                    EntityPaths[entity] = new List <Location>();
                }
                EntityPaths[entity].Add(status.Position);
                if (TargetEntityPathCopyThing != null && TargetEntity?.Status.ObjectId == entity.Status.ObjectId)
                {
                    TargetEntityPathCopyThing.Add(status.Position);
                }
            }

            if (TargetEntityPathCopyThing?.Count() > 0)
            {
                TargetLocation = TargetEntityPathCopyThing.First();
            }

            if (TargetLocation != null)
            {
                Location result = Lerp(Client.PlayerData.Pos, TargetLocation, Client.PlayerData.TilesPerTick());
                Client.SendGoto(result);
                if (result.ToString() == TargetLocation.ToString())
                {
                    TargetLocation = null;
                    if (TargetEntityPathCopyThing?.Count() > 0)
                    {
                        OnTargetReached();
                    }
                    else
                    {
                        TargetReached?.Invoke();
                    }
                }
            }
        }
Ejemplo n.º 20
0
 private bool OnNewTick(ref NewTickPacket packet)
 {
     for (int i = 0; i < packet.UpdateStatuses.Length; i++)
     {
         if (packet.UpdateStatuses[i].Id == myObjId)
         {
             for (int j = 0; j < packet.UpdateStatuses[i].Stats.Length; j++)
             {
                 if (packet.UpdateStatuses[i].Stats[j].Key == StatsType.Glowing)
                 {
                     packet.UpdateStatuses[i].Stats[j] = new KeyValuePair <StatsType, object>(StatsType.Glowing, Singleton <Settings> .Instance.GetValue <bool>("glowing").ToInt32() - 1);
                 }
             }
         }
     }
     return(true);
 }
Ejemplo n.º 21
0
        //public static void MoveInventory(Slot)

        private static void OnNewTick(Client client, NewTickPacket packet)
        {
            client.Self().Parse(packet);

            foreach (Status stat in packet.Statuses)
            {
                foreach (cPlayer cplayer in cPlayers.ToList())
                {
                    if (cplayer.Client.PlayerData == null)
                    {
                        continue;
                    }
                    foreach (Player player in cplayer.Players.ToList())
                    {
                        if (player.PlayerData.OwnerObjectId == stat.ObjectId)
                        {
                            // Check for inv changes
                            if (!cPlayers.Select(x =>
                            {
                                if (x.Client.PlayerData == null)
                                {
                                    return(null);
                                }
                                else
                                {
                                    return(x.Client.PlayerData.Name == client.PlayerData.Name ? null : x.Client.PlayerData.Name);
                                }
                            }).Contains(player.PlayerData.Name)) // Doesn't fire if its a cPlayer that moved the inv
                            {
                                for (int a = 0; a <= stat.Data.Count() - 1; a++)
                                {
                                    StatData thing = stat.Data[a]; // for lack of a better name
                                    if (thing.IsInventory())
                                    {
                                        cplayer.FireInventorySwap(player, stat.Data.Select(x => new Item(x.Id, x.IntValue)).ToArray());
                                        break;
                                    }
                                }
                            }
                            player.PlayerData.Parse(packet);
                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 22
0
        private bool OnNewTickPacket(ref NewTickPacket packet)
        {
            foreach (var i in packet.UpdateStatuses)
            {
                Entity en = Singleton <World> .Instance.GetEntity(i.Id);

                if (en != null)
                {
                    en.ImportStats(i);
                }

                if (i.Id == myObjectId)
                {
                    Singleton <Player> .Instance.ImportStats(i);
                }
            }
            return(true);
        }
Ejemplo n.º 23
0
        private void OnNewTick(Client client, Packet packet)
        {
            // Update player positions
            NewTickPacket newTick = (NewTickPacket)packet;
            TeleportState state   = _states[client];

            foreach (Status status in newTick.Statuses)
            {
                if (state.PlayerLocations.ContainsKey(status.ObjectId))
                {
                    state.PlayerLocations[status.ObjectId] = status.Position;
                }
                else if (status.ObjectId == state.QuestId)
                {
                    state.QuestLocation = status.Position;
                }
            }
        }
Ejemplo n.º 24
0
        private void OnNT(Client client, NewTickPacket packet)
        {
            Status ent = packet.Statuses.SingleOrDefault(x => x.ObjectId == ObjectId);

            if (ent != null)
            {
                foreach (StatData stat in ent.Data)
                {
                    if (stat.Id == StatsType.HP)
                    {
                        stat.IntValue = MaximumHP - (PrevHealth - stat.IntValue);
                    }
                    else if (stat.Id == StatsType.MP)
                    {
                        stat.IntValue = MaximumMP - (PrevMana - stat.IntValue);
                    }
                }
            }
        }
Ejemplo n.º 25
0
        private void OnNewTick(Client client, Packet packet)
        {
            LootState     state   = _states[client];
            NewTickPacket newTick = (NewTickPacket)packet;

            // Updated Objects
            foreach (Status status in newTick.Statuses)
            {
                if (state.LootBagItems.ContainsKey(status.ObjectId))
                {
                    foreach (StatData statData in status.Data)
                    {
                        if (statData.Id >= 8 && statData.Id <= 15)
                        {
                            state.LootBagItems[status.ObjectId][statData.Id - 8] = statData.IntValue;
                        }
                    }
                }
            }
        }
Ejemplo n.º 26
0
        public void Tick(NewTickPacket tick)
        {
            HP += (int)(0.2 + (client.PlayerData.Vitality * 0.024));

            foreach (Status status in tick.Statuses)
            {
                if (status.ObjectId == client.ObjectId)
                {
                    foreach (StatData stat in status.Data)
                    {
                        if (stat.Id == StatsType.HP)
                        {
                            HP = stat.IntValue;
                        }
                    }
                }
            }

            ArmorBroken = client.PlayerData.HasConditionEffect(ConditionEffects.ArmorBroken);
            Armored     = client.PlayerData.HasConditionEffect(ConditionEffects.Armored);
        }
Ejemplo n.º 27
0
        void SendNewTick(RealmTime time)
        {
            if (tickPassed > 1)
            {
                tickPassed--;
                timePassed += time.thisTickTimes;
                return;
            }
            else
            {
                tickPassed = RealmManager.TPS / TICK_PER_SECOND;
                tickIdTime = time.tickTimes;
            }

            var sendEntities = new List <Entity>();

            foreach (var i in clientEntities)
            {
                if (i.UpdateCount > lastUpdate[i])
                {
                    sendEntities.Add(i);
                    lastUpdate[i] = i.UpdateCount;
                }
            }
            if (questEntity != null && (!lastUpdate.ContainsKey(questEntity) || questEntity.UpdateCount > lastUpdate[questEntity]))
            {
                sendEntities.Add(questEntity);
                lastUpdate[questEntity] = questEntity.UpdateCount;
            }
            NewTickPacket p = new NewTickPacket();

            tickId++;
            p.TickId         = tickId;
            p.TickTime       = timePassed;
            timePassed       = time.thisTickTimes;
            p.UpdateStatuses = sendEntities.Select(_ => _.ExportStats()).ToArray();
            psr.SendPacket(p);

            SaveToCharacter();
        }
Ejemplo n.º 28
0
 // Token: 0x06000467 RID: 1127 RVA: 0x00017458 File Offset: 0x00015658
 public void NewTick(NewTickPacket newTick)
 {
     foreach (System.Windows.Forms.VisualStyles.VisualStyleElement.Status status in newTick.Statuses)
     {
         if (this.Client.Enemies.ContainsKey(status.ObjectId))
         {
             this.ProcessStatus(status);
         }
     }
     if (Settings.Default.EnableFameTools && Settings.Default.FameAccuracyFarm)
     {
         this._maxedHpLastTick = true;
         return;
     }
     if (this._maxedHpLastTick)
     {
         foreach (GameObject gameObject in this.Client.Enemies.Values)
         {
             if (this._originalHealthValues.ContainsKey(gameObject.ObjectId))
             {
                 newTick.Statuses.Add(new Status
                 {
                     Position = gameObject.ServerPosition,
                     ObjectId = gameObject.ObjectId,
                     Data     = new List <StatData>
                     {
                         new StatData
                         {
                             Id          = StatsType.HP,
                             IntValue    = this._originalHealthValues[gameObject.ObjectId],
                             StringValue = string.Empty
                         }
                     }
                 });
             }
         }
         this._maxedHpLastTick = false;
     }
 }
Ejemplo n.º 29
0
 // Token: 0x06000486 RID: 1158 RVA: 0x00018480 File Offset: 0x00016680
 public void NewTick(NewTickPacket newTick)
 {
     foreach (Status status in newTick.Statuses)
     {
         this.ProcessStatus(status);
     }
     this._selfInGuild = !string.IsNullOrEmpty(this.client.Player.Guild);
     if (this._newObjectToScaleThisTick || this._changeGuildSizeLastTick != Settings.Default.AntiLagApplyToGuildMates || this._changeLockSizeLastTick != Settings.Default.AntiLagApplyToLockList || this._hidePetSizeLastTick != Settings.Default.AntiLagHideAllyPets || (Settings.Default.AntiLagAllyPlayerSize != 100 && Settings.Default.AntiLagAllyPlayerSize != this._sizeLastTick))
     {
         foreach (KeyValuePair <int, int> keyValuePair in this._objectsToScale)
         {
             if (this.client.Objects.ContainsKey(keyValuePair.Key))
             {
                 GameObject gameObject = this.client.Objects[keyValuePair.Key];
                 int        scaledSize = this.GetScaledSize(keyValuePair.Key);
                 newTick.Statuses.Add(new Status
                 {
                     Position = gameObject.ServerPosition,
                     ObjectId = keyValuePair.Key,
                     Data     = new List <StatData>
                     {
                         new StatData
                         {
                             Id          = StatsType.Size,
                             IntValue    = scaledSize,
                             StringValue = string.Empty
                         }
                     }
                 });
             }
         }
     }
     this._sizeLastTick             = Settings.Default.AntiLagAllyPlayerSize;
     this._changeGuildSizeLastTick  = Settings.Default.AntiLagApplyToGuildMates;
     this._changeLockSizeLastTick   = Settings.Default.AntiLagApplyToLockList;
     this._hidePetSizeLastTick      = Settings.Default.AntiLagHideAllyPets;
     this._newObjectToScaleThisTick = false;
 }
Ejemplo n.º 30
0
        //int obect = 0;
        private void OnNewTick(Client client, NewTickPacket packet)
        {
            client.PlayerData.Parse(packet);

            foreach (Status status in packet.Statuses)
            {
                Entity ent = client.State.RenderedEntities.FirstOrDefault(x => x.Status.ObjectId == status.ObjectId);
                if (ent == null)
                {
                    continue;
                }
                ent.Status.Position = status.Position;
                foreach (StatData stat in status.Data)
                {
                    StatData oldStat = ent.Status.Data.FirstOrDefault(x => x.Id == stat.Id);
                    if (oldStat != null)
                    {
                        oldStat.IntValue    = stat.IntValue;
                        oldStat.StringValue = stat.StringValue;
                    }
                }
            }
        }