apiinterface

package
v0.0.0-...-843b749 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package apiinterface provides utilities for interacting with the Blade II Online REST API.

Package apiinterface provides utilities for interacting with the Blade II Online REST API.

Package apiinterface provides utilities for interacting with the Blade II Online REST API.

Package apiinterface provides utilities for interacting with the Blade II Online REST API.

Index

Constants

View Source
const (
	Draw    Winner = 0
	Player1        = 1
	Player2        = 2
)

Enum values that represent the potential winners for a match.

Variables

This section is empty.

Functions

func GetURL

func GetURL(endpoint string) string

GetURL constructs and returns the URL for the specified endpoint of the Blade II Online REST API.

func UpdateMatchStats

func UpdateMatchStats(client1ID uint64, client2ID uint64, winner Winner)

UpdateMatchStats synchronously sends a request to the API server to update the MMR, as well as the w/d/l for the specified players, based on the winner.

Fails silently (for the client) but logs to console.

Types

type MMRUpdateRequest

type MMRUpdateRequest struct {
	Player1ID uint64 `json:"player1id"`
	Player2ID uint64 `json:"player2id"`
	Winner    Winner `json:"winner"`
}

MMRUpdateRequest describes the data needed to update the MMR for a pair of users.

type Winner

type Winner uint8

Winner represents the winner for a match.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL