From b7b2262d538eac621d23b77f3619343e2af88741 Mon Sep 17 00:00:00 2001 From: ALEXTANGXIAO <574809918@qq.com> Date: Thu, 27 Jul 2023 00:33:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E7=90=86=E5=8C=96=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E5=91=BD=E5=90=8D=EF=BC=8C=E4=BD=BF=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E8=80=85=E6=9B=B4=E5=AE=B9=E6=98=93=E7=90=86=E8=A7=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Scene的routeId更名为locationId --- .../GameScripts/DotNet/Core/Entitas/Entity.cs | 27 ++-- .../DotNet/Core/Entitas/Scene/Scene.cs | 123 ++++++++++-------- .../DotNet/Core/Entitas/Scene/SceneEvent.cs | 8 +- .../Exporter/Excel/ServerConfigTableManage.cs | 2 - .../DotNet/Core/IdFactory/EntityIdStruct.cs | 14 +- .../DotNet/Core/IdFactory/IdFactory.cs | 4 +- .../Network/Base/Server/SceneConfigInfo.cs | 10 +- .../DotNet/Core/Network/Base/Server/Server.cs | 29 +++-- .../Interface/Handler/IRouteMessageHandler.cs | 8 +- .../Core/Network/Message/MessageHelper.cs | 8 +- DotNet/Config/Binary/SceneConfigData.bytes | Bin 180 -> 141 bytes DotNet/Config/Excel/Server/SceneConfig.xlsx | Bin 10561 -> 10369 bytes DotNet/Config/Excel/Version.txt | 2 +- .../Config/Json/Server/SceneConfigData.Json | 9 +- .../ConfigTable/Entity/SceneConfig.cs | 6 +- .../src/Generate/CustomExport/SceneType.cs | 2 - .../src/Helper/AddressableSceneHelper.cs | 2 +- DotNet/Logic/src/Helper/ConfigTableSystem.cs | 4 +- DotNet/Logic/src/OnCreateScene.cs | 26 +--- 19 files changed, 134 insertions(+), 150 deletions(-) diff --git a/Assets/GameScripts/DotNet/Core/Entitas/Entity.cs b/Assets/GameScripts/DotNet/Core/Entitas/Entity.cs index 0b05f7f0..0d976beb 100644 --- a/Assets/GameScripts/DotNet/Core/Entitas/Entity.cs +++ b/Assets/GameScripts/DotNet/Core/Entitas/Entity.cs @@ -194,14 +194,14 @@ namespace TEngine public static T Create(Scene scene, bool isRunEvent = true) where T : Entity, new() { - var entity = Create(scene.RouteId, isRunEvent); + var entity = Create(scene.LocationId, isRunEvent); entity.Scene = scene; return entity; } public static T Create(Scene scene, long id, bool isRunEvent = true) where T : Entity, new() { - var entity = Create(id, scene.RouteId, isRunEvent); + var entity = Create(id, scene.LocationId, isRunEvent); entity.Scene = scene; return entity; } @@ -235,12 +235,12 @@ namespace TEngine return entity; } - private static T Create(long id, uint routeId, bool isRunEvent = true) where T : Entity, new() + protected static T Create(long id, uint locationId, bool isRunEvent = true) where T : Entity, new() { - return Create(id, IdFactory.NextEntityId(routeId), isRunEvent); + return Create(id, IdFactory.NextEntityId(locationId), isRunEvent); } - private static T Create(long id, long runtimeId, bool isRunEvent = true) where T : Entity, new() + protected static T Create(long id, long runtimeId, bool isRunEvent = true) where T : Entity, new() { var entity = Rent(typeof(T)); entity.Id = id; @@ -264,13 +264,6 @@ namespace TEngine return entity; } - protected static Scene CreateScene(long id, bool isRunEvent = true) - { - var entity = Create(id, id, isRunEvent); - entity.Scene = entity; - return entity; - } - #endregion #region Members @@ -293,12 +286,12 @@ namespace TEngine [BsonIgnore] [JsonIgnore] [IgnoreDataMember] - public Scene Scene { get; private set; } + public Scene Scene { get; protected set; } [BsonIgnore] [JsonIgnore] [IgnoreDataMember] - public Entity Parent { get; private set; } + public Entity Parent { get; protected set; } [BsonElement("t")] [BsonIgnoreIfNull] @@ -321,7 +314,7 @@ namespace TEngine public T AddComponent() where T : Entity, new() { - var entity = Create(Id, Scene.RouteId, false); + var entity = Create(Id, Scene.LocationId, false); AddComponent(entity); EntitiesSystem.Instance.Awake(entity); EntitiesSystem.Instance.StartUpdate(entity); @@ -330,7 +323,7 @@ namespace TEngine public T AddComponent(long id) where T : Entity, new() { - var entity = Create(id, Scene.RouteId, false); + var entity = Create(id, Scene.LocationId, false); AddComponent(entity); EntitiesSystem.Instance.Awake(entity); EntitiesSystem.Instance.StartUpdate(entity); @@ -538,7 +531,7 @@ namespace TEngine { Scene = scene; #if TENGINE_NET - RuntimeId = IdFactory.NextEntityId(scene.RouteId); + RuntimeId = IdFactory.NextEntityId(scene.LocationId); #else RuntimeId = IdFactory.NextRunTimeId(); #endif diff --git a/Assets/GameScripts/DotNet/Core/Entitas/Scene/Scene.cs b/Assets/GameScripts/DotNet/Core/Entitas/Scene/Scene.cs index b39d28f1..72d6fdb9 100644 --- a/Assets/GameScripts/DotNet/Core/Entitas/Scene/Scene.cs +++ b/Assets/GameScripts/DotNet/Core/Entitas/Scene/Scene.cs @@ -12,16 +12,15 @@ namespace TEngine public sealed class Scene : Entity, INotSupportedPool { public string Name { get; private set; } - public uint RouteId { get; private set; } + public uint LocationId { get; private set; } #if TENGINE_UNITY public Session Session { get; private set; } public SceneConfigInfo SceneInfo { get; private set; } #endif #if TENGINE_NET + public string SceneType { get; private set; } public World World { get; private set; } public Server Server { get; private set; } - public uint SceneConfigId { get; private set; } - public SceneConfigInfo SceneInfo => ConfigTableManage.SceneConfig(SceneConfigId); #endif public static readonly List Scenes = new List(); @@ -33,11 +32,11 @@ namespace TEngine } Name = null; - RouteId = 0; + this.LocationId = 0; #if TENGINE_NET World = null; Server = null; - SceneConfigId = 0; + SceneType = null; #endif #if TENGINE_UNITY SceneInfo = null; @@ -61,8 +60,10 @@ namespace TEngine #if TENGINE_UNITY public static Scene Create(string name) { - var runTimeId = IdFactory.NextRunTimeId(); - var scene = CreateScene(runTimeId); + var sceneId = IdFactory.NextRunTimeId(); + var scene = Create(sceneId, sceneId); + scene.Scene = scene; + scene.Parent = scene; scene.Name = name; Scenes.Add(scene); return scene; @@ -77,41 +78,81 @@ namespace TEngine } #else /// - /// 创建一个Scene + /// 创建一个Scene、但这个Scene是在某个Scene下面的Scene + /// + /// + /// + /// + /// + public static async FTask Create(Scene scene, string sceneType, string sceneName) + { + var newScene = Create(scene); + newScene.Scene = scene; + newScene.Parent = scene; + newScene.Name = sceneName; + newScene.SceneType = sceneType; + newScene.Server = scene.Server; + newScene.LocationId = scene.Server.Id; + + if (scene.World !=null) + { + newScene.World = scene.World; + } + + if (!string.IsNullOrEmpty(sceneType)) + { + await EventSystem.Instance.PublishAsync(new OnCreateScene(scene)); + } + + Scenes.Add(scene); + return scene; + } + + /// + /// 创建一个Scene。 /// /// + /// + /// + /// + /// + /// /// - /// - /// - /// + /// /// - public static async FTask Create(Server server, string outerBindIp, SceneConfigInfo sceneInfo, Action onSetNetworkComplete = null, bool runEvent = true) + public static async FTask Create(Server server, string sceneType, string sceneName, long sceneId =0, uint worldId =0, string networkProtocol = null, string outerBindIp = null, int outerPort = 0) { - var scene = CreateScene(sceneInfo.EntityId); - sceneInfo.Scene = scene; - scene.Name = sceneInfo.Name; - scene.RouteId = sceneInfo.RouteId; + if (sceneId == 0) + { + sceneId = new EntityIdStruct(server.Id, 0, 0); + } + + var scene = Create(sceneId, sceneId); + scene.Scene = scene; + scene.Parent = scene; + scene.Name = sceneName; + scene.SceneType = sceneType; scene.Server = server; - scene.SceneConfigId = sceneInfo.Id; + scene.LocationId = server.Id; - if (sceneInfo.WorldId != 0) + if (worldId != 0) { // 有可能不需要数据库、所以这里默认0的情况下就不创建数据库了 - scene.World = World.Create(sceneInfo.WorldId); + scene.World = World.Create(worldId); } - if (!string.IsNullOrEmpty(sceneInfo.NetworkProtocol) && !string.IsNullOrEmpty(outerBindIp) && sceneInfo.OuterPort != 0) + if (!string.IsNullOrEmpty(networkProtocol) && !string.IsNullOrEmpty(outerBindIp) && outerPort != 0) { // 设置Scene的网络、目前只支持KCP和TCP - var networkProtocolType = Enum.Parse(sceneInfo.NetworkProtocol); + var networkProtocolType = Enum.Parse(networkProtocol); var serverNetworkComponent = scene.AddComponent(); - var address = NetworkHelper.ToIPEndPoint($"{outerBindIp}:{sceneInfo.OuterPort}"); + var address = NetworkHelper.ToIPEndPoint($"{outerBindIp}:{outerPort}"); serverNetworkComponent.Initialize(networkProtocolType, NetworkTarget.Outer, address); } - if (runEvent && sceneInfo.SceneType != null) + if (!string.IsNullOrEmpty(sceneType)) { - switch (sceneInfo.SceneType) + switch (sceneType) { case "Addressable": { @@ -121,7 +162,7 @@ namespace TEngine default: { // 没有SceneType目前只有代码创建的Scene才会这样、目前只有Server的Scene是这样 - await EventSystem.Instance.PublishAsync(new OnCreateScene(sceneInfo, onSetNetworkComplete)); + await EventSystem.Instance.PublishAsync(new OnCreateScene(scene)); break; } } @@ -131,42 +172,14 @@ namespace TEngine return scene; } - /// - /// 一般用于创建临时Scene、如果不是必要不建议使用这个接口 - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public static async FTask Create(string name, Server server, long entityId, uint sceneConfigId = 0, string networkProtocol = null, string outerBindIp = null, int outerPort = 0, Action onSetNetworkComplete = null, bool runEvent = true) - { - var sceneInfo = new SceneConfigInfo() - { - Name = name, - EntityId = entityId, - Id = sceneConfigId, - NetworkProtocol = networkProtocol, - OuterPort = outerPort, - WorldId = ((EntityIdStruct)entityId).WordId - }; - - return await Create(server, outerBindIp, sceneInfo, onSetNetworkComplete, runEvent); - } - - public static List GetSceneInfoByRouteId(uint routeId) + public static List GetSceneInfoByServerConfigId(uint serverConfigId) { var list = new List(); var allSceneConfig = ConfigTableManage.AllSceneConfig(); foreach (var sceneConfigInfo in allSceneConfig) { - if (sceneConfigInfo.RouteId != routeId) + if (sceneConfigInfo.ServerConfigId != serverConfigId) { continue; } diff --git a/Assets/GameScripts/DotNet/Core/Entitas/Scene/SceneEvent.cs b/Assets/GameScripts/DotNet/Core/Entitas/Scene/SceneEvent.cs index 03f27b3a..20e7566c 100644 --- a/Assets/GameScripts/DotNet/Core/Entitas/Scene/SceneEvent.cs +++ b/Assets/GameScripts/DotNet/Core/Entitas/Scene/SceneEvent.cs @@ -5,13 +5,11 @@ namespace TEngine { public struct OnCreateScene { - public readonly SceneConfigInfo SceneInfo; - public readonly Action OnSetNetworkComplete; + public readonly Scene Scene; - public OnCreateScene(SceneConfigInfo sceneInfo, Action onSetNetworkComplete) + public OnCreateScene(Scene scene) { - SceneInfo = sceneInfo; - OnSetNetworkComplete = onSetNetworkComplete; + Scene = scene; } } } diff --git a/Assets/GameScripts/DotNet/Core/Exporter/Excel/ServerConfigTableManage.cs b/Assets/GameScripts/DotNet/Core/Exporter/Excel/ServerConfigTableManage.cs index c8b7c2ea..00d8b9d6 100644 --- a/Assets/GameScripts/DotNet/Core/Exporter/Excel/ServerConfigTableManage.cs +++ b/Assets/GameScripts/DotNet/Core/Exporter/Excel/ServerConfigTableManage.cs @@ -33,8 +33,6 @@ namespace TEngine.Core { var configFile = GetConfigPath(dataConfig); var bytes = File.ReadAllBytes(configFile); - // var data = (AProto) ProtoBufHelper.FromBytes(typeof(T), bytes, 0, bytes.Length); - // var data = ProtoBufHelper.FromBytes(bytes, 0, bytes.Length); var data = (T)ProtoBufHelper.FromBytes(typeof(T), bytes, 0, bytes.Length); data.AfterDeserialization(); ConfigDic[dataConfig] = data; diff --git a/Assets/GameScripts/DotNet/Core/IdFactory/EntityIdStruct.cs b/Assets/GameScripts/DotNet/Core/IdFactory/EntityIdStruct.cs index 976f20d0..a70153fb 100644 --- a/Assets/GameScripts/DotNet/Core/IdFactory/EntityIdStruct.cs +++ b/Assets/GameScripts/DotNet/Core/IdFactory/EntityIdStruct.cs @@ -14,26 +14,26 @@ namespace TEngine.Core public uint Time{ get; private set; } public uint Sequence{ get; private set; } - public uint RouteId { get; private set; } + public uint LocationId { get; private set; } - public ushort AppId => (ushort)(RouteId >> 10 & RouteIdStruct.MaskAppId); - public ushort WordId=> (ushort)(RouteId & RouteIdStruct.MaskWordId); + public ushort AppId => (ushort)(this.LocationId >> 10 & RouteIdStruct.MaskAppId); + public ushort WordId=> (ushort)(this.LocationId & RouteIdStruct.MaskWordId); public const int MaskRouteId = 0x3FFFF; public const int MaskSequence = 0xFFFF; - public EntityIdStruct(uint routeId, uint time, uint sequence) + public EntityIdStruct(uint locationId, uint time, uint sequence) { Time = time; Sequence = sequence; - RouteId = routeId; + LocationId = locationId; } public static implicit operator long(EntityIdStruct entityIdStruct) { ulong result = 0; result |= entityIdStruct.Sequence; - result |= (ulong)entityIdStruct.RouteId << 16; + result |= (ulong)entityIdStruct.LocationId << 16; result |= (ulong)entityIdStruct.Time << 34; return (long)result; } @@ -46,7 +46,7 @@ namespace TEngine.Core Sequence = (uint) (result & MaskSequence) }; result >>= 16; - idStruct.RouteId = (uint) (result & 0x3FFFF); + idStruct.LocationId = (uint) (result & 0x3FFFF); result >>= 18; idStruct.Time = (uint) result; return idStruct; diff --git a/Assets/GameScripts/DotNet/Core/IdFactory/IdFactory.cs b/Assets/GameScripts/DotNet/Core/IdFactory/IdFactory.cs index 504f19bc..d0f75865 100644 --- a/Assets/GameScripts/DotNet/Core/IdFactory/IdFactory.cs +++ b/Assets/GameScripts/DotNet/Core/IdFactory/IdFactory.cs @@ -32,7 +32,7 @@ namespace TEngine.Core return new RuntimeIdStruct(_lastRunTimeIdTime, _lastRunTimeIdSequence); } - public static long NextEntityId(uint routeId) + public static long NextEntityId(uint locationId) { var time = (uint)((TimeHelper.Now - Epoch2023) / 1000); @@ -47,7 +47,7 @@ namespace TEngine.Core _lastEntityIdSequence = 0; } - return new EntityIdStruct(routeId, _lastEntityIdTime, _lastEntityIdSequence); + return new EntityIdStruct(locationId, _lastEntityIdTime, _lastEntityIdSequence); } public static uint GetRouteId(long entityId) diff --git a/Assets/GameScripts/DotNet/Core/Network/Base/Server/SceneConfigInfo.cs b/Assets/GameScripts/DotNet/Core/Network/Base/Server/SceneConfigInfo.cs index 80fbed2d..3da40038 100644 --- a/Assets/GameScripts/DotNet/Core/Network/Base/Server/SceneConfigInfo.cs +++ b/Assets/GameScripts/DotNet/Core/Network/Base/Server/SceneConfigInfo.cs @@ -2,16 +2,14 @@ namespace TEngine { public class SceneConfigInfo { - public Scene Scene; - public long EntityId; - public uint Id; - public string SceneType; public string Name; - public string NetworkProtocol; - public uint RouteId; + public long EntityId; + public string SceneType; + public uint ServerConfigId; public uint WorldId; public int OuterPort; + public string NetworkProtocol; } } diff --git a/Assets/GameScripts/DotNet/Core/Network/Base/Server/Server.cs b/Assets/GameScripts/DotNet/Core/Network/Base/Server/Server.cs index b246a9aa..19f1d951 100644 --- a/Assets/GameScripts/DotNet/Core/Network/Base/Server/Server.cs +++ b/Assets/GameScripts/DotNet/Core/Network/Base/Server/Server.cs @@ -103,13 +103,13 @@ namespace TEngine private static readonly Dictionary Servers = new Dictionary(); - public static async FTask Create(uint routeId) + public static async FTask Create(uint serverConfigId) { - var serverConfigInfo = ConfigTableManage.ServerConfig(routeId); + var serverConfigInfo = ConfigTableManage.ServerConfig(serverConfigId); if (serverConfigInfo == null) { - Log.Error($"not found server by Id:{routeId}"); + Log.Error($"not found server by Id:{serverConfigId}"); return; } @@ -121,14 +121,14 @@ namespace TEngine return; } - var sceneInfos = Scene.GetSceneInfoByRouteId(routeId); - await Create(routeId, machineConfigInfo.InnerBindIP, serverConfigInfo.InnerPort, machineConfigInfo.OuterBindIP, sceneInfos); - // Log.Info($"ServerId:{routeId} is start complete"); + var sceneInfos = Scene.GetSceneInfoByServerConfigId(serverConfigId); + await Create(serverConfigId, machineConfigInfo.InnerBindIP, serverConfigInfo.InnerPort, machineConfigInfo.OuterBindIP, sceneInfos); + // Log.Info($"ServerId:{serverConfigId} is start complete"); } - public static async FTask Create(uint routeId, string innerBindIp, int innerPort, string outerBindIp, List sceneInfos) + public static async FTask Create(uint serverConfigId, string innerBindIp, int innerPort, string outerBindIp, List sceneInfos) { - if (Servers.TryGetValue(routeId, out var server)) + if (Servers.TryGetValue(serverConfigId, out var server)) { return server; } @@ -137,10 +137,10 @@ namespace TEngine server = new Server { - Id = routeId + Id = serverConfigId }; - server.Scene = await Scene.Create($"ServerScene{routeId}", server, new EntityIdStruct(routeId, 0, 0)); + server.Scene = await Scene.Create(server,null,$"ServerScene{serverConfigId}"); // 创建网络、Server下的网络只能是内部网络、外部网络是在Scene中定义 @@ -155,16 +155,17 @@ namespace TEngine foreach (var sceneConfig in sceneInfos) { - await Scene.Create(server, outerBindIp, sceneConfig); + await Scene.Create(server, sceneConfig.SceneType, sceneConfig.Name, sceneConfig.EntityId, + sceneConfig.WorldId, sceneConfig.NetworkProtocol, outerBindIp, sceneConfig.OuterPort); } - Servers.Add(routeId, server); + Servers.Add(serverConfigId, server); return server; } - public static Server Get(uint routeId) + public static Server Get(uint serverConfigId) { - return Servers.TryGetValue(routeId, out var server) ? server : null; + return Servers.TryGetValue(serverConfigId, out var server) ? server : null; } #endregion diff --git a/Assets/GameScripts/DotNet/Core/Network/Message/Interface/Handler/IRouteMessageHandler.cs b/Assets/GameScripts/DotNet/Core/Network/Message/Interface/Handler/IRouteMessageHandler.cs index bb362cdf..edfc26ce 100644 --- a/Assets/GameScripts/DotNet/Core/Network/Message/Interface/Handler/IRouteMessageHandler.cs +++ b/Assets/GameScripts/DotNet/Core/Network/Message/Interface/Handler/IRouteMessageHandler.cs @@ -41,7 +41,7 @@ namespace TEngine.Core.Network scene = entity.Scene; } - Log.Error($"SceneWorld:{session.Scene.World.Id} SceneRouteId:{scene.RouteId} SceneType:{scene.SceneInfo.SceneType} EntityId {tEntity.Id} : Error {e}"); + Log.Error($"SceneWorld:{session.Scene.World.Id} ServerConfigId:{scene.Server?.Id} SceneType:{scene.SceneType} EntityId {tEntity.Id} : Error {e}"); } } @@ -100,7 +100,7 @@ namespace TEngine.Core.Network scene = entity.Scene; } - Log.Error($"SceneWorld:{session.Scene.World.Id} SceneRouteId:{scene.RouteId} SceneType:{scene.SceneInfo.SceneType} EntityId {tEntity.Id} : Error {e}"); + Log.Error($"SceneWorld:{session.Scene.World?.Id} ServerConfigId:{scene.Server?.Id} SceneType:{scene.SceneType} EntityId {tEntity.Id} : Error {e}"); response.ErrorCode = CoreErrorCode.ErrRpcFail; } finally @@ -144,7 +144,7 @@ namespace TEngine.Core.Network scene = entity.Scene; } - Log.Error($"SceneWorld:{session.Scene.World?.Id} SceneRouteId:{scene.RouteId} SceneType:{scene.SceneInfo.SceneType} EntityId {tEntity.Id} : Error {e}"); + Log.Error($"SceneWorld:{session.Scene.World.Id} ServerConfigId:{scene.Server?.Id} SceneType:{scene.SceneType} EntityId {tEntity.Id} : Error {e}"); } finally { @@ -207,7 +207,7 @@ namespace TEngine.Core.Network scene = entity.Scene; } - Log.Error($"SceneWorld:{session.Scene.World.Id} SceneRouteId:{scene.RouteId} SceneType:{scene.SceneInfo.SceneType} EntityId {tEntity.Id} : Error {e}"); + Log.Error($"SceneWorld:{session.Scene.World?.Id} ServerConfigId:{scene.Server?.Id} SceneType:{scene.SceneType} EntityId {tEntity.Id} : Error {e}"); response.ErrorCode = CoreErrorCode.ErrRpcFail; } finally diff --git a/Assets/GameScripts/DotNet/Core/Network/Message/MessageHelper.cs b/Assets/GameScripts/DotNet/Core/Network/Message/MessageHelper.cs index 51fda256..809dfa82 100644 --- a/Assets/GameScripts/DotNet/Core/Network/Message/MessageHelper.cs +++ b/Assets/GameScripts/DotNet/Core/Network/Message/MessageHelper.cs @@ -35,7 +35,7 @@ public static class MessageHelper } EntityIdStruct entityIdStruct = entityId; - var session = scene.Server.GetSession(entityIdStruct.RouteId); + var session = scene.Server.GetSession(entityIdStruct.LocationId); session.Send(message, 0, entityId); } @@ -48,7 +48,7 @@ public static class MessageHelper } EntityIdStruct entityIdStruct = entityId; - var session = scene.Server.GetSession(entityIdStruct.RouteId); + var session = scene.Server.GetSession(entityIdStruct.LocationId); session.Send(message, 0, routeTypeOpCode, entityId); } @@ -81,7 +81,7 @@ public static class MessageHelper EntityIdStruct entityIdStruct = entityId; var rpcId = ++_rpcId; - var session = scene.Server.GetSession(entityIdStruct.RouteId); + var session = scene.Server.GetSession(entityIdStruct.LocationId); var requestCallback = FTask.Create(false); RequestCallback.Add(rpcId, MessageSender.Create(rpcId, requestType, requestCallback)); session.Send(request, rpcId, routeTypeOpCode, entityId); @@ -98,7 +98,7 @@ public static class MessageHelper EntityIdStruct entityIdStruct = entityId; var rpcId = ++_rpcId; - var session = scene.Server.GetSession(entityIdStruct.RouteId); + var session = scene.Server.GetSession(entityIdStruct.LocationId); var requestCallback = FTask.Create(false); RequestCallback.Add(rpcId, MessageSender.Create(rpcId, request, requestCallback)); session.Send(request, rpcId, entityId); diff --git a/DotNet/Config/Binary/SceneConfigData.bytes b/DotNet/Config/Binary/SceneConfigData.bytes index 06edf031424a64a2a3d51568f4eca85d9414a163..9db43dcaf810f7fd15eef22b94acae4754cb7b75 100644 GIT binary patch delta 6 NcmdnO*vmMf7XSz+0$~6E delta 46 vcmeBW+`>4aSDj0hgH52JpCK~7?&5hsjg=)eE~I?4@~ diff --git a/DotNet/Config/Excel/Server/SceneConfig.xlsx b/DotNet/Config/Excel/Server/SceneConfig.xlsx index 01c7df48075aee0b4af18c8ced220b9f3bfc895d..7aed6363b53b6f80af1b6e470cdf5e47b9bd31a8 100644 GIT binary patch delta 5911 zcmZ8lbx_pZ_g)(5RzMo0L%KT`SsLl?kXkxE2rleW0!s@>N;lGyqKI@iiXfc=D+|KU zciunV`F-!qxp(H&+?n&tGjpDPgO~aZg&5eQ#k`5gQVc!-nXYH1#S=M8osoi%+1PyO z=8-Cy>ZRGWBfgp>@{Qd~6UTlp#JeX%#IJMFxC}+IJZ$d7MTCE@cxJBo{>!98jh$0-u~d^Qlf30*w%S*Du=-~y{D9taekYf^VH49 zl@jfCw;5glNaGcIJLXsHW}+a)URuO%6jivYxOe9vMzjN05vCI{NetP2F#qnz?b0MK zr3=SVkFN~FCS)m^baQu|R*G(=m3X=R_4o6*-ys30$@+cmxwUw#5yO7&g+9+(f3^%6 zmw3*y<8TgkQQ8SiKHFE zDFp`v!led*9)XbL+;qqtY;vHG5I?KbsHUss&02hORvUjJZUTX;Xp`C+XBX?NR*(Py)3dDzUSsHEw>^%%v~Dy`$AIe{G-xaC2S$CFiG2JR3_H1|w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V8BUrXJlF;E{l>ec z5lXn1G)?J9#<=46j&Gz;7C3ovcT<0LL1OO5iFU2X!|Z91boo78s6JOvlnf`}IO6T{ z5wqz*euO3%mLFIR!};)@k9&qY?W5*R zt<3I@RCRCYj%p0TtD3qTa=wSjo5~7uSAj^lXo*|ocwehrpzv?X3K1AE*x1*_jY6!8 z@P)Q*2V^O5HOX85wrh{Cl2ASmut+@99l2)R1FHn)UBX_+Y(Jok7)-lBS@VCX6VM!m zu8?mO_vBog#~d~qPn6c04Adx!#(2kn7#{hMD&CfRu~hIYKJt|4V3D1Uq;C0)wCDS{ zF6AaZX1hf}2=S*(H=)Lmw_HSJb$5(bWS(ERe;LJK;>|v0OAXe6Z^cIbC<{MaaEh5} zjzMhsYYSd(K6Eb7F;lmZK-DQu+V)+YhFWwazUy7hMe1T&NF{Nctr@?W_gOvsLY=j{ zX6!kc_GT}Nye7?wF`%l-tQRtATE*(7thU0pt-_zB+z+Y+FKt>6uS>qyW=)=Si(3Br zEUJ{m6@4HfH2gky^60IuRZ5@0J-5^Ecb&eB(&SQaFUkMgr3C+N)3vNQ8F3^4-~oP4 zM-Giw*X-fN2|HE#8~(<7HrC%>&6)L_*-J(#`k02Qu|AnaKVjnh^po)~5jT}1kywk) z(b-~y8qI1v*r+dGgebBZRYc3^{o~EP?LgY4tZHs_SOzq3>u~dd{SYSkg~A<-GS0mR zyIocI5g{ZtyJa+<^w-H?+xVL=htIdCi=~dA(wo8WcXSd{^5@!% zs#txv_v3bz4Q1nv3?iBI)SxAgQvpEn&vOR!`wR_SJK1;6%cs zAr)QjD*P>lT*U_Dv(}42P?%pnM}-4zcQET+ec(2g0 v;b2z5SKQd}6jo-M|E2aHdh!1a{%>^jYxq2?8P@-8mf=!wB+!7&|8e>sZibmC diff --git a/DotNet/Config/Excel/Version.txt b/DotNet/Config/Excel/Version.txt index ec7fde68..a61a561f 100644 --- a/DotNet/Config/Excel/Version.txt +++ b/DotNet/Config/Excel/Version.txt @@ -1 +1 @@ -{"MachineConfig":1689771956715,"SceneConfig":1689619864417,"ServerConfig":1689620185714,"WorldConfig":1689267887552} \ No newline at end of file +{"MachineConfig":1690328264682,"SceneConfig":1690415187917,"ServerConfig":1690328264682,"WorldConfig":1690328264683} \ No newline at end of file diff --git a/DotNet/Config/Json/Server/SceneConfigData.Json b/DotNet/Config/Json/Server/SceneConfigData.Json index 8e087481..7aa3e0b3 100644 --- a/DotNet/Config/Json/Server/SceneConfigData.Json +++ b/DotNet/Config/Json/Server/SceneConfigData.Json @@ -1,7 +1,6 @@ {"List":[ -{"Id":1,"EntityId":17246978048,"RouteId":1024,"WorldId":0,"SceneType":"Gate","Name":"Gate","NetworkProtocol":"KCP","OuterPort":20000}, -{"Id":2,"EntityId":34493956096,"RouteId":2048,"WorldId":0,"SceneType":"Addressable","Name":"Addressable1","NetworkProtocol":null,"OuterPort":0}, -{"Id":4,"EntityId":68920803328,"RouteId":3072,"WorldId":0,"SceneType":"Map","Name":"Map1","NetworkProtocol":null,"OuterPort":0}, -{"Id":5,"EntityId":86167781376,"RouteId":4096,"WorldId":0,"SceneType":"Chat","Name":"Chat1","NetworkProtocol":null,"OuterPort":0}, -{"Id":6,"EntityId":103414759424,"RouteId":5120,"WorldId":0,"SceneType":"Gameplay","Name":"Gameplay1","NetworkProtocol":null,"OuterPort":0} +{"Id":1,"EntityId":17246978048,"ServerConfigId":1024,"WorldId":0,"SceneType":"Gate","Name":"Gate","NetworkProtocol":"KCP","OuterPort":20000}, +{"Id":2,"EntityId":34493956096,"ServerConfigId":2048,"WorldId":0,"SceneType":"Addressable","Name":"Addressable1","NetworkProtocol":null,"OuterPort":0}, +{"Id":4,"EntityId":68920803328,"ServerConfigId":3072,"WorldId":0,"SceneType":"Map","Name":"Map1","NetworkProtocol":null,"OuterPort":0}, +{"Id":5,"EntityId":86167781376,"ServerConfigId":4096,"WorldId":0,"SceneType":"Chat","Name":"Chat1","NetworkProtocol":null,"OuterPort":0} ]} diff --git a/DotNet/Logic/src/Generate/ConfigTable/Entity/SceneConfig.cs b/DotNet/Logic/src/Generate/ConfigTable/Entity/SceneConfig.cs index 8f64dcf4..9499190d 100644 --- a/DotNet/Logic/src/Generate/ConfigTable/Entity/SceneConfig.cs +++ b/DotNet/Logic/src/Generate/ConfigTable/Entity/SceneConfig.cs @@ -29,9 +29,9 @@ namespace TEngine public SceneConfig Get(uint id, bool check = true) { - if (this._configs.TryGetValue(id, out SceneConfig? config)) + if (_configs.ContainsKey(id)) { - return config; + return _configs[id]; } if (check) @@ -79,7 +79,7 @@ namespace TEngine [ProtoMember(2, IsRequired = true)] public long EntityId { get; set; } // 实体Id [ProtoMember(3, IsRequired = true)] - public uint RouteId { get; set; } // 路由Id + public uint ServerConfigId { get; set; } // 服务配置Id [ProtoMember(4, IsRequired = true)] public uint WorldId { get; set; } // 世界Id [ProtoMember(5, IsRequired = true)] diff --git a/DotNet/Logic/src/Generate/CustomExport/SceneType.cs b/DotNet/Logic/src/Generate/CustomExport/SceneType.cs index a0d59e7f..e4ccaa18 100644 --- a/DotNet/Logic/src/Generate/CustomExport/SceneType.cs +++ b/DotNet/Logic/src/Generate/CustomExport/SceneType.cs @@ -7,7 +7,6 @@ namespace TEngine public const int Addressable = 2; public const int Map = 3; public const int Chat = 4; - public const int Gameplay = 5; public static readonly Dictionary SceneDic = new Dictionary() { @@ -15,7 +14,6 @@ namespace TEngine { "Addressable", 2 }, { "Map", 3 }, { "Chat", 4 }, - { "Gameplay", 5 }, }; } } diff --git a/DotNet/Logic/src/Helper/AddressableSceneHelper.cs b/DotNet/Logic/src/Helper/AddressableSceneHelper.cs index ea3dddd1..9cb7b3a6 100644 --- a/DotNet/Logic/src/Helper/AddressableSceneHelper.cs +++ b/DotNet/Logic/src/Helper/AddressableSceneHelper.cs @@ -10,7 +10,7 @@ public static class AddressableSceneHelper var sceneEntityId = 0L; foreach (var sceneConfig in SceneConfigData.Instance.List) { - if (sceneConfig.RouteId == 3072) + if (sceneConfig.ServerConfigId == 3072) { sceneEntityId = sceneConfig.EntityId; break; diff --git a/DotNet/Logic/src/Helper/ConfigTableSystem.cs b/DotNet/Logic/src/Helper/ConfigTableSystem.cs index f149060a..9ccb9d11 100644 --- a/DotNet/Logic/src/Helper/ConfigTableSystem.cs +++ b/DotNet/Logic/src/Helper/ConfigTableSystem.cs @@ -74,7 +74,7 @@ public static class ConfigTableSystem SceneType = sceneConfig.SceneType, Name = sceneConfig.Name, NetworkProtocol = sceneConfig.NetworkProtocol, - RouteId = sceneConfig.RouteId, + ServerConfigId = sceneConfig.ServerConfigId, WorldId = sceneConfig.WorldId, OuterPort = sceneConfig.OuterPort }; @@ -126,7 +126,7 @@ public static class ConfigTableSystem SceneType = sceneConfig.SceneType, Name = sceneConfig.Name, NetworkProtocol = sceneConfig.NetworkProtocol, - RouteId = sceneConfig.RouteId, + ServerConfigId = sceneConfig.ServerConfigId, WorldId = sceneConfig.WorldId, OuterPort = sceneConfig.OuterPort }); diff --git a/DotNet/Logic/src/OnCreateScene.cs b/DotNet/Logic/src/OnCreateScene.cs index 21ed8d95..25458261 100644 --- a/DotNet/Logic/src/OnCreateScene.cs +++ b/DotNet/Logic/src/OnCreateScene.cs @@ -22,21 +22,15 @@ public enum SceneType: long /// Addressable = 1 << 2, - /// - /// 场景GamePlay - /// 游戏玩法服。 - /// - Gameplay = 1 << 3, - /// /// 游戏场景服。 /// - Map = 1 << 4, + Map = 1 << 3, /// /// 游戏聊天服。 /// - Chat = 1 << 5, + Chat = 1 << 4, } /// @@ -51,24 +45,16 @@ public class OnCreateScene : AsyncEventSystem // OnCreateScene这个事件就是给开发者使用的 // 比如Address协议这里、我就是做了一个管理Address地址的一个组件挂在到Address这个Scene下面了 // 比如Map下你需要一些自定义组件、你也可以在这里操作 - var sceneConfigInfo = self.SceneInfo; - - switch (sceneConfigInfo.SceneType.Parse()) + var scene = self.Scene; + switch (scene.SceneType.Parse()) { - case SceneType.Addressable: - { - sceneConfigInfo.Scene.AddComponent(); - break; - } case SceneType.Gate: { - sceneConfigInfo.Scene.AddComponent(); + self.Scene.AddComponent(); break; } - case SceneType.Gameplay: - break; } - Log.Info($"scene create: {self.SceneInfo.SceneType} {self.SceneInfo.Name} SceneId:{self.SceneInfo.Id} ServerId:{self.SceneInfo.RouteId} WorldId:{self.SceneInfo.WorldId}"); + Log.Info($"scene create: {self.Scene.SceneType} {self.Scene.Name} SceneId:{self.Scene.Id} LocationId:{self.Scene.LocationId} WorldId:{self.Scene.World?.Id}"); await FTask.CompletedTask; }