This commit is contained in:
2025-08-07 09:16:23 +08:00
parent c97bd0ab55
commit 70bfe43a80
34 changed files with 532 additions and 135 deletions

View File

@@ -26,9 +26,13 @@ public class C2A_LoginRequestHandler : MessageRPC<C2A_LoginRequest, A2C_LoginRes
if (result.ErrorCode != ErrorCode.Successful && result.AccountId == -1)
{
if (request.Region == 0)
{
request.Region = RegionDef.CN;
}
//开始注册账号
var regErrorCode =
await AuthenticationHelper.Register(session.Scene, request.Username, request.Password, "用户注册");
await AuthenticationHelper.Register(session.Scene, request.Username, request.Region, "用户注册");
if (regErrorCode != ErrorCode.Successful)
{
result.ErrorCode = regErrorCode;
@@ -55,7 +59,7 @@ public class C2A_LoginRequestHandler : MessageRPC<C2A_LoginRequest, A2C_LoginRes
var machineConfig = MachineConfigData.Instance.Get(processConfig.MachineId);
// 颁发一个ToKen令牌给客户端
response.ToKen = AuthenticationJwtHelper.GetToken(scene, result.AccountId,
$"{machineConfig.OuterIP}:{outerPort}", gateSceneConfig.Id);
$"{machineConfig.OuterIP}:{outerPort}", gateSceneConfig.Id, result.region);
}
response.ErrorCode = result.ErrorCode;