Support SRTools web
This commit is contained in:
@@ -18,21 +18,17 @@ async def handle(session: PlayerSession, msg: DressAvatarCsReq) -> betterproto.M
|
||||
target_equipment = session.player.inventory_manager.get(target_avatar.lightcone_id)
|
||||
target_avatar.lightcone_id, previous_avatar.lightcone_id = previous_avatar.lightcone_id, target_avatar.lightcone_id
|
||||
target_equipment.equip_avatar, equipment.equip_avatar = previous_avatar.avatar_id, target_avatar.avatar_id
|
||||
#target_equipment.save_item()
|
||||
else:
|
||||
previous_avatar.lightcone_id = 0
|
||||
equipment.equip_avatar = target_avatar.avatar_id
|
||||
target_avatar.lightcone_id = equipment.unique_id
|
||||
#previous_avatar.save_avatar()
|
||||
else:
|
||||
if target_avatar.lightcone_id > 0:
|
||||
previous_equipment = session.player.inventory_manager.get(target_avatar.lightcone_id)
|
||||
previous_equipment.equip_avatar = 0
|
||||
#previous_equipment.save_item()
|
||||
equipment.equip_avatar = target_avatar.avatar_id
|
||||
target_avatar.lightcone_id = equipment.unique_id
|
||||
|
||||
#equipment.save_item()
|
||||
#target_avatar.save_avatar()
|
||||
await session.notify(session.player.PlayerSyncProto())
|
||||
return DressAvatarScRsp(retcode=0)
|
||||
|
||||
session.pending_notify(session.player.PlayerSyncProto())
|
||||
return DressAvatarScRsp()
|
||||
@@ -33,41 +33,30 @@ async def handle(session: PlayerSession, msg: DressRelicAvatarCsReq) -> betterpr
|
||||
target_avatar.relic_ids[relic_sub_type] = previous_relic.unique_id
|
||||
previous_relic.equip_avatar = target_avatar.avatar_id
|
||||
|
||||
#current_relic.save_item()
|
||||
#previous_relic.save_item()
|
||||
|
||||
elif previous_relic_id > 0:
|
||||
previous_relic = session.player.inventory_manager.get(previous_relic_id)
|
||||
if previous_relic:
|
||||
previous_relic.equip_avatar = 0
|
||||
#previous_relic.save_item()
|
||||
previous_avatar.relic_ids[relic_sub_type] = 0
|
||||
|
||||
elif current_relic_id > 0:
|
||||
current_relic = session.player.inventory_manager.get(current_relic_id)
|
||||
if current_relic:
|
||||
current_relic.equip_avatar = 0
|
||||
#current_relic.save_item()
|
||||
target_avatar.relic_ids[relic_sub_type] = 0
|
||||
|
||||
target_avatar.relic_ids[relic_sub_type] = relic.unique_id
|
||||
relic.equip_avatar = target_avatar.avatar_id
|
||||
#relic.save_item()
|
||||
#previous_avatar.save_avatar()
|
||||
|
||||
else:
|
||||
if current_relic_id > 0:
|
||||
current_relic = session.player.inventory_manager.get(current_relic_id)
|
||||
if current_relic:
|
||||
current_relic.equip_avatar = 0
|
||||
#current_relic.save_item()
|
||||
|
||||
target_avatar.relic_ids[relic_sub_type] = relic.unique_id
|
||||
relic.equip_avatar = target_avatar.avatar_id
|
||||
#relic.save_item()
|
||||
|
||||
#target_avatar.save_avatar()
|
||||
|
||||
await session.notify(session.player.PlayerSyncProto())
|
||||
session.pending_notify(session.player.PlayerSyncProto())
|
||||
|
||||
return DressRelicAvatarScRsp(retcode=0)
|
||||
return DressRelicAvatarScRsp()
|
||||
|
||||
33
game_server/handlers/GetBigDataAllRecommendCsReq.py
Normal file
33
game_server/handlers/GetBigDataAllRecommendCsReq.py
Normal file
@@ -0,0 +1,33 @@
|
||||
import betterproto
|
||||
from game_server.net.session import PlayerSession
|
||||
from rail_proto.lib import (
|
||||
GetBigDataAllRecommendCsReq,
|
||||
GetBigDataAllRecommendScRsp,
|
||||
PIIIPHEFDJO,
|
||||
MKJALMKMPGL,
|
||||
OFNGPLJKLOJ,
|
||||
KNNFPFKCABE
|
||||
)
|
||||
|
||||
async def handle(session: PlayerSession, msg: GetBigDataAllRecommendCsReq) -> betterproto.Message:
|
||||
unk1 = PIIIPHEFDJO()
|
||||
unk2 = MKJALMKMPGL()
|
||||
list1 = []
|
||||
for _,avatar_data in session.player.avatar_manager.items():
|
||||
id = avatar_data.avatar_id
|
||||
list1.append(id)
|
||||
|
||||
unk2unk2 = OFNGPLJKLOJ()
|
||||
unk2unk2.avatar_id = id
|
||||
unk2.bfdmginboib.append(unk2unk2)
|
||||
unk1.apfecoopnkn.append(
|
||||
KNNFPFKCABE(
|
||||
avatar_id_list=list1
|
||||
)
|
||||
)
|
||||
|
||||
return GetBigDataAllRecommendScRsp(
|
||||
big_data_recommend_type=msg.big_data_recommend_type,
|
||||
dklbnbdpmpo=unk1,
|
||||
pfopjpjkklk=unk2,
|
||||
)
|
||||
13
game_server/handlers/GetBigDataRecommendCsReq.py
Normal file
13
game_server/handlers/GetBigDataRecommendCsReq.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import betterproto
|
||||
from game_server.net.session import PlayerSession
|
||||
from rail_proto.lib import (
|
||||
GetBigDataRecommendCsReq,
|
||||
GetBigDataRecommendScRsp
|
||||
)
|
||||
|
||||
async def handle(session: PlayerSession, msg: GetBigDataRecommendCsReq) -> betterproto.Message:
|
||||
return GetBigDataRecommendScRsp(
|
||||
big_data_recommend_type=msg.big_data_recommend_type,
|
||||
has_recommand=True,
|
||||
equip_avatar=msg.equip_avatar
|
||||
)
|
||||
Reference in New Issue
Block a user