This repository was archived by the owner on Oct 12, 2020. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathprocessjoin.php
More file actions
118 lines (109 loc) · 2.5 KB
/
Copy pathprocessjoin.php
File metadata and controls
118 lines (109 loc) · 2.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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
@include_once('link.php');
@include_once('steamauth/steamauth.php');
if(isset($_SESSION["steamid"]))
{
$prices = file_get_contents('https://api.csgofast.com/price/all');
$parsedPrices = json_decode($prices);
$sid=$_SESSION["steamid"];
$tradelink = fetchinfo("tlink","users","steamid",$sid);
$token = substr(strstr($tradelink, 'token='),6);
if($tradelink)
{
$array[0] = "";
$array2[0] = "";
for ($i=1; $i < sizeof($_POST)-1; $i++)
{
$array[$i] = $_POST[$i];
}
$items = join('/',$array);
for ($i=1; $i < sizeof($array); $i++) {
$array2[$i-1] = $array[$i];
}
$lobbyid = $_POST[0];
$lobbyid=mysql_escape_string($lobbyid);
$gap=fetchinfo("gap","cflobbies","ID",$lobbyid);
$value=fetchinfo("value","cflobbies","ID",$lobbyid);
$valuemin=$value-$gap;
$valuemax=$value+$gap;
$sum=0;
foreach($array2 as $key => $value)
{
$price = $parsedPrices->$value;
$sum+=$price;
if(!$price || $price==0)
{
$error=1;
}
}
if($sum<=$valuemax && $sum>=$valuemin )
{
function generateRandomString($length = 10)
{
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}
$key=generateRandomString(6);
if($sum!=0)
{
if($lobbyid)
{
$pid=fetchinfo("pid","cflobbies","ID",$lobbyid);
$cid=fetchinfo("cid","cflobbies","ID",$lobbyid);
$poid=fetchinfo("pofferid","cflobbies","ID",$lobbyid);
if(!$pid && $poid==0)
{
if($error==0)
{
if($cid!=$sid)
{
$items=mysql_escape_string($items);
$sum=mysql_escape_string($sum);
$token=mysql_escape_string($token);
mysql_query("INSERT INTO `cfqueue` (`userid`,`value`,`hash`,`token`,`skins`,`status`,`type`) VALUES ('$sid','$sum','$key','$token','$items','active','$lobbyid')") or die(mysql_error());
$lastid=mysql_insert_id();
$newkey='l'.$lobbyid.'g'.$lastid.'h'.$key;
mysql_query("UPDATE `cfqueue` SET `hash`='$newkey' WHERE `id`='$lastid'");
echo $newkey;
}
else
{
echo 'err0';
}
}
else
{
echo'err1';
}
}
else
{
echo'err2';
}
}
else
{
echo'err3';
}
}
else
{
echo'err4';
}
}
else
{
echo'err5';
}
}
else
{
echo'err6';
}
}
?>