-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
99 lines (83 loc) · 2.68 KB
/
index.php
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
<?php
/*
This script checks if the user [SocialClubID] owns a copy of GTA:V on any platform.
Script authors:
- Gamer_Z / grasmanek94 (https://github.com/grasmanek94/)
- eider (https://github.com/eider-i128/)
*/
//list of ip addresses that are allowed to execute this script
$allowed_ips = array('0.0.0.0', '127.0.0.1', '192.168.2.1', '::1');
if(!in_array($_SERVER['REMOTE_ADDR'], $allowed_ips))
{
die();
}
require('rockstarsocialclubapi.php');
// Set default timezone for date()
date_default_timezone_set('Europe/Berlin');
//example usage:
$rsscapi = new RockStarSocialClubAPI();
//create an account for this script on social club:
$rsscapi->SetCredentials("SocialClubLogin", "PaSSword");
//Uncomment if you have problems:
//$rsscapi->DisableVerification();
if(!$rsscapi->AlreadyLoggedIn())
{
$status = $rsscapi->Login();
switch($status)
{
case 3:
case 2:
echo("0<BR/>ERROR: SSL error or Rockstar Service is unavailable.");
exit();
case 1:
echo("1<BR/>ERROR: Invalid credentials, cannot logon to Rockstar SocialClub.");
exit();
}
}
$SocialClubID = isset($_GET['SocialClubID']) ? $_GET['SocialClubID'] : '';
if(strlen($SocialClubID) < 2)
{
$SocialClubID = "-";
}
if(!isset($_GET['message']))
{
$status = $rsscapi->UserGTAStatus($SocialClubID, 1);
switch($status)
{
case 3:
echo("2<BR/>ERROR: Too many retries.");
break;
case 2:
echo("3<BR/>ERROR: User does not exist.");
break;
case 1:
echo("4<BR/>ERROR: User does not own a legitimate copy of GTA:V or privacy settings do not allow viewing this information.");
break;
case 0:
echo("9<BR/>SUCCESS: User owns a legitimate copy of GTA:V on any platform.");
break;
}
}
else
{
$status = $rsscapi->SendMessage($SocialClubID, $_GET['message'], 1);
switch($status)
{
case 4:
echo("2<BR/>ERROR: Too many retries.");
break;
case 3:
echo("3<BR/>ERROR: User does not exist.");
break;
case 2:
echo("4<BR/>ERROR: SSL error or Rockstar Service is unavailable.");
break;
case 1:
echo("5<BR/>ERROR: Unknown error while sending the message.");
break;
case 0:
echo("9<BR/>SUCCESS: Message sent.");
break;
}
}
?>