From 269905b3399597ecf60e8fa5d65235da238b43bd Mon Sep 17 00:00:00 2001 From: Mootfrost777 Date: Mon, 19 Aug 2024 00:41:26 +0300 Subject: [PATCH] Add recursive load of animations --- .../GameManagers/NetworkManager/ClientNetworkManager.cs | 2 +- .../GameManagers/NetworkManager/ServerNetworkManager.cs | 2 +- ZoFo/GameCore/Graphics/AnimationBuilder.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs index b8e3737..85d8a19 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs @@ -124,7 +124,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager while(socket.Connected) { byte[] bytes = new byte[65535]; - var countAnsw = socket.Receive(bytes, SocketFlags.Partial); //Вылетает если кто то закрыл + var countAnsw = socket.Receive(bytes); //Вылетает если кто то закрыл string update = Encoding.UTF8.GetString(bytes, 0, countAnsw); // обновление отосланные сервером GetDataSent(update); } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs b/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs index e8be1b5..366bafc 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs @@ -171,7 +171,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager while (client.Connected) { var buff = new byte[65535]; - var answ = client.Receive(buff, SocketFlags.Partial); + var answ = client.Receive(buff); string response = Encoding.UTF8.GetString(buff, 0, answ); GetDataSend(response); } diff --git a/ZoFo/GameCore/Graphics/AnimationBuilder.cs b/ZoFo/GameCore/Graphics/AnimationBuilder.cs index 50f9162..6dd24de 100644 --- a/ZoFo/GameCore/Graphics/AnimationBuilder.cs +++ b/ZoFo/GameCore/Graphics/AnimationBuilder.cs @@ -12,7 +12,7 @@ namespace ZoFo.GameCore.Graphics public void LoadAnimations() { Animations = new List(); - string[] animationFilesNames = Directory.GetFiles(Path.Combine(AppContext.BaseDirectory, "Content", "Textures", "Animations")); + string[] animationFilesNames = Directory.GetFiles(Path.Combine(AppContext.BaseDirectory, "Content", "Textures", "Animations"), "*.animation", SearchOption.AllDirectories); StreamReader reader; foreach (var fileName in animationFilesNames)