initial 2.0.0-a5 commit

fix waitMessage function
fix CQCommand regexMatch and fullMatch
it just works
This commit is contained in:
jerry
2020-11-04 18:43:50 +08:00
parent 29fa9d8662
commit deab5fd921
10 changed files with 43 additions and 36 deletions

View File

@@ -247,6 +247,7 @@ class ServerEventHandler
* @param Frame $frame
*/
public function onMessage($server, Frame $frame) {
Console::debug("Calling Swoole \"message\" from fd=" . $frame->fd.": ".TermColor::ITALIC.$frame->data.TermColor::RESET);
unset(Context::$context[Co::getCid()]);
$conn = ManagerGM::get($frame->fd);
@@ -264,7 +265,9 @@ class ServerEventHandler
}
});
try {
$starttime = microtime(true);
$dispatcher->dispatchEvents($conn);
Console::success("Used ".round((microtime(true) - $starttime) * 1000, 3)." ms!");
} catch (Exception $e) {
$error_msg = $e->getMessage() . " at " . $e->getFile() . "(" . $e->getLine() . ")";
Console::error("Uncaught exception " . get_class($e) . " when calling \"message\": " . $error_msg);
@@ -274,6 +277,7 @@ class ServerEventHandler
Console::error("Uncaught Error " . get_class($e) . " when calling \"message\": " . $error_msg);
Console::trace();
}
}
/**