From 4d6c32bd3737be45651d4373676b8dc454f076f4 Mon Sep 17 00:00:00 2001 From: Mootfrost777 Date: Fri, 16 Aug 2024 23:52:51 +0300 Subject: [PATCH] Fix server --- .../Updates/ServerToClient/UpdateInteraction.cs | 2 +- .../Updates/ServerToClient/UpdateInteractionAvailable.cs | 2 +- ZoFo/GameCore/GameObjects/GameObject.cs | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs index 6c87be3..6b3f9cc 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs @@ -1,6 +1,6 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient; -public class UpdateInteraction : IUpdateData // при попытке взаимодействия с объектом +public class UpdateInteraction : UpdateData // при попытке взаимодействия с объектом { public int IdEntity { get; set; } public string UpdateType { get; set; } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs index 26471f5..3b7787b 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionAvailable.cs @@ -1,7 +1,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient; public class UpdateInteractionAvailable(int idEntity, bool isReady) - : IUpdateData // при изменении возможности повзаимодействовать с объектом + : UpdateData // при изменении возможности повзаимодействовать с объектом { public int IdEntity { get; set; } = idEntity; public string UpdateType { get; set; } diff --git a/ZoFo/GameCore/GameObjects/GameObject.cs b/ZoFo/GameCore/GameObjects/GameObject.cs index 01dce1b..4847052 100644 --- a/ZoFo/GameCore/GameObjects/GameObject.cs +++ b/ZoFo/GameCore/GameObjects/GameObject.cs @@ -12,7 +12,6 @@ public abstract class GameObject { public Vector2 position; - private Server server; public Vector2 rotation; //вектор направления объекта public abstract GraphicsComponent graphicsComponent { get; } @@ -20,8 +19,7 @@ public abstract class GameObject public GameObject(Vector2 position) { this.position = position; - server = new Server(); - server.RegisterGameObject(this); + AppManager.Instance.server.RegisterGameObject(this); graphicsComponent.LoadContent(); }