Ejemplo n.º 1
0
 // <summary>
 // Return the MD5 hash of the string as a string.
 // </summary>
 public static string Md5Text(this string instance)
 {
     return(NativeCalls.godot_icall_String_md5_text(instance));
 }
Ejemplo n.º 2
0
 public static void PrintS(params object[] what)
 {
     NativeCalls.godot_icall_Godot_prints(what);
 }
Ejemplo n.º 3
0
 // <summary>
 // Return the MD5 hash of the string as an array of bytes.
 // </summary>
 public static byte[] Md5Buffer(this string instance)
 {
     return(NativeCalls.godot_icall_String_md5_buffer(instance));
 }
Ejemplo n.º 4
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            Select();
            IntPtr hwnd = Handle;

            if ((ResizeParent) && (Parent != null) && (Parent.IsHandleCreated))
            {
                hwnd = Parent.Handle;
            }

            if (e.Button == MouseButtons.Left)
            {
                MousePos mousePos = GetMousePos(e.Location);
                if (mousePos == MousePos.NoWhere)
                {
                    if (MainForm.Conf.ShowOverlayControls)
                    {
                        int bpi = GetButtonIndexByLocation(e.Location);
                        switch (bpi)
                        {
                        case 0:
                            MainClass.EditFloorplan(Fpobject);
                            break;

                        case 1:
                            if (Helper.HasFeature(Enums.Features.Access_Media))
                            {
                                string url = MainForm.Webserver + "/watch_new.aspx";
                                if (WsWrapper.WebsiteLive && MainForm.Conf.ServicesEnabled)
                                {
                                    MainForm.OpenUrl(url);
                                }
                                else
                                {
                                    MainClass.Connect(url, false);
                                }
                            }
                            break;
                        }
                    }
                }
                if (MainForm.Conf.LockLayout)
                {
                    return;
                }
                switch (mousePos)
                {
                case MousePos.Right:
                {
                    NativeCalls.ReleaseCapture(hwnd);
                    NativeCalls.SendMessage(hwnd, NativeCalls.WmSyscommand, NativeCalls.ScDragsizeE, IntPtr.Zero);
                }
                break;

                case MousePos.Bottom:
                {
                    NativeCalls.ReleaseCapture(hwnd);
                    NativeCalls.SendMessage(hwnd, NativeCalls.WmSyscommand, NativeCalls.ScDragsizeS, IntPtr.Zero);
                }
                break;

                case MousePos.BottomRight:
                {
                    NativeCalls.ReleaseCapture(hwnd);
                    NativeCalls.SendMessage(hwnd, NativeCalls.WmSyscommand, NativeCalls.ScDragsizeSe,
                                            IntPtr.Zero);
                }
                break;
                }
            }
        }
Ejemplo n.º 5
0
 public static void printraw(params object[] what)
 {
     NativeCalls.godot_icall_Godot_printraw(what);
 }
Ejemplo n.º 6
0
 // <summary>
 // Return the SHA-256 hash of the string as a string.
 // </summary>
 public static string Sha256Text(this string instance)
 {
     return(NativeCalls.godot_icall_String_sha256_text(instance));
 }
Ejemplo n.º 7
0
        internal static void Main()
        {
            Console.Title = "Clashers Republic Clash Server - ©Clashers Repbulic";
            NativeCalls.SetWindowLong(NativeCalls.GetConsoleWindow(), -20, (int)NativeCalls.GetWindowLong(NativeCalls.GetConsoleWindow(), -20) ^ 0x80000);
            NativeCalls.SetLayeredWindowAttributes(NativeCalls.GetConsoleWindow(), 0, 217, 0x2);

            Console.SetOut(new Prefixed());

            Console.WriteLine(@"_________ .__                .__                          __________                   ___.   .__  .__        ");
            Console.WriteLine(@"\_   ___ \|  | _____    _____|  |__   ___________  ______ \______   \ ____ ______  __ _\_ |__ |  | |__| ____  ");
            Console.WriteLine(@"/    \  \/|  | \__  \  /  ___/  |  \_/ __ \_  __ \/  ___/  |       _// __ \\____ \|  |  \ __ \|  | |  |/ ___\ ");
            Console.WriteLine(@"\     \___|  |__/ __ \_\___ \|   Y  \  ___/|  | \/\___ \   |    |   \  ___/|  |_> >  |  / \_\ \  |_|  \  \___ ");
            Console.WriteLine(@" \______  /____(____  /____  >___|  /\___  >__|  /____  >  |____|_  /\___  >   __/|____/|___  /____/__|\___  >");
            Console.WriteLine(@"        \/          \/     \/     \/     \/           \/          \/     \/|__|             \/             \/ ");
            Console.WriteLine(@"                                                                                        Development Edition  ");


            Console.WriteLine(@"Clashers Repbulic's programs are protected by our policies, available only to our partner.");
            Console.WriteLine(@"Clashers Repbulic's programs are under the 'Proprietary' license.");
            Console.WriteLine(@"Clashers Repbulic is NOT affiliated to 'Supercell Oy'.");
            Console.WriteLine(@"Clashers Repbulic does NOT own 'Clash of Clans', 'Boom Beach', 'Clash Royale'.");

            Console.WriteLine(Assembly.GetExecutingAssembly().GetName().Name + @" is now starting..." + Environment.NewLine);

            Resources.Initialize();
            Console.WriteLine(@"-------------------------------------" + Environment.NewLine);

            Thread.Sleep(Timeout.Infinite);
        }
Ejemplo n.º 8
0
 public static object Str2Var(string str)
 {
     return(NativeCalls.godot_icall_Godot_str2var(str));
 }
Ejemplo n.º 9
0
 public static bool TypeExists(string type)
 {
     return(NativeCalls.godot_icall_Godot_type_exists(type));
 }
Ejemplo n.º 10
0
 public static object Convert(object what, int type)
 {
     return(NativeCalls.godot_icall_Godot_convert(what, type));
 }
Ejemplo n.º 11
0
 public static string Str(params object[] what)
 {
     return(NativeCalls.godot_icall_Godot_str(what));
 }
Ejemplo n.º 12
0
 public static void Seed(int seed)
 {
     NativeCalls.godot_icall_Godot_seed(seed);
 }
Ejemplo n.º 13
0
 public static object Bytes2Var(byte[] bytes)
 {
     return(NativeCalls.godot_icall_Godot_bytes2var(bytes));
 }
Ejemplo n.º 14
0
 public static WeakRef weakref(Object obj)
 {
     return(NativeCalls.godot_icall_Godot_weakref(Object.GetPtr(obj)));
 }
Ejemplo n.º 15
0
 // <summary>
 // Perform a search for a substring, but start from the end of the string instead of the beginning. Also search case-insensitive.
 // </summary>
 public static int Rfindn(this string instance, string what, int from = -1)
 {
     return(NativeCalls.godot_icall_String_rfindn(instance, what, from));
 }
Ejemplo n.º 16
0
 public static byte[] Var2Bytes(object var)
 {
     return(NativeCalls.godot_icall_Godot_var2bytes(var));
 }
Ejemplo n.º 17
0
 public static byte[] Sha256Buffer(this string instance)
 {
     return(NativeCalls.godot_icall_String_sha256_buffer(instance));
 }
Ejemplo n.º 18
0
 public static string Var2Str(object var)
 {
     return(NativeCalls.godot_icall_Godot_var2str(var));
 }
Ejemplo n.º 19
0
        internal static void Main()
        {
            NativeCalls.SetWindowLong(NativeCalls.GetConsoleWindow(), -20, (int)NativeCalls.GetWindowLong(NativeCalls.GetConsoleWindow(), -20) ^ 0x80000);
            Console.Title = $"ClashLand Server V{Constants.Version} - Developer - {DateTime.Now.Year} ©";
            Console.SetOut(new Prefixed());
            Console.SetWindowSize(Program.Width, Program.Height);

            ClashLand.Core.Consoles.Colorful.Console.WriteWithGradient(@"

                         _________ .__                .__     .____                       .___
                         \_   ___ \|  | _____    _____|  |__  |    |   _____    ____    __| _/
                         /    \  \/|  | \__  \  /  ___/  |  \ |    |   \__  \  /    \  / __ |
                         \     \___|  |__/ __ \_\___ \|   Y  \|    |___ / __ \|   |  \/ /_/ | 
                          \______  /____(____  /____  >___|  /|_______ (____  /___|  /\____ | 
                                 \/          \/     \/     \/         \/    \/     \/      \/       
        
                                      Version 9.256 Support (+ v10.134 mod)
            ", Color.Yellow, Color.Fuchsia, 14);



            Console.ForegroundColor = ConsoleColor.White;

            Console.WriteLine(Environment.NewLine);
            Console.WriteLine(@"ClashLand is protected by our policies, available only to our partner.");
            Console.WriteLine(@"ClashLand program is under the 'Proprietary' license.");
            Console.WriteLine(@"ClashLand is NOT affiliated to 'Supercell Oy'.");
            Console.WriteLine(@"-----------------------------------------------------");
            Console.ResetColor();

            Console.ForegroundColor = ConsoleColor.White;

            Console.WriteLine(Assembly.GetExecutingAssembly().GetName().Name + @" is now starting..." + Environment.NewLine);

            Resources.Initialize();
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine(@"-------------------------------------" + Environment.NewLine);

            Thread.Sleep(Timeout.Infinite);
        }
Ejemplo n.º 20
0
 public static int Hash(object var)
 {
     return(NativeCalls.godot_icall_Godot_hash(var));
 }
Ejemplo n.º 21
0
    private static void Main(string[] args)
    {
        //uninstall?
        string[] arguments = Environment.GetCommandLineArgs();

        foreach (string argument in arguments)
        {
            if (argument.Split('=')[0].ToLower() == "/u")
            {
                string guid = argument.Split('=')[1];
                string path = Environment.GetFolderPath(Environment.SpecialFolder.System);
                var    si   = new ProcessStartInfo(path + "/msiexec.exe", "/x " + guid);
                Process.Start(si);
                Application.Exit();
                return;
            }
        }

        var  version = Environment.OSVersion.Version;
        bool canrun  = true;

        switch (version.Major)
        {
        case 5:
            canrun = false;
            break;

        case 6:
            switch (version.Minor)
            {
            case 0:
                canrun = false;
                break;
            }
            break;
        }
        if (!canrun)
        {
            MessageBox.Show("iSpy is not supported on this operating system. Please uninstall and download v6.5.8.0 instead. Your settings will be saved.");
            Process.Start("http://www.ispyconnect.com/download.aspx");
            return;
        }

        try
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);


            bool firstInstance = true;

            var me           = Process.GetCurrentProcess();
            var arrProcesses = Process.GetProcessesByName(me.ProcessName);

            //only want to do this if not passing in a command

            if (arrProcesses.Length > 1)
            {
                firstInstance = false;
            }

            string executableName     = Application.ExecutablePath;
            var    executableFileInfo = new FileInfo(executableName);
            ExecutableDirectory = executableFileInfo.DirectoryName;

            bool ei = (!Directory.Exists(AppDataPath) || !Directory.Exists(AppDataPath + @"XML\") ||
                       !File.Exists(AppDataPath + @"XML\config.xml"));
            if (ei)
            {
                EnsureInstall(true);
            }
            else
            {
                try
                {
                    var o = Registry.CurrentUser.OpenSubKey(@"Software\ispy", true);
                    if (o?.GetValue("firstrun") != null)
                    {
                        o.DeleteValue("firstrun");
                        //copy over updated static files on first run of new install
                        EnsureInstall(false);
                    }
                }
                catch (Exception ex)
                {
                    Logger.LogExceptionToFile(ex, "startup");
                }
            }

            bool silentstartup = false;

            string command = "";
            if (args.Length > 0)
            {
                if (args[0].ToLower().Trim() == "-reset" && !ei)
                {
                    if (firstInstance)
                    {
                        if (
                            MessageBox.Show("Reset iSpy? This will overwrite all your settings.", "Confirm",
                                            MessageBoxButtons.OKCancel) == DialogResult.OK)
                        {
                            EnsureInstall(true);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Please exit iSpy before resetting it.");
                    }
                }
                if (args[0].ToLower().Trim() == "-silent" || args[0].ToLower().Trim('\\') == "s")
                {
                    if (firstInstance)
                    {
                        silentstartup = true;
                    }
                }
                else
                {
                    command = args.Aggregate(command, (current, s) => current + (s + " "));
                }
            }

            if (!firstInstance)
            {
                if (!string.IsNullOrEmpty(command))
                {
                    File.WriteAllText(AppDataPath + "external_command.txt", command);
                    Thread.Sleep(1000);
                }
                else
                {
                    //show form
                    File.WriteAllText(AppDataPath + "external_command.txt", "showform");
                    Thread.Sleep(1000);
                }

                Application.Exit();
                return;
            }

            if (IntPtr.Size == 8)
            {
                Platform = "x64";
            }

            File.WriteAllText(AppDataPath + "external_command.txt", "");

            // in case our https certificate ever expires or there is some other issue
            //ServicePointManager.ServerCertificateValidationCallback += ValidateRemoteCertificate;
            ServicePointManager.Expect100Continue      = false;
            ServicePointManager.DefaultConnectionLimit = 1000;

            FfmpegMutex = new Mutex();

            Application.ThreadException += ApplicationThreadException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;


            _previousExecutionState = NativeCalls.SetThreadExecutionState(NativeCalls.EsContinuous | NativeCalls.EsSystemRequired);

            AppIdle = new WinFormsAppIdleHandler {
                Enabled = false
            };
            var mf = new MainForm(silentstartup, command);
            GC.KeepAlive(FfmpegMutex);

            Application.Run(mf);
            FfmpegMutex.Close();

            AppIdle.Enabled = false;
            ffmpeg.avformat_network_deinit();


            if (_previousExecutionState != 0)
            {
                NativeCalls.SetThreadExecutionState(_previousExecutionState);
            }
        }
        catch (Exception ex)
        {
            try
            {
                Logger.LogExceptionToFile(ex);
            } catch
            {
            }
            while (ex.InnerException != null)
            {
                try
                {
                    Logger.LogExceptionToFile(ex);
                }
                catch
                {
                }
            }
        }
        try
        {
            Logger.WriteLogs();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
Ejemplo n.º 22
0
 public static Object InstanceFromId(int instanceId)
 {
     return(NativeCalls.godot_icall_Godot_instance_from_id(instanceId));
 }
Ejemplo n.º 23
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            Select();
            IntPtr hwnd = Handle;

            if ((ResizeParent) && (Parent != null) && (Parent.IsHandleCreated))
            {
                hwnd = Parent.Handle;
            }

            if (e.Button == MouseButtons.Left)
            {
                MousePos mousePos = GetMousePos(e.Location);
                if (mousePos == MousePos.NoWhere)
                {
                    if (MainForm.Conf.ShowOverlayControls)
                    {
                        int leftpoint = Width / 2 - ButtonPanelWidth / 2;
                        int ypoint    = Height - 24 - ButtonPanelHeight;
                        if (e.Location.X > leftpoint && e.Location.X < leftpoint + ButtonPanelWidth &&
                            e.Location.Y > ypoint && e.Location.Y < ypoint + ButtonPanelHeight)
                        {
                            int x = e.Location.X - leftpoint;
                            if (x < ButtonWidth + ButtonOffset)
                            {
                                //settings
                                if (TopLevelControl != null)
                                {
                                    ((MainForm)TopLevelControl).EditFloorplan(Fpobject);
                                }
                            }
                            else
                            {
                                string url = MainForm.Webserver + "/watch_new.aspx";// "?tab=2";
                                if (WsWrapper.WebsiteLive && MainForm.Conf.ServicesEnabled)
                                {
                                    MainForm.OpenUrl(url);
                                }
                                else if (TopLevelControl != null)
                                {
                                    ((MainForm)TopLevelControl).Connect(url, false);
                                }
                            }
                        }
                    }
                }
                if (MainForm.Conf.LockLayout)
                {
                    return;
                }
                switch (mousePos)
                {
                case MousePos.Right:
                {
                    NativeCalls.ReleaseCapture(hwnd);
                    NativeCalls.SendMessage(hwnd, NativeCalls.WmSyscommand, NativeCalls.ScDragsizeE, IntPtr.Zero);
                }
                break;

                case MousePos.Bottom:
                {
                    NativeCalls.ReleaseCapture(hwnd);
                    NativeCalls.SendMessage(hwnd, NativeCalls.WmSyscommand, NativeCalls.ScDragsizeS, IntPtr.Zero);
                }
                break;

                case MousePos.BottomRight:
                {
                    NativeCalls.ReleaseCapture(hwnd);
                    NativeCalls.SendMessage(hwnd, NativeCalls.WmSyscommand, NativeCalls.ScDragsizeSe,
                                            IntPtr.Zero);
                }
                break;
                }
            }
        }
Ejemplo n.º 24
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            Select();
            IntPtr hwnd = Handle;

            if ((ResizeParent) && (Parent != null) && (Parent.IsHandleCreated))
            {
                hwnd = Parent.Handle;
            }

            if (e.Button == MouseButtons.Left)
            {
                MousePos mousePos = GetMousePos(e.Location);
                if (mousePos == MousePos.NoWhere)
                {
                    if (MainForm.Conf.ShowOverlayControls)
                    {
                        int bpi = GetButtonIndexByLocation(e.Location);
                        switch (bpi)
                        {
                        case -999:
                            var layoutPanel = (LayoutPanel)Parent;
                            layoutPanel?.ISpyControlDown(new Point(this.Left + e.X, this.Top + e.Y));
                            break;

                        case 0:
                            MainClass.EditFloorplan(Fpobject);
                            break;

                        case 1:
                            throw new NotSupportedException("Website not supported exception");
                        }
                    }
                }
                if (MainForm.LockLayout)
                {
                    return;
                }
                switch (mousePos)
                {
                case MousePos.Right:
                {
                    NativeCalls.ReleaseCapture(hwnd);
                    NativeCalls.SendMessage(hwnd, NativeCalls.WmSyscommand, NativeCalls.ScDragsizeE, IntPtr.Zero);
                }
                break;

                case MousePos.Bottom:
                {
                    NativeCalls.ReleaseCapture(hwnd);
                    NativeCalls.SendMessage(hwnd, NativeCalls.WmSyscommand, NativeCalls.ScDragsizeS, IntPtr.Zero);
                }
                break;

                case MousePos.BottomRight:
                {
                    NativeCalls.ReleaseCapture(hwnd);
                    NativeCalls.SendMessage(hwnd, NativeCalls.WmSyscommand, NativeCalls.ScDragsizeSe,
                                            IntPtr.Zero);
                }
                break;
                }
            }
        }