From d654bd893c957e10b0595965cc6559f9c1ba1614 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 12:03:21 +0800 Subject: [PATCH] 1 --- webapp/controller/BaseController.class.php | 18 +++++++++++++--- webapp/mt/Bigwheel.php | 24 ++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 webapp/mt/Bigwheel.php diff --git a/webapp/controller/BaseController.class.php b/webapp/controller/BaseController.class.php index b521ca20..76e90de3 100644 --- a/webapp/controller/BaseController.class.php +++ b/webapp/controller/BaseController.class.php @@ -276,15 +276,27 @@ class BaseController { return $channel == "0000"; } + public function _getServiceConstant($serviceName, $name) + { + $this->_mustBeLoadService($serviceName); + $reflectionConstant = new ReflectionClassConstant('services\\' . $serviceName, $name); + return $reflectionConstant->getValue();; + } + public function _callServiceStatic($serviceName, $funcName, ...$args) + { + $this->_mustBeLoadService($serviceName); + $method = new ReflectionMethod('services\\' . $serviceName, $funcName); + $ret = $method->invoke(null, ...$args); + return $ret; + } + + private function _mustBeLoadService($serviceName) { if (!array_key_exists($serviceName, $this->serviceHash)) { require_once('services/' . $serviceName . '.php'); $this->serviceHash[$serviceName] = $this->_getNowTime(); } - $method = new ReflectionMethod('services\\' . $serviceName, $funcName); - $ret = $method->invoke(null, ...$args); - return $ret; } public function _getGameId() { diff --git a/webapp/mt/Bigwheel.php b/webapp/mt/Bigwheel.php new file mode 100644 index 00000000..fb7257f0 --- /dev/null +++ b/webapp/mt/Bigwheel.php @@ -0,0 +1,24 @@ +