fix:角色基础修正
This commit is contained in:
@@ -81,29 +81,33 @@ class Equipments:
|
||||
def __init__(self, version='0'):
|
||||
self.version = version
|
||||
self.engine = get_engine(version)
|
||||
self.equs: list[Equ] = []
|
||||
self.oaths: list[Oath] = []
|
||||
self.oath_dict: dict[str, Oath] = {}
|
||||
# self.stones: list[Equ] = []
|
||||
self.funs = self.init_func()
|
||||
self.equ_dict: dict[str, Equ] = {}
|
||||
# self.stone_dict: dict[str, Equ] = {}
|
||||
self.jades = []
|
||||
self.enchants = []
|
||||
self.emblems = []
|
||||
self.suits: list[Suit] = []
|
||||
self.suit_dict: dict[str, Suit] = {}
|
||||
self.suit_id_dict: dict[str, Suit] = {}
|
||||
self.oath_suits: list[OathSuit] = []
|
||||
self.oath_suit_dict: dict[str, OathSuit] = {}
|
||||
self.init_equs()
|
||||
self.init_suits()
|
||||
self.init_enchants()
|
||||
# self.init_stones()
|
||||
self.init_emblem()
|
||||
self.init_jades()
|
||||
self.init_oaths()
|
||||
self.init_oath_suits()
|
||||
try:
|
||||
self.equs: list[Equ] = []
|
||||
self.oaths: list[Oath] = []
|
||||
self.oath_dict: dict[str, Oath] = {}
|
||||
# self.stones: list[Equ] = []
|
||||
self.funs = self.init_func()
|
||||
self.equ_dict: dict[str, Equ] = {}
|
||||
# self.stone_dict: dict[str, Equ] = {}
|
||||
self.jades = []
|
||||
self.enchants = []
|
||||
self.emblems = []
|
||||
self.suits: list[Suit] = []
|
||||
self.suit_dict: dict[str, Suit] = {}
|
||||
self.suit_id_dict: dict[str, Suit] = {}
|
||||
self.oath_suits: list[OathSuit] = []
|
||||
self.oath_suit_dict: dict[str, OathSuit] = {}
|
||||
self.init_equs()
|
||||
self.init_suits()
|
||||
self.init_enchants()
|
||||
# self.init_stones()
|
||||
self.init_emblem()
|
||||
self.init_jades()
|
||||
self.init_oaths()
|
||||
self.init_oath_suits()
|
||||
finally:
|
||||
self.engine.dispose()
|
||||
self.engine = None
|
||||
|
||||
def init_equs(self):
|
||||
"""从数据库中获取所有装备信息"""
|
||||
|
||||
Binary file not shown.
@@ -3,6 +3,7 @@ from pathlib import Path
|
||||
import redis
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy.pool import NullPool
|
||||
from config.main import config
|
||||
|
||||
RedisPool = redis.ConnectionPool.from_url(config.REDIS_URL)
|
||||
@@ -21,7 +22,11 @@ def get_redis():
|
||||
@cache
|
||||
def get_db_engine(version='0'):
|
||||
db_path = BACKEND_DIR / 'dataFiles' / f'dcalc_{version}.db'
|
||||
return create_engine(f'sqlite:///{db_path}', connect_args={'check_same_thread': False})
|
||||
return create_engine(
|
||||
f'sqlite:///{db_path}',
|
||||
connect_args={'check_same_thread': False},
|
||||
poolclass=NullPool,
|
||||
)
|
||||
|
||||
|
||||
def get_db():
|
||||
|
||||
+1
-1
Submodule backend/openapi updated: 79295067f0...97fb4c180e
Reference in New Issue
Block a user