12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Mead
- * Date: 2019/9/3
- * Time: 8:05 PM
- */
- namespace App\Servers;
- use App\Models\CacheLogTraitModel;
- class BoxSelectCmdServer extends BaseServer
- {
- use CacheLogTraitModel;
- public function main($body)
- {
- $data = $this->decode($body);
- $this->cacheLog($data['msg_id'], $data['setting']);
- self::log($data, 'BoxSelectCmdServer', self::$LOG_MAJOR);
- return false;
- }
- /**
- * 解析装载的数据
- * @param $body
- * @return array
- * User: Mead
- */
- private function decode($body)
- {
- $arr = explode(BikeControl::SPLIT_TAG, implode('', $body));
- $setting = $_msg = $msg = '';
- if (count($arr) === 2) {
- list($setting, $_msg) = explode(BikeControl::SPLIT_TAG, implode('', $body));
- } else {
- $setting = $arr[0];
- }
- // $msg = $this->decodeMsgId($_msg);
- $setting = $this->decodeSetting($setting);
- return [
- 'setting' => $setting,
- 'msg_id' => $_msg,
- ];
- }
- }
|