flower_svr/sysapi/hotUpdata.php
2021-06-11 16:09:56 +08:00

36 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**游戏热更新配置
* Created by ddcai.
* User: 252378189@qq.com
* Date: 2018/12/10
* Time: 16:50
*/
//如果不是在命令行下执行,则出错
if(PHP_SAPI !== 'cli'){
echo("NO");
exit;
}
include("../include/config.inc.php");
//如果有redis连接则初始化
if(isset($GLOBALS['myredis']) && $GLOBALS['myredis']){
hotUpdata($GLOBALS['myredis'],true);
//触发长连接进行更新
//=====begin 进行用户通知
$tmp_send_data = array(
'uid'=>1,//http请求的用户UID,
'do_a'=>"do_act",//http要执行的动作(在ajax_user_msg.class.php里制定的动作),
'a'=>"hotUpdate",//需要执行的websocket端动作
'm'=>"gzhq_game",//需要执行的websocket端模块,
'd'=>array("uid"=>1),//websocket端执行时自动提交的数据参数(数组)
't'=>time(),//生成消息的时间,
);
$tmp_send_data = set_login_token($tmp_send_data);
$tmp_data = do_act_post_websocket(1,$tmp_send_data,$myredis);
var_dump($tmp_data);
//=====end 进行用户通知
}else{
echo('没有加载游戏配置文件');
sys_log_write_content( '没有加载游戏配置文件' ,"error_log","data_config_arr.log");
}