GithubHelp home page GithubHelp logo

code-game-project / codegame-share Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 167 KB

A service to make sharing game IDs, spectate links and sessions easier.

Home Page: https://share.code-game.org

License: GNU Affero General Public License v3.0

Go 58.06% CSS 22.19% HTML 19.76%
ecosystem go share

codegame-share's Introduction

codegame-share

A service to make sharing game IDs, spectate links and sessions easier.

API

POST /game

Description

Stores the game URL and ID and returns an 8 characters long ID which when presented to the /{id} endpoint will return a web page with information about the game.

Request Body

{
	"game_url": "", // URL of the game server (e.g. games.code-game.org/hoverrace)
	"game_id": "" // ID of the game
}

POST /spectate

Description

Stores the game URL, game ID, player ID and player secret and returns an 8 characters long ID, which when presented to the /{id} endpoint will redirect the user to the respective spectate view of the game server.

Request Body

{
	"game_url": "", // URL of the game server (e.g. games.code-game.org/hoverrace)
	"game_id": "", // ID of the game
	"player_id": "", // ID of the player
	"player_secret": "" // the player secret
}

POST /session

Description

Stores a session object and returns an 8 characters long ID, which when presented to the /{id} endpoint will return the session again.

Request Body

{
	"game_url": "", // URL of the game server (e.g. games.code-game.org/hoverrace)
	"username": "", // the username of the player
	"session": {
		"game_id": "", // ID of the game
		"player_id": "", // ID of the player
		"player_secret": "" // the player secret
	},
	"password": "" // optional password
}

GET /{id}?type=<game|spectate|session>

Retrieves the data associated with the ID and returns it in a different format depending on the endpoint used to store it.

You can use the optional type parameter to assert that the entry is of a specific type.

If the entry is password protected, you will need to set the Password header with the correct password.

IDs and their associated content are stored for 24h.

License

Copyright (c) 2022 Julian Hofmann

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

codegame-share's People

Contributors

juho05 avatar

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.