diff --git a/AIGC/data.db b/AIGC/data.db index 01eaf47..add1f56 100644 Binary files a/AIGC/data.db and b/AIGC/data.db differ diff --git a/AIGC/main.py b/AIGC/main.py index b3fb640..358a7d2 100644 --- a/AIGC/main.py +++ b/AIGC/main.py @@ -90,7 +90,19 @@ async def handle_characterlist(client: WebSocket): ### 获得数据库中的角色信息### characters = database.get_character_byname("") protocol = {} - protocol["cmd"] = "CharacterList" + protocol["cmd"] = "RequestCharacterInfos" + protocol["status"] = 1 + protocol["message"] = "success" + characterforUE = {} + characterforUE["characterInfos"] = characters + protocol["data"] = json.dumps(characterforUE) + await senddata(client, protocol) + +async def handle_characternames(client: WebSocket): + ### 获得数据库中的角色信息### + characters = database.get_character_byname("") + protocol = {} + protocol["cmd"] = "RequestCharacterNames" protocol["status"] = 1 protocol["message"] = "success" characterforUE = {} @@ -178,8 +190,10 @@ async def process_protocol_json(json_str: str, client: WebSocket): protocol = json.loads(json_str) cmd = protocol.get("cmd") data = protocol.get("data") - if cmd == "CharacterList": + if cmd == "RequestCharacterInfos": await handle_characterlist(client) + elif cmd == "RequestCharacterNames": + await handle_characternames(client) elif cmd == "AddCharacter": await handle_addcharacter(client, data) elif cmd == "AiChatGenerate":