-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
47 lines (41 loc) · 1.5 KB
/
Program.cs
File metadata and controls
47 lines (41 loc) · 1.5 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
using EntryPoint.Server;
using System;
namespace EntryPoint
{
internal class Program
{
static void Main(string[] args)
{
Console.Title = "Game Server";
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine($"Получено аргументов: {args.Length}");
for (int i = 0; i < args.Length; i++)
{
Console.WriteLine($" args[{i}] = '{args[i]}'");
}
using (var entryPoint = new GameServerEntryPoint())
{
var config = entryPoint.ParseArguments(args);
if (config == null)
{
return;
}
if (entryPoint.InitializeServices(config))
{
entryPoint.RunServerLoop();
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Ошибка инициализации сервера. Нажмите любую клавишу для выхода...");
Console.ResetColor();
Console.ReadKey();
}
}
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\nНажмите любую клавишу для выхода...");
Console.ResetColor();
Console.ReadKey();
}
}
}