腾讯在离线回调
This commit is contained in:
@@ -919,14 +919,28 @@ class Tencent extends Model
|
||||
|
||||
if($quit_room) {
|
||||
foreach ($quit_room as &$v){
|
||||
$text['text'] = '杀进程!';
|
||||
$text['user_id'] = $uid;
|
||||
$text['type'] = 0;
|
||||
model('Chat')->sendMsg(1058,$v['room_id'],$text);
|
||||
model('Room')->quit_room($v['user_id'], $v['room_id'],$v['user_id']);
|
||||
}
|
||||
}
|
||||
|
||||
} elseif ($action == 'Login') {
|
||||
Db::name('user')->where('id', $uid)->update(['is_online' => 1, 'updatetime' => time()]);
|
||||
$room = Db::name('vs_room_visitor')->where('user_id', $uid)->order('id desc')->value('room_id');
|
||||
$text['text'] = '重新上线!';
|
||||
$text['user_id'] = $uid;
|
||||
$text['type'] = 1;
|
||||
model('Chat')->sendMsg(1058,$room,$text);
|
||||
}elseif ($action == 'Logout'){
|
||||
Db::name('user')->where('id', $uid)->update(['is_online' => 0, 'updatetime' => time()]);
|
||||
$room = Db::name('vs_room_visitor')->where('user_id', $uid)->order('id desc')->value('room_id');
|
||||
$text['text'] = '重新上线!';
|
||||
$text['user_id'] = $uid;
|
||||
$text['type'] = 0;
|
||||
model('Chat')->sendMsg(1058,$room,$text);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user