<?php

/**
 * 初始服务器状态 开启中
 */

namespace Tool\InitServer\Logic;

use Framework\Logic\TemplateHelp;
use Game\Logic\CommonConstLogic;
use Tool\InitServer\Config;
use Tool\InitServer\IBase;

class InitServerState extends IBase
{
    use TemplateHelp;
    use CommonConstLogic;

    protected function run(): bool
    {
        $result = $this->getCommonConstData();
        if(!isset($result[Config::SERVER_STATE_KEY])) {
            $data = array(
                Config::SERVER_STATE_KEY => Config::SERVER_TYPE_OPENING,
            );
            $this->saveCommonConstData($data);
        }
        return true;
    }
}
