mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 03:14:47 +00:00
36 lines
1022 B
C#
36 lines
1022 B
C#
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);
|
|
|
|
}
|
|
|
|
}
|
|
} |