升级框架
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
using Fantasy;
|
||||
using System;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class
|
||||
S2G_GetPlayerBasicInfoRequestHandler : RouteRPC<Scene, S2G_GetPlayerBasicInfoRequest,
|
||||
S2G_GetPlayerBasicInfoRequestHandler : AddressRPC<Scene, S2G_GetPlayerBasicInfoRequest,
|
||||
G2S_GetPlayerBasicInfoResponse>
|
||||
{
|
||||
protected override async FTask Run(Scene scene, S2G_GetPlayerBasicInfoRequest request,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy;
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using NB.Common;
|
||||
|
||||
@@ -15,9 +16,9 @@ public static class CacheHandler
|
||||
public static async FTask<List<RoleSimpleInfo>> GetPlayerBasicCacheInfos(Scene scene, List<long> id)
|
||||
{
|
||||
var gameSceneConfig = SceneConfigHelper.GetConfig(SceneType.Game);
|
||||
var gameRouteId = gameSceneConfig.RouteId;
|
||||
var gameRouteId = gameSceneConfig.Address;
|
||||
//连接到游戏中心服
|
||||
var gameResponse = (G2S_GetPlayerBasicInfoResponse)await scene.NetworkMessagingComponent.CallInnerRoute(
|
||||
var gameResponse = (G2S_GetPlayerBasicInfoResponse)await scene.NetworkMessagingComponent.Call(
|
||||
gameRouteId, new S2G_GetPlayerBasicInfoRequest()
|
||||
{
|
||||
IdList = id
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Entitas.Interface;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using Fantasy;
|
||||
using System;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class C2Game_GetItemsRequestHandler : RouteRPC<Player, C2Game_GetItemsRequest, Game2C_GetItemsResponse>
|
||||
public class C2Game_GetItemsRequestHandler : AddressRPC<Player, C2Game_GetItemsRequest, Game2C_GetItemsResponse>
|
||||
{
|
||||
protected override async FTask Run(Player entity, C2Game_GetItemsRequest request, Game2C_GetItemsResponse response,
|
||||
Action reply)
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
using Fantasy;
|
||||
using System;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Entitas;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class C2Game_GetRoleInfoRequestHandler : RouteRPC<Player, C2Game_GetRoleInfoRequest, Game2C_GetRoleInfoResponse>
|
||||
public class C2Game_GetRoleInfoRequestHandler : AddressRPC<Player, C2Game_GetRoleInfoRequest, Game2C_GetRoleInfoResponse>
|
||||
{
|
||||
protected override async FTask Run(Player entity, C2Game_GetRoleInfoRequest request,
|
||||
Game2C_GetRoleInfoResponse response, Action reply)
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
using Fantasy;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class C2Game_RigChangeRequestHandler : RouteRPC<Player, C2Game_RigChangeRequest, Game2C_RigChangeResponse>
|
||||
public class C2Game_RigChangeRequestHandler : AddressRPC<Player, C2Game_RigChangeRequest, Game2C_RigChangeResponse>
|
||||
{
|
||||
protected override async FTask Run(Player entity, C2Game_RigChangeRequest request,
|
||||
Game2C_RigChangeResponse response, Action reply)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using Fantasy;
|
||||
using System;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class C2Game_SetSlotRequestHandler : RouteRPC<Player, C2Game_SetSlotRequest, Game2C_SetSlotResponse>
|
||||
public class C2Game_SetSlotRequestHandler : AddressRPC<Player, C2Game_SetSlotRequest, Game2C_SetSlotResponse>
|
||||
{
|
||||
protected override async FTask Run(Player entity, C2Game_SetSlotRequest request, Game2C_SetSlotResponse response,
|
||||
Action reply)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using Fantasy;
|
||||
using System;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class C2Game_UseItemRequestHandler : RouteRPC<Player, C2Game_UseItemRequest, Game2C_UseItemResponse>
|
||||
public class C2Game_UseItemRequestHandler : AddressRPC<Player, C2Game_UseItemRequest, Game2C_UseItemResponse>
|
||||
{
|
||||
protected override async FTask Run(Player entity, C2Game_UseItemRequest request, Game2C_UseItemResponse response,
|
||||
Action reply)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy;
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Entitas.Interface;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy;
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Entitas.Interface;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy;
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Entitas.Interface;
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
using Fantasy;
|
||||
using System;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Entitas;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class C2Map_CreateRoomRequestHandler : RouteRPC<Player, C2Map_CreateRoomRequest, Map2C_CreateRoomResponse>
|
||||
public class C2Map_CreateRoomRequestHandler : AddressRPC<Player, C2Map_CreateRoomRequest, Map2C_CreateRoomResponse>
|
||||
{
|
||||
protected override async FTask Run(Player entity, C2Map_CreateRoomRequest request,
|
||||
Map2C_CreateRoomResponse response,
|
||||
|
||||
@@ -4,7 +4,7 @@ using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class C2Map_LookHandler : Route<Player, C2Map_Look>
|
||||
public class C2Map_LookHandler : Address<Player, C2Map_Look>
|
||||
{
|
||||
protected override async FTask Run(Player entity, C2Map_Look message)
|
||||
{
|
||||
@@ -37,7 +37,7 @@ public class C2Map_LookHandler : Route<Player, C2Map_Look>
|
||||
foreach (var (_, unit) in room.Units)
|
||||
{
|
||||
// if (unit.Id == entity.Id) continue;
|
||||
entity.Scene.NetworkMessagingComponent.SendInnerRoute(unit.SessionRunTimeId, notifyMessage);
|
||||
entity.Scene.NetworkMessagingComponent.Send(unit.SessionRunTimeId, notifyMessage);
|
||||
}
|
||||
|
||||
await FTask.CompletedTask;
|
||||
|
||||
@@ -5,7 +5,7 @@ using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class C2Map_MoveHandler : Route<Player, C2Map_Move>
|
||||
public class C2Map_MoveHandler : Address<Player, C2Map_Move>
|
||||
{
|
||||
protected override async FTask Run(Player entity, C2Map_Move message)
|
||||
{
|
||||
@@ -45,7 +45,7 @@ public class C2Map_MoveHandler : Route<Player, C2Map_Move>
|
||||
foreach (var (_, unit) in room.Units)
|
||||
{
|
||||
// if (unit.Id == entity.Id) continue;
|
||||
entity.Scene.NetworkMessagingComponent.SendInnerRoute(unit.SessionRunTimeId, notifyMessage);
|
||||
entity.Scene.NetworkMessagingComponent.Send(unit.SessionRunTimeId, notifyMessage);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class C2Map_RolePropertyChangeHandler : Route<Player, C2Map_RolePropertyChange>
|
||||
public class C2Map_RolePropertyChangeHandler : Address<Player, C2Map_RolePropertyChange>
|
||||
{
|
||||
protected override async FTask Run(Player entity, C2Map_RolePropertyChange message)
|
||||
{
|
||||
@@ -33,7 +33,7 @@ public class C2Map_RolePropertyChangeHandler : Route<Player, C2Map_RolePropertyC
|
||||
foreach (var (_, unit) in room.Units)
|
||||
{
|
||||
if (unit.Id == entity.Id) continue;
|
||||
entity.Scene.NetworkMessagingComponent.SendInnerRoute(unit.SessionRunTimeId, notifyMessage);
|
||||
entity.Scene.NetworkMessagingComponent.Send(unit.SessionRunTimeId, notifyMessage);
|
||||
}
|
||||
|
||||
await FTask.CompletedTask;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using Fantasy;
|
||||
using System;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class C2Map_TakeItemRequestHandler : RouteRPC<Player, C2Map_TakeItemRequest, Map2C_TakeItemResponse>
|
||||
public class C2Map_TakeItemRequestHandler : AddressRPC<Player, C2Map_TakeItemRequest, Map2C_TakeItemResponse>
|
||||
{
|
||||
protected override async FTask Run(Player entity, C2Map_TakeItemRequest request, Map2C_TakeItemResponse response,
|
||||
Action reply)
|
||||
@@ -53,7 +54,7 @@ public class C2Map_TakeItemRequestHandler : RouteRPC<Player, C2Map_TakeItemReque
|
||||
foreach (var (_, unit) in room.Units)
|
||||
{
|
||||
// if (unit.Id == entity.Id) continue;
|
||||
entity.Scene.NetworkMessagingComponent.SendInnerRoute(unit.SessionRunTimeId, notifyMessage);
|
||||
entity.Scene.NetworkMessagingComponent.Send(unit.SessionRunTimeId, notifyMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy;
|
||||
using System;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
using NB.Game;
|
||||
@@ -8,7 +9,7 @@ namespace NB.Game.Inner;
|
||||
/// <summary>
|
||||
/// 请求进入地图
|
||||
/// </summary>
|
||||
public class G2Map_EnterMapRequestHandler : RouteRPC<Scene, G2Map_EnterMapRequest, Map2G_EnterMapResponse>
|
||||
public class G2Map_EnterMapRequestHandler : AddressRPC<Scene, G2Map_EnterMapRequest, Map2G_EnterMapResponse>
|
||||
{
|
||||
protected override async FTask Run(Scene entity, G2Map_EnterMapRequest request, Map2G_EnterMapResponse response,
|
||||
Action reply)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using Fantasy;
|
||||
using System;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Game.Inner;
|
||||
|
||||
public class G2Map_ExitRoomRequestHandler : RouteRPC<Scene, G2Map_ExitRoomRequest, Map2G_ExiRoomResponse>
|
||||
public class G2Map_ExitRoomRequestHandler : AddressRPC<Scene, G2Map_ExitRoomRequest, Map2G_ExiRoomResponse>
|
||||
{
|
||||
protected override async FTask Run(Scene entity, G2Map_ExitRoomRequest request, Map2G_ExiRoomResponse response,
|
||||
Action reply)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Text;
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using Fantasy.Entitas;
|
||||
using Fantasy.Entitas.Interface;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy;
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Entitas.Interface;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy;
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Fantasy;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Entitas;
|
||||
using Fantasy.Entitas.Interface;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Entitas;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http.Headers;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
@@ -69,8 +70,8 @@ public static class PlayerSystem
|
||||
var ret = new MapUnitInfo()
|
||||
{
|
||||
Id = self.Id,
|
||||
Position = Vector3Info.Create(self.Scene),
|
||||
Rotation = Vector3Info.Create(self.Scene),
|
||||
Position = Vector3Info.Create(),
|
||||
Rotation = Vector3Info.Create(),
|
||||
};
|
||||
|
||||
var mapUnit = self.GetComponent<MapUnitComponent>();
|
||||
|
||||
@@ -133,7 +133,7 @@ public static class PlayerHelper
|
||||
var info = new RoleInfo();
|
||||
info.BaseInfo = GetRoleBaseInfo(self);
|
||||
// info.Items = self.ItemContainer.GetItemInfos();
|
||||
info.RoleId = self.RouteId;
|
||||
info.RoleId = self.Address;
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user