diff --git a/ZoFo/GameCore/Server.cs b/ZoFo/GameCore/Server.cs index 5385ce5..5fcb39c 100644 --- a/ZoFo/GameCore/Server.cs +++ b/ZoFo/GameCore/Server.cs @@ -16,6 +16,7 @@ namespace ZoFo.GameCore public class Server { private ServerNetworkManager networkManager; + private int ticks = 0; public Server() { networkManager = new ServerNetworkManager(); @@ -61,12 +62,20 @@ namespace ZoFo.GameCore private List entities; //entity public void Update(GameTime gameTime) { - foreach (var go in gameObjects) + if (ticks == 3) //ОБРАБАТЫВАЕТСЯ 20 РАЗ В СЕКУНДУ { - go.UpdateLogic(gameTime); + foreach (var go in gameObjects) + { + go.UpdateLogic(gameTime); + } + ticks = 0; + networkManager.SendData(); } + ticks++; } + + /// /// Регистрирует игровой объект ///