Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.
/ DotNetPonies Public archive

A C# api wrapper for the game pony town

Notifications You must be signed in to change notification settings

C4NX/DotNetPonies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DNP Logo

A DotNet Standard C# PonyTown API Wrapper

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.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(new PonyTownScope { DefaultApiVersion = "<api-version>" });

About

A C# api wrapper for the game pony town

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages