使用steam
登录后,Index.php将返回此错误Deprecated: the 'CN_match' SSL context option is deprecated in favor of 'peer_name' in /---/steamauth/openid.php on line 345
同样返回:
Warning: Invalid argument supplied for foreach() in /---/index.php on line 177
这是我的index.php代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="//fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="materialize/css/materialize.min.css" media="screen,projection"/>
<link type="text/css" rel="stylesheet" href="/css/main.css"/>
<link rel="icon" href="/favicon.ico?" type="image/x-icon">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body class="grey lighten-3">
<header>
<?php
session_start();
if(isset($_GET['referral'])) {
$_SESSION['referral'] = $_GET['referral'];
}
session_write_close();
include 'header.php';
include 'bannedusers.php'
?>
</header>
<main>
<div class="modal" id="freecoins">
<div class="modal-content">
<h4>Submit</h4>
<div class="row">
<div class="input-field col s12"><label for="code">Type</label><input name="code" id="code" type="text" style="margin:0;"></div>
</div>
<div class="modal-footer">
<button id="refcode-submit" class="btn">Submit</button>
<div class="preloader-wrapper small active center" id="free-coins-loading">
<div class="spinner-layer spinner-green-only">
<div class="circle-clipper left">
<div class="circle"></div>
</div><div class="gap-patch">
<div class="circle"></div>
</div><div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="chatrulesmodal">
<div class="modal-content">
<h4>Chat Rules</h4>
<ol>
<li>No Begging.</li>
<li>No Spamming.</li>
<li>No Advertising.</li>
<li>No Code Spamming.</li>
<li>English ONLY.</li>
<li>Always be polite, ESPECIALLY to mods and admins.</li>
<li>No Coin Trading</li>
</ol>
</div>
</div>
<button class="btn-floating btn-large waves-effect waves-light green" id="chatToggle"><i id="chat-toggle-icon" class="material-icons">arrow_drop_up</i></button>
<div class="row">
<div class="col s3" id="chat-col">
<div class="card grey lighten-4 hoverable chat-card">
<div class="card-content">
<div class="row">
<div class="col s4 left-align"><input type="checkbox" id="mute" /><label for="mute">Mute</label></div><div class="col s4 center-align"><a href="#chatrulesmodal" class="center modal-trigger">Chat Rules</a></div><div class="col s4 right-align"><input type="checkbox" id="chatpause" /><label for="chatpause">Pause</label></div>
</div>
<div class="chat" style="border-radius: 0.5em 0.5em 0 0;border-bottom: none;">
<span>Chat</span>
<span style="float: right;">Users Online: <span id="online">0</span></span>
</div>
<div class="chat" id="chat">
<?php
if(!isset($_SESSION['loggedin']) || !$_SESSION['loggedin']) {
echo '<div><i>Login through steam to connect.</i></div>';
}
?>
</div>
<div class="chat" style="border-top: none; padding-top: none;">
<form id="chatForm" autocomplete="off">
<input id="chatMessage" type="text" placeholder="Chat Message" style="margin:0;">
</form>
</div>
</div>
</div>
</div>
<div class="col s9" style="position:relative; left:25%">
<div class= "card grey lighten-4 hoverable main-card">
<div class="card-content">
<span class="card-title large-text">
<span id="status">Welcome to site</span>
<div class="progress grey lighten-4" style="height: 1em">
<div class="determinate grey" style="width:100%"></div>
</div>
</span>
<div class="row">
<div class="wheel_container col s6" style="padding: none;">
<object type="image/svg+xml" data="images/wheel.svg" class="wheel" id="wheel">Your browser does not support SVG</object>
</div>
<div class="col s6">
<?php
function generateRandomString($length = 10) {
return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);
}
session_start();
require 'api/openid.php';
if(isset($_GET['logout'])){
unset($_SESSION['loggedin']);
unset($_SESSION['avatar']);
unset($_SESSION['steamid']);
unset($_SESSION['name']);
unset($_SESSION['signup_date']);
unset($_SESSION['mod']);
header("Location: ----------------------------/header.php");
}
$_STEAMAPI = "---------------------------";
try {
$openid = new LightOpenID('------------------------');
if(!$openid->mode) {
if(isset($_GET['login'])) {
$openid->identity = "http://steamcommunity.com/openid/?l=english";
header('Location: ' . $openid->authUrl());
} else {
if(!isset($_SESSION['loggedin']) || !$_SESSION['loggedin']) {
echo '<div class="card white hoverable black-text" id="login">';
echo '<div class="card-content">';
echo '<span class="card-title">Login!</span>';
echo '<p>Please login before playing.</p>';
echo '</div>';
echo '</div>';
} else {
if(in_array($_SESSION['steamid'], $banned_steamids)) {
echo "<script> $(document).ready(function() { Materialize.toast('This steam account is banned from site.'); }); </script>";
echo '<div class="card white hoverable black-text" id="login">';
echo '<div class="card-content">';
echo '<span class="card-title">Login!</span>';
echo '<p>Please login before playing.</p>';
echo '</div>';
echo '</div>';
unset($_SESSION['loggedin']);
unset($_SESSION['avatar']);
unset($_SESSION['steamid']);
unset($_SESSION['name']);
unset($_SESSION['signup_date']);
unset($_SESSION['mod']);
} else {
mysql_connect("--------------------", "--------------------------", "---------------------------") or die(mysql_error());
mysql_select_db("------------------------") or die(mysql_error());
$steamid = $_SESSION['steamid'];
$date = $_SESSION['signup_date'];
$login_time = $_SESSION['login_time'];
$tokenSalt = $_SESSION['salt'];
$token = hash("sha256", $steamid.'-'.$date.'-'.$login_time.'-'.$tokenSalt);
$token_sql = "SELECT * FROM steam_users WHERE token='$token'";
$query_id = mysql_query($token_sql);
if(mysql_num_rows($query_id) == 0) {
header("Location: ----------/?logout");
}
mysql_close();
}
}
}
} elseif($openid->mode == 'cancel') {
echo 'User canceled auth';
} elseif($openid->validate()) {
$id = $openid->identity;
$ptn = "/^http:\/\/steamcommunity\.com\/openid\/id\/(7[0-9]{15,25}+)$/";
preg_match($ptn, $id, $matches);
$steamid = $matches[1];
$url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=$_STEAMAPI&steamids=$steamid";
$json_object = file_get_contents($url);
$json_decoded = json_decode($json_object);
foreach ($json_decoded->response->players as $player) {
$url = "http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=$_STEAMAPI&steamid=$steamid&format=json";
$json_object2 = file_get_contents($url);
$gamesOwned = json_decode($json_object2);
$ownsCSGO = 0;
foreach($gamesOwned->response->games as $game) {
if($game->appid == 730) {
$ownsCSGO = 1;
break;
}
}
if($ownsCSGO == 0) {
echo "<script> $(document).ready(function() { Materialize.toast('This steam account does not have CS:GO'); }); </script>";
} else {
mysql_connect("--------------", "--------------------", "----------------------") or die(mysql_error());
mysql_select_db("---------------------") or die(mysql_error());
$sql_fetch_id = "SELECT * FROM steam_users WHERE steamid = $player->steamid";
$query_id = mysql_query($sql_fetch_id);
$date = "";
if(mysql_num_rows($query_id) == 0) {
$date = date("Y-m-d H:i:s");
$token = hash("sha256", $player->steamid.'-'.$date);
if(isset($_SESSION['referral']) && $referrers[$_SESSION['referral']]) {
$startamt = "250";
} else {
$startamt = "0";
}
$ref_id = $_SESSION['referral'] or '';
$sql_steam = "INSERT INTO steam_users (name, steamid, avatar, signup_date, balance, referrer_id) VALUES ('".mysql_real_escape_string($player->personaname)."','$player->steamid','".mysql_real_escape_string($player->avatar)."', '$date', $startamt, '$ref_id')";
mysql_query($sql_steam) or die(mysql_error());
if($referrers[$ref_id]) {
$ref_id = mysql_real_escape_string($_SESSION['referral']);
mysql_query("UPDATE steam_users SET `ref_withdraw_amt`=`ref_withdraw_amt`+100, `ref_total`=`ref_total`+100 WHERE `steamid`='$ref_id'");
}
}
$query_id = mysql_query($sql_fetch_id);
$res = mysql_fetch_array($query_id);
$signup_date = $res['signup_date'];
$mod = $res['mod'];
$login_time = date("c");
$tokenSalt = generateRandomString(25);
$token = hash("sha256", $player->steamid.'-'.$date.'-'.$login_time.'-'.$tokenSalt);
$sql_steam = "UPDATE steam_users SET token='$token', name='".mysql_real_escape_string($player->personaname)."', avatar='".mysql_real_escape_string($player->avatar)."' WHERE steamid=$player->steamid";
mysql_query($sql_steam) or die(mysql_error());
$_SESSION['loggedin'] = true;
$_SESSION['avatar'] = $player->avatar;
$_SESSION['steamid'] = $player->steamid;
$_SESSION['name'] = htmlentities($player->personaname);
$_SESSION['signup_date'] = $date;
$_SESSION['login_time'] = $login_time;
$_SESSION['salt'] = $tokenSalt;
$_SESSION['mod'] = $mod;
mysql_close();
session_write_close();
header("Location: ------------------------");
}
}
} else {
echo 'User not logged in<br>';
header("Location: ------------------------?logout");
}
} catch(ErrorException $e) {}
if(isset($_SESSION['loggedin']) && $_SESSION['loggedin']) {
?>
<div id="past-rolls" class="z-depth-2">
<?php
mysql_connect("---------", "-------------", "---------------------") or die(mysql_error());
mysql_select_db("--------------") or die(mysql_error());
$query_id = mysql_query("SELECT * FROM `rolls` ORDER BY `id` DESC LIMIT 10");
echo mysql_num_rows($query_id);
$divs = array();
while ($row = mysql_fetch_array($query_id)) {
$id = $row['id'];
$roll = $row['roll'];
$color = "";
if($roll == 0) {
$color = "green";
} else if ($roll < 8) {
$color = "grey darken-3";
} else {
$color = "red";
}
$divs[] = "<div class=\"white-text valign-wrapper past-roll $color\" style='padding-top: 1%;'>".$roll."</div>";
}
$divs = array_reverse($divs);
foreach($divs as $div) {
echo $div;
}
mysql_close();
?>
</div>
<?php
}
?>
<div class="card hoverable" id="bet-card" style="display:none;">
<div class="card-content">
<span class="card-title"><span class="valign-wrapper">Balance:<span class='right'><span id="balance">0</span><a href="javascript:void(0)" id="refreshBalance" class="black-text material-icons">refresh</a></span></span><span style="position:absolute;right:25px;top:0;"><input checked type="checkbox" id="snowtoggle" /><label for="snowtoggle">Disable "Snow"</label></span></span>
<div class="row blue-text text-darken-3">
Requests for lost coins go in the Support discussion board in the <a href="STEAM/">steam group</a>. Sponsorship requests should be posted on the forums as well. Do not add the owner, please. Please? Pleeease. Asking for this stuff in chat will get you muted for 30 minutes.
</div>
<span class="red-text">Red</span><span class="grey-text">/</span>Black<span class="grey-text">=2x | </span><span class="green-text">Green</span><span class="grey-text">=14x</span>
<div class="row">
<div class="input-field col s12"><label for="betamt">Bet Amount</label><input type="text" id="betamt"></div>
</div>
<div class="row">
<div class="col s4">
<button class="btn red betbtn waves-effect waves-light truncate" color="red" style="width: 100%"><span class="hide-on-med-and-down">Red</span></button>
</div>
<div class="col s4">
<button class="btn green betbtn waves-effect waves-light truncate" color="green" style="width: 100%"><span class="hide-on-med-and-down">Green</span></button>
</div>
<div class="col s4">
<button class="btn grey darken-3 betbtn waves-effect waves-light truncate" color="black" style="width: 100%"><span class="hide-on-med-and-down">Black</span></button><br />
</div>
</div>
<div class="row">
<div class="col s12 center-align">
My Bet
<div class="divider"></div>
</div>
</div>
<div class="row">
<div class="col s4 center-align">
Red
<div class="divider"></div>
<span id="my-red-bet">0</span>
</div>
<div class="col s4 center-align">
Green
<div class="divider"></div>
<span id="my-green-bet">0</span>
</div>
<div class="col s4 center-align">
Black
<div class="divider"></div>
<span id="my-black-bet">0</span>
</div>
</div>
</div>
</div>
</div>
<div class= "col s12">
<div class="card hoverable" id="topbets-card" style="display:none;">
<div class="card-content">
<span class="card-title">Top Bets</span>
<div class="row">
<div class="col s4 center-align">
Red Total Bet<br />
<div class="divider"></div>
<span id="red-total" val='0' style="val:0;">0</span>
<span id="red-bets"></span>
</div>
<div class="col s4 center-align">
Green Total Bet<br />
<div class="divider"></div>
<span id="green-total" val='0' style="val:0;">0</span>
<span id="green-bets"></span>
</div>
<div class="col s4 center-align">
Black Total Bet<br />
<div class="divider"></div>
<span id="black-total" val='0' style="val:0;">0</span>
<span id="black-bets"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
if(isset($_SESSION['loggedin']) && $_SESSION['loggedin']) {
?>
<div class="modal" id="new-cf-modal">
<div class="modal-content">
<h4>New Coin Flip</h4>
<div class="row">
<div class="input-field col s12"><label for="flipwager">Enter Wager</label><input name="flipwager" id="flipwager" type="text" style="margin:0;"></div>
</div>
<div class="modal-footer">
<button id="flip-submit" class="btn green waves-effect waves-light">Submit</button>
</div>
</div>
</div>
<div class="modal" id="cf-modal">
</div>
<div class="container">
<div class="card grey lighten-4 hoverable cflip-card">
<div class="card-content">
<a class="right modal-trigger btn green waves-effect waves-light" href="#new-cf-modal">Create Coin Flip</a><button id="mboxopen-btn" class="right modal-trigger btn green waves-effect waves-light" href="#mysterybox-modal" style="margin-right:1%; position:relative;">Mystery Box</button>
<span class="card-title">Coin Flip</span><br>
To create a coinflip challenge, type "/flip wager" where wager is the amount of coins you wish to wager on the coin flip in chat.
<br>For example, to create a coinflip challenge with a 500 coin wager, type "/flip 500"
<div class="container">
<table class="bordered highlight centered">
<thead>
<tr>
<th data-field="challenger-name">Challenger Name</th>
<th data-field="wager">Wager</th>
<th data-field="challenge"></th>
</tr>
</thead>
<tbody id="fliptable-body">
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="modal" id="mysterybox-modal">
<div class="modal-content">
<h4>~Mystery Box~</h4>
<p class="center-align grey-text">Mystery boxes are like opening cases in CS:GO. You pay 2,500 coins to have a chance at getting way more! You will always win at least 500 coins so it's much less risky than opening cases as well.</p>
<div class="mysterybox-container center-align" style="position: relative; width: 100%">
<div class="mysterybox-spinner">
<div class="mboxcards-container" style="position: relative;display:inline-block;white-space:nowrap;">
<?php for($i = 0; $i < 50; $i++) { ?>
<div class='card item-card white-text'><div class='card-content center-align' style='padding:6%'><img draggable='false' src='/images/rare.png' style='width:100%;height:auto;'><span class='mbox-coinamt'>0</span> Coins</div></div>
<?php } ?>
</div>
<div class="mysterybox-spinner-overlay">
<div class="mysterybox-selector"></div>
</div>
</div>
</div>
<br />
<div class="center-align" id="mbox-status">
</div>
<div class="row">
<div class="col s5"> </div>
<button style="margin-left: auto; margin-right: auto;" class="col s2 btn green waves-effect waves-light" id="mysterybox-button">Spin!</button>
<div class="col s5"> </div>
</div>
</div>
</div>
<?php
}
?>
<script type="text/javascript" src="/js/HackTimer.js"></script>
<script type="text/javascript" src="/js/jquery.bez.min.js"></script>
<script type="text/javascript" src="/materialize/js/materialize.min.js"></script>
<script type="text/javascript" src="/js/sha256.js"></script>
<script type="text/javascript" src="/js/sprintf.js"></script>
<script type="text/javascript" src="/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="/js/jquery.spotlight.js"></script>
<span id="escape"></span>
<script src="/js/main.js"></script>
<script src="/js/fallingsnow_v6.js"></script>
<div id="snowflakeContainer">
<!-- <p class="snowflake" style="font-family: Consolas">
___<br />
// 7<br />
(_,_/\<br />
\ \<br />
\ \<br />
_\ \__<br />
( \ )<br />
\___\___/<br />
</p>
<p class="snowflake">❄</p> -->
<img class="snowflake" src="/images/karambit.png" style="width:64px; height:auto;">
<img class="snowflake" src="/images/karambit2.png" style="width:64px; height:auto;">
<img class="snowflake" src="/images/dlore.png" style="width:64px; height:auto;">
<img class="snowflake" src="http://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpou-6kejhjxszFJTwT09S5g4yCmfDLP7LWnn9u5MRjjeyP9tqhiQ2yqEo6Mmn3doPBcwZqZQrRr1O-we_sgMO5tZ_BzCFr6ycltmGdwULa1vGJFg/330x192" style="width:64px; height:auto;">
<img class="snowflake" src="http://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpotLu8JAllx8zJfwJW5duzhr-Ehfb6NL7ummJW4NFOhujT8om73wzkrRVvMmz7cIaUIwE9NVyE_QW5xOu-0cTo78zNz3ZruXQj5imMyQv330-wFnub9Q/330x192" style="width:64px; height:auto;">
<img class="snowflake" src="http://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpot7HxfDhjxszOeC9H_9mkhIWFg8j1OO-GqWlD6dN-teXI8oTht1i1uRQ5fWDwLYbAdVBqYVHRrwC2kO7rhpLq6J_IzXE2unFxs3-JmkG200ofZ-JxxavJKZiOt4k/330x192" style="width:64px; height:auto;">
<img class="snowflake" src="http://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpovbSsLQJf0ebcZThQ6tCvq4GGqO3xManQqWdY781lteXA54vwxgyy_hduaz_7do6TcgFqaVvQ_1jtxbq5g5e07p7AwCdh7HEn4H6PzRGpwUYb-q86lXo/330x192" style="width:64px; height:auto;">
<img class="snowflake" src="http://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpovbSsLQJf3qr3czxb49KzgL-Kmsj5MqnTmm5u7sR1j9bN_Iv9nGu4qgE7Nnf0J4THcFU-NFuD-Fi5yOjn1sXvvM7OnCE37yAm5neMzRy-hE5Faedvm7XAHpMyLagJ/330x192" style="width:64px; height:auto;">
<img class="snowflake" src="http://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpovbSsLQJf1f_BYQJD7eOwlYSOqPv9NLPFqWdQ-sJ0xLGQpIqtjQy1rUE5Y2n1I4PGcgI5MFGD-wS3l-7r18TpucyanHpg6CE8pSGKbZ02GvY/330x192" style="width:64px; height:auto;">
<img class="snowflake" src="http://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpovbSsLQJf2PLacDBA5ciJlY20mvbmMbfUqW1Q7MBOhuDG_ZjKhFWmrBZyNmynJNCRdQdtMlyBqwW2lbq7g8Po6ZnLwCM17yhxsX2JlxXkgEsabPsv26LDJQinCA/330x192" style="width:64px; height:auto;">
<img class="snowflake" src="http://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgposbaqKAxf0vL3dzxG6eO6nYeDg8j4MqnWkyUHucB1ieqXrIrz2gHmr0ZvZDj3cNKUdlQ-YF6DqAS2w-i8h5Dt6Zib1zI97Ycw1ud8/330x192" style="width:64px; height:auto;">
<img class="snowflake" src="http://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpot7HxfDhjxszJemkV086jloKOhcj4OrzZglRd6dd2j6eUrd-jiwfsr0BsYG6iIdeUJA8-Nw6EqVntyLrv15-4v5vOmiNr73Z2-z-DyAddTn8e/330x192" style="width:64px; height:auto;">
<!-- <img class="snowflake" src="http://vignette3.wikia.nocookie.net/t101medialifestudyguide/images/3/3d/Meatspin.gif"> -->
</div>
</main>
<footer class="page-footer" style="padding:0;">
<?php include 'footer.php' ?>
</footer>
</body>
</span>
我希望有人可以帮助我!谢谢!
我无法在堆栈溢出或谷歌上找到任何有用的帮助。所以这就是我提出这个问题的原因。希望你明白!