进入房间 子进程发送特效
This commit is contained in:
@@ -888,7 +888,8 @@ class Room extends Model
|
|||||||
$ttex['ToUserInfo'] = db::name('user')->where('id', $partner_id)->field('id as user_id,nickname,avatar,sex')->find();
|
$ttex['ToUserInfo'] = db::name('user')->where('id', $partner_id)->field('id as user_id,nickname,avatar,sex')->find();
|
||||||
$ttex['text'] = 'CP特效';
|
$ttex['text'] = 'CP特效';
|
||||||
|
|
||||||
// 子进程推送CP特效消息
|
// 检查是否支持 pcntl 扩展
|
||||||
|
if (function_exists('pcntl_fork')) {
|
||||||
$pid = pcntl_fork();
|
$pid = pcntl_fork();
|
||||||
|
|
||||||
if ($pid == -1) {
|
if ($pid == -1) {
|
||||||
@@ -903,6 +904,11 @@ class Room extends Model
|
|||||||
model('api/Chat')->sendMsg(1080, $room_id, $ttex);
|
model('api/Chat')->sendMsg(1080, $room_id, $ttex);
|
||||||
exit(0); // 子进程结束
|
exit(0); // 子进程结束
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// 不支持 pcntl,直接推送消息
|
||||||
|
model('api/Chat')->sendMsg(1080, $room_id, $ttex);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user