Skip to content

Commit

Permalink
Change server to .NET 5
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesDeml committed Mar 5, 2021
1 parent a460a43 commit 0d0f9fc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
7 changes: 0 additions & 7 deletions ENetServer/BuildAll.bat

This file was deleted.

4 changes: 2 additions & 2 deletions ENetServer/ENetServer/ENetServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ENet-CSharp" Version="2.4.3" />
<PackageReference Include="ENet-CSharp" Version="2.4.6" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions ENetServer/ENetServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ static void Main(string[] args)
_server.Flush();
}

Console.WriteLine($"Server stopped");
ENet.Library.Deinitialize();
}

Expand Down
6 changes: 6 additions & 0 deletions ENetServer/win-build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Options: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build
// Build targets: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog

dotnet build --configuration Release --output ./bin/ENetServer-Windows/

PAUSE
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ENet Unity Mobile Setup

*Bootstrap setup for a client server architecture*
[![Unity 2020.1](https://img.shields.io/badge/unity-2020.1-green.svg?logo=unity&cacheSeconds=2592000)](https://unity3d.com/get-unity/download/archive) [![](https://img.shields.io/github/release-date/JohannesDeml/ENetUnityMobile.svg)](../../releases)
[![Unity 2020.2](https://img.shields.io/badge/unity-2020.2-green.svg?logo=unity&cacheSeconds=2592000)](https://unity3d.com/get-unity/download/archive) [![.NET 5.0](https://img.shields.io/badge/.NET-5.0-blueviolet.svg)](https://dotnet.microsoft.com/download/dotnet/5.0) [![Release Date](https://img.shields.io/github/release-date/JohannesDeml/ENetUnityMobile.svg)](../../releases)

![Live Preview](./Docs/live-preview.gif)

Expand All @@ -21,9 +21,9 @@ The server application is built with .Net Core and therefore will run on Windows

### Libraries

* [ENet-CSharp 2.4.3](https://github.com/nxrighthere/ENet-CSharp)
* Unity 2020.1.9f1
* .Net Core 3.1
* [ENet-CSharp 2.4.6](https://github.com/nxrighthere/ENet-CSharp)
* Unity 2020.2.7f1, but should work fine in almost any version
* .Net 5

## Run Project

Expand All @@ -39,13 +39,13 @@ The server listens to Port 3333 and can be aborted by pressing any key.

![Commandline Server](./Docs/unity-client.png)

Either get the build for Android or Windows from the [release section](../../releases) or open the project in Unity and run it (Make sure you started the server). Find out the ip of your server (127.0.0.1 if it is on the same machine), and click connect.
Either get the build for Android or Windows from the [release page](../../releases) or open the project in Unity and run it (Make sure you started the server). Find out the ip of your server (127.0.0.1 if it is on the same machine), and click connect.

When connected successfully, you can enter messages in the box next to the send button. The messages will be broadcasted to all other clients that are online at that time.

## Build Libraries

The libraries for android and iOS are already built for this repo, you can find them [here](../../tree/master/ENetClient/Assets/ENet/Plugins).
The easiest way is to get the built libraries from the [release page](../../releases).
If you want to build them yourself (or for a newer ENet version), take a look at the instructions below.

### Android
Expand Down

0 comments on commit 0d0f9fc

Please sign in to comment.