15 lines
578 B
Python
15 lines
578 B
Python
import betterproto
|
|
from game_server.net.session import PlayerSession
|
|
from rail_proto.lib import (
|
|
GetBagCsReq,
|
|
GetBagScRsp
|
|
)
|
|
|
|
async def handle(session: PlayerSession, msg: GetBagCsReq) -> betterproto.Message:
|
|
equipment = [equipment.ToProto() for unique_id,equipment in session.player.inventory_manager.items() if equipment.main_type == 1]
|
|
relics = [relic.ToProto() for unique_id,relic in session.player.inventory_manager.items() if relic.main_type == 2]
|
|
return GetBagScRsp(
|
|
retcode=0,
|
|
equipment_list=equipment,
|
|
relic_list=relics
|
|
) |