mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-26 18:26:23 +00:00
提交无缝数据回滚
This commit is contained in:
@@ -20,6 +20,7 @@ namespace AppGame
|
||||
|
||||
//获取ID
|
||||
public UniTask<NewsContext<int>> NSyncTileId = App.API.GetNews<int>($"/sync/tile/id");
|
||||
public UniTask<NewsContext<int>> NSyncTileRandomId = App.API.GetNews<int>($"/sync/tile/random/id");
|
||||
//获取端口
|
||||
public UniTask<NewsContext<int>> NSyncTilePort = App.API.GetNews<int>($"/sync/tile/port");
|
||||
//获取默认连接
|
||||
|
@@ -49,6 +49,8 @@ namespace AppGame.Sync
|
||||
protected override async Task OnInit()
|
||||
{
|
||||
|
||||
RandomSize = (await App.GAPI.NSyncTileRandomId).data;
|
||||
|
||||
await base.OnInit();
|
||||
|
||||
if (isRecover)
|
||||
@@ -67,7 +69,7 @@ namespace AppGame.Sync
|
||||
{
|
||||
Debug.Log("[JNGTileServerSystem] 获取到恢复数据成功 正在恢复数据");
|
||||
|
||||
var message = new Dictionary<long, byte[]>();
|
||||
var message = new Dictionary<ulong, byte[]>();
|
||||
tileInfo.Data.Data.ForEach(frame =>
|
||||
{
|
||||
message.Clear();
|
||||
|
@@ -115,7 +115,7 @@ namespace AppGame.Systems
|
||||
/// </summary>
|
||||
public void AddState(JNStateItemData frame)
|
||||
{
|
||||
var message = new Dictionary<long, byte[]>();
|
||||
var message = new Dictionary<ulong, byte[]>();
|
||||
foreach (var data in frame.Messages)
|
||||
{
|
||||
message.Add(data.Key,data.Value.Data.ToByteArray());
|
||||
|
@@ -45,9 +45,9 @@ namespace Game.JNGState.Logic.Data
|
||||
|
||||
public override int NetID => (int)NetDataEnum.EDNodeData;
|
||||
|
||||
public override Dictionary<long, EDNodeData> GetLatest()
|
||||
public override Dictionary<ulong, EDNodeData> GetLatest()
|
||||
{
|
||||
var nodes = new Dictionary<long, EDNodeData>();
|
||||
var nodes = new Dictionary<ulong, EDNodeData>();
|
||||
NodeContext.GetEntities().ForEach(child =>
|
||||
{
|
||||
if (nodes.ContainsKey(child.Id))
|
||||
|
@@ -70,9 +70,9 @@ namespace Game.JNGState.Logic.Data
|
||||
public override JNTileContext<EDPlayer> NodeContext => Contexts.GetContext<EDPlayerContext>();
|
||||
|
||||
|
||||
public override Dictionary<long, EDPlayerData> GetLatest()
|
||||
public override Dictionary<ulong, EDPlayerData> GetLatest()
|
||||
{
|
||||
var nodes = new Dictionary<long, EDPlayerData>();
|
||||
var nodes = new Dictionary<ulong, EDPlayerData>();
|
||||
NodeContext.GetEntities().ForEach(child =>
|
||||
{
|
||||
nodes.Add(child.Id,new EDPlayerData(child));
|
||||
|
@@ -110,7 +110,7 @@ namespace Game.JNGState.Logic.Data
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnSendUBytes(Dictionary<long, byte[]> bytes)
|
||||
public override void OnSendUBytes(Dictionary<ulong, byte[]> bytes)
|
||||
{
|
||||
|
||||
JNStateItemData data = new JNStateItemData();
|
||||
|
@@ -70,35 +70,35 @@ namespace Game.JNGFrame.Logic.System
|
||||
}
|
||||
|
||||
//添加避障
|
||||
public void AddAgent(long id,LVector3 start)
|
||||
public void AddAgent(ulong id,LVector3 start)
|
||||
{
|
||||
Root.AddAgent(id,new RcVec3f(start.x,start.y,start.z));
|
||||
}
|
||||
public void AddAgent(long id,LVector3 start,DtCrowdAgentParams agentParams)
|
||||
public void AddAgent(ulong id,LVector3 start,DtCrowdAgentParams agentParams)
|
||||
{
|
||||
Root.AddAgent(id,new RcVec3f(start.x,start.y,start.z),agentParams);
|
||||
}
|
||||
|
||||
//删除避障
|
||||
public void DelAgent(long id)
|
||||
public void DelAgent(ulong id)
|
||||
{
|
||||
Root.DelAgent(id);
|
||||
}
|
||||
|
||||
//移动避障
|
||||
public void MoveAgent(long id,LVector3 move)
|
||||
public void MoveAgent(ulong id,LVector3 move)
|
||||
{
|
||||
Root.MoveAgent(id,new RcVec3f(move.x,move.y,move.z));
|
||||
}
|
||||
|
||||
//向量移动避障
|
||||
public void VectorMoveAgent(long id,LVector2 vector)
|
||||
public void VectorMoveAgent(ulong id,LVector2 vector)
|
||||
{
|
||||
Root.VectorMoveAgent(id,new RcVec3f(vector.x,0,vector.y));
|
||||
}
|
||||
|
||||
//获取避障
|
||||
public DtCrowdAgent GetAgent(long id)
|
||||
public DtCrowdAgent GetAgent(ulong id)
|
||||
{
|
||||
return Root.GetAgent(id);
|
||||
}
|
||||
|
Reference in New Issue
Block a user