升级框架
This commit is contained in:
@@ -7,7 +7,7 @@ using Fantasy.PacketParser;
|
||||
|
||||
namespace NB.Gate;
|
||||
|
||||
public class S2G_ChatMessageHandler : Route<Scene, S2G_ChatMessage>
|
||||
public class S2G_ChatMessageHandler : Address<Scene, S2G_ChatMessage>
|
||||
{
|
||||
protected override async FTask Run(Scene scene, S2G_ChatMessage message)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Fantasy;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network;
|
||||
using Fantasy.Network.Interface;
|
||||
@@ -68,7 +70,7 @@ public class C2G_EnterMapRequestHandler : MessageRPC<C2G_EnterMapRequest, G2C_En
|
||||
|
||||
//先判断是否需要更换地图服务器
|
||||
var oldServerRouteId = gateUnit.GetAddress(sceneConfig.SceneType);
|
||||
if (oldServerRouteId != sceneConfig.RouteId)
|
||||
if (oldServerRouteId != sceneConfig.Address)
|
||||
{
|
||||
//先退出旧的服务
|
||||
var ret = await gateUnit.Offline(session.RuntimeId, RouteType.GameRoute);
|
||||
@@ -88,8 +90,8 @@ public class C2G_EnterMapRequestHandler : MessageRPC<C2G_EnterMapRequest, G2C_En
|
||||
}
|
||||
|
||||
//执行进入房间操作
|
||||
var roomResponse = (Map2G_EnterMapResponse)await session.Scene.NetworkMessagingComponent.CallInnerRoute(
|
||||
sceneConfig.RouteId, new G2Map_EnterMapRequest()
|
||||
var roomResponse = (Map2G_EnterMapResponse)await session.Scene.NetworkMessagingComponent.Call(
|
||||
sceneConfig.Address, new G2Map_EnterMapRequest()
|
||||
{
|
||||
AccountId = gateUnit.Id,
|
||||
RoomCode = request.RoomCode,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network;
|
||||
@@ -62,8 +63,8 @@ public class C2G_ExitRoomRequestHandler : MessageRPC<C2G_ExitRoomRequest, G2C_Ex
|
||||
}
|
||||
|
||||
//执行退出房间操作
|
||||
var roomResponse = (Map2G_ExiRoomResponse)await session.Scene.NetworkMessagingComponent.CallInnerRoute(
|
||||
sceneConfig.RouteId, new G2Map_ExitRoomRequest()
|
||||
var roomResponse = (Map2G_ExiRoomResponse)await session.Scene.NetworkMessagingComponent.Call(
|
||||
sceneConfig.Address, new G2Map_ExitRoomRequest()
|
||||
{
|
||||
AccountId = gateUnit.Id,
|
||||
RoomCode = request.RoomCode,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy;
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Entitas;
|
||||
using Fantasy.Network;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy;
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Entitas.Interface;
|
||||
using Fantasy.Network;
|
||||
@@ -72,9 +73,9 @@ public static class GateUnitSystem
|
||||
sceneConfig = SceneConfigHelper.GetConfigByRouteType(routeType);
|
||||
}
|
||||
|
||||
var gameRouteId = sceneConfig.RouteId;
|
||||
var gameRouteId = sceneConfig.Address;
|
||||
|
||||
var gameResponse = (G2Common_EnterResponse)await self.Scene.NetworkMessagingComponent.CallInnerRoute(
|
||||
var gameResponse = (G2Common_EnterResponse)await self.Scene.NetworkMessagingComponent.Call(
|
||||
gameRouteId, new G2Common_EnterRequest()
|
||||
{
|
||||
AccountId = self.AccountID,
|
||||
@@ -115,11 +116,11 @@ public static class GateUnitSystem
|
||||
public static async FTask<uint> Offline(this GateUnit self, long sessionId, int routeType)
|
||||
{
|
||||
var sceneConfig = SceneConfigHelper.GetConfigByRouteType(routeType);
|
||||
var sceneRouteId = sceneConfig.RouteId;
|
||||
var sceneRouteId = sceneConfig.Address;
|
||||
if (sceneRouteId < 1) return ErrorCode.Successful;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
var gameResponse = (Common2G_ExitResponse)await self.Scene.NetworkMessagingComponent.CallInnerRoute(
|
||||
var gameResponse = (Common2G_ExitResponse)await self.Scene.NetworkMessagingComponent.Call(
|
||||
sceneRouteId, new G2Common_ExitRequest()
|
||||
{
|
||||
AccountId = self.AccountID,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Security.Cryptography;
|
||||
using Fantasy.Entitas.Interface;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using Fantasy;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user