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; break;
case GameState.HostPlaying: case GameState.HostPlaying:
server.Update(gameTime); server.Update(gameTime);
// client.Update(gameTime); client.Update(gameTime);
break; break;
case GameState.ClientPlaying: case GameState.ClientPlaying:
server.Update(gameTime); server.Update(gameTime);

View file

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

View file

@ -9,6 +9,6 @@ public class UpdateInteractionReady(int idEntity, bool isReady)
: UpdateData : UpdateData
{ {
public int IdEntity { get; set; } = idEntity; public int IdEntity { get; set; } = idEntity;
public string UpdateType { get; set; } public string UpdateType { get; set; } = "UpdateInteractionReady";
public bool IsReady { get; set; } = isReady; public bool IsReady { get; set; } = isReady;
} }

View file

@ -21,7 +21,7 @@ namespace ZoFo.GameCore
{ {
private ServerNetworkManager networkManager; private ServerNetworkManager networkManager;
private int ticks = 0; private int ticks = 0;
public IPEndPoint MyIp { get { return networkManager.InfoConnect; } } public IPEndPoint MyIp { get { return networkManager.InfoConnect; } }
public Server() public Server()
{ {
networkManager = new ServerNetworkManager(); networkManager = new ServerNetworkManager();
@ -46,6 +46,32 @@ namespace ZoFo.GameCore
{ {
//ТУТ Switch case будет честное слово //ТУТ 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() public void CloseConnection()
@ -136,8 +162,8 @@ namespace ZoFo.GameCore
AddData(new UpdateGameObjectCreated() AddData(new UpdateGameObjectCreated()
{ GameObjectType = gameObject.GetType().Name } { GameObjectType = gameObject.GetType().Name }
); );
} }
} }
#endregion #endregion