-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
62 lines (50 loc) · 1.73 KB
/
Copy pathProgram.cs
File metadata and controls
62 lines (50 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.IO;
using System.Windows.Forms;
using System.ComponentModel;
namespace NetOnlineDedicatedGUI
{
internal static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if (File.Exists("config.json"))
{
// Конфиг есть → сразу основное окно
Application.Run(new ServerManager());
}
else
{
// Конфига нет → мастер первоначальной настройки
Application.Run(new SetupWizard());
}
}
}
}
class ServerEntry
{
public string Name { get; set; } // hname
public string Mode { get; set; } // lb / fmp / tdm / dm / cp / br
public string Location { get; set; } // lobby / map name
public int MaxPlayers { get; set; }
public int PortSv { get; set; }
public int PortGs { get; set; }
public int PortCl { get; set; }
public string Password { get; set; }
public int AffinityCores { get; set; } // кол-во ядер (пока)
public int LifetimeHours { get; set; } // 0 = бессрочно
public string Status { get; set; } = "Stopped";
}
class AppConfig
{
public string EnginePath { get; set; }
public string FsGamePath { get; set; }
public BindingList<ServerEntry> Servers { get; set; }
public bool UseSandboxie { get; set; }
public string SandboxieStartPath { get; set; } =
@"C:\Program Files\Sandboxie-Plus\Start.exe";
public string SandboxieBoxName { get; set; } = "DefaultBox";
}