|
@@ -13,6 +13,7 @@ use Workerman\Worker;
|
|
use Workerman\Connection\AsyncTcpConnection;
|
|
use Workerman\Connection\AsyncTcpConnection;
|
|
use Illuminate\Support\Facades\Redis;
|
|
use Illuminate\Support\Facades\Redis;
|
|
use GatewayWorker\Lib\Gateway;
|
|
use GatewayWorker\Lib\Gateway;
|
|
|
|
+use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
class robot extends Command
|
|
class robot extends Command
|
|
{
|
|
{
|
|
@@ -168,20 +169,16 @@ class robot extends Command
|
|
if($json_data->type == 'game_end'){
|
|
if($json_data->type == 'game_end'){
|
|
$update_data = [
|
|
$update_data = [
|
|
"is_login" => 0,
|
|
"is_login" => 0,
|
|
- "client_id" => '',
|
|
|
|
];
|
|
];
|
|
//更新机器人登陆状态
|
|
//更新机器人登陆状态
|
|
User::where("user_id", $user->user_id)->update($update_data);
|
|
User::where("user_id", $user->user_id)->update($update_data);
|
|
- unset($update_data);
|
|
|
|
- $update_data['state'] = 2;
|
|
|
|
- RoomUser::where("user_id", $user->user_id)->where("state", 1)->update($update_data);
|
|
|
|
echo "已结算,机器人离开房间";
|
|
echo "已结算,机器人离开房间";
|
|
//结束进程
|
|
//结束进程
|
|
$sig = SIGINT;
|
|
$sig = SIGINT;
|
|
$master_pid = is_file($worker::$pidFile) ? file_get_contents($worker::$pidFile) : 0;
|
|
$master_pid = is_file($worker::$pidFile) ? file_get_contents($worker::$pidFile) : 0;
|
|
$master_pid && posix_kill($master_pid, $sig);
|
|
$master_pid && posix_kill($master_pid, $sig);
|
|
|
|
+ Log::info("删除不了进程 {$master_pid}");
|
|
}
|
|
}
|
|
-
|
|
|
|
};
|
|
};
|
|
$con->connect();
|
|
$con->connect();
|
|
};
|
|
};
|