|
|
@ -32,7 +32,7 @@ import torch.multiprocessing as mp
|
|
|
|
from aiohttp import web
|
|
|
|
from aiohttp import web
|
|
|
|
import aiohttp
|
|
|
|
import aiohttp
|
|
|
|
import aiohttp_cors
|
|
|
|
import aiohttp_cors
|
|
|
|
from aiortc import RTCPeerConnection, RTCSessionDescription,RTCIceServer,RTCConfiguration
|
|
|
|
from aiortc import RTCPeerConnection, RTCSessionDescription, RTCIceServer, RTCConfiguration
|
|
|
|
from aiortc.rtcrtpsender import RTCRtpSender
|
|
|
|
from aiortc.rtcrtpsender import RTCRtpSender
|
|
|
|
from webrtc import HumanPlayer
|
|
|
|
from webrtc import HumanPlayer
|
|
|
|
from basereal import BaseReal
|
|
|
|
from basereal import BaseReal
|
|
|
@ -57,7 +57,6 @@ nerfreals:Dict[int, BaseReal] = {} #sessionid:BaseReal
|
|
|
|
opt = None
|
|
|
|
opt = None
|
|
|
|
model = None
|
|
|
|
model = None
|
|
|
|
avatar = None
|
|
|
|
avatar = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#####webrtc###############################
|
|
|
|
#####webrtc###############################
|
|
|
|
pcs = set()
|
|
|
|
pcs = set()
|
|
|
@ -98,7 +97,7 @@ def set_enable_status(db_path):
|
|
|
|
"UPDATE live_config SET value = '1' WHERE key = 'livetlking_enable_status';"
|
|
|
|
"UPDATE live_config SET value = '1' WHERE key = 'livetlking_enable_status';"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
conn.commit()
|
|
|
|
conn.commit()
|
|
|
|
print("enable_status 对应的 value 字段改为 '1'")
|
|
|
|
print("livetlking_enable_status 对应的 value 字段改为 '1'")
|
|
|
|
finally:
|
|
|
|
finally:
|
|
|
|
conn.close()
|
|
|
|
conn.close()
|
|
|
|
|
|
|
|
|
|
|
@ -310,6 +309,12 @@ async def on_shutdown(app):
|
|
|
|
coros = [pc.close() for pc in pcs]
|
|
|
|
coros = [pc.close() for pc in pcs]
|
|
|
|
await asyncio.gather(*coros)
|
|
|
|
await asyncio.gather(*coros)
|
|
|
|
pcs.clear()
|
|
|
|
pcs.clear()
|
|
|
|
|
|
|
|
# 关闭数据库连接
|
|
|
|
|
|
|
|
global conn
|
|
|
|
|
|
|
|
if conn:
|
|
|
|
|
|
|
|
conn.close()
|
|
|
|
|
|
|
|
print("[INFO] 已关闭数据库连接")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def post(url,data):
|
|
|
|
async def post(url,data):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -344,7 +349,7 @@ async def run(push_url,sessionid):
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
if __name__ == '__main__':
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
db_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'live_chat.db')
|
|
|
|
db_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', 'live_chat.db')
|
|
|
|
|
|
|
|
|
|
|
|
load_db_config(db_path)
|
|
|
|
load_db_config(db_path)
|
|
|
|
|
|
|
|
|
|
|
|