DotNetPonies 1.0.2

dotnet add package DotNetPonies --version 1.0.2
                    
NuGet\Install-Package DotNetPonies -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DotNetPonies" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotNetPonies" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="DotNetPonies" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DotNetPonies --version 1.0.2
                    
#r "nuget: DotNetPonies, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DotNetPonies@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DotNetPonies&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=DotNetPonies&version=1.0.2
                    
Install as a Cake Tool

Getting Started

  • Install the library from Nuget or this repository

Features

  • Get the servers list and status
  • Get the account informations
  • Get the account ponies
  • Pony data parsing
  • OAuth2 support
  • Friends list
  • Simple bot implementation

How to ?

  • Get the servers list
using DotNetPonies;

var client = new PonyTownClient();

// Resolve api version by searching in the pony town javascript code.
await client.ResolveApiVersionAsync();

var status = await client.GetStatusAsync();

foreach (var server in status.Servers)
{
    Console.WriteLine($"{server.Id} - {server.Name} - {server.OnlineCount} players");
}
  • Get all pony for an account
using DotNetPonies;

var client = new PonyTownClient();

// Resolve api version by searching in the pony town javascript code.
await client.ResolveApiVersionAsync();

// Login with your pony town account (cookie)
client.LoginWithCookie("<connect_sid>", "<remember_me>");

var ponies = await client.GetCharactersAsync("<account_id>", "<account_name>");

foreach (var pony in ponies)
{
    Console.WriteLine(pony.Name);
}

Get Api Version manually

PonyTownException: Invalid game version

PonyTown API V2 is using a api-version header to validate a lot of request, in this case the api-version is not valid anymore for this build, it will be necessary to get it manually.

var client = new PonyTownClient("<api-version-here>");
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 270 7/17/2023
1.0.1 243 7/11/2023
1.0.0 322 1/1/2023