GatewayWorker 可以顺利转发文本文件
图片从服务器来是正常的GatewayWorker不转发图片是什么原因哟
代码
public static function onMessage($client_id, $message)
{
$message_data = json_decode($message, true);
if(!$message_data)
{
return ;
}
switch ($message_data) {
case "bind":
Gateway::bindUid($client_id,$message_data);
return;
case "say_video":
$data = array(
'type' =>'say_video',
'toid' =>$message_data,
'formid' =>$message_data,
'video' => $message_data
);
Gateway::sendToUid($message_data,json_encode($data));
return;
case "say_audio":
$data = array(
'type' =>'audio',
'toid' =>$message_data,
'formid' =>$message_data,
'audio' => $message_data
);
Gateway::sendToUid($message_data,json_encode($data));
return;
case "say_image":
$data= array(
'type' =>'say_image',
'toid' =>$message_data,
'image' => $message_data
);
Gateway::sendToUid($message_data,json_encode($data));
return;
case "say":
if(Gateway::isUidOnline($message_data)){
$data=array(
'type'=>'text',
'formid'=>$message_data,
'data'=> $message_data,
);
Gateway::sendToUid($message_data,json_encode($data));
}else{
$data=array(
'type'=>'save',
'isread'=>0
);
Gateway::sendToUid($message_data,json_encode($data));
}
return;
}
}