房间创建和进入相关逻辑和协议

This commit is contained in:
2025-08-27 00:04:40 +08:00
parent 7325e268ce
commit f6d85a1e0a
45 changed files with 1246 additions and 729 deletions

View File

@@ -6,6 +6,7 @@ using Fantasy.Event;
using Fantasy.Helper;
using Fantasy.Serialize;
using NB.Game;
using NB.Map;
using ProtoBuf;
namespace NB;
@@ -66,6 +67,14 @@ public sealed class OnCreateSceneEvent : AsyncEventSystem<OnCreateScene>
case SceneType.Map:
{
Log.Debug($"Map Scene SceneRuntimeId:{scene.RuntimeId}");
// uint serverId = 25255;
// for (int i = 1; i < 65535; i++)
// {
// var roomId = RoomHelper.GenerateCode(serverId, i);
// RoomHelper.ParseCode(roomId, out var pId, out var rId);
// Log.Info($"生成id测试房间id={roomId} 原始服务id{serverId} 原始房间id={i} 解析={pId} {rId}");
// }
break;
}
case SceneType.Social:
@@ -74,7 +83,6 @@ public sealed class OnCreateSceneEvent : AsyncEventSystem<OnCreateScene>
}
case SceneType.Game:
{
// // Begins transaction
// using (var session = mongoClient.StartSession())
// {
@@ -131,8 +139,8 @@ public sealed class OnCreateSceneEvent : AsyncEventSystem<OnCreateScene>
//
// stopwatch.Stop();
// Log.Info($"创建100个号入库耗时={stopwatch.ElapsedMilliseconds}ms");
break;
}
case SceneType.Gate: