diff --git a/ZoFo/GameCore/Client.cs b/ZoFo/GameCore/Client.cs index 6eedbed..312b50c 100644 --- a/ZoFo/GameCore/Client.cs +++ b/ZoFo/GameCore/Client.cs @@ -216,10 +216,10 @@ namespace ZoFo.GameCore (gameObjects.Last() as Entity).SetIdByClient((update as UpdateGameObjectCreated).IdEntity); } - else if (update is UpdateGameOBjectWithoutIdCreated) + else if (update is UpdateGameObjectWithoutIdCreated) { - Type t = Type.GetType("ZoFo.GameCore.GameObjects." + (update as UpdateGameOBjectWithoutIdCreated).GameObjectClassName); - GameObject gameObject = Activator.CreateInstance(t, (update as UpdateGameOBjectWithoutIdCreated).position.GetVector2()) as GameObject; + Type t = Type.GetType("ZoFo.GameCore.GameObjects." + (update as UpdateGameObjectWithoutIdCreated).GameObjectClassName); + GameObject gameObject = Activator.CreateInstance(t, (update as UpdateGameObjectWithoutIdCreated).position.GetVector2()) as GameObject; if (gameObject is Particle) particles.Add(gameObject as Particle); } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs index 33bed8e..2d0c82a 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs @@ -145,6 +145,10 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager update = token.ToObject(); data.Add(update); break; + case "UpdateStopObjectCreated": + update = token.ToObject(); + data.Add(update); + break; case "UpdateInteractionReady": update = token.ToObject(); data.Add(update); diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameOBjectWithoutIdCreated.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameOBjectWithoutIdCreated.cs index f5a3a88..a7e0722 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameOBjectWithoutIdCreated.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateGameOBjectWithoutIdCreated.cs @@ -7,9 +7,9 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient /// /// Хранит новое сосотяние анимации /// - public class UpdateGameOBjectWithoutIdCreated : UpdateData + public class UpdateGameObjectWithoutIdCreated : UpdateData { - public UpdateGameOBjectWithoutIdCreated() { UpdateType = "UpdateGameOBjectWithoutIdCreated"; } + public UpdateGameObjectWithoutIdCreated() { UpdateType = "UpdateGameObjectWithoutIdCreated"; } public string GameObjectClassName { get; set; } public SerializableVector2 position { get; set; } } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/UpdateData.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/UpdateData.cs index f5edbe8..23a1555 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/UpdateData.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/UpdateData.cs @@ -18,7 +18,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates [JsonDerivedType(typeof(UpdateInteraction))] [JsonDerivedType(typeof(UpdateInteractionReady))] [JsonDerivedType(typeof(UpdateLoot))] - [JsonDerivedType(typeof(UpdateGameOBjectWithoutIdCreated))] + [JsonDerivedType(typeof(UpdateGameObjectWithoutIdCreated))] [JsonDerivedType(typeof(UpdatePlayerParametrs))] [JsonDerivedType(typeof(UpdatePosition))] [JsonDerivedType(typeof(UpdateStopObjectCreated))] diff --git a/ZoFo/GameCore/Server.cs b/ZoFo/GameCore/Server.cs index 10afa6e..0f41fe6 100644 --- a/ZoFo/GameCore/Server.cs +++ b/ZoFo/GameCore/Server.cs @@ -215,7 +215,7 @@ namespace ZoFo.GameCore if (gameObject is Particle) { - AddData(new UpdateGameOBjectWithoutIdCreated() + AddData(new UpdateGameObjectWithoutIdCreated() { GameObjectClassName = gameObject.GetType().Name, position = gameObject.position.Serialize()