redis6.0.10
出现这个是什么问题?
源码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<title>绿色传奇(17mp.cn)</title>
<style>
body {
font: Normal 18px "Microsoft YaHei";
}
@media (min-width: 768px) {
div {
margin: 0 auto;
width: 414px;
}
}
a {
text-decoration: none;
}
</style>
</head>
<body>
<div>
<?php
//忽略危险
error_reporting(E_ALL || ~E_NOTICE);
//开始会话
session_start();
//引入游戏文件
//配置文件
require_once("app/conf/config.php");
//系统函数
require_once("app/sys/system.php");
//系统类
require_once("app/sys/class.php");
//事件系统
require_once("app/sys/event.php");
//任务系统
require_once("app/sys/task.php");
//基础框架
//开始时间戳
$stime = c_msectime();
//玩家是否登录
$is_login = true;
//玩家是否退出
$is_exit = false;
//全局参数
$t_arr = array();
//获取uid
$uid = $_SESSION['uid'];
//获取cmd
$cmd = $_GET['cmd'];
//获取进入区服
$enter_game_area = $_GET['g'];
//设置游戏区服
if ($enter_game_area) {
$_SESSION['game_area'] = $enter_game_area;
}
$game_area = $_SESSION['game_area'];
//在线游戏
if (!$GLOBALS['system_update']) {
//验证uid
if ($uid) {
if ($game_area) {
//设置游戏数据库
$game_area_dbname = $mysql_game_area_db_name[$game_area - 1];
//游戏数据库操作
$mysqli = new mysqli($mysql_host, $mysql_user_name, $mysql_passwd, $game_area_dbname, $mysql_port) or die("error");
//执行编码
$mysqli->query("SET NAMES UTF8MB4");
//Redis数据库操作
$redis = new Redis();
$redis->open($re_host, $re_port);
$redis->auth($re_pass);
$re_db = $re_db_name[$game_area_dbname];
$redis->select($re_db);
if (!$_SESSION["{$game_area_dbname}_db_ok"]) {
if ($redis->get("game_area_name") != $game_area_dbname) {
echo <<<html
游戏区服尚未开放!
<br>
<a href="{$_SESSION['wapgame_url']}">返回书签</a>
html;
exit;
} else {
$_SESSION["{$game_area_dbname}_db_ok"] = 1;
}
}
//获取用户数据
$sql = "SELECT `user_id`,`is_online`,`sid` FROM `game_user` WHERE `user_id` = {$uid} LIMIT 1";
$result = $mysqli->query($sql);
//玩家是否在线
list($user_id, $is_online, $sid) = $result->fetch_row();
//玩家是否注册
if ($user_id) {
//玩家正在登录
if ($enter_game_area) {
value::set_game_user_value('sid', session_id());
if ($is_online) {
//刷新模板
call_func('e0');
} else {
//登录事件
call_func('e2,' . $game_area . ',true');
}
} else {
//玩家正在游戏
//游戏会话验证
if (session_id() == $sid) {
//玩家是否在线
if ($is_online) {
//echo "金币:", value::get_user_value('money', $uid), "";br();
if ($cmd) {
$cmd = $mysqli->real_escape_string($cmd);
$user_event = cmd::getcmd($cmd);
//获取事件
if ($user_event) {
//调用用户操作事件
call_func($user_event);
} else {
//刷新模板
call_func('e0');
}
} else {
//刷新模板
call_func('e0');
}
} else {
$is_login = false;
cmd::set_show_return_game(false);
}
} else {
$is_exit = true;
cmd::set_show_return_game(false);
}
}
} else {
//注册事件
call_func('e1,' . $game_area);
}
//返回游戏链接
cmd::add_return_game();
//设置最大cmd
cmd::set_max_cmd();
//关闭数据库
//$mysqli->close();
$redis->close();
} else {
$is_login = false;
}
} else {
$is_exit = true;
}
//玩家已经离线
if (!$is_login) {
//提示玩家登录
c_need_login();
}
//玩家已经退出
if ($is_exit) {
//提示玩家登录
c_need_login();
//结束游戏会话
unset($_SESSION['uid']);
}
} else {
//在线更新
c_update();
}
//结束时间戳
$endtime = c_msectime() - $stime;
//基础框架
?>
</div>
</body>
</html>
小米8周年旗舰手机
redis配置了密码?redis密码错误?
小米MIX2s(白)我是测试文字