mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-26 18:26:23 +00:00
还没有完全解决
This commit is contained in:
@@ -106,7 +106,7 @@ namespace JNGame.Sync.System.Data
|
||||
base.OnUByteUpdate(bytes);
|
||||
if (isServer)
|
||||
{
|
||||
OnDataSyncContext();
|
||||
OnDataSyncContext(bytes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,11 +206,24 @@ namespace JNGame.Sync.System.Data
|
||||
/// <summary>
|
||||
/// 将数据Data同步到Context
|
||||
/// </summary>
|
||||
protected virtual void OnDataSyncContext()
|
||||
protected virtual void OnDataSyncContext(Dictionary<ulong, byte[]> bytes = null)
|
||||
{
|
||||
|
||||
Dictionary<ulong, T> lIsTileData = new Dictionary<ulong, T>(Data);
|
||||
|
||||
//同步删除
|
||||
if (bytes is not null)
|
||||
{
|
||||
foreach (var keyValue in bytes)
|
||||
{
|
||||
E entity;
|
||||
if (SDByteOperate.IsDelete(keyValue.Value) && (entity = NodeContext.Query(keyValue.Key)) is not null)
|
||||
{
|
||||
entity.Destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NodeContext.GetEntities().ForEach(child =>
|
||||
{
|
||||
//如果有则删除
|
||||
|
Reference in New Issue
Block a user