协议修改
This commit is contained in:
@@ -29,6 +29,7 @@ public class C2Map_LookHandler : Route<MapUnit, C2Map_Look>
|
||||
|
||||
foreach (var (_, unit) in room.Units)
|
||||
{
|
||||
// if (unit.Id == entity.Id) continue;
|
||||
entity.Scene.NetworkMessagingComponent.SendInnerRoute(unit.GateRouteId, notifyMessage);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ public class C2Map_MoveHandler : Route<MapUnit, C2Map_Move>
|
||||
|
||||
foreach (var (_, unit) in room.Units)
|
||||
{
|
||||
// if (unit.Id == entity.Id) continue;
|
||||
entity.Scene.NetworkMessagingComponent.SendInnerRoute(unit.GateRouteId, notifyMessage);
|
||||
}
|
||||
|
||||
|
||||
34
Hotfix/Map/Handler/C2Map_RolePropertyChangeHandler.cs
Normal file
34
Hotfix/Map/Handler/C2Map_RolePropertyChangeHandler.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Map;
|
||||
|
||||
public class C2Map_RolePropertyChangeHandler : Route<MapUnit, C2Map_RolePropertyChange>
|
||||
{
|
||||
protected override async FTask Run(MapUnit entity, C2Map_RolePropertyChange message)
|
||||
{
|
||||
var roomManageComponent = entity.Scene.GetComponent<RoomManageComponent>();
|
||||
var roomId = entity.RoomId;
|
||||
var room = roomManageComponent.Get(roomId);
|
||||
if (room == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var notifyMessage = new Map2C_RolePropertyChangeNotify()
|
||||
{
|
||||
Id = entity.Id,
|
||||
Propertys = message.Propertys,
|
||||
};
|
||||
|
||||
|
||||
foreach (var (_, unit) in room.Units)
|
||||
{
|
||||
if (unit.Id == entity.Id) continue;
|
||||
entity.Scene.NetworkMessagingComponent.SendInnerRoute(unit.GateRouteId, notifyMessage);
|
||||
}
|
||||
|
||||
await FTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user