mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
@@ -8,7 +8,7 @@ namespace Game.Plugins.App
|
||||
|
||||
public static readonly JNGSocket Socket = new JNGSocket();
|
||||
public static readonly JNGSyncFrame Sync = new JNGSyncFrame();
|
||||
public static readonly JAPI Api = new(new JAPIConfig(){BaseURL = "http://192.168.0.120:8080"});
|
||||
public static readonly JAPI Api = new(new JAPIConfig(){BaseURL = "http://127.0.0.1:8080"});
|
||||
public static readonly EventDispatcher Event = EventDispatcher.Event;
|
||||
|
||||
public static SystemBase[] System()
|
||||
|
@@ -8,7 +8,7 @@ namespace Game.Plugins.App
|
||||
protected override async UniTask<string> GetUrl()
|
||||
{
|
||||
await UniTask.NextFrame();
|
||||
return "ws://192.168.0.120:8080/websocket";
|
||||
return "ws://127.0.0.1:8080/websocket";
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using System;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Plugins.JNGame.Network.Action;
|
||||
using Plugins.JNGame.Sync.Frame;
|
||||
using UnityEngine;
|
||||
@@ -16,17 +17,23 @@ namespace Game.Plugins.App
|
||||
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 })
|
||||
try
|
||||
{
|
||||
JNFrameInfos info = JNFrameInfos.Parser.ParseFrom(data);
|
||||
Debug.Log($"OnServerData - {start} 结束");
|
||||
return info;
|
||||
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
|
||||
catch(Exception e)
|
||||
{
|
||||
return new JNFrameInfos();
|
||||
// ignored
|
||||
Debug.LogError(e.Message);
|
||||
}
|
||||
|
||||
return new JNFrameInfos();
|
||||
}
|
||||
}
|
||||
}
|
@@ -23,7 +23,7 @@ namespace Game.Plugins.App.Sync
|
||||
.Where(item => !(item is IJNSyncFrameComponent))
|
||||
.Where(item => !(item is Transform))
|
||||
.Where(item => !(allow.Contains(item)));
|
||||
|
||||
|
||||
Debug.Log($"{this.NID} 有{Components.Count()}组件不是同步组件 尝试接管同步 请保证被接管的组件有enabled 同时被接管的组件 enabled 禁止修改");
|
||||
|
||||
foreach (var component in Components)
|
||||
|
Reference in New Issue
Block a user