Coder Social home page Coder Social logo

gdmc-http-wrapper's Introduction

GDMC-HTTP-wrapper

C# library to interface with the http server for the GDMC competition

Library State

The library is simple, functional and usable but does little error checking. It is probably 'good enough' for most uses (but PRs welcome when it isn't)!

The library aims to offer an MVP-level of interaction with the API - enough to get started without having to write an HTTP wrapper and make a best effort at some simple abstractions to make using the resulting data straightforward.

There is some additional functionality available throught the McWorld class which gives a local block cache and simple heightmap calculator.

GDMC HTTP Server Supported Versions

Last version tested against:

The client may work with newer versions, as long as there have been no breaking changes,

Limitations

For simplicity this client no longer support the /chunks endpoint.

This client does not support the dimension query parameter on any requests - yet.

Release versioning

Releases are now versioned to match the HTTP mod. eg, HTTP Mod version is v0.6.2, then first release targeting that version is v0.6.2.0, then v0.6.2.1 etc

Usage

All methods are synchronous.

Examples

using GDMCHttp;
using GDMCHttp.Commands;
using GDMCHttp.Data;

Func<string, Connection, string> announce = (string msg, Connection connection) =>
{
    return connection.SendCommandSync(new Say(msg));
};

Connection connection = new Connection();
announce("Client connected", connection);

for (int y = 65; y < 70; y++)
{
    for (int x = 0; x < 5; x++)
    {
        Block b = connection.GetBlockSync(new Vec3Int(x, y, 0));
        Console.WriteLine(b.ToString());
    }
}

BiomePoint[] biomePoints = connection.GetBiomesSync(new Vec3Int(0, 65, 0), new Vec3Int(5, 5, 1));

announce("Client done", connection);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.