diff --git a/ZoFo/GameCore/GUI/SelectModeMenu.cs b/ZoFo/GameCore/GUI/SelectModeMenu.cs index 726a261..84290a8 100644 --- a/ZoFo/GameCore/GUI/SelectModeMenu.cs +++ b/ZoFo/GameCore/GUI/SelectModeMenu.cs @@ -64,12 +64,14 @@ public class SelectModeMenu : AbstractGUI optionButton.LeftButtonPressed += () => { // multi - Server server = new Server(); //Server Logic SinglePlayer + Server server = new Server(); //Server Logic MultiPlayer Client client = new Client(); - server.CreateRoom(1); - client.JoinYourself(); + server.CreateRoom(5); + client.JoinRoom("127.0.0.1"); //указать айпишник AppManager.Instance.SetServer(server); AppManager.Instance.SetClient(client); + string key = client.IsConnected.ToString(); + AppManager.Instance.debugHud.Set(key, "MultiPlayer"); // ваш код здесь }; Elements.Add(optionButton); diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/IUpdateData.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/IUpdateData.cs index a90aaf4..5c363d7 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/IUpdateData.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/IUpdateData.cs @@ -17,8 +17,10 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates [JsonDerivedType(typeof(UpdateLoot))] [JsonDerivedType(typeof(UpdatePlayerParametrs))] [JsonDerivedType(typeof(UpdatePosition))] + [JsonDerivedType(typeof(UpdateTileCreated))] [JsonDerivedType(typeof(UpdateInput))] [JsonDerivedType(typeof(UpdatePlayerExit))] + public interface IUpdateData { public int IdEntity { get; set; } //Id объекта diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateTileCreated.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateTileCreated.cs new file mode 100644 index 0000000..796683d --- /dev/null +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ServerToClient/UpdateTileCreated.cs @@ -0,0 +1,21 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json.Serialization; +using System.Threading.Tasks; +using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ClientToServer; + +namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient +{ + + public class UpdateTileCreated : IUpdateData + { + public int IdEntity { get; set; } + public string UpdateType { get; set; } + public Texture2D TextureTile { get; set; } + public Vector2 Position { get; set; } + } +}