diff --git a/ZoFo/GameCore/Client.cs b/ZoFo/GameCore/Client.cs index 3716e15..f8a9288 100644 --- a/ZoFo/GameCore/Client.cs +++ b/ZoFo/GameCore/Client.cs @@ -7,7 +7,7 @@ namespace ZoFo.GameCore public void GameEndedUnexpectedly(){ } - public void JoinRoom() { } + public void JoinRoom(){ } public void JoinYourself(){ } } diff --git a/ZoFo/GameCore/GameManagers/MapManager/MapElements/Chunk.cs b/ZoFo/GameCore/GameManagers/MapManager/MapElements/Chunk.cs new file mode 100644 index 0000000..6337d3c --- /dev/null +++ b/ZoFo/GameCore/GameManagers/MapManager/MapElements/Chunk.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZoFo.GameCore.GameManagers.MapManager.MapElements +{ + public class Chunk + { + public int[] Data { get; set; } + public int Height { get; set; } + public int Width { get; set; } + public int X { get; set; } + public int Y { get; set; } + } +} diff --git a/ZoFo/GameCore/GameManagers/MapManager/MapElements/Layer.cs b/ZoFo/GameCore/GameManagers/MapManager/MapElements/Layer.cs new file mode 100644 index 0000000..f598efe --- /dev/null +++ b/ZoFo/GameCore/GameManagers/MapManager/MapElements/Layer.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZoFo.GameCore.GameManagers.MapManager.MapElements +{ + public class Layer + { + public List Chunks { get; set; } + public int Height { get; set; } + public int Width { get; set; } + public int Id { get; set; } + public bool Visibility { get; set; } + } +} diff --git a/ZoFo/GameCore/GameManagers/MapManager/MapElements/TileMap.cs b/ZoFo/GameCore/GameManagers/MapManager/MapElements/TileMap.cs new file mode 100644 index 0000000..4cd2de9 --- /dev/null +++ b/ZoFo/GameCore/GameManagers/MapManager/MapElements/TileMap.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZoFo.GameCore.GameManagers.MapManager.MapElements +{ + public class TileMap + { + public bool Infinite { get; set; } + public int TileHeight { get; set; } + public int TileWidth { get; set; } + public List TileSets { get; set; } + } +} diff --git a/ZoFo/GameCore/GameManagers/MapManager/MapElements/TileSet.cs b/ZoFo/GameCore/GameManagers/MapManager/MapElements/TileSet.cs new file mode 100644 index 0000000..26b3627 --- /dev/null +++ b/ZoFo/GameCore/GameManagers/MapManager/MapElements/TileSet.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZoFo.GameCore.GameManagers.MapManager.MapElements +{ + public class TileSet + { + } +} diff --git a/ZoFo/GameCore/GameManagers/MapManager/MapManager.cs b/ZoFo/GameCore/GameManagers/MapManager/MapManager.cs new file mode 100644 index 0000000..d9325e0 --- /dev/null +++ b/ZoFo/GameCore/GameManagers/MapManager/MapManager.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZoFo.GameCore.GameManagers.MapManager +{ + public class MapManager + { + public void LoadMap() + { + + } + private void LoadTileSet() + { + + } + + } +} diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs index 8e77a67..033cc30 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs @@ -1,17 +1,55 @@ +using System; +using System.Data.SqlTypes; +using System.Net; +using System.Net.Sockets; using System.Security.Cryptography.X509Certificates; +using System.Text; using System.Threading; namespace ZoFo.GameCore.GameManagers.NetworkManager { - public delegate void OnDataSent(string Data); - public class ClientNetworkManager { - public event OnDataSent DataSent; - public static void StartListening() + private IPAddress iPAddress = IPAddress.Any; + private int port = 7632; + private EndPoint endPoint; + private Socket socket; + delegate void OnDataSent(string Data); + event OnDataSent GetDataSent; // event + public void Init() //create endPoint, socket + { + endPoint = new IPEndPoint(iPAddress, port); + socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + } + + public void SendData() { } + + public void JoinRoom() // multyplayer + { + SendData(); + StartListening(); + } + + public void JoinYourself() // single player + { + SendData(); + StartListening(); + } + + //поток 2 + public void StartListening() + { + socket.Connect(endPoint); + + byte[] bytes = new byte[2048]; + + var countAnsw = socket.Receive(bytes); + + string updates = Encoding.UTF8.GetString(bytes, 0, countAnsw); // обновления отосланные сервером + } } } \ No newline at end of file diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ClientToServer/UpdateInput.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ClientToServer/UpdateInput.cs index 017ab85..81af1d9 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ClientToServer/UpdateInput.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ClientToServer/UpdateInput.cs @@ -6,7 +6,9 @@ using System.Threading.Tasks; namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ClientToServer { - internal class UpdateInput + public class UpdateInput :IUpdateData { + public int IdEntity { get; set; } + public string UpdateType { get; set; } } } diff --git a/ZoFo/ZoFo.csproj b/ZoFo/ZoFo.csproj index 70c8cbc..a2b6bc2 100644 --- a/ZoFo/ZoFo.csproj +++ b/ZoFo/ZoFo.csproj @@ -21,10 +21,13 @@ +<<<<<<< HEAD +======= +>>>>>>> CollisionManager diff --git a/macos-fix-mgcb.sh b/macos-fix-mgcb.sh new file mode 100755 index 0000000..a2ec83b --- /dev/null +++ b/macos-fix-mgcb.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +brew install freetype +brew install freeimage +mgcb_ver=$(ls ~/.nuget/packages/dotnet-mgcb/) +mgcb_path=~/.nuget/packages/dotnet-mgcb/$mgcb_ver/tools/net6.0/any/ + +rm $mgcb_path/libfreetype6.dylib $mgcb_path/libFreeImage.dylib + +ln -s /opt/homebrew/lib/libfreetype.dylib $mgcb_path/libfreetype6.dylib +ln -s /opt/homebrew/lib/libfreeimage.dylib $mgcb_path/libFreeImage.dylib