|
@@ -17,14 +17,6 @@ namespace ET.Server
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // 重复请求
|
|
|
- if (session.GetComponent<SessionLockComponent>() != null)
|
|
|
- {
|
|
|
- response.Error = ErrorCode.ERR_RequestRepeatedly;
|
|
|
- reply();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
Scene scene = session.DomainScene();
|
|
|
string account = scene.GetComponent<GameSessionKeyComponent>().Get(request.Key);
|
|
|
if (account == null)
|
|
@@ -38,11 +30,13 @@ namespace ET.Server
|
|
|
// 移除session自动超时组件
|
|
|
session.RemoveComponent<SessionAcceptTimeoutComponent>();
|
|
|
|
|
|
- PlayerComponent playerComponent = scene.GetComponent<PlayerComponent>();
|
|
|
+ GamePlayerComponent playerComponent = scene.GetComponent<GamePlayerComponent>();
|
|
|
Player player = playerComponent.AddChild<Player, string>(account);
|
|
|
playerComponent.Add(player);
|
|
|
+
|
|
|
+ // 添加session组件,用于绑定角色
|
|
|
session.AddComponent<SessionPlayerComponent>().PlayerId = player.Id;
|
|
|
- session.AddComponent<MailBoxComponent, MailboxType>(MailboxType.GateSession);
|
|
|
+ session.AddComponent<MailBoxComponent, MailboxType>(MailboxType.GameSession);
|
|
|
|
|
|
response.PlayerId = player.Id;
|
|
|
reply();
|