@@ -180,9 +180,17 @@ def init(data):
180180
181181 res_data = {
182182 "pid" : pid ,
183- "cards" : cards ,
184- "confidence" : confidence ,
185183 "game_over" : res_game_over ,
184+ "play" : [
185+ {
186+ "cards" : cards ,
187+ "confidence" : confidence ,
188+ },
189+ {
190+ "cards" : None ,
191+ "confidence" : None ,
192+ },
193+ ],
186194 }
187195 res_action = "play"
188196 else :
@@ -223,49 +231,6 @@ def init(data):
223231 player_position_code
224232 ]
225233
226- """# 玩家手牌
227- user_hand_cards_real = data["player_data"][0]["hand_cards"]
228- ai0_use_hand_cards_env = [
229- RealCard2EnvCard[c] for c in list(user_hand_cards_real)
230- ]
231- user_hand_cards_real = data["player_data"][1]["hand_cards"]
232- ai1_use_hand_cards_env = [
233- RealCard2EnvCard[c] for c in list(user_hand_cards_real)
234- ]
235- # 角色位号
236- ai0_user_position_code = data["player_data"][0]["position_code"]
237- ai0_user_position = ["landlord_up", "landlord", "landlord_down"][
238- ai0_user_position_code
239- ]
240- ai1_user_position_code = data["player_data"][1]["position_code"]
241- ai1_user_position = ["landlord_up", "landlord", "landlord_down"][
242- ai1_user_position_code
243- ]
244- player_position_code = 3 - ai0_user_position_code - ai1_user_position_code
245- player_position = ["landlord_up", "landlord", "landlord_down"][
246- player_position_code
247- ]
248- # 三张底牌
249- three_landlord_cards_real = data["three_landlord_cards"]
250- three_landlord_cards_env = [
251- RealCard2EnvCard[c] for c in list(three_landlord_cards_real)
252- ]
253- # AI模型
254- ai0_model_name = data["player_data"][0]["model"]
255- ai0_model_list = check_model(ai0_model_name)
256- if ai0_model_list == None:
257- error = Exception(f"找不到此模型:{ai0_model_name}")
258- raise error
259- else:
260- ai0_model = ai0_model_list[ai0_user_position_code]
261- ai1_model_name = data["player_data"][1]["model"]
262- ai1_model_list = check_model(ai1_model_name)
263- if ai1_model_list == None:
264- error = Exception(f"找不到此模型:{ai1_model_name}")
265- raise error
266- else:
267- ai1_model = ai1_model_list[ai1_user_position_code]"""
268-
269234 # 减去两位AI的牌,剩下的牌就是玩家的手牌
270235 other_hand_cards = []
271236 for i in set (AllEnvCard ):
0 commit comments