diff --git a/ZoFo/GameCore/Client.cs b/ZoFo/GameCore/Client.cs index 5d054b3..ff0a36b 100644 --- a/ZoFo/GameCore/Client.cs +++ b/ZoFo/GameCore/Client.cs @@ -197,6 +197,7 @@ namespace ZoFo.GameCore } else if (update is UpdateGameObjectCreated) { + //TODO Entity created_gameObject; if ((update as UpdateGameObjectCreated).GameObjectType == "Player") { diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectDeleted.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectDeleted.cs index d149be8..121e8df 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectDeleted.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameObjectDeleted.cs @@ -12,6 +12,6 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient public class UpdateGameObjectDeleted : UpdateData { public UpdateGameObjectDeleted() { UpdateType = "UpdateGameObjectDeleted"; isImportant = false; } - public string GameObjectType; + public string GameObjectType { get; set; } } } \ No newline at end of file diff --git a/ZoFo/GameCore/GameObjects/Entities/Entity.cs b/ZoFo/GameCore/GameObjects/Entities/Entity.cs index 97630bf..fc7cea8 100644 --- a/ZoFo/GameCore/GameObjects/Entities/Entity.cs +++ b/ZoFo/GameCore/GameObjects/Entities/Entity.cs @@ -59,7 +59,10 @@ namespace ZoFo.GameCore.GameObjects public virtual void Delete() { - AppManager.Instance.server.DeleteObject(this); + if (AppManager.Instance.gamestate == GameState.HostPlaying) + { + AppManager.Instance.server.DeleteObject(this); + } } } } diff --git a/ZoFo/GameCore/GameObjects/GameObject.cs b/ZoFo/GameCore/GameObjects/GameObject.cs index 225db2a..b94b084 100644 --- a/ZoFo/GameCore/GameObjects/GameObject.cs +++ b/ZoFo/GameCore/GameObjects/GameObject.cs @@ -44,7 +44,10 @@ public abstract class GameObject public void Instantiate(GameObject gameObject) { - AppManager.Instance.server.RegisterGameObject(gameObject); + if (AppManager.Instance.gamestate == GameState.HostPlaying) + { + AppManager.Instance.server.RegisterGameObject(gameObject); + } } #endregion diff --git a/ZoFo/GameCore/Server.cs b/ZoFo/GameCore/Server.cs index 01265ef..7e4be00 100644 --- a/ZoFo/GameCore/Server.cs +++ b/ZoFo/GameCore/Server.cs @@ -123,6 +123,7 @@ namespace ZoFo.GameCore networkManager.StartGame(); new MapManager().LoadMap(); + //TODO //AppManager.Instance.server.RegisterGameObject(new EntittyForAnimationTests(new Vector2(0, 0))); AppManager.Instance.server.RegisterGameObject(new Player(new Vector2(760, 140))); //for (int i = 0; i < 20; i++)