服务合并

This commit is contained in:
Bob.Song
2026-03-11 10:15:34 +08:00
parent 945ffe9861
commit c2ec7226c0
68 changed files with 866 additions and 1032 deletions

View File

@@ -4,7 +4,6 @@ using Fantasy.Async;
using Fantasy.Network.Interface;
using NB.Chat;
using NB.Game;
using NBF.Social;
namespace NB.Common;
@@ -23,14 +22,9 @@ public class G2Common_EnterRequestHandler : AddressRPC<Scene, G2Common_EnterRequ
break;
}
case SceneType.Social:
{
await RunSocial(scene, request, response);
break;
}
// case SceneType.Map:
// case SceneType.Social:
// {
// await RunMap(scene, request, response);
// await RunSocial(scene, request, response);
// break;
// }
}
@@ -53,21 +47,21 @@ public class G2Common_EnterRequestHandler : AddressRPC<Scene, G2Common_EnterRequ
Log.Info($"登录到游戏服成功id={response.UnitRouteId}");
}
private async FTask RunSocial(Scene scene, G2Common_EnterRequest request, G2Common_EnterResponse response)
{
// 在缓存中检查该账号是否存在
var chatUnitManageComponent = scene.GetComponent<SocialUnitManageComponent>();
var account = await chatUnitManageComponent.Online(scene, request.AccountId, request.GateRouteId);
if (account == null)
{
response.ErrorCode = ErrorCode.ErrServer;
return;
}
response.UnitRouteId = account.RuntimeId;
Log.Info($"登录到社交服成功id={response.UnitRouteId}");
}
// private async FTask RunSocial(Scene scene, G2Common_EnterRequest request, G2Common_EnterResponse response)
// {
// // 在缓存中检查该账号是否存在
// var chatUnitManageComponent = scene.GetComponent<SocialUnitManageComponent>();
// var account = await chatUnitManageComponent.Online(scene, request.AccountId, request.GateRouteId);
//
// if (account == null)
// {
// response.ErrorCode = ErrorCode.ErrServer;
// return;
// }
//
// response.UnitRouteId = account.RuntimeId;
// Log.Info($"登录到社交服成功id={response.UnitRouteId}");
// }
// private async FTask RunMap(Scene scene, G2Common_EnterRequest request, G2Common_EnterResponse response)
// {