public RemoteControlForm()
        {
            InitializeComponent();

            mOpensim = new ProcessController(mConfig.OpenSimExe, Path.GetDirectoryName(mConfig.OpenSimExe), "");
            if (File.Exists(mConfig.OpenSimExe))
                mOpensim.Start();

            TopMost = true;
            Text = mConfig.Title;
            shutdownCheck.Checked = mConfig.ShutdownEverything;
        }
        private void CopyWebStatsDB()
        {
            string dbFolder = Path.Combine(Environment.CurrentDirectory, "Experiments", mConfig.ExperimentName);
            string file = "LocalUserStatistics.db";

            if (!mCopyDone) {
                mCopyDone = true;

                string local = dbFolder.Substring(2);
                //string remote = "/home/opensim/opensim-0.7.3.1/bin/LocalUserStatistics.db";
                string remote = "/home/opensim/opensim-0.7.6.1/bin/" + file;
                string server = "apollo.cs.st-andrews.ac.uk";
                string pass = "******";
                string username = "******";

                ProcessController p = new ProcessController("cmd.exe", "C:\\Windows\\System32", "");

                p.Start();

                Thread.Sleep(500);

                p.PressKey("E:{ENTER}");
                p.SendString("scp " + username + "@" + server + ":" + remote + " " + local);
                p.PressKey("{ENTER}");
                p.SendString(pass);
                p.PressKey("{ENTER}");
                p.SendString(pass);
                p.PressKey("{ENTER}");

                p.Process.Close();

                Thread.Sleep(5000);
            }
        }
        public bool Launch()
        {
            StartServer();
            string windowPosition = "";

            if (mConfig.Fill != Chimera.Fill.Windowed) {
                windowPosition += " -WinX=" + mFrame.Monitor.Bounds.X;
                windowPosition += " -WinY=" + mFrame.Monitor.Bounds.Y;
                if (mConfig.Fill == Chimera.Fill.Full) {
                    windowPosition += " -ResX=" + mFrame.Monitor.Bounds.Width;
                    windowPosition += " -ResY=" + mFrame.Monitor.Bounds.Height;
                } else if (mConfig.Fill == Chimera.Fill.Left || mConfig.Fill == Chimera.Fill.Right) {
                    Rectangle position = mFrame.Monitor.Bounds;
                    position.Width /= 2;
                    if (mConfig.Fill == Chimera.Fill.Right)
                        position.X += position.Width;
                    windowPosition += " -ResX=" + position.Width;
                    windowPosition += " -ResY=" + position.Height;
                }
            }

            mProcess = new ProcessController(mConfig.UnrealExecutable, mConfig.UnrealWorkingDirectory, mConfig.UnrealArguments + windowPosition);
            mProcess.Start();

            return false;
        }