角色控制和房间进入推送

This commit is contained in:
2025-09-07 23:51:17 +08:00
parent 61d20b5729
commit 7dad49bf5f
28 changed files with 432 additions and 221 deletions

View File

@@ -0,0 +1,33 @@
using Fantasy;
using Fantasy.Async;
using Fantasy.Network.Interface;
namespace NB.Map;
public class C2Map_LookHandler : Route<MapUnit, C2Map_Look>
{
protected override async FTask Run(MapUnit entity, C2Map_Look message)
{
var roomManageComponent = entity.Scene.GetComponent<RoomManageComponent>();
var notifyMessage = new Map2C_LookeNotify()
{
Id = entity.Id,
Rotation = message.Rotation,
Timestamp = message.Timestamp
};
entity.Rotation.x = message.Rotation.x;
entity.Rotation.y = message.Rotation.y;
entity.Rotation.z = message.Rotation.z;
var room = roomManageComponent.Get(entity.MapId);
// foreach (var (_, unit) in mapUnitManageComponent.Units)
// {
// entity.Scene.NetworkMessagingComponent.SendInnerRoute(unit.GateRouteId, notifyMessage);
// }
await FTask.CompletedTask;
}
}