mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交demo
This commit is contained in:
@@ -177,13 +177,13 @@ namespace AppGame.Sync
|
||||
|
||||
if (IsTileConnect(index))
|
||||
{
|
||||
Debug.Log($"[{index}] 连接 Socket");
|
||||
App.Client.AddClient(client);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Sockets.Remove(index);
|
||||
Debug.Log("获取连接失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -192,6 +192,7 @@ namespace AppGame.Sync
|
||||
{
|
||||
if (Sockets.TryGetValue(index,out var client))
|
||||
{
|
||||
Debug.Log($"[{index}] 卸载 Socket");
|
||||
App.Client.RemoveClient(client);
|
||||
}
|
||||
Sockets.Remove(index);
|
||||
|
@@ -128,11 +128,14 @@ namespace AppGame.Sync
|
||||
{
|
||||
|
||||
//插入未处理输入
|
||||
foreach (var input in Inputs)
|
||||
lock (Inputs)
|
||||
{
|
||||
GetSystem<DInputSystem>().Enqueue(input);
|
||||
foreach (var input in Inputs)
|
||||
{
|
||||
GetSystem<DInputSystem>().Enqueue(input);
|
||||
}
|
||||
Inputs.Clear();
|
||||
}
|
||||
Inputs.Clear();
|
||||
base.OnRunSimulate();
|
||||
|
||||
}
|
||||
@@ -202,13 +205,13 @@ namespace AppGame.Sync
|
||||
TileServerInfo info = message.data;
|
||||
if (info is not null)
|
||||
{
|
||||
Debug.Log($"[{index}] 连接 Socket");
|
||||
client.SetPoint($"{info.ip}:{info.port}");
|
||||
await client.OnInit();
|
||||
}
|
||||
else
|
||||
{
|
||||
Sockets.Remove(index);
|
||||
Debug.Log("获取连接失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -217,6 +220,7 @@ namespace AppGame.Sync
|
||||
{
|
||||
if (Sockets.TryGetValue(index,out var client))
|
||||
{
|
||||
Debug.Log($"[{index}] 卸载 Socket");
|
||||
client.OnClose();
|
||||
}
|
||||
Sockets.Remove(index);
|
||||
|
Reference in New Issue
Block a user