From 3849435115c3f41cbb2c4e5d24e989384de721e6 Mon Sep 17 00:00:00 2001 From: rawer470 Date: Sat, 17 Aug 2024 11:24:12 +0300 Subject: [PATCH 1/6] MbReadyMultiPlayer --- ZoFo/GameCore/Client.cs | 4 ++ ZoFo/GameCore/GUI/SelectingServerGUI.cs | 49 ++++++++++++++--------- ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs | 33 ++++++++++++--- 3 files changed, 62 insertions(+), 24 deletions(-) diff --git a/ZoFo/GameCore/Client.cs b/ZoFo/GameCore/Client.cs index f49020f..64d088c 100644 --- a/ZoFo/GameCore/Client.cs +++ b/ZoFo/GameCore/Client.cs @@ -14,6 +14,8 @@ using ZoFo.GameCore.GameObjects.MapObjects.Tiles; using System.Drawing; using System.Reflection; using ZoFo.GameCore.GameObjects.Entities; +using System.Net.Sockets; +using System.Net; namespace ZoFo.GameCore { @@ -22,6 +24,8 @@ namespace ZoFo.GameCore ClientNetworkManager networkManager; public bool IsConnected { get { return networkManager.IsConnected; } } + public IPEndPoint InfoConnect => networkManager.InfoConnect; + public Client() { networkManager = new ClientNetworkManager(); diff --git a/ZoFo/GameCore/GUI/SelectingServerGUI.cs b/ZoFo/GameCore/GUI/SelectingServerGUI.cs index fafc259..f2c911c 100644 --- a/ZoFo/GameCore/GUI/SelectingServerGUI.cs +++ b/ZoFo/GameCore/GUI/SelectingServerGUI.cs @@ -21,14 +21,14 @@ public class SelectingServerGUI : AbstractGUI { int width = AppManager.Instance.CurentScreenResolution.X; int height = AppManager.Instance.CurentScreenResolution.Y; - + menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures/GUI/background/join" }; Elements.Add(menuBackground); menuBackground.LoadTexture(AppManager.Instance.Content); - - Elements.Add(new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 7, (int)(width / 4), (int)(height / 20)), text = "Select server", fontColor = Color.White, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts/Font"}); - TextBox ipBox = new TextBox(Manager) + Elements.Add(new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 7, (int)(width / 4), (int)(height / 20)), text = "Select server", fontColor = Color.White, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts/Font" }); + + TextBox ipBox = new TextBox(Manager) { rectangle = new Rectangle(width / 4 - (width / 4) / 2, height / 4, (int)(width / 4), (int)(height / 20)), text = "ip", @@ -38,13 +38,15 @@ public class SelectingServerGUI : AbstractGUI textAligment = MonogameLibrary.UI.Enums.TextAligment.Left, fontName = "Fonts/Font" }; - ipBox.TextChanged += input => { + ipBox.TextChanged += input => + { if (input == "ip") { ipBox.text = ""; ipBox.fontColor = Color.White; } }; - ipBox.StopChanging += input => { + ipBox.StopChanging += input => + { if (input.Length == 0) { ipBox.fontColor = Color.White; @@ -52,7 +54,7 @@ public class SelectingServerGUI : AbstractGUI } }; Elements.Add(ipBox); - Button joinButton = new Button(Manager) + Button joinButton = new Button(Manager) { rectangle = new Rectangle(width / 4 + (width / 4) / 2, height / 4, (int)(width / 15), (int)(height / 20)), text = "Join", @@ -61,23 +63,34 @@ public class SelectingServerGUI : AbstractGUI mainColor = Color.Gray, fontName = "Fonts/Font" }; - joinButton.LeftButtonPressed += () => + joinButton.LeftButtonPressed += () => { // join Client client = new Client(); - var endpoint = ipBox.text.Split(':'); + var endpoint = ipBox.text.Split(':'); int port; - if (int.TryParse(endpoint[1], out port)) + try { - client.JoinRoom(endpoint[0], port); - AppManager.Instance.SetClient(client); - AppManager.Instance.SetGUI(new WaitingForPlayersGUI(false)); + if (int.TryParse(endpoint[1], out port)) + { + client.JoinRoom(endpoint[0], port); + AppManager.Instance.SetClient(client); + Server server = new Server(); + AppManager.Instance.SetServer(server); + AppManager.Instance.SetGUI(new WaitingForPlayersGUI(false)); + } } + catch (Exception) + { + + // throw; + } + // ваш код здесь }; Elements.Add(joinButton); - Button hostButton = new Button(Manager) + Button hostButton = new Button(Manager) { rectangle = new Rectangle(width / 4 + (width / 4) / 2 + (width / 15), height / 4, (int)(width / 15), (int)(height / 20)), text = "Host", @@ -86,9 +99,9 @@ public class SelectingServerGUI : AbstractGUI mainColor = Color.Gray, fontName = "Fonts/Font" }; - hostButton.LeftButtonPressed += () => + hostButton.LeftButtonPressed += () => { - + // host Server server = new Server(); //Server Logic MultiPlayer server.CreateRoom(5); @@ -99,9 +112,9 @@ public class SelectingServerGUI : AbstractGUI AppManager.Instance.SetGUI(new WaitingForPlayersGUI(true)); }; Elements.Add(hostButton); - + Button bTExit = new Button(Manager) - { fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures/GUI/checkboxs_off"}; + { fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures/GUI/checkboxs_off" }; Elements.Add(bTExit); bTExit.LeftButtonPressed += () => { diff --git a/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs b/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs index 12a67b9..dd9cd13 100644 --- a/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs +++ b/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs @@ -31,12 +31,13 @@ public class WaitingForPlayersGUI : AbstractGUI menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures\\GUI\\background\\Waiting" }; Elements.Add(menuBackground); menuBackground.LoadTexture(AppManager.Instance.Content); - // string pcIp = - ip = new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 7, (int)(width / 4), (int)(height / 20)), text = AppManager.Instance.server.MyIp.ToString(), fontColor = Color.White, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts\\Font3" }; - Elements.Add(ip); + // string pcIp = + if (isHost) { - Button startButton = new Button(Manager) + ip = new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 7, (int)(width / 4), (int)(height / 20)), text = AppManager.Instance.server.MyIp.ToString(), fontColor = Color.White, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts\\Font3" }; + Elements.Add(ip); + Button startButton = new Button(Manager) { rectangle = new Rectangle(width / 2 - (width / 15) / 2, height / 2 + height / 4, (int)(width / 15), (int)(height / 20)), text = "Start", @@ -45,14 +46,34 @@ public class WaitingForPlayersGUI : AbstractGUI mainColor = Color.Gray, fontName = "Fonts/Font" }; - startButton.LeftButtonPressed += () => + startButton.LeftButtonPressed += () => { // start - + // ваш код здесь }; Elements.Add(startButton); } + else { + ip = new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 7, (int)(width / 4), (int)(height / 20)), text = AppManager.Instance.client.InfoConnect.ToString(), fontColor = Color.White, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts\\Font3" }; + Elements.Add(ip); + Button waitButton = new Button(Manager) + { + rectangle = new Rectangle(width / 2 - (width / 15) / 2, height / 2 + height / 4, (int)(width / 15), (int)(height / 20)), + text = "WAITING", + scale = 0.3f, + fontColor = Color.White, + mainColor = Color.Gray, + fontName = "Fonts/Font" + }; + waitButton.LeftButtonPressed += () => + { + // start + + // ваш код здесь + }; + Elements.Add(waitButton); + } Button bTExit = new Button(Manager) { fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures/GUI/checkboxs_off"}; From 2cce4ea9b92ce1ab434ed0a5a7f66b9ee3ece531 Mon Sep 17 00:00:00 2001 From: rawer470 Date: Sat, 17 Aug 2024 12:25:53 +0300 Subject: [PATCH 2/6] CreateConnectMultiplayer --- ZoFo/GameCore/GUI/SelectingServerGUI.cs | 8 +++----- ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs | 4 ++-- ZoFo/GameCore/GameManagers/AppManager.cs | 2 +- .../GameManagers/NetworkManager/ServerNetworkManager.cs | 7 +++++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ZoFo/GameCore/GUI/SelectingServerGUI.cs b/ZoFo/GameCore/GUI/SelectingServerGUI.cs index f2c911c..717e2b3 100644 --- a/ZoFo/GameCore/GUI/SelectingServerGUI.cs +++ b/ZoFo/GameCore/GUI/SelectingServerGUI.cs @@ -32,11 +32,11 @@ public class SelectingServerGUI : AbstractGUI { rectangle = new Rectangle(width / 4 - (width / 4) / 2, height / 4, (int)(width / 4), (int)(height / 20)), text = "ip", - scale = 0.2f, + scale = 0.5f, fontColor = Color.White, mainColor = Color.Gray, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left, - fontName = "Fonts/Font" + fontName = "Fonts/Font3" }; ipBox.TextChanged += input => { @@ -76,8 +76,6 @@ public class SelectingServerGUI : AbstractGUI { client.JoinRoom(endpoint[0], port); AppManager.Instance.SetClient(client); - Server server = new Server(); - AppManager.Instance.SetServer(server); AppManager.Instance.SetGUI(new WaitingForPlayersGUI(false)); } } @@ -104,7 +102,7 @@ public class SelectingServerGUI : AbstractGUI // host Server server = new Server(); //Server Logic MultiPlayer - server.CreateRoom(5); + server.CreateRoom(1); AppManager.Instance.SetServer(server); string key = server.MyIp.ToString(); AppManager.Instance.debugHud.Set(key, "MultiPlayer"); diff --git a/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs b/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs index dd9cd13..7bcf287 100644 --- a/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs +++ b/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs @@ -49,7 +49,7 @@ public class WaitingForPlayersGUI : AbstractGUI startButton.LeftButtonPressed += () => { // start - + AppManager.Instance.ChangeState(GameState.HostPlaying); // ваш код здесь }; Elements.Add(startButton); @@ -69,7 +69,7 @@ public class WaitingForPlayersGUI : AbstractGUI waitButton.LeftButtonPressed += () => { // start - + AppManager.Instance.ChangeState(GameState.ClientPlaying); // ваш код здесь }; Elements.Add(waitButton); diff --git a/ZoFo/GameCore/GameManagers/AppManager.cs b/ZoFo/GameCore/GameManagers/AppManager.cs index fba2e17..48d923c 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/ServerNetworkManager.cs b/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs index 76e72c2..1d0ae62 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs @@ -142,13 +142,16 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager for (int i = 0; i < playNumber; i++) { Socket client = socket.Accept(); + AppManager.Instance.debugHud.Set("Connect", client.ToString()); Thread thread = new Thread(StartListening); thread.IsBackground = true; thread.Start(client); managerThread.Add(client, thread); - clients.Add(client); //добавляем клиентов в лист + clients.Add(client); + //AppManager.Instance.ChangeState(GameState.HostPlaying); + //добавляем клиентов в лист } - + AppManager.Instance.ChangeState(GameState.HostPlaying); } /// From d95c65c12caf72d0adab18479b03ea9113727125 Mon Sep 17 00:00:00 2001 From: rawer470 Date: Sat, 17 Aug 2024 14:03:06 +0300 Subject: [PATCH 3/6] SwitchOnServer --- ZoFo/GameCore/GameManagers/AppManager.cs | 2 +- .../ServerToClient/UpdateInteraction.cs | 3 +- .../ServerToClient/UpdateInteractionReady.cs | 2 +- ZoFo/GameCore/Server.cs | 32 +++++++++++++++++-- 4 files changed, 32 insertions(+), 7 deletions(-) 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 From 6c07557debc9b118356457768ba85c1518b6bbf5 Mon Sep 17 00:00:00 2001 From: rawer470 Date: Sat, 17 Aug 2024 19:02:02 +0300 Subject: [PATCH 4/6] FixGetIp --- .../GameManagers/NetworkManager/ServerNetworkManager.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs b/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs index 1d0ae62..9ea5de2 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs @@ -53,8 +53,9 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager /// public static IPAddress GetIp() { - string hostName = Dns.GetHostName(); // Retrive the Name of HOST - string myIP = Dns.GetHostByName(hostName).AddressList[1].ToString();// Get the IP + string hostName = Dns.GetHostName(); // Retrive the Name of HOST + var ipList = Dns.GetHostByName(hostName).AddressList; + string myIP = ipList[ipList.Count()-1].ToString();// Get the IP return IPAddress.Parse(myIP); } From a06f9c7ddb738f048bc707b5c7e786d1794dfa1d Mon Sep 17 00:00:00 2001 From: rawer470 Date: Sat, 17 Aug 2024 22:25:03 +0300 Subject: [PATCH 5/6] MaybeFinallyMultiplayer --- ZoFo/GameCore/GUI/SelectingServerGUI.cs | 5 ++++- ZoFo/GameCore/GameManagers/AppManager.cs | 4 ++-- .../GameManagers/NetworkManager/ServerNetworkManager.cs | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ZoFo/GameCore/GUI/SelectingServerGUI.cs b/ZoFo/GameCore/GUI/SelectingServerGUI.cs index 717e2b3..9460341 100644 --- a/ZoFo/GameCore/GUI/SelectingServerGUI.cs +++ b/ZoFo/GameCore/GUI/SelectingServerGUI.cs @@ -102,8 +102,11 @@ public class SelectingServerGUI : AbstractGUI // host Server server = new Server(); //Server Logic MultiPlayer - server.CreateRoom(1); + Client client = new Client(); + server.CreateRoom(2); + client.JoinYourself(server.MyIp.Port); AppManager.Instance.SetServer(server); + AppManager.Instance.SetClient(client); string key = server.MyIp.ToString(); AppManager.Instance.debugHud.Set(key, "MultiPlayer"); // ваш код здесь diff --git a/ZoFo/GameCore/GameManagers/AppManager.cs b/ZoFo/GameCore/GameManagers/AppManager.cs index fba2e17..f328803 100644 --- a/ZoFo/GameCore/GameManagers/AppManager.cs +++ b/ZoFo/GameCore/GameManagers/AppManager.cs @@ -91,7 +91,7 @@ namespace ZoFo.GameCore.GameManagers Keyboard.GetState().IsKeyDown(Keys.Escape)) { server.CloseConnection(); Exit(); } - debugHud.Set("key", "value"); + // debugHud.Set("key", "value"); InputManager.Update(); currentGUI.Update(gameTime); @@ -104,7 +104,7 @@ namespace ZoFo.GameCore.GameManagers client.Update(gameTime); break; case GameState.ClientPlaying: - server.Update(gameTime); + client.Update(gameTime); break; default: break; diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs b/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs index 9ea5de2..f6452af 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs @@ -143,7 +143,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager for (int i = 0; i < playNumber; i++) { Socket client = socket.Accept(); - AppManager.Instance.debugHud.Set("Connect", client.ToString()); + AppManager.Instance.debugHud.Set("Connect", client.LocalEndPoint.ToString()); Thread thread = new Thread(StartListening); thread.IsBackground = true; thread.Start(client); From 0afee1fb815ba052433c1d4d322b021f96edf84d Mon Sep 17 00:00:00 2001 From: rawer470 Date: Sun, 18 Aug 2024 10:43:02 +0300 Subject: [PATCH 6/6] WorkConnectMultiPlayer --- .../GameManagers/NetworkManager/ClientNetworkManager.cs | 2 +- .../GameManagers/NetworkManager/ServerNetworkManager.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs index 2a93f71..9c6137b 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs @@ -108,7 +108,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager while(socket.Connected) { byte[] bytes = new byte[2048]; - var countAnsw = socket.Receive(bytes); + var countAnsw = socket.Receive(bytes); //Вылетает если кто то закрыл string update = Encoding.UTF8.GetString(bytes, 0, countAnsw); // обновление отосланные сервером GetDataSent(update); } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs b/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs index f6452af..dcdaf1c 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs @@ -71,7 +71,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager } updates.Clear(); return; //TODO TODO REMOVE TO ADD NETWORK TODO REMOVE TO ADD NETWORK TODO REMOVE TO ADD NETWORK TODO REMOVE TO ADD NETWORK - + //Что это? //по 10 паков за раз TODO FIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXIT List datasToSend = new List(); for (int i = 0; i < 5 && i