walkor před 11 roky
rodič
revize
d240e5bd80

+ 5 - 5
applications/ChatDemo/Bootstrap/BusinessWorker.php

@@ -80,9 +80,9 @@ class BusinessWorker extends Man\Core\SocketWorker
         $cmd = $pack->header['cmd'];
         
         $interface_map = array(
-                GatewayProtocol::CMD_ON_CONNECTION   => 'CMD_SEND_TO_ONE',
-                GatewayProtocol::CMD_ON_MESSAGE          => 'CMD_KICK',
-                GatewayProtocol::CMD_ON_CLOSE                => 'CMD_SEND_TO_ALL',
+                GatewayProtocol::CMD_ON_CONNECTION   => 'CMD_ON_CONNECTION',
+                GatewayProtocol::CMD_ON_MESSAGE          => 'CMD_ON_MESSAGE',
+                GatewayProtocol::CMD_ON_CLOSE                => 'CMD_ON_CLOSE',
         );
         $cmd = $pack->header['cmd'];
         StatisticClient::tick();
@@ -146,10 +146,10 @@ class BusinessWorker extends Man\Core\SocketWorker
                         $addresses_list = Store::get($key);
                         unset($addresses_list[$addr]);
                         Store::set($key, $addresses_list);
-                        $this->notice("tcp://$addr ".$errstr." del $addr from store");
+                        $this->notice("tcp://$addr ".$errstr." del $addr from store", false);
                         continue;
                     }
-                    $this->notice("tcp://$addr ".$errstr);
+                    $this->notice("tcp://$addr ".$errstr, false);
                     continue;
                 }
                 unset($this->badGatewayAddress[$addr]);

+ 8 - 4
applications/ChatDemo/Bootstrap/Gateway.php

@@ -399,17 +399,21 @@ class Gateway extends Man\Core\SocketWorker
             switch($cmd)
             {
                 case GatewayProtocol::CMD_SEND_TO_ONE:
-                    return $this->sendToSocketId($pack->header['socket_id'], $pack->body);
+                    $this->sendToSocketId($pack->header['socket_id'], $pack->body);
+                    break;
                 case GatewayProtocol::CMD_KICK:
                     if($pack->body)
                     {
                         $this->sendToSocketId($pack->header['socket_id'], $pack->body);
                     }
-                    return $this->closeClientBySocketId($pack->header['socket_id']);
+                    $this->closeClientBySocketId($pack->header['socket_id']);
+                    break;
                 case GatewayProtocol::CMD_SEND_TO_ALL:
-                    return $this->broadCast($pack->body);
+                    $this->broadCast($pack->body);
+                    break;
                 case GatewayProtocol::CMD_CONNECT_SUCCESS:
-                    return $this->connectSuccess($pack->header['socket_id'], $pack->header['uid']);
+                    $this->connectSuccess($pack->header['socket_id'], $pack->header['uid']);
+                    break;
                 default :
                     $this->notice('gateway inner pack cmd err data:' .$recv_str );
             }

+ 1 - 2
applications/Statistics/Modules/logger.php

@@ -29,9 +29,8 @@ function logger($module, $interface, $date, $start_time, $offset, $count)
             $_GET['ip'][] = $ip;
             $_GET['offset'][] = $log_data['offset'];
         }
-        
+        $log_str = nl2br(str_replace("\n", "\n\n", $log_str));
         $next_page_url = http_build_query($_GET);
-        $log_str = nl2br(htmlspecialchars($log_str));
         $log_str .= "</br><center><a href='/?fn=logger&$next_page_url'>下一页</a></center>";
 
         include ST_ROOT . '/Views/header.tpl.php';