diff --git a/ZoFo/GameCore/GameManagers/AppManager.cs b/ZoFo/GameCore/GameManagers/AppManager.cs index 48d923c..fba2e17 100644 --- a/ZoFo/GameCore/GameManagers/AppManager.cs +++ b/ZoFo/GameCore/GameManagers/AppManager.cs @@ -101,7 +101,7 @@ namespace ZoFo.GameCore.GameManagers break; case GameState.HostPlaying: server.Update(gameTime); - // client.Update(gameTime); + client.Update(gameTime); break; case GameState.ClientPlaying: server.Update(gameTime); diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs index e42f0f4..96ecef2 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteraction.cs @@ -5,6 +5,5 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient; /// public class UpdateInteraction : UpdateData { - public int IdEntity { get; set; } - public string UpdateType { get; set; } + public UpdateInteraction() { UpdateType = "UpdateInteraction"; } } \ No newline at end of file diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionReady.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionReady.cs index db4d01d..591bc1b 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionReady.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateInteractionReady.cs @@ -9,6 +9,6 @@ public class UpdateInteractionReady(int idEntity, bool isReady) : UpdateData { public int IdEntity { get; set; } = idEntity; - public string UpdateType { get; set; } + public string UpdateType { get; set; } = "UpdateInteractionReady"; public bool IsReady { get; set; } = isReady; } \ No newline at end of file diff --git a/ZoFo/GameCore/Server.cs b/ZoFo/GameCore/Server.cs index 4bea6cc..8dd53dc 100644 --- a/ZoFo/GameCore/Server.cs +++ b/ZoFo/GameCore/Server.cs @@ -21,7 +21,7 @@ namespace ZoFo.GameCore { private ServerNetworkManager networkManager; private int ticks = 0; - public IPEndPoint MyIp { get { return networkManager.InfoConnect; } } + public IPEndPoint MyIp { get { return networkManager.InfoConnect; } } public Server() { networkManager = new ServerNetworkManager(); @@ -46,6 +46,32 @@ namespace ZoFo.GameCore { //ТУТ Switch case будет честное слово + switch (updateData.UpdateType) + { + case "UpdateAnimation": + break; + case "UpdateEntityHealth": + break; + case "UpdateGameEnded": + break; + case "UpdateGameObjectCreated": + break; + case "UpdateGameObjectDeleted": + break; + case "UpdateInteraction": + break; + case "UpdateInteractionReady": + break; + case "UpdateLoot": + break; + case "UpdatePlayerParametrs": + break; + case "UpdatePosition": + break; + case "UpdateTileCreated": + break; + + } } public void CloseConnection() @@ -136,8 +162,8 @@ namespace ZoFo.GameCore AddData(new UpdateGameObjectCreated() { GameObjectType = gameObject.GetType().Name } - ); - + ); + } } #endregion