SwitchOnServer

This commit is contained in:
rawer470 2024-08-17 14:03:06 +03:00
parent 2cce4ea9b9
commit d95c65c12c
4 changed files with 32 additions and 7 deletions

View file

@ -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);

View file

@ -5,6 +5,5 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
/// </summary>
public class UpdateInteraction : UpdateData
{
public int IdEntity { get; set; }
public string UpdateType { get; set; }
public UpdateInteraction() { UpdateType = "UpdateInteraction"; }
}

View file

@ -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;
}

View file

@ -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()