JisolGame/JNFrame2/Assets/Scripts/Game/Data/DStateDataSystem.cs

36 lines
1022 B
C#
Raw Normal View History

2024-08-17 14:27:18 +08:00
using System.Collections.Generic;
using AppGame;
using Google.Protobuf;
using JNGame.Sync.Entity;
using JNGame.Sync.State.Tile.Entity;
using JNGame.Sync.System.Data;
using Plugins.JNGame.Network.Action;
namespace Game.JNGState.Logic.Data
{
public abstract class DStateDataSystem<T,E> : STileDataSystem<T,E> where T : ISTileData,new() where E : JNTileEntity, new()
{
protected DStateDataSystem(SStateDataEnum type) : base(type)
{
}
public override void OnSendUBytes(Dictionary<long, byte[]> bytes)
{
JNStateItemData data = new JNStateItemData();
data.NetID = NetID;
foreach (var byteItem in bytes)
{
data.Messages.Add(byteItem.Key,new JNStateData()
{
Data = ByteString.CopyFrom(byteItem.Value)
});
}
App.Server.AllSend((int)NActionEnum.NSyncStateDataUpdate,data);
}
}
}