🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
>[danger]游戏中表情推送 >客户端发送数据 ``` { type:'gameMessage', mType:2,//3为用户头像表情,发送信息类型 message:""//发送的内容 } ``` >服务器推送数据 ``` $return['type'] = "gameMessage"; $return['mType'] = $mType; $return['message'] = $message; ``` >[danger]游戏中邀请好友 >客户端发送数据 ``` { type:'mate', roomid:2,//游戏房间id fromUid:1,//邀请用户id toUid:1//被邀请用户id } ``` >服务器推送数据 ``` $return['type'] = "mate"; $return['roomid'] = 1;//房间id $return['toUser'] = $user;//邀请用户信息 $return['formUser'] = $use; $return['groupName'] =""//亲友圈名称 $return['number'] =2; //亲友圈房间号 $return['gameSign'] = $game['room']['gameSign']; //游戏标识 ``` >[danger]游戏中玩家掉线 >服务器推送数据 ``` $return['type'] = "close"; $return['uid'] = $uid;//掉线用户id $return['p'] = $p;//掉线用户位置 $return['roomid'] = $roomid; $return['groupid'] = $groupid; ``` >[danger]当玩家连接游戏成功 >服务器推送数据 ``` $data['type'] = "connect"; $data['uid'] = $uid; $data['client_id'] = $client_id; $data['game'] = $userGame['roomid'];//如果玩家在游戏中,为游戏的房间id $data['gameSign'] = "Points"//当前游戏的标识 ```