18 lines
560 B
Python
18 lines
560 B
Python
import betterproto
|
|
from game_server.net.session import PlayerSession
|
|
from rail_proto.lib import (
|
|
ReplaceLineupCsReq,
|
|
ReplaceLineupScRsp,
|
|
SyncLineupNotify
|
|
)
|
|
|
|
async def handle(session: PlayerSession, msg: ReplaceLineupCsReq) -> betterproto.Message:
|
|
lineup = session.player.lineup_manager.get(msg.index)
|
|
lineup.avatar_list = [avatar.id for avatar in msg.lineup_slot_list]
|
|
await session.notify(
|
|
SyncLineupNotify(
|
|
lineup=lineup.ToProto()
|
|
)
|
|
)
|
|
#lineup.save_lineup()
|
|
return ReplaceLineupScRsp(retcode=0) |