-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
53 lines (43 loc) · 1.27 KB
/
Copy pathconfig.py
File metadata and controls
53 lines (43 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""
Configuration settings for the FastAPI Gomoku game
"""
from pydantic_settings import BaseSettings
from typing import Optional
import os
from pathlib import Path
class Settings(BaseSettings):
"""Application settings using Pydantic"""
# Application settings
app_name: str = "Gomoku Game"
version: str = "2.0.0"
debug: bool = False
# Game configuration
number_of_row: int = 15
number_of_col: int = 15
game_type_single: str = 'single'
game_type_pvp: str = 'pvp'
async_mode: str = 'eventlet'
max_number_of_room: int = 100000
ai_id: str = 'AI_0'
# Server settings
host: str = "0.0.0.0"
port: int = 8000
reload: bool = True
# Static files
static_dir: str = "static"
templates_dir: str = "templates"
# Socket.IO settings
cors_origins: list = ["*"]
class Config:
env_file = ".env"
case_sensitive = False
# Create settings instance
settings = Settings()
# Game constants (for backward compatibility)
NUMBER_OF_ROW = settings.number_of_row
NUMBER_OF_COL = settings.number_of_col
GAME_TYPE_SINGLE = settings.game_type_single
GAME_TYPE_PVP = settings.game_type_pvp
ASYNC_MODE = settings.async_mode
MAX_NUMBER_OF_ROOM = settings.max_number_of_room
AI_ID = settings.ai_id