forked from emist/Eryan
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathClient.cs
99 lines (74 loc) · 2.25 KB
/
Client.cs
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Diagnostics;
using Syringe;
using System.Text;
using System.IO;
using Eryan.Factories;
using Eryan.IPC;
using Eryan.Responses;
using Eryan.UI;
namespace Eryan
{
static class Client
{
static ClientWindow cWindow;
/// <summary>
/// Spawns the Eryan Client on a new thread
/// </summary>
public static void createWindow()
{
cWindow = new ClientWindow();
Application.Run(cWindow);
}
/// <summary>
/// The main entry point of the application
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
EulaView eula;
if (!System.IO.File.Exists("r"))
{
eula = new UI.EulaView();
Application.Run(eula);
if (eula.Status == false)
{
MessageBox.Show("You must accept the EULA in order to use Eryan(E2)", "EULA Declined");
return;
}
else
{
System.IO.File.Create("r");
}
}
Thread ClientThread = new Thread(new ThreadStart(createWindow));
ClientThread.SetApartmentState(ApartmentState.STA);
ClientThread.Start();
while (cWindow == null)
{
Thread.Sleep(300);
}
cWindow.createBot();
while(cWindow.getBots().Count < 1)
Thread.Sleep(100);
Bot bot1 = cWindow.getBots()[0];
WindowHandler BotHandle = bot1.getHandle();
while (true)
{
if ( bot1 != null)
{
bot1.update();
}
System.Threading.Thread.Sleep(1000);
}
}
}
}