Example #1
0
        public void SerializeTest()
        {
            DB.Serializer serializer = new DB.Serializer();
            var           ctx        = EntityChangeSetTests.RandomContext();

            for (int i = 0; i < 100; i++)
            {
                RCS       rcs     = RandomOutboundRCS(ctx);
                SerialRCS srcs    = new SerialRCS(new RCS.GenID(Int3.Zero, Int3.One, 0), rcs);
                string    json    = serializer.Serialize(srcs);
                SerialRCS backRCS = serializer.Deserialize <SerialRCS>(json);
                RCS       back    = backRCS.Deserialize();
                Assert.AreEqual(srcs, backRCS);
                Assert.AreEqual(rcs, back);
            }

            for (int i = 0; i < 100; i++)
            {
                SDS    sds     = RandomSDS(ctx);
                var    s       = new SerialSDS(sds, Simulation.ID.XYZ);
                string json    = serializer.Serialize(s);
                var    reverse = serializer.Deserialize <SerialSDS>(json);
                Assert.AreEqual(s, reverse);
                SDS rev2 = reverse.Deserialize();
                Assert.IsTrue(sds.ICMessagesAndEntitiesAreEqual(rev2));
            }
        }
Example #2
0
        // ///////////////////////
        // RECOIL CONTROL THREAD//
        // ///////////////////////

        public static void AimbotCall()
        {
            var RCS = new RCS();

            var RCSThread = new Thread(RCS.Run);

            RCSThread.Start();
        }
Example #3
0
 private static RCS[] RandomOutboundRCSs(SimulationContext ctx, int count)
 {
     RCS[] rs = new RCS[count];
     for (int i = 0; i < count; i++)
     {
         rs[i] = RandomOutboundRCS(ctx);
     }
     return(rs);
 }
Example #4
0
    public void Awake()
    {
        // Configure the SDK
        DDNA.Instance.SetLoggingLevel(DeltaDNA.Logger.Level.DEBUG);
        DDNA.Instance.ClientVersion = "1.0.0";

        // Start collecting data
        DDNA.Instance.StartSDK();


        Debug.Log("UnityAds.Init()");
        StartCoroutine("InitAds");

        Debug.Log("Initialising rcs");
        RCS.Initialize();
        RCS.RequestSegment(this);
    }
Example #5
0
        public List <RssChannelSubscriptionWithStatisticsData> LoadAllChannelsWithStatistics()
        {
            var f =
                from channel in this.database.RssChannels
                join subscription in this.database.RssChannelsSubscriptions
                on channel.Id equals subscription.RssChannelId into RCS
                join entries in this.database.RssEntries
                on channel.Id equals entries.RssChannelId into RE
                select
                new RssChannelSubscriptionWithStatisticsData
            {
                Id    = channel.Id,
                Title = channel.Title,
                SubscriptionsCount = RCS.Count(),
                RssEntriesCount    = RE.Count(),
                Created            = channel.Created,
                Updated            = channel.Updated
            };

            return(f.Distinct().ToList());
        }
Example #6
0
        public static void Start()
        {
            gvar.SHUTDOWN++;
            while (true)
            {
                if (gvar.isShuttingDown)
                {
                    gvar.SHUTDOWN--;
                    break;
                }

                Thread.Sleep(10);

                if (gvar.isMenu)
                {
                    continue;
                }
                if (!Local.InGame)
                {
                    AimbotSettings = new Settings.UserSettings.Aimbot.ASettings();
                    continue;
                }
                if (Local.ActiveWeapon.isKnife() || Local.ActiveWeapon.isBomb() || Local.ActiveWeapon.isGrenade())
                {
                    AimbotSettings = new Settings.UserSettings.Aimbot.ASettings();
                    continue;
                }
                LoadSetting();

                if (!Local.ActiveWeapon.CanFire)
                {
                    continue;
                }

                if (!AimbotSettings.Enabled)
                {
                    Local.ViewAngle = RCS.ClampAngle();

                    Attack();
                    continue;
                }

                if (Settings.userSettings.AimbotSettings.Key == 1)
                {
                    if (AimbotSettings.SmoothPitch == 0 && AimbotSettings.SmoothYaw == 0)
                    {
                        if (!AimbotSettings.AutoShoot)
                        {
                            if (WinAPI.GetAsyncKeyState(1) <= 0 &&
                                (WinAPI.GetAsyncKeyState(1) & 0x8000) <= 0)
                            {
                                continue;
                            }
                        }
                    }
                }
                else
                {
                    if (WinAPI.GetAsyncKeyState(Settings.userSettings.AimbotSettings.Key) <= 0 &&
                        (WinAPI.GetAsyncKeyState(Settings.userSettings.AimbotSettings.Key) & 0x8000) <= 0)
                    {
                        Local.ViewAngle = RCS.ClampAngle();
                        continue;
                    }
                }
                using (Entity closestPlayer = ClosestPlayer)
                {
                    if (closestPlayer.Index == -1)
                    {
                        Local.ViewAngle = RCS.ClampAngle();

                        Attack();
                    }
                    else
                    {
                        Thread.Sleep(AimbotSettings.Delay);

                        if (AimbotSettings.SmoothPitch == 0 || AimbotSettings.SmoothYaw == 0)
                        {
                            Local.SendPackets = false;
                        }

                        oldAngle.x = (float)(Local.PunchAngle.x * (AimbotSettings.RcsYaw * 2) / 100);
                        oldAngle.y = (float)(Local.PunchAngle.y * (AimbotSettings.RcsPitch * 2) / 100);

                        Vector2 ang = CalculateAimAngle(Local.EyeLevel, closestPlayer).ClampAngle();

                        Local.ViewAngle = ang;

                        //SetSilentAngle(ang);
                        //Enable If you dare.

                        Thread.Sleep(6);

                        Local.SendPackets = true;

                        if (AimbotSettings.AutoShoot)
                        {
                            Vector2 v2 = CalculateAimAngle(Local.EyeLevel, closestPlayer, false).ClampAngle();
                            if (Math.Round(ang.x, 1) == Math.Round(v2.x, 1) && Math.Round(ang.y, 1) == Math.Round(v2.y, 1))
                            {
                                Local.Attack();
                            }
                        }
                        else
                        {
                            Vector2 v2 = CalculateAimAngle(Local.EyeLevel, closestPlayer, false).ClampAngle();
                            if (Math.Round(ang.x, 1) == Math.Round(v2.x, 1) && Math.Round(ang.y, 1) == Math.Round(v2.y, 1))
                            {
                                Attack();
                            }
                        }
                        Thread.Sleep(50);
                    }
                }
            }
        }
Example #7
0
        public void NestedComputationTest()
        {
            int numRCS = 0;


            SimulationRun run = new SimulationRun(
                new BaseDB.ConfigContainer()
            {
                extent = new Int3(3), r = 1f / 8, m = 1f / 16
            },
                new ShardID(Int3.One, 0));

            Vec3 outlierCoords = Simulation.MySpace.Min;

            var    crossingLogic  = new MovingLogic(new Vec3(-1, 0, 0));
            Entity crosser        = new Entity(new EntityID(Guid.NewGuid(), Simulation.MySpace.Min), Vec3.Zero, crossingLogic, null);
            Vec3   crossingTarget = crosser.ID.Position + crossingLogic.Motion;

            foreach (var n in Simulation.Neighbors)
            {
                n.OnPutRCS = (decoded, gen) =>
                {
                    numRCS++;

                    Assert.AreEqual(gen, 1);


                    //RCS decoded = new RCS(rcs);

                    Assert.IsTrue(decoded.IsFullyConsistent);
                    //RCS.GenID id = new RCS.GenID(rcs.NumericID,0);
                    //Link lnk = Simulation.Neighbors.Find(id.ID.ToShard);
                    //Assert.IsNotNull(lnk);

                    if (n.WorldSpace.Grow(Simulation.Ranges.Transmission).Contains(outlierCoords))
                    {
                        Assert.IsFalse(decoded.CS.IsEmpty);
                    }
                    else
                    {
                        Assert.IsTrue(decoded.CS.IsEmpty);
                    }

                    if (n.WorldSpace.Contains(crossingTarget))
                    {
                        Assert.IsNotNull(decoded.CS.FindMotionOf(crosser.ID.Guid));
                    }
                }
            }
            ;


            run.FeedEntities(
                new Entity[]
            {
                new Entity(
                    new EntityID(Guid.NewGuid(), Simulation.MySpace.Center),
                    Vec3.Zero,
                    new ExceedingMovementLogic(),
                    //new EntityTest.FaultLogic.State(),
                    null),

                new Entity(
                    new EntityID(Guid.NewGuid(), outlierCoords),
                    Vec3.Zero,
                    new StationaryLogic(),
                    //new EntityTest.FaultLogic.State(),
                    null),
                crosser
            }
                );



            var inter = run.BeginAdvanceTLG(true);

            foreach (var p in inter.Intermediate.localChangeSet.NamedSets)
            {
                int expected = p.Key == "motions" || p.Key == "advertisements" ? 3 : 0;
                Assert.AreEqual(expected, p.Value.Size);
            }

            Assert.AreEqual(inter.Generation, 1);
            Assert.AreEqual(Simulation.NeighborCount, numRCS);
            //comp.

            {
                Link inbound = Simulation.Neighbors.Find(new Int3(0, 1, 1));
                RCS  inRCS   = new RCS(new EntityChangeSet(), new InconsistencyCoverage(inbound.ICExportRegion.Size));
                Simulation.FetchNeighborUpdate(run.tlgEntry, inbound, inRCS.Export());
            }

            var rs = run.CompleteAdvanceTLG(false);

            //check if most outer cells are 1 (one full-edge incoming RCS):
            var core     = rs.SDS.IC.Sub(Int3.One, rs.SDS.IC.Size - 2);
            int edgeSize = InconsistencyCoverage.CommonResolution - 2;

            Assert.AreEqual(rs.SDS.IC.OneCount, rs.SDS.IC.Size.Product - core.Size.Product - edgeSize * edgeSize, edgeSize.ToString());
            Assert.IsTrue(rs.SDS.IC.OneCount > 0);
            Assert.IsTrue(core.OneCount == 0);


            Assert.AreEqual(rs.Generation, 1);
            Assert.AreEqual(rs.SDS.FinalEntities.Length, 2);
            Assert.IsFalse(rs.SDS.HasEntity(crosser.ID.Guid));

            var check = Simulation.CheckMissingRCS(rs);

            Assert.IsFalse(check.AllThere);
            Assert.IsFalse(check.AnyAvailableFromNeighbors);
            Assert.AreEqual(check.missingRCS, numRCS - 1);
            Assert.IsTrue(check.predecessorIsConsistent);
            Assert.AreEqual(check.rcsAvailableFromNeighbor, 0);
            Assert.AreEqual(check.rcsRestoredFromDB, 0);
        }