mirror of
https://github.com/MikuLeaks/KianaBH3.git
synced 2025-12-14 13:54:43 +01:00
Initial commit
This commit is contained in:
26
game_server/packet/handlers/SetWarshipAvatarReq.py
Normal file
26
game_server/packet/handlers/SetWarshipAvatarReq.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import betterproto
|
||||
from game_server.net.session import Session
|
||||
from game_server.game.enum.data_type import DataType
|
||||
from database import mongo
|
||||
from lib.proto import (
|
||||
SetWarshipAvatarReq,
|
||||
SetWarshipAvatarRsp,
|
||||
GetMainDataRsp,
|
||||
WarshipAvatarData
|
||||
)
|
||||
|
||||
async def handle(session: Session, msg: SetWarshipAvatarReq) -> betterproto.Message:
|
||||
await session.send(session.create_packet(
|
||||
GetMainDataRsp(
|
||||
retcode=0,
|
||||
warship_avatar=WarshipAvatarData(
|
||||
warship_first_avatar_id=msg.first_avatar_id,
|
||||
warship_second_avatar_id=0
|
||||
),
|
||||
type_list=[35]
|
||||
)
|
||||
)
|
||||
)
|
||||
session.player.warship_avatar.warship_first_avatar_id = msg.first_avatar_id
|
||||
mongo.save(session,DataType.PLAYER)
|
||||
return SetWarshipAvatarRsp(retcode=0)
|
||||
Reference in New Issue
Block a user