예제 #1
0
        public override void ConvertPacketEntititiesCallback(HalfLifeDelta delta, String entityType, Int32 gameVersion)
        {
            if (gameVersion < (Int32)Versions.CounterStrike10 || gameVersion > (Int32)Versions.CounterStrike15)
            {
                return;
            }

            if (entityType == "entity_state_player_t")
            {
                UInt32?sequence = (UInt32?)delta.FindEntryValue("sequence");

                if (sequence != null)
                {
                    ConvertSequenceNumber(gameVersion, ref sequence);
                    delta.SetEntryValue("sequence", sequence);
                }

                UInt32?gaitSequence = (UInt32?)delta.FindEntryValue("gaitsequence");

                if (gaitSequence != null)
                {
                    ConvertSequenceNumber(gameVersion, ref gaitSequence);
                    delta.SetEntryValue("gaitsequence", gaitSequence);
                }
            }

            // all entities: zero out animtime
            if (gameVersion == (Int32)Versions.CounterStrike10 || gameVersion == (Int32)Versions.CounterStrike11)
            {
                if (delta.FindEntryValue("animtime") != null)
                {
                    delta.SetEntryValue("animtime", 0.0f);
                }
            }
        }
예제 #2
0
        public override void ConvertEventCallback(Demo demo, HalfLifeDelta delta, uint eventIndex)
        {
            // Smoke fix for CS 1.0-1.1 demos.
            if ((demo.GameVersion == (Int32)Versions.CounterStrike10 || demo.GameVersion == (Int32)Versions.CounterStrike11) && demo.Resources.ContainsKey("events/createsmoke.sc"))
            {
                if (eventIndex == demo.Resources["events/createsmoke.sc"])
                {
                    if (delta.FindEntryValue("iparam1") != null)
                    {
                        Random r = new Random();
                        delta.SetEntryValue("iparam1", r.Next(128, 300)); // FIXME: random guess
                    }
                }
            }

            // See ConvertDeltaDescriptionCallback.
            if (demo.GameVersion == (Int32)Versions.CounterStrike13)
            {
                for (int i = 1; i <= 2; i++)
                {
                    String paramName = "iparam" + i.ToString();
                    Int32? value     = (Int32?)delta.FindEntryValue(paramName);

                    if (value != null)
                    {
                        delta.SetEntryValue(paramName, value / 8192);
                    }
                }
            }
        }
예제 #3
0
        public override void ConvertDeltaDescriptionCallback(Int32 gameVersion, String deltaStructureName, HalfLifeDelta delta)
        {
            // CS 1.3 has a different event_t delta description for parameters iparam1 and iparam2.
            // Without this fix, bullets fly off in random directions in HLTV demos. No noticeable affect in POV demos.
            if (gameVersion != (Int32)Versions.CounterStrike13 || deltaStructureName != "event_t" || !((String)delta.FindEntryValue("name")).StartsWith("iparam"))
            {
                return;
            }

            delta.SetEntryValue("nBits", (UInt32)18);
            delta.SetEntryValue("divisor", 1.0f);
        }
예제 #4
0
        public override void ConvertDeltaDescriptionCallback(Int32 gameVersion, String deltaStructureName, HalfLifeDelta delta)
        {
            // CS 1.3 has a different event_t delta description for parameters iparam1 and iparam2.
            // Without this fix, bullets fly off in random directions in HLTV demos. No noticeable affect in POV demos.
            if (gameVersion != (Int32)Versions.CounterStrike13 || deltaStructureName != "event_t" || !((String)delta.FindEntryValue("name")).StartsWith("iparam"))
            {
                return;
            }

            delta.SetEntryValue("nBits", (UInt32)18);
            delta.SetEntryValue("divisor", 1.0f);
        }
예제 #5
0
        public override void ConvertPacketEntititiesCallback(HalfLifeDelta delta, String entityType, Int32 gameVersion)
        {
            if (gameVersion < (Int32)Versions.CounterStrike10 || gameVersion > (Int32)Versions.CounterStrike15)
            {
                return;
            }

            if (entityType == "entity_state_player_t")
            {
                UInt32? sequence = (UInt32?)delta.FindEntryValue("sequence");

                if (sequence != null)
                {
                    ConvertSequenceNumber(gameVersion, ref sequence);
                    delta.SetEntryValue("sequence", sequence);
                }

                UInt32? gaitSequence = (UInt32?)delta.FindEntryValue("gaitsequence");

                if (gaitSequence != null)
                {
                    ConvertSequenceNumber(gameVersion, ref gaitSequence);
                    delta.SetEntryValue("gaitsequence", gaitSequence);
                }
            }

            // all entities: zero out animtime
            if (gameVersion == (Int32)Versions.CounterStrike10 || gameVersion == (Int32)Versions.CounterStrike11)
            {
                if (delta.FindEntryValue("animtime") != null)
                {
                    delta.SetEntryValue("animtime", 0.0f);
                }
            }
        }
예제 #6
0
        public override void ConvertEventCallback(Demo demo, HalfLifeDelta delta, uint eventIndex)
        {
            // Smoke fix for CS 1.0-1.1 demos.
            if ((demo.GameVersion == (Int32)Versions.CounterStrike10 || demo.GameVersion == (Int32)Versions.CounterStrike11) && demo.Resources.ContainsKey("events/createsmoke.sc"))
            {
                if (eventIndex == demo.Resources["events/createsmoke.sc"])
                {
                    if (delta.FindEntryValue("iparam1") != null)
                    {
                        Random r = new Random();
                        delta.SetEntryValue("iparam1", r.Next(128, 300)); // FIXME: random guess
                    }
                }
            }

            // See ConvertDeltaDescriptionCallback.
            if (demo.GameVersion == (Int32)Versions.CounterStrike13)
            {
                for (int i = 1; i <= 2; i++)
                {
                    String paramName = "iparam" + i.ToString();
                    Int32? value = (Int32?)delta.FindEntryValue(paramName);

                    if (value != null)
                    {
                        delta.SetEntryValue(paramName, value / 8192);
                    }
                }
            }
        }