新增逻辑

This commit is contained in:
2025-12-15 12:30:45 +08:00
parent a4c2bb021b
commit 240bee00c3
56 changed files with 649 additions and 526 deletions

View File

@@ -3,7 +3,6 @@ using Fantasy.Async;
using Fantasy.Network.Interface;
using NB.Chat;
using NB.Game;
using NB.Map;
namespace NB.Common;
@@ -27,11 +26,11 @@ public class G2Common_EnterRequestHandler : RouteRPC<Scene, G2Common_EnterReques
await RunSocial(scene, request, response);
break;
}
case SceneType.Map:
{
await RunMap(scene, request, response);
break;
}
// case SceneType.Map:
// {
// await RunMap(scene, request, response);
// break;
// }
}
await FTask.CompletedTask;
@@ -68,19 +67,19 @@ public class G2Common_EnterRequestHandler : RouteRPC<Scene, G2Common_EnterReques
Log.Info($"登录到社交服成功id={response.UnitRouteId}");
}
private async FTask RunMap(Scene scene, G2Common_EnterRequest request, G2Common_EnterResponse response)
{
// 在缓存中检查该账号是否存在
var chatUnitManageComponent = scene.GetComponent<MapUnitManageComponent>();
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)
// {
// // 在缓存中检查该账号是否存在
// var chatUnitManageComponent = scene.GetComponent<MapUnitManageComponent>();
// 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}");
// }
}

View File

@@ -3,7 +3,6 @@ using Fantasy.Async;
using Fantasy.Network.Interface;
using NB.Chat;
using NB.Game;
using NB.Map;
namespace NB.Common;
@@ -25,11 +24,11 @@ public class G2Common_ExitRequestHandler : RouteRPC<Scene, G2Common_ExitRequest,
await RunSocial(scene, request, response);
break;
}
case SceneType.Map:
{
await RunMap(scene, request, response);
break;
}
// case SceneType.Map:
// {
// await RunMap(scene, request, response);
// break;
// }
}
await FTask.CompletedTask;
@@ -51,9 +50,9 @@ public class G2Common_ExitRequestHandler : RouteRPC<Scene, G2Common_ExitRequest,
Log.Info("退出聊天服成功==");
}
private async FTask RunMap(Scene scene, G2Common_ExitRequest request, Common2G_ExitResponse response)
{
await MapHelper.Offline(scene, request.AccountId, request.GateRouteId);
Log.Info("退出房间服成功==");
}
// private async FTask RunMap(Scene scene, G2Common_ExitRequest request, Common2G_ExitResponse response)
// {
// await MapHelper.Offline(scene, request.AccountId, request.GateRouteId);
// Log.Info("退出房间服成功==");
// }
}

View File

@@ -16,10 +16,6 @@ public static class SceneConfigHelper
{
sceneType = SceneType.Social;
}
else if (routeType == RouteType.MapRoute)
{
sceneType = SceneType.Map;
}
else if (routeType == RouteType.GateRoute)
{
sceneType = SceneType.Gate;