|
4 | 4 | using System.Drawing; |
5 | 5 | using System.IO; |
6 | 6 | using System.Linq; |
| 7 | +using System.Net; |
7 | 8 | using System.Runtime.InteropServices; |
8 | 9 | using System.Security.Cryptography; |
9 | 10 | using System.Text; |
@@ -81,6 +82,7 @@ public partial class entry : Form |
81 | 82 | public bool useExtendedName = false; |
82 | 83 | int selectedTab = 0; |
83 | 84 | Stopwatch st = new Stopwatch(); |
| 85 | + public string aboutBoxContactData = "Loading..."; |
84 | 86 |
|
85 | 87 | public entry() |
86 | 88 | { |
@@ -169,9 +171,13 @@ private void Entry_Load(object sender, EventArgs e) |
169 | 171 |
|
170 | 172 | this.Invoke(new MethodInvoker(delegate () |
171 | 173 | { |
| 174 | + //LOADING FINISHED |
172 | 175 | ld.Close(); |
173 | 176 | })); |
174 | 177 |
|
| 178 | + Thread getContact = new Thread(() => aboutBoxContactData = getContactInfoFromExtServer()); |
| 179 | + getContact.Start(); |
| 180 | + |
175 | 181 | //just show the fucking form to the user |
176 | 182 | User32.AllowSetForegroundWindow((uint)Process.GetCurrentProcess().Id); |
177 | 183 | User32.SetForegroundWindow(Handle); |
@@ -1293,7 +1299,7 @@ private void entry_kDown(object sender, KeyEventArgs e) |
1293 | 1299 | { |
1294 | 1300 | if(e.KeyCode == Keys.F1) |
1295 | 1301 | { |
1296 | | - about ab = new about(); |
| 1302 | + about ab = new about(aboutBoxContactData); |
1297 | 1303 | ab.ShowDialog(); |
1298 | 1304 | } |
1299 | 1305 | if(e.KeyCode == Keys.F2) |
@@ -1657,6 +1663,28 @@ private void tabs_selectedChanged(object sender, EventArgs e) |
1657 | 1663 | } |
1658 | 1664 | } |
1659 | 1665 |
|
| 1666 | + public string getContactInfoFromExtServer() |
| 1667 | + { |
| 1668 | + try |
| 1669 | + { |
| 1670 | + WebClient w = new WebClient(); |
| 1671 | + w.Headers.Add("user-agent", "Internal WTE request"); |
| 1672 | + string _tmp = w.DownloadString(@"http://knedit.pw/WTE_Contact_Data_Tmp/"); |
| 1673 | + if (_tmp[0] == 'W') |
| 1674 | + { |
| 1675 | + return _tmp; |
| 1676 | + } |
| 1677 | + else |
| 1678 | + { |
| 1679 | + throw new Exception("corrupt data"); |
| 1680 | + } |
| 1681 | + } |
| 1682 | + catch |
| 1683 | + { |
| 1684 | + return "Unknown server error :("; |
| 1685 | + } |
| 1686 | + } |
| 1687 | + |
1660 | 1688 | private void nudHair_ValueChanged(object sender, EventArgs e) |
1661 | 1689 | { |
1662 | 1690 | playerHS = (int)nudHair.Value; |
|
0 commit comments