Compare commits

...

3 Commits
2.3.1 ... 2.3.2

Author SHA1 Message Date
Whale
c20e3324d4 Merge pull request #35 from zhamao-robot/2.3.x
2.3.x
2021-03-23 13:28:18 +08:00
303f44cd2b update to version 2.3.2 (build 395)
fix overflow bug
2021-03-23 13:11:59 +08:00
66b73973b4 update to version 2.3.2 (build 394)
fix mysql error bugs
2021-03-23 12:47:00 +08:00
3 changed files with 10 additions and 20 deletions

View File

@@ -29,25 +29,15 @@ trait CQAPI
public function processWebsocketAPI($connection, $reply, $function = false) { public function processWebsocketAPI($connection, $reply, $function = false) {
$api_id = ZMAtomic::get("wait_msg_id")->add(1); $api_id = ZMAtomic::get("wait_msg_id")->add(1);
$reply["echo"] = $api_id; $reply["echo"] = $api_id;
SpinLock::lock("wait_api");
$r = LightCacheInside::get("wait_api", "wait_api");
$r[$api_id] = [
"data" => $reply,
"time" => microtime(true),
"self_id" => $connection->getOption("connect_id"),
"echo" => $api_id
];
LightCacheInside::set("wait_api", "wait_api", $r);
SpinLock::unlock("wait_api");
if (server()->push($connection->getFd(), json_encode($reply))) { if (server()->push($connection->getFd(), json_encode($reply))) {
if ($function === true) { if ($function === true) {
return CoMessage::yieldByWS($r[$api_id], ["echo"], 60); $obj = [
} else { "data" => $reply,
SpinLock::lock("wait_api"); "time" => microtime(true),
$r = LightCacheInside::get("wait_api", "wait_api"); "self_id" => $connection->getOption("connect_id"),
unset($r[$api_id]); "echo" => $api_id
LightCacheInside::set("wait_api", "wait_api", $r); ];
SpinLock::unlock("wait_api"); return CoMessage::yieldByWS($obj, ["echo"], 60);
} }
return true; return true;
} else { } else {

View File

@@ -18,8 +18,8 @@ use ZM\Utils\DataProvider;
class ConsoleApplication extends Application class ConsoleApplication extends Application
{ {
const VERSION_ID = 388; const VERSION_ID = 395;
const VERSION = "2.3.1"; const VERSION = "2.3.2";
public function __construct(string $name = 'UNKNOWN') { public function __construct(string $name = 'UNKNOWN') {
define("ZM_VERSION_ID", self::VERSION_ID); define("ZM_VERSION_ID", self::VERSION_ID);

View File

@@ -61,7 +61,7 @@ class Table
if ($msg == "") { if ($msg == "") {
$msg .= $k . " $operator ? "; $msg .= $k . " $operator ? ";
} else { } else {
$msg .= "AND " . $k . " $operator ?"; $msg .= " AND " . $k . " $operator ?";
} }
$param[] = $v; $param[] = $v;
} }