コード例 #1
0
        private void runGameWithoutClientToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FileSystemOverlay.prepareForSP();
            Process gameProcess = new Process();

            gameProcess.StartInfo = new ProcessStartInfo("LaunchGTAIV.exe");
            gameProcess.Start();
        }
コード例 #2
0
        private void GameLaunchedForm_Shown(object sender, EventArgs e)
        {
            FileSystemOverlay.prepareForMIV();
            Application.DoEvents();
            Process gameProcess = new Process();

            gameProcess.StartInfo = new ProcessStartInfo("LaunchGTAIV.exe");
            gameProcess.Start();
            gameProcess.WaitForExit();
            FileSystemOverlay.prepareForSP();
            this.Close();
        }
コード例 #3
0
        public Client()
        {
            var startup = new Timer(6000);

            startup.Tick += (o, e) =>
            {
                startup.Stop();
                BindConsoleCommand("reconnect", (a) =>
                {
                    if (System.IO.File.Exists("miv_lastserver.ini"))
                    {
                        darkscreen = new ClientRectangleView(new System.Drawing.RectangleF(0, 0, 2000, 2000), System.Drawing.Color.Black);
                        Game.FadeScreenOut(1);
                        string[] lines   = System.IO.File.ReadAllLines("miv_lastserver.ini");
                        INIReader reader = new INIReader(lines);
                        initAndConnect(reader.getString("ip"), reader.getInt16("port"), reader.getString("nickname"));
                    }
                });
                if (System.IO.File.Exists("_serverinit.ini"))
                {
                    darkscreen = new ClientRectangleView(new System.Drawing.RectangleF(0, 0, 2000, 2000), System.Drawing.Color.Black);
                    string[]  lines           = System.IO.File.ReadAllLines("_serverinit.ini");
                    INIReader reader          = new INIReader(lines);
                    Int64     timestamp_saved = reader.getInt64("timestamp");
                    Int64     timestamp_now   = System.Diagnostics.Stopwatch.GetTimestamp();
                    TimeSpan  time_delta      = new TimeSpan(timestamp_now - timestamp_saved);
                    if (time_delta.Minutes < 5)
                    {
                        System.IO.File.Delete("_serverinit.ini");
                        System.IO.File.WriteAllLines("miv_lastserver.ini", lines);
                        initAndConnect(reader.getString("ip"), reader.getInt16("port"), reader.getString("nickname"));
                    }
                }
                else
                {
                    FileSystemOverlay.crashIfSPPreparationFail();
                }
            };
            startup.Start();
            // nope? nothing to do
        }
コード例 #4
0
 private void ServerBrowser_Load(object sender, EventArgs e)
 {
     refreshList();
     FileSystemOverlay.prepareForSP();
 }