新增私聊相关

This commit is contained in:
2025-08-18 23:24:33 +08:00
parent 34b25273a7
commit 8122c577f6
68 changed files with 1442 additions and 467 deletions

View File

@@ -1,3 +1,4 @@
using System.Diagnostics;
using Fantasy;
using Fantasy.Async;
using Fantasy.Entitas;
@@ -73,6 +74,46 @@ public sealed class OnCreateSceneEvent : AsyncEventSystem<OnCreateScene>
}
case SceneType.Game:
{
// // Begins transaction
// using (var session = mongoClient.StartSession())
// {
// session.StartTransaction();
// try
// {
// // Creates sample data
// var book = new Book
// {
// Title = "Beloved",
// Author = "Toni Morrison",
// InStock = true
// };
// var film = new Film
// {
// Title = "Star Wars",
// Director = "George Lucas",
// InStock = true
// };
// // Inserts sample data
// books.InsertOne(session, book);
// films.InsertOne(session, film);
// // Commits our transaction
// session.CommitTransaction();
// }
// catch (Exception e)
// {
// Console.WriteLine("Error writing to MongoDB: " + e.Message);
// return;
// }
// // Prints a success message if no error thrown
// Console.WriteLine("Successfully committed transaction!");
// }
// var client = self.Scene.World.DataBase;
// List<FTask> tasks = new List<FTask>();
// Stopwatch stopwatch = new Stopwatch();
// stopwatch.Start();
// for (int i = 0; i < 100; i++)
// {
// var accountId = scene.EntityIdFactory.Create;
@@ -83,9 +124,15 @@ public sealed class OnCreateSceneEvent : AsyncEventSystem<OnCreateScene>
// account.Country = "cn";
// account.Exp = 999;
// account.Head = "xxx.png";
// await account.Save();
// tasks.Add(account.Save());
// }
// await FTask.WaitAll(tasks);
// // self.Scene.World.DataBase.InsertBatch()
//
// stopwatch.Stop();
// Log.Info($"创建100个号入库耗时={stopwatch.ElapsedMilliseconds}ms");
break;
}
case SceneType.Gate: