diff --git a/ZoFo/Content/Content.mgcb b/ZoFo/Content/Content.mgcb index 07a0dca..271558f 100644 --- a/ZoFo/Content/Content.mgcb +++ b/ZoFo/Content/Content.mgcb @@ -362,6 +362,141 @@ /processorParam:ResizeToPowerOfTwo=False /processorParam:MakeSquare=False /processorParam:TextureFormat=Color +<<<<<<< HEAD +======= +/build:Textures/GUI/switch.png + +#begin Textures/icons/12.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/icons/12.png + +#begin Textures/icons/13.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/icons/13.png + +#begin Textures/icons/14.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/icons/14.png + +#begin Textures/icons/21.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/icons/21.png + +#begin Textures/icons/22.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/icons/22.png + +#begin Textures/icons/5.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/icons/5.png + +#begin Textures/icons/6.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/icons/6.png + +#begin Textures/icons/7.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/icons/7.png + +#begin Textures/icons/8.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/icons/8.png + +#begin Textures/icons/9.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/icons/9.png + +#begin Textures/Test/pickaxe.webp +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +>>>>>>> aa6f003605d9e74d99ed25af0bb80ad8f16a352d /build:Textures/Test/pickaxe.webp #begin Textures/Test/rock.jpg @@ -400,7 +535,11 @@ /processorParam:TextureFormat=Color /build:Textures/Test/wood.jpg +<<<<<<< HEAD #begin Textures/TileSetImages/Pipes.png +======= +#begin Textures/TileSets/Tilelist1.png +>>>>>>> aa6f003605d9e74d99ed25af0bb80ad8f16a352d /importer:TextureImporter /processor:TextureProcessor /processorParam:ColorKeyColor=255,0,255,255 @@ -410,9 +549,11 @@ /processorParam:ResizeToPowerOfTwo=False /processorParam:MakeSquare=False /processorParam:TextureFormat=Color + /build:Textures/TileSetImages/Pipes.png #begin Textures/TileSetImages/Tilelist1.png + /importer:TextureImporter /processor:TextureProcessor /processorParam:ColorKeyColor=255,0,255,255 @@ -422,9 +563,14 @@ /processorParam:ResizeToPowerOfTwo=False /processorParam:MakeSquare=False /processorParam:TextureFormat=Color +<<<<<<< HEAD /build:Textures/TileSetImages/Tilelist1.png #begin Textures/TileSetImages/Tilelist2.png +======= +/build:Textures/TileSets/Tilelist2.png + +#begin Textures/TileSets/Tilelist3.png /importer:TextureImporter /processor:TextureProcessor /processorParam:ColorKeyColor=255,0,255,255 @@ -434,6 +580,44 @@ /processorParam:ResizeToPowerOfTwo=False /processorParam:MakeSquare=False /processorParam:TextureFormat=Color +/build:Textures/TileSets/Tilelist3.png + +#begin Textures/TileSets/Tilelist4.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/TileSets/Tilelist4.png + +#begin Textures/TileSets/TilesetFloor.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/TileSets/TilesetFloor.png + +#begin Textures/TileSets/TilesetFloor.png +>>>>>>> aa6f003605d9e74d99ed25af0bb80ad8f16a352d +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +<<<<<<< HEAD /build:Textures/TileSetImages/Tilelist2.png #begin Textures/TileSetImages/Tilelist3.png @@ -651,4 +835,7 @@ /processorParam:MakeSquare=False /processorParam:TextureFormat=Color /build:Textures/TileSetImages/TilesetWater.png +======= +/build:Textures/TileSets/TilesetFloor.png +>>>>>>> aa6f003605d9e74d99ed25af0bb80ad8f16a352d diff --git a/ZoFo/Content/Textures/TileSetImages/Pipes.png b/ZoFo/Content/Textures/TileSets/Pipes.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/Pipes.png rename to ZoFo/Content/Textures/TileSets/Pipes.png diff --git a/ZoFo/Content/Textures/TileSetImages/Tilelist1.png b/ZoFo/Content/Textures/TileSets/Tilelist1.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/Tilelist1.png rename to ZoFo/Content/Textures/TileSets/Tilelist1.png diff --git a/ZoFo/Content/Textures/TileSetImages/Tilelist2.png b/ZoFo/Content/Textures/TileSets/Tilelist2.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/Tilelist2.png rename to ZoFo/Content/Textures/TileSets/Tilelist2.png diff --git a/ZoFo/Content/Textures/TileSetImages/Tilelist3.png b/ZoFo/Content/Textures/TileSets/Tilelist3.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/Tilelist3.png rename to ZoFo/Content/Textures/TileSets/Tilelist3.png diff --git a/ZoFo/Content/Textures/TileSetImages/Tilelist4.png b/ZoFo/Content/Textures/TileSets/Tilelist4.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/Tilelist4.png rename to ZoFo/Content/Textures/TileSets/Tilelist4.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetDesert.png b/ZoFo/Content/Textures/TileSets/TilesetDesert.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetDesert.png rename to ZoFo/Content/Textures/TileSets/TilesetDesert.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetDungeon.png b/ZoFo/Content/Textures/TileSets/TilesetDungeon.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetDungeon.png rename to ZoFo/Content/Textures/TileSets/TilesetDungeon.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetElement.png b/ZoFo/Content/Textures/TileSets/TilesetElement.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetElement.png rename to ZoFo/Content/Textures/TileSets/TilesetElement.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetField.png b/ZoFo/Content/Textures/TileSets/TilesetField.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetField.png rename to ZoFo/Content/Textures/TileSets/TilesetField.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetFloor.png b/ZoFo/Content/Textures/TileSets/TilesetFloor.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetFloor.png rename to ZoFo/Content/Textures/TileSets/TilesetFloor.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetFloorB.png b/ZoFo/Content/Textures/TileSets/TilesetFloorB.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetFloorB.png rename to ZoFo/Content/Textures/TileSets/TilesetFloorB.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetFloorDetail.png b/ZoFo/Content/Textures/TileSets/TilesetFloorDetail.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetFloorDetail.png rename to ZoFo/Content/Textures/TileSets/TilesetFloorDetail.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetHole.png b/ZoFo/Content/Textures/TileSets/TilesetHole.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetHole.png rename to ZoFo/Content/Textures/TileSets/TilesetHole.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetHouse.png b/ZoFo/Content/Textures/TileSets/TilesetHouse.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetHouse.png rename to ZoFo/Content/Textures/TileSets/TilesetHouse.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetLogic.png b/ZoFo/Content/Textures/TileSets/TilesetLogic.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetLogic.png rename to ZoFo/Content/Textures/TileSets/TilesetLogic.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetNature.png b/ZoFo/Content/Textures/TileSets/TilesetNature.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetNature.png rename to ZoFo/Content/Textures/TileSets/TilesetNature.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetRelief.png b/ZoFo/Content/Textures/TileSets/TilesetRelief.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetRelief.png rename to ZoFo/Content/Textures/TileSets/TilesetRelief.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetReliefDetail.png b/ZoFo/Content/Textures/TileSets/TilesetReliefDetail.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetReliefDetail.png rename to ZoFo/Content/Textures/TileSets/TilesetReliefDetail.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetTowers.png b/ZoFo/Content/Textures/TileSets/TilesetTowers.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetTowers.png rename to ZoFo/Content/Textures/TileSets/TilesetTowers.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetVillageAbandoned.png b/ZoFo/Content/Textures/TileSets/TilesetVillageAbandoned.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetVillageAbandoned.png rename to ZoFo/Content/Textures/TileSets/TilesetVillageAbandoned.png diff --git a/ZoFo/Content/Textures/TileSetImages/TilesetWater.png b/ZoFo/Content/Textures/TileSets/TilesetWater.png similarity index 100% rename from ZoFo/Content/Textures/TileSetImages/TilesetWater.png rename to ZoFo/Content/Textures/TileSets/TilesetWater.png diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs index 84b8750..1f1e787 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs @@ -100,8 +100,16 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager { 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("127.0.0.1"); + + foreach (var ip in ipList) + { + if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) + { + return ip; + } + } + return IPAddress.Loopback; + } //поток 2 diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs b/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs index a6c1a96..e625ce4 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/ServerNetworkManager.cs @@ -54,8 +54,15 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager { 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("127.0.0.1"); + + foreach (var ip in ipList) + { + if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) + { + return ip; + } + } + return IPAddress.Loopback; } /// diff --git a/ZoFo/GameCore/GameManagers/SoundManager.cs b/ZoFo/GameCore/GameManagers/SoundManager.cs index 7e8d408..da8880b 100644 --- a/ZoFo/GameCore/GameManagers/SoundManager.cs +++ b/ZoFo/GameCore/GameManagers/SoundManager.cs @@ -9,6 +9,7 @@ using System.Linq; using Newtonsoft.Json; using Microsoft.Xna.Framework.Media; +using ZoFo.GameCore.GUI; namespace ZoFo.GameCore.GameManagers { @@ -21,15 +22,14 @@ namespace ZoFo.GameCore.GameManagers public void LoadSounds() // метод для загрузки звуков из папки { //List sounds = AppManager.Instance.Content.Load>("sounds/"); - - var k = Directory.GetFiles(Directory.GetCurrentDirectory() + "//Content//sounds").Where(x => x.EndsWith("xnb")); + var k = Directory.GetFiles(Path.Combine(AppContext.BaseDirectory, "Content", "sounds")).Where(x => x.EndsWith("xnb")); if (k.Count() > 0) { string[] soundFiles = k.Select(x => x.Split("\\").Last().Split("/").Last().Replace(".xnb", "")).ToArray();// папка со звуками там где exe foreach (var soundFile in soundFiles) { - Sounds.Add(soundFile, AppManager.Instance.Content.Load("sounds//" + soundFile)); + Sounds.Add(soundFile, AppManager.Instance.Content.Load(Path.Combine("sounds", soundFile))); } }