From f3c710946f27ba086b2659d6fac1c88795a30664 Mon Sep 17 00:00:00 2001 From: SergeantSerk <14278530+SergeantSerk@users.noreply.github.com> Date: Fri, 20 Sep 2019 18:45:10 +0100 Subject: [PATCH] Update README.md Added installation instructions and sample usage --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index 386e6de..a91984c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,34 @@ # MCQuery A C# library for querying/pinging Minecraft servers. + +# Sample Usage +See MCQueryConsole for sample console or below. +``` +using MCQuery; +using System; + +namespace Sample +{ + public class Program + { + // Enter the server address + private static string server = "mc.hypixel.net"; + // Enter the server port + private static ushort port = 25565; + + public static void Main(string[] args) + { + string json = Minecraft.Status(server, port); + double ping = Minecraft.Ping(server, port); + Console.WriteLine($"Server: {server}:{port}"); + Console.WriteLine($"Ping: {ping}ms"); + Console.WriteLine($"Status: {json}"); + } + } +} +``` + +# Installation +For the latest features (bleeding-edge), clone this repository and open the **`MCQuery/MCQuery.sln`** solution in Visual Studio. Build using the **Release** configuration and use the **`MCQuery/bin/Release/netcoreapp(x)/MCQuery.dll`** file in your project. + +Alternatively, you can download the DLL (not always up-to-date) from the [Release](https://github.com/SergeantSerk/MCQuery/releases) page, or download the MCQuery NuGet package from nuget.org using Visual Studio's NuGet Package Manager.