Skip to content

Commit 1984c97

Browse files
committed
#9 [修复]1. 修复ActorId 和PlayerID不一致的问题
#9
1 parent 67c758c commit 1984c97

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

GameFrameX.Hotfix/Logic/Role/Login/ReqPlayerLoginHandler.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ namespace GameFrameX.Hotfix.Logic.Role.Login;
66
[MessageMapping(typeof(ReqPlayerLogin))]
77
internal class ReqPlayerLoginHandler : PlayerComponentHandler<PlayerComponentAgent>
88
{
9+
protected override Task InitActor()
10+
{
11+
if (ActorId <= 0 && Message is ReqPlayerLogin reqPlayerLogin)
12+
{
13+
NetWorkChannel.SetData(GlobalConst.ActorIdKey, reqPlayerLogin.Id);
14+
ActorId = reqPlayerLogin.Id;
15+
}
16+
17+
return base.InitActor();
18+
}
19+
920
protected override async Task ActionAsync()
1021
{
1122
await ComponentAgent.OnPlayerLogin(NetWorkChannel, Message as ReqPlayerLogin);

0 commit comments

Comments
 (0)