コード例 #1
0
    public override void ViewDisappeared()
    {
        base.ViewDisappeared();

        //Reseting tabs selections
        selectedLaunchMethod = LaunchMethod.Regular;
    }
コード例 #2
0
ファイル: LauncherForm.cs プロジェクト: rayschpp/ModLauncher
        private void ApplyMethod_SelectionChangeCommitted(object sender, EventArgs e)
        {
            LaunchMethod method = (LaunchMethod)Enum.Parse(typeof(LaunchMethod), (string)applyMethod.SelectedItem);

            if (method == LaunchMethod.LooseFiles)
            {
                FolderBrowserDialog d = new FolderBrowserDialog();
                d.Description = "Directory to find packs for";
                DialogResult r = d.ShowDialog();

                if (r == System.Windows.Forms.DialogResult.OK)
                {
                    LooseFileDirectory = d.SelectedPath;
                }
            }

            if (method == LaunchMethod.ExtraAssetPack)
            {
                OpenFileDialog op = new OpenFileDialog();
                op.Title  = "Extra .pack file";
                op.Filter = "Pack Files (*.pack)|*.pack";
                DialogResult r = op.ShowDialog();
                if (r == DialogResult.OK)
                {
                    File.Copy(op.FileName, planetside2PathTextField.Text + "\\Resources\\Assets\\Assets_256.pack", true);
                }
            }
        }
コード例 #3
0
    private void LaunchTabGroup_OnMethodChanged(LaunchMethod newLaunchMethod)
    {
        if (selectedLaunchMethod != newLaunchMethod)
        {
            selectedLaunchMethod = newLaunchMethod;
            SetReqFuel();

            ToggleSendButton();
        }
    }
コード例 #4
0
ファイル: CosmicPort.cs プロジェクト: AArtlone/SkyhookGame
 public void LaunchShip(SendShipData sendShipData, LaunchMethod launchMethod)
 {
     if (launchMethod == LaunchMethod.Regular)
     {
         smokeObject.SetActive(true);
         landLaunchManager.LaunchShip(sendShipData, LevelModule.Level);
     }
     else
     {
         skyhookLandLaunchManager.TryToLaunchShip(sendShipData);
     }
 }
コード例 #5
0
        public void OnAwake()
        {
            rays     = new List <RayInfo>();
            hit      = new RaycastHit();
            destrArr = new List <RayInfo>();
            rng      = new Random();


            launchMethod   = LaunchMethod.targeted_raycast;
            startBehaviour = RayTransformBehaivour.stick;
            endBehaviour   = RayTransformBehaivour.stick;

            throw new NotImplementedException();
            // arcPrefab = Resourcesengine.LaserTypesMapping[LaserTypes.LightningBig];
        }
コード例 #6
0
ファイル: LauncherForm.cs プロジェクト: rayschpp/ModLauncher
        private void button2_Click(object sender, EventArgs e)
        {
            long ts = DateTime.Now.ToFileTime();

            string path = planetside2PathTextField.Text;
            string file = path + "/Planetside2.exe";


            if (!File.Exists(file))
            {
                MessageBox.Show("Error: Cannot open planetside2.exe (did you select the wrong directory?)", "Can't Find Executable", MessageBoxButtons.OK);
                return;
            }

            //Save the ps2 path
            if (Settings.Default.PS2Path != path)
            {
                Settings.Default.PS2Path = path;
            }
            //And the extra launch args
            if (Settings.Default.ExtraArgs != launchArgs.Text)
            {
                Settings.Default.ExtraArgs = this.launchArgs.Text;
            }



            string         cookie      = loginWebBrowser.Document.Cookie;
            string         requestpath = domains[domain] + "/get_play_session?ts=" + ts;
            HttpWebRequest request     = WebRequest.Create(requestpath) as HttpWebRequest;

            request.CookieContainer = new CookieContainer();
            request.CookieContainer.MaxCookieSize = 4000;
            string[] cks = cookie.Split(';');
            foreach (string cook in cks)
            {
                string[] sp = cook.Split('=');
                Cookie   c  = new Cookie(sp[0].Trim(), sp[1].Trim());
                request.CookieContainer.Add(request.RequestUri, c);
            }
            HttpWebResponse r;

            try
            {
                r = request.GetResponse() as HttpWebResponse;
            }
            catch (WebException x)
            {
                MessageBox.Show("Log in on the side over there");
                return;
            }
            StreamReader reader = new StreamReader(r.GetResponseStream());
            string       text   = reader.ReadToEnd();

            JObject obj = JObject.Parse(text);

            string launch_args = "";

            launch_args += (string)obj["launch_args"];
            launch_args  = launch_args.Replace("LaunchPad:SessionId=", "LaunchPad:SessionId=" + ts);


            string UFP = this.ufpTextBox.Text;

            launch_args = launch_args.Replace("LaunchPad:Ufp=", "LaunchPad:Ufp=" + UFP);

            //Launch Mode: Loose Files.
            LaunchMethod method = (LaunchMethod)Enum.Parse(typeof(LaunchMethod), (string)applyMethod.SelectedItem);

            if (method == LaunchMethod.LooseFiles)
            {
                launch_args += @" AssetDelivery:AdditionalPaths=.\CommonData\;.\GraphicsData\;" + LooseFileDirectory;
                launch_args += " AssetDelivery:IndirectEnabled=0 AssetsDelivery:PreferDirect=1";
            }

            if (loggingCheckBox.Checked)
            {
                launch_args += LoggingArgs;
            }

            string ExtraLaunchArgs = launchArgs.Text;

            launch_args += ExtraLaunchArgs;


            ps2 = new Process();

            ps2.StartInfo.WorkingDirectory       = path;
            ps2.StartInfo.FileName               = path + "\\Planetside2.exe";
            ps2.StartInfo.Arguments              = launch_args;
            ps2.StartInfo.RedirectStandardOutput = true;
            ps2.StartInfo.UseShellExecute        = false;

            ps2.Exited += new EventHandler(ps2_Exited);

            ps2.OutputDataReceived += new DataReceivedEventHandler(ps2_OutputDataReceived);

            ps2.Start();
        }