# -*- coding: utf-8 -*-
"""Shared imports and constants for server command services."""

import base64
import concurrent.futures
import os
import re
import shlex
import shutil
import socket
import struct
import subprocess
import sys
import tempfile
import threading
import time
import platform
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Union

# 平台检测
IS_WINDOWS = platform.system() == 'Windows'
IS_LINUX = platform.system() == 'Linux'

# rebar3 命令：Linux 使用当前目录下的 ./rebar3，Windows 使用 rebar3.cmd
REBAR3_CMD = 'rebar3.cmd' if IS_WINDOWS else './rebar3'

DEFAULT_CONFIG_FILE = 'default.config'
LEGACY_DEFAULT_CONFIG_FILE = 'default.kv'
USER_CONFIG_FILE = 'user.config'
LEGACY_USER_CONFIG_FILE = 'tool.config'
PROJECT_CONFIG_FILE = 'project.config'

MANAGED_CONFIG_TEMPLATE_FILES = (
    DEFAULT_CONFIG_FILE,
    'sys_center.config.example',
    'sys_client.config.example',
    'sys_cross.config.example',
    'sys_game.config.example',
    'sys_login.config.example',
)
