-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwinautopatcher.cpp
74 lines (71 loc) · 1.92 KB
/
winautopatcher.cpp
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
#include <iostream>
#include <string>
#include <sys/stat.h>
#include <bits/stdc++.h>
#include <exception>
using namespace std;
char str1[10];
char str2[10];
int server_ver=0;
int local_ver=0;
int main()
{
system("del current.txt");
system("cls");
system("UberStrike_Data\\updater\\curl.exe -LO https://uberkill.cc/patcher/current.txt");
system("cls");
FILE * dir;
dir = fopen("version.txt", "r");
if(errno==2)
return 0;
fclose (dir);
ifstream in1("current.txt");
while(in1)
{
in1.getline(str1, 10);
if(in1)
{
sscanf(str1, "%d", &server_ver);
}
}
in1.close();
ifstream in2("version.txt");
while(in2)
{
in2.getline(str2, 10);
if(in2)
{
sscanf(str2, "%d", &local_ver);
}
}
in2.close();
if(server_ver>local_ver)
{
system("taskkill /IM uberstrike.exe /F");
system("taskkill /IM ubereye.exe /F");
system("taskkill /IM ubereyeengine.exe /F");
system("taskkill /IM uberdaemon.exe /F");
system("rmdir /q /s Uberstrike");
system("del patchfiles.zip");
system("cls");
cout<<endl<<"Server Version: "<<server_ver<<endl;
cout<<endl<<"Local Version: "<<local_ver<<endl;
cout<<"Updating......"<<endl<<endl<<endl;
system("UberStrike_Data\\updater\\curl.exe -LO https://www.uberkill.cc/patcher/patchfiles.zip");
system("UberStrike_Data\\updater\\7z.exe x patchfiles.zip");
system("xcopy Uberstrike /s/h/e/k/f/c/y");
system("del steampath.txt");
system("cls");
system("del steampath.txt");
system("del patchfiles.zip");
system("rmdir /q /s Uberstrike");
system("cls");
cout<<"Launching Game...."<<endl;
system("del version.txt");
system("ren current.txt version.txt");
system("start steam://rungameid/291210");
return 0;
}
else system("del current.txt");
return 0;
}