diff --git a/src/Api/WebSocketV3/SocketClient.php b/src/Api/WebSocketV3/SocketClient.php index 7af34f8..4921bb7 100644 --- a/src/Api/WebSocketV3/SocketClient.php +++ b/src/Api/WebSocketV3/SocketClient.php @@ -57,7 +57,9 @@ function keysecret(array $keysecret=[]){ * @param array $sub */ public function subscribe(array $sub=[]){ - $this->save('add_sub',$this->resub($sub)); + $add_sub=$this->get('add_sub'); + if(empty($add_sub)) $this->save('add_sub',$this->resub($sub)); + else $this->save('add_sub',array_merge($this->resub($sub),$add_sub)); } /** @@ -176,9 +178,14 @@ protected function getData($global,$callback=null,$sub=[]){ * * */ function reconPrivate(string $key){ - $this->client->debug=[ - 'private'=>[$key=>'close'], - ]; + $debug=$this->client->debug; + if(empty($debug)){ + $this->client->debug=[ + 'private'=>[$key=>$key], + ]; + }else{ + $this->client->debug=['private'=>array_merge($this->client->debug['private'],[$key=>$key])]; + } } function reconPublic(){ diff --git a/src/Api/WebSocketV3/SocketFunction.php b/src/Api/WebSocketV3/SocketFunction.php index bc84214..8aef66c 100644 --- a/src/Api/WebSocketV3/SocketFunction.php +++ b/src/Api/WebSocketV3/SocketFunction.php @@ -124,6 +124,8 @@ private function reconnection($global,$type='public',array $keysecret=[]){ } } - $global->save('add_sub',$this->resub($temp)); + $add_sub=$global->get('add_sub'); + if(empty($add_sub)) $global->save('add_sub',$this->resub($temp)); + else $global->save('add_sub',array_merge($this->resub($temp),$add_sub)); } } diff --git a/src/Api/WebSocketV3/SocketServer.php b/src/Api/WebSocketV3/SocketServer.php index 5037047..de2fccf 100644 --- a/src/Api/WebSocketV3/SocketServer.php +++ b/src/Api/WebSocketV3/SocketServer.php @@ -252,10 +252,10 @@ private function debug($con,$global){ } }else{ //private - if(isset($debug['private'][$con->tag_keysecret['key']]) && $debug['private'][$con->tag_keysecret['key']]=='close'){ + if(isset($debug['private'][$con->tag_keysecret['key']]) && $debug['private'][$con->tag_keysecret['key']]==$con->tag_keysecret['key']){ $this->log($con->tag_keysecret['key'].' debug '.json_encode($debug)); - $debug['private'][$con->tag_keysecret['key']]='recon'; + unset($debug['private'][$con->tag_keysecret['key']]); $global->save('debug',$debug); //更改登录状态