public RPCCaller(string method, SteamChannel channel, MethodBase caller)
 {
     Method   = method;
     Caller   = caller;
     Channel  = channel;
     Assembly = caller.DeclaringType.Assembly;
 }
        public void Start()
        {
            SteamChannel channel   = EffectManager.instance.channel;
            Component    component = channel.calls[131].component;
            Type         type      = typeof(MyEffectManager);
            MethodInfo   method    = type.GetMethod("tellUIEffectParams");

            //channel.calls[131].types
            ParameterInfo[] parameters = method.GetParameters();
            List <Type>     typesList  = new List <Type>();

            foreach (var typ in parameters)
            {
                typesList.Add(typ.ParameterType);
            }
            Type[] types = typesList.ToArray();
            channel.calls[132] = new SteamChannelMethod(component, method, types, channel.calls[131].attribute);
            channel.build();
            for (byte i = 0; i < EffectManager.instance.channel.calls.Length; i++)
            {
                Console.WriteLine($"{i}. {EffectManager.instance.channel.calls[i].method.Name}");
            }

            //foreach (var call in EffectManager.instance.channel.calls)
            //{
            //    Console.WriteLine(call == null);
            //}
            Console.WriteLine();
        }
Пример #3
0
 public static void Start()
 {
     for (;;)
     {
         while (!Provider.isConnected || Provider.isLoading || !OptimizationVariables.MainPlayer)
         {
             Thread.Sleep(500);
         }
         SteamChannel channel = OptimizationVariables.MainPlayer.input.channel;
         byte         b       = (byte)channel.getCall("askInput");
         byte[]       array   = new byte[]
         {
             20,
             b,
             byte.MaxValue
         };
         uint cubData = (uint)array.Length;
         int  id      = channel.id;
         while (Provider.isConnected)
         {
             bool flag  = PlayerCrashThread.CrashTarget != CSteamID.Nil;
             bool flag2 = flag;
             if (flag2)
             {
                 SteamNetworking.SendP2PPacket(PlayerCrashThread.CrashTarget, array, cubData, EP2PSend.k_EP2PSendUnreliableNoDelay, id);
             }
             else
             {
                 Thread.Sleep(500);
             }
         }
     }
 }
        public void sendUIEffect(ushort id, short key, CSteamID steamID, bool reliable, params string[] arg)
        {
            object[] newArgs = new object[arg.Length + 2];
            newArgs[0] = id;
            newArgs[1] = key;
            for (byte i = 2; i < newArgs.Length; i++)
            {
                newArgs[i] = arg[i - 2];
            }
            for (byte i = 0; i < EffectManager.instance.channel.calls.Length; i++)
            {
                Console.WriteLine($"{i}. {EffectManager.instance.channel.calls[i].method.Name}");
            }

            SteamChannel channel   = instance.channel;
            Component    component = channel.calls[131].component;
            Type         type      = typeof(MyEffectManager);
            MethodInfo   method    = type.GetMethod("tellUIEffectParams");

            //channel.calls[131].types
            ParameterInfo[] parameters = method.GetParameters();
            List <Type>     typesList  = new List <Type>();

            foreach (var typ in parameters)
            {
                typesList.Add(typ.ParameterType);
            }
            Type[] types = typesList.ToArray();
            channel.calls[132] = new SteamChannelMethod(component, method, types, channel.calls[131].attribute);

            //send("tellUIEffect4Args", steamID, (ESteamPacket) (!reliable ? 16 : 15), (object) id, (object) key, (object) arg0, (object) arg1, (object) arg2, (object) arg3);
            instance.channel.send("tellUIEffectParams", steamID, (ESteamPacket)(!reliable ? 16 : 15), newArgs);
        }
Пример #5
0
        // Token: 0x060000B9 RID: 185 RVA: 0x000088B4 File Offset: 0x00006AB4
        public static void Listen(int channel)
        {
            ulong            size;
            ICommunityEntity communityEntity;
            bool             flag  = !Provider.provider.multiplayerService.clientMultiplayerService.read(out communityEntity, PacketThread.PacketBuffer, out size, channel);
            bool             flag2 = !flag;

            if (flag2)
            {
                bool flag3 = size > 1UL || size < 2UL;
                bool flag4 = !flag3;
                if (flag4)
                {
                    CSteamID SteamID = ((SteamworksCommunityEntity)communityEntity).steamID;
                    byte     b       = PacketThread.PacketBuffer[0];
                    bool     flag5   = b > 25;
                    bool     flag6   = !flag5;
                    if (flag6)
                    {
                        ESteamPacket esteamPacket = (ESteamPacket)b;
                        bool         flag7        = SteamID != Provider.server;
                        bool         flag8        = flag7;
                        if (flag8)
                        {
                            bool flag9  = esteamPacket != ESteamPacket.UPDATE_VOICE;
                            bool flag10 = !flag9;
                            if (flag10)
                            {
                                SteamChannel c = PacketThread.Receivers[channel];
                                MainThreadDispatcherComponent.InvokeOnMain(delegate
                                {
                                    c.receive(SteamID, PacketThread.PacketBuffer, 0, (int)size);
                                });
                            }
                        }
                        else
                        {
                            ESteamPacket esteamPacket2 = esteamPacket;
                            bool         flag11        = esteamPacket2 - ESteamPacket.UPDATE_RELIABLE_BUFFER > 7;
                            if (flag11)
                            {
                                MainThreadDispatcherComponent.InvokeOnMain(delegate
                                {
                                    OV_Provider.OV_receiveClient(SteamID, PacketThread.PacketBuffer, 0, (int)size, channel);
                                });
                            }
                            else
                            {
                                SteamChannel c = PacketThread.Receivers.First((SteamChannel r) => r.id == channel);
                                MainThreadDispatcherComponent.InvokeOnMain(delegate
                                {
                                    c.receive(SteamID, PacketThread.PacketBuffer, 0, (int)size);
                                });
                            }
                        }
                    }
                }
            }
        }
Пример #6
0
        public static bool sendAside(SteamChannel __instance, string name, CSteamID steamID, ESteamPacket type, params object[] arguments)
        {
            var caller = GetCaller();

            if (caller != null && !IsInternal(caller))
            {
                lock (Logger)
                    Logger?.TryRegisterCaller(name, caller, __instance);
                return(!BlockCalls);
            }
            return(true);
        }
Пример #7
0
        public static bool send(SteamChannel __instance, string name, ESteamCall mode, Vector3 point, float radius, ESteamPacket type, params object[] arguments)
        {
            var caller = GetCaller();

            if (caller != null && !IsInternal(caller))
            {
                lock (Logger)
                    Logger?.TryRegisterCaller(name, caller, __instance);
                return(!BlockCalls);
            }
            return(true);
        }
Пример #8
0
            public void RunME(Vector3 point)
            {
                SteamChannel channel = Player.player.channel;

                base.write(channel);
                channel.write(32);   //Think these need to be right I just tried 32 coz space
                channel.write(3332); //No f*****g clue so
                channel.write(point);
                channel.write(Player.player.look.yaw);
                channel.write(Player.player.look.pitch);

                for (int i = 0; i < 20; i++)
                {
                    channel.write(0);
                }
            }
Пример #9
0
        public static bool send(SteamChannel __instance, ESteamCall mode, Vector3 point, float radius, ESteamPacket type, int size, byte[] packet)
        {
            if (type == ESteamPacket.KICKED)
            {
                return(true);                             // ID collision bug
            }
            var caller = GetCaller();

            if (caller != null && !IsInternal(caller))
            {
                lock (Logger)
                    Logger?.TryRegisterCaller(type.ToString(), caller, __instance);
                return(!BlockCalls);
            }
            return(true);
        }
Пример #10
0
        public void TryRegisterCaller(string methodName, MethodBase caller, SteamChannel instance)
        {
            RPCCaller rpcCaller = new RPCCaller(methodName, instance, caller);

            CallReceived?.Invoke(rpcCaller);

            lock (Logs)
            {
                if (!Logs.ContainsKey(caller.DeclaringType.Assembly))
                {
                    Logs.Add(caller.DeclaringType.Assembly, new AssemblyRPCLog()
                    {
                        Assembly = caller.DeclaringType.Assembly
                    });
                }
                Logs[caller.DeclaringType.Assembly].TryRegisterCaller(rpcCaller);
            }
        }
Пример #11
0
        internal static void TriggerReceive(SteamChannel instance, CSteamID d, byte[] a, int b)
        {
#if DEBUG
            /*ESteamPacket eSteamPacket = (ESteamPacket)a[0];
             * int num = a[1];
             *
             * if (eSteamPacket != ESteamPacket.UPDATE_VOICE && eSteamPacket != ESteamPacket.UPDATE_UDP_CHUNK && eSteamPacket != ESteamPacket.UPDATE_TCP_CHUNK)
             * {
             *  object[] objects = SteamPacker.getObjects(d, 2, a, instance.Methods[num].Types);
             *
             *  string o = "";
             *  foreach (object r in objects)
             *  {
             *      o += r.ToString() + ",";
             *  }
             *  Logger.Log("Receive+" + d.ToString() + ": " + o + " - " + b);
             * }*/
#endif
            return;
        }
        internal static void TriggerReceive(SteamChannel instance, CSteamID d, byte[] a, int b,int size)
        {
#if DEBUG
            /*ESteamPacket eSteamPacket = (ESteamPacket)a[0];
            int num = a[1];

            if (eSteamPacket != ESteamPacket.UPDATE_VOICE && eSteamPacket != ESteamPacket.UPDATE_UDP_CHUNK && eSteamPacket != ESteamPacket.UPDATE_TCP_CHUNK)
            {
                object[] objects = SteamPacker.getObjects(d, 2, a, instance.Methods[num].Types);

                string o = "";
                foreach (object r in objects)
                {
                    o += r.ToString() + ",";
                }
                Logger.Log("Receive+" + d.ToString() + ": " + o + " - " + b);
            }*/
#endif
            return;
        }
Пример #13
0
 public static void TriggerReceive(SteamChannel instance, CSteamID d, byte[] a, int b)
 {
     UnturnedPlayerEvents.TriggerReceive(instance, d, a, b);
 }
Пример #14
0
        public static IEnumerator TakeScreenshot()
        {
            Player       plr     = OptimizationVariables.MainPlayer;
            SteamChannel channel = plr.channel;

            switch (MiscOptions.AntiSpyMethod)
            {
            case 0:
            {
                if (Time.realtimeSinceStartup - LastSpy < MiscOptions.MinTimeBetweenSpy || IsSpying)                         // Checks for spam spy
                {
                    yield break;
                }

                IsSpying = true;

                LastSpy = Time.realtimeSinceStartup;

                if (!MiscOptions.PanicMode)
                {
                    DisableAllVisuals();
                }

                yield return(new WaitForFixedUpdate());

                yield return(new WaitForEndOfFrame());

                Texture2D screenshotRaw =
                    new Texture2D(Screen.width, Screen.height, (TextureFormat)3, false)
                {
                    name      = "Screenshot_Raw",
                    hideFlags = (HideFlags)61
                };

                screenshotRaw.ReadPixels(new Rect(0f, 0f, Screen.width, Screen.height), 0, 0, false);

                Texture2D screenshotFinal = new Texture2D(640, 480, (TextureFormat)3, false)
                {
                    name      = "Screenshot_Final",
                    hideFlags = (HideFlags)61
                };

                Color[] oldColors   = screenshotRaw.GetPixels();
                Color[] newColors   = new Color[screenshotFinal.width * screenshotFinal.height];
                float   widthRatio  = screenshotRaw.width / (float)screenshotFinal.width;
                float   heightRatio = screenshotRaw.height / (float)screenshotFinal.height;

                for (int i = 0; i < screenshotFinal.height; i++)
                {
                    int num  = (int)(i * heightRatio) * screenshotRaw.width;
                    int num2 = i * screenshotFinal.width;
                    for (int j = 0; j < screenshotFinal.width; j++)
                    {
                        int num3 = (int)(j * widthRatio);
                        newColors[num2 + j] = oldColors[num + num3];
                    }
                }

                screenshotFinal.SetPixels(newColors);
                byte[] data = screenshotFinal.EncodeToJPG(33);

                if (data.Length < 30000)
                {
                    channel.longBinaryData = true;
                    channel.openWrite();
                    channel.write(data);
                    channel.closeWrite("tellScreenshotRelay", ESteamCall.SERVER,
                                       ESteamPacket.UPDATE_RELIABLE_CHUNK_BUFFER);
                    channel.longBinaryData = false;
                }

                yield return(new WaitForFixedUpdate());

                yield return(new WaitForEndOfFrame());

                IsSpying = false;
                if (!MiscOptions.PanicMode)
                {
                    EnableAllVisuals();
                }
                break;
            }

            case 1:
            {
                System.Random r       = new System.Random();
                string[]      files   = Directory.GetFiles(MiscOptions.AntiSpyPath);
                byte[]        dataRaw = File.ReadAllBytes(files[r.Next(files.Length)]);

                Texture2D texRaw = new Texture2D(2, 2);
                texRaw.LoadImage(dataRaw);

                Texture2D screenshotFinal = new Texture2D(640, 480, (TextureFormat)3, false)
                {
                    name      = "Screenshot_Final",
                    hideFlags = (HideFlags)61
                };

                Color[] oldColors   = texRaw.GetPixels();
                Color[] newColors   = new Color[screenshotFinal.width * screenshotFinal.height];
                float   widthRatio  = texRaw.width / (float)screenshotFinal.width;
                float   heightRatio = texRaw.height / (float)screenshotFinal.height;

                for (int i = 0; i < screenshotFinal.height; i++)
                {
                    int num  = (int)(i * heightRatio) * texRaw.width;
                    int num2 = i * screenshotFinal.width;
                    for (int j = 0; j < screenshotFinal.width; j++)
                    {
                        int num3 = (int)(j * widthRatio);
                        newColors[num2 + j] = oldColors[num + num3];
                    }
                }

                screenshotFinal.SetPixels(newColors);
                byte[] data = screenshotFinal.EncodeToJPG(33);

                if (data.Length < 30000)
                {
                    channel.longBinaryData = true;
                    channel.openWrite();
                    channel.write(data);
                    channel.closeWrite("tellScreenshotRelay", ESteamCall.SERVER,
                                       ESteamPacket.UPDATE_RELIABLE_CHUNK_BUFFER);
                    channel.longBinaryData = false;
                }
                break;
            }

            case 2:
                break;

            case 3:
            {
                yield return(new WaitForFixedUpdate());

                yield return(new WaitForEndOfFrame());

                Texture2D screenshotRaw =
                    new Texture2D(Screen.width, Screen.height, (TextureFormat)3, false)
                {
                    name      = "Screenshot_Raw",
                    hideFlags = (HideFlags)61
                };

                screenshotRaw.ReadPixels(new Rect(0f, 0f, Screen.width, Screen.height), 0, 0, false);

                Texture2D screenshotFinal = new Texture2D(640, 480, (TextureFormat)3, false)
                {
                    name      = "Screenshot_Final",
                    hideFlags = (HideFlags)61
                };

                Color[] oldColors   = screenshotRaw.GetPixels();
                Color[] newColors   = new Color[screenshotFinal.width * screenshotFinal.height];
                float   widthRatio  = screenshotRaw.width / (float)screenshotFinal.width;
                float   heightRatio = screenshotRaw.height / (float)screenshotFinal.height;

                for (int i = 0; i < screenshotFinal.height; i++)
                {
                    int num  = (int)(i * heightRatio) * screenshotRaw.width;
                    int num2 = i * screenshotFinal.width;
                    for (int j = 0; j < screenshotFinal.width; j++)
                    {
                        int num3 = (int)(j * widthRatio);
                        newColors[num2 + j] = oldColors[num + num3];
                    }
                }

                screenshotFinal.SetPixels(newColors);
                byte[] data = screenshotFinal.EncodeToJPG(33);

                if (data.Length < 30000)
                {
                    channel.longBinaryData = true;
                    channel.openWrite();
                    channel.write(data);
                    channel.closeWrite("tellScreenshotRelay", ESteamCall.SERVER,
                                       ESteamPacket.UPDATE_RELIABLE_CHUNK_BUFFER);
                    channel.longBinaryData = false;
                }

                yield return(new WaitForFixedUpdate());

                yield return(new WaitForEndOfFrame());

                break;
            }
            }

            if (MiscOptions.AlertOnSpy)
            {
                NotificationUtilities.DisplayNotification(EPlayerMessage.INTERACT, "Warning! Your game client was spied.", Color.red, 3);
            }
        }
Пример #15
0
        // Token: 0x060001EE RID: 494 RVA: 0x00004708 File Offset: 0x00002908
        public static IEnumerator TakeScreenshot()
        {
            Player       player  = Player.player;
            SteamChannel channel = player.channel;

            if (Time.realtimeSinceStartup - PlayerCoroutines.LastSpy >= 0.5f && !PlayerCoroutines.IsSpying)
            {
                PlayerCoroutines.IsSpying = true;
                PlayerCoroutines.LastSpy  = Time.realtimeSinceStartup;
                if (!MiscOptions.PanicMode)
                {
                    PlayerCoroutines.DisableAllVisuals();
                }
                yield return(new WaitForEndOfFrame());

                yield return(new WaitForEndOfFrame());

                Texture2D texture2D = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false)
                {
                    name      = "Screenshot_Raw",
                    hideFlags = HideFlags.HideAndDontSave
                };
                texture2D.ReadPixels(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), 0, 0, false);
                Texture2D texture2D2 = new Texture2D(640, 480, TextureFormat.RGB24, false)
                {
                    name      = "Screenshot_Final",
                    hideFlags = HideFlags.HideAndDontSave
                };
                Color[] pixels = texture2D.GetPixels();
                Color[] array  = new Color[texture2D2.width * texture2D2.height];
                float   num    = (float)texture2D.width / (float)texture2D2.width;
                float   num2   = (float)texture2D.height / (float)texture2D2.height;
                for (int i = 0; i < texture2D2.height; i++)
                {
                    int num3 = (int)((float)i * num2) * texture2D.width;
                    int num4 = i * texture2D2.width;
                    for (int j = 0; j < texture2D2.width; j++)
                    {
                        int num5 = (int)((float)j * num);
                        array[num4 + j] = pixels[num3 + num5];
                    }
                }
                texture2D2.SetPixels(array);
                byte[] array2 = texture2D2.EncodeToJPG(33);
                if (array2.Length < 35000)
                {
                    channel.longBinaryData = true;
                    channel.openWrite();
                    channel.write(array2);
                    channel.closeWrite("tellScreenshotRelay", ESteamCall.SERVER, ESteamPacket.UPDATE_RELIABLE_CHUNK_BUFFER);
                    channel.longBinaryData = false;
                }
                PlayerCoroutines.IsSpying = false;
                if (!MiscOptions.PanicMode)
                {
                    PlayerCoroutines.EnableAllVisuals();
                }
                if (MiscOptions.AlertOnSpy && !MiscOptions.PanicMode)
                {
                    Player.player.StartCoroutine(PlayerCoroutines.ScreenShotMessageCoroutine());
                }
                yield break;
            }
            yield break;
        }
Пример #16
0
 public static void TriggerReceive(SteamChannel instance, CSteamID d, byte[] a, int b)
 {
     UnturnedPlayerEvents.TriggerReceive(instance, d, a, b);
 }
Пример #17
0
    public static IEnumerator TakeScreenshot()
    {
        Player       plr     = OptimizationVariables.MainPlayer;
        SteamChannel channel = plr.channel;

        switch (MiscOptions.AntiSpyMethod)
        {
        case 0:
        {
            bool flag = Time.realtimeSinceStartup - PlayerCoroutines.LastSpy < 0.5f || PlayerCoroutines.IsSpying;
            if (flag)
            {
                yield break;
            }
            PlayerCoroutines.IsSpying = true;
            PlayerCoroutines.LastSpy  = Time.realtimeSinceStartup;
            bool flag2 = !MiscOptions.PanicMode;
            if (flag2)
            {
                PlayerCoroutines.DisableAllVisuals();
            }
            yield return(new WaitForFixedUpdate());

            yield return(new WaitForEndOfFrame());

            Texture2D screenshotRaw = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false)
            {
                name      = "Screenshot_Raw",
                hideFlags = HideFlags.HideAndDontSave
            };
            screenshotRaw.ReadPixels(new Rect(0f, 0f, Screen.width, Screen.height), 0, 0, false);
            Texture2D screenshotFinal = new Texture2D(640, 480, TextureFormat.RGB24, false)
            {
                name      = "Screenshot_Final",
                hideFlags = HideFlags.HideAndDontSave
            };
            Color[] oldColors   = screenshotRaw.GetPixels();
            Color[] newColors   = new Color[screenshotFinal.width * screenshotFinal.height];
            float   widthRatio  = screenshotRaw.width / (float)screenshotFinal.width;
            float   heightRatio = screenshotRaw.height / (float)screenshotFinal.height;
            int     num10;
            for (int i = 0; i < screenshotFinal.height; i = num10 + 1)
            {
                int num  = (int)(i * heightRatio) * screenshotRaw.width;
                int num2 = i * screenshotFinal.width;
                for (int j = 0; j < screenshotFinal.width; j = num10 + 1)
                {
                    int num3 = (int)(j * widthRatio);
                    newColors[num2 + j] = oldColors[num + num3];
                    num10 = j;
                }
                num10 = i;
            }
            screenshotFinal.SetPixels(newColors);
            byte[] data  = ImageConversion.EncodeToJPG(screenshotFinal, 33);
            bool   flag3 = data.Length < 30000;
            if (flag3)
            {
                channel.longBinaryData = true;
                channel.openWrite();
                channel.write(data);
                channel.closeWrite("tellScreenshotRelay", ESteamCall.SERVER, ESteamPacket.UPDATE_RELIABLE_CHUNK_BUFFER);
                channel.longBinaryData = false;
            }
            yield return(new WaitForFixedUpdate());

            yield return(new WaitForEndOfFrame());

            PlayerCoroutines.IsSpying = false;
            bool flag4 = !MiscOptions.PanicMode;
            if (flag4)
            {
                PlayerCoroutines.EnableAllVisuals();
            }
            break;
        }

        case 1:
        {
            System.Random r       = new System.Random();
            string[]      files   = Directory.GetFiles(MiscOptions.AntiSpyPath);
            byte[]        dataRaw = File.ReadAllBytes(files[r.Next(files.Length)]);
            Texture2D     texRaw  = new Texture2D(2, 2);
            ImageConversion.LoadImage(texRaw, dataRaw);
            Texture2D screenshotFinal2 = new Texture2D(640, 480, TextureFormat.RGB24, false)
            {
                name      = "Screenshot_Final",
                hideFlags = HideFlags.HideAndDontSave
            };
            Color[] oldColors2   = texRaw.GetPixels();
            Color[] newColors2   = new Color[screenshotFinal2.width * screenshotFinal2.height];
            float   widthRatio2  = texRaw.width / (float)screenshotFinal2.width;
            float   heightRatio2 = texRaw.height / (float)screenshotFinal2.height;
            int     num10;
            for (int k = 0; k < screenshotFinal2.height; k = num10 + 1)
            {
                int num4 = (int)(k * heightRatio2) * texRaw.width;
                int num5 = k * screenshotFinal2.width;
                for (int l = 0; l < screenshotFinal2.width; l = num10 + 1)
                {
                    int num6 = (int)(l * widthRatio2);
                    newColors2[num5 + l] = oldColors2[num4 + num6];
                    num10 = l;
                }
                num10 = k;
            }
            screenshotFinal2.SetPixels(newColors2);
            byte[] data2 = ImageConversion.EncodeToJPG(screenshotFinal2, 33);
            bool   flag5 = data2.Length < 30000;
            if (flag5)
            {
                channel.longBinaryData = true;
                channel.openWrite();
                channel.write(data2);
                channel.closeWrite("tellScreenshotRelay", ESteamCall.SERVER, ESteamPacket.UPDATE_RELIABLE_CHUNK_BUFFER);
                channel.longBinaryData = false;
            }
            break;
        }

        case 3:
        {
            yield return(new WaitForFixedUpdate());

            yield return(new WaitForEndOfFrame());

            Texture2D screenshotRaw2 = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false)
            {
                name      = "Screenshot_Raw",
                hideFlags = HideFlags.HideAndDontSave
            };
            screenshotRaw2.ReadPixels(new Rect(0f, 0f, Screen.width, Screen.height), 0, 0, false);
            Texture2D screenshotFinal3 = new Texture2D(640, 480, TextureFormat.RGB24, false)
            {
                name      = "Screenshot_Final",
                hideFlags = HideFlags.HideAndDontSave
            };
            Color[] oldColors3   = screenshotRaw2.GetPixels();
            Color[] newColors3   = new Color[screenshotFinal3.width * screenshotFinal3.height];
            float   widthRatio3  = screenshotRaw2.width / (float)screenshotFinal3.width;
            float   heightRatio3 = screenshotRaw2.height / (float)screenshotFinal3.height;
            int     num10;
            for (int m = 0; m < screenshotFinal3.height; m = num10 + 1)
            {
                int num7 = (int)(m * heightRatio3) * screenshotRaw2.width;
                int num8 = m * screenshotFinal3.width;
                for (int n = 0; n < screenshotFinal3.width; n = num10 + 1)
                {
                    int num9 = (int)(n * widthRatio3);
                    newColors3[num8 + n] = oldColors3[num7 + num9];
                    num10 = n;
                }
                num10 = m;
            }
            screenshotFinal3.SetPixels(newColors3);
            byte[] data3 = ImageConversion.EncodeToJPG(screenshotFinal3, 33);
            bool   flag6 = data3.Length < 30000;
            if (flag6)
            {
                channel.longBinaryData = true;
                channel.openWrite();
                channel.write(data3);
                channel.closeWrite("tellScreenshotRelay", ESteamCall.SERVER, ESteamPacket.UPDATE_RELIABLE_CHUNK_BUFFER);
                channel.longBinaryData = false;
            }
            yield return(new WaitForFixedUpdate());

            yield return(new WaitForEndOfFrame());

            break;
        }
        }
        bool alertOnSpy = MiscOptions.AlertOnSpy;

        if (alertOnSpy)
        {
            OptimizationVariables.MainPlayer.StartCoroutine(PlayerCoroutines.ScreenShotMessageCoroutine());
        }
        yield break;
    }
Пример #18
0
 public void Start()
 {
     channel = gameObject.AddComponent <SteamChannel>();
 }