mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 03:14:47 +00:00
30 lines
870 B
C#
30 lines
870 B
C#
using Cysharp.Threading.Tasks;
|
|
using Plugins.JNGame.Sync.Frame;
|
|
using UnityEngine;
|
|
|
|
namespace Script.AppImpl
|
|
{
|
|
public class JNGSyncFrame : JNSyncFrame
|
|
{
|
|
protected override void OnSendInput(JNFrameInputs inputs)
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
protected override async UniTask<JNFrameInfos> OnServerData(int start, int end)
|
|
{
|
|
Debug.Log($"OnServerData - {start}");
|
|
var data = (await App.Api.GetByte($"/sync/frame?start={start}"));
|
|
if (data is { Length: > 0 })
|
|
{
|
|
JNFrameInfos info = JNFrameInfos.Parser.ParseFrom(data);
|
|
Debug.Log($"OnServerData - {start} 结束");
|
|
return info;
|
|
}
|
|
else
|
|
{
|
|
return new JNFrameInfos();
|
|
}
|
|
}
|
|
}
|
|
} |