init
This commit is contained in:
15
game_server/handlers/SetNicknameCsReq.py
Normal file
15
game_server/handlers/SetNicknameCsReq.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import betterproto
|
||||
from game_server.net.session import PlayerSession
|
||||
from rail_proto.lib import (
|
||||
SetNicknameCsReq,
|
||||
SetNicknameScRsp
|
||||
)
|
||||
|
||||
async def handle(session: PlayerSession, msg: SetNicknameCsReq) -> betterproto.Message:
|
||||
if msg.is_modify:
|
||||
session.player.data.name = msg.nickname
|
||||
await session.notify(session.player.PlayerSyncProto())
|
||||
return SetNicknameScRsp(
|
||||
retcode=0,
|
||||
is_modify=msg.is_modify
|
||||
)
|
||||
Reference in New Issue
Block a user