Record games and emulate a League of Legends spectator server

Overview

Neeko-Server

Neeko-Server is an application that record games emulates a League of Legends spectator server to serve them to the League of Legends client.

It is an asynchronous software capable of recording multiple League of Legends live games at the same time, while simultaneously allowing multiple League of Legends clients to watch different games at the same time.

If you have any questions of want to participate to the development, feel free to join this Discord server: https://discord.gg/gqkjwBK58Z

Building

1. Clone from repo

git clone [email protected]:Vidalee/Neeko-Server.git

2. Install dependencies

yarn install

3. Build

yarn build

4. Start

yarn start

Configuration

Rename config.example.json to config.json.

{
    "riot_api_key": "RGAPI-YOUR-API-KEY-HERE", // See next section for more information.
    "spectator_servers": {
        ... // URLs of the League of Legends spectator servers for the different regions.
    },
    "paths": {
        "games": "games" // Path of where the games recorded will be saved.
    },
    "server": {
        "address": "127.0.0.1", // Address of the spectator server
        "port": 3000, // Its port
        "logger": false, // Wether to enable the fastify logger or not
        "secrets": {
            "spectate_secret": "spectate_secret", // Secret of the /spectate endpoint.
            "check_spectate_secret": true, // Wether to use it or not
            "statistics_secret": "statistics_secret",  // Secret of the /spectate endpoint.
            "check_statistics_secret": true // Wether to use it or not
        }
    },
    "spectator": {
        "logger": true, // Our spectator client logger (used to record games).
        "get_riot_match_details": true // Wether to download the corresponding match detail from the matchv5 Riot Games API endpoint.
    },
    "spectator_manager": {
        "logger": true // Our SpectatorManager logger (used to spectate new games and give statistics).
    },
    "replay_manager": {
        "logger": true // Our ReplayManager logger (used to serve games to League of Legends clients).
    },
    "use_ansi_colors": true // If your terminal does not support ANSI escape code, set it to false.
}

Riot Games API

This application uses the Riot Games API to get the gameId of a summoner currently in game, in order to record that game. If config.spectator.get_riot_match_details is set to true, it will also query for the results of the game through the match endpoint of the Riot Games API. Thus, if you want to fully use this application your API key must have access to the corresponding endpoints:

/lol/summoner/v4/summoners/by-name/{summonerName}
/lol/spectator/v4/active-games/by-summoner/{encryptedSummonerId}
/lol/match/v5/matches/{matchId}

If you just want to serve games you already recorded, the API key is not necessary.

Server endpoints

GET /admin/spectate/:region/:summonerName

Record the live game of a summoner. The region options are:

BR1, EUN1, EUW1, KR, LA1, LA2, NA1, OC1, TR1, RU, JP1 and PBE1

The summonerName option is the name of the summoner whose game you want to record.

Additionally, you can specify a secret in config.server.secret.spectate_secret, and if config.server.secret.check_spectate_secret is enabled, the request will not go through unless you have a Secret header which value matches with config.server.secret.spectate_secret.

When recording a game that has already started, you may see a lots of chunks unavailables messages on the console. These are not errors, it is just not possible to get the past data of a game, only the data from the moment ou started spectating.

GET /spectate/statistics

As with the endpoint above, you can secure this one using config.server.secret.statistics_secret

It provides statistics, mainly the list of the games that are currently being recorded, and those which are already saved. One interesting thing about this endpoint is that you can specify custom game data if you enabled the config.spectator.get_riot_match_details endpoint. You just need to edit the getCustomGameStats function, located in the src/utils/getCustomGameStats.ts file. I set it to output the largest multi kill in a match, and its duration in minutes as an example.

Here is an example response:

{
	"spectators": [ // Spectators client, one for each game currently being recorded
		{
			"gameId": 1234567890,
			"region": "EUW1",
			"targetSummonerName": "Player 1",
			"date": "Mar 6, 2022 2:13:19 PM",
			"liveGameMinutes": 17,
			"interestScore": 1932
		}
	],
	"games": [ // Games stored on the spectator server
		{
			"gameId": 1234567891,
			"region": "EUW1",
			"targetSummonerName": "Player 2",
			"date": "Mar 6, 2022 12:27:03 PM",
			"interestScore": 1097,
			"gameLength": 0,
			"gameMode": "CLASSIC",
			"gameType": "MATCHED_GAME",
			"custom": {
				"largestMultiKill": 3,
                		"gameMinutes": 21
			}
		}
	]
}

GET /spectate/windows/:gameId

Download a .bat file that will launch the League of Legends client to spectate the specified game ID on our spectator server. The corresponding game must have been recorded previously using the application.

Development

Feel free to propose any PR, they are very welcome especially on the fastify error code management (errors getting caught inside the router functions) and on the architecture of the project.

Inspiration

Special thanks to the loldevs team for their work on reversing the League of Legends spectator servers nearly a decade ago (https://github.com/loldevs/leaguespec) and more so to Divi for his past implementation of a spectator server (https://github.com/EloGank/lol-replay-downloader) that inspired me for the getLastChunkInfo endpoint implementation.

You might also like...

Incredible drastically simplifies creation of developer video content. It offers a unified workflow to storyboard, record, collaborate and produce the video.

Incredible drastically simplifies creation of developer video content. It offers a unified workflow to storyboard, record, collaborate and produce the video.

đź‘‹ Introduction Incredible drastically simplifies creation of developer video content. It offers a unified workflow to storyboard, record, collaborate

Dec 6, 2022

A prototype on how web3 technology can enable us to build an open, immutable, reproducible, and permanently accessible scientific record.

A prototype on how web3 technology can enable us to build an open, immutable, reproducible, and permanently accessible scientific record.

Web3 Research A prototype on how web3 technology can enable us to build an open, immutable, reproducible, and permanently accessible scientific record

Nov 27, 2022

Leader board application made with JavaScript that fetches an API to keep a record of users' scores.

Leader board application made with JavaScript that fetches an API to keep a record of users' scores.

Leaderboard This is a leaderboard that allows the user to created boards and input scores to them usin Rest API. Also, it saves new boards into local

Mar 23, 2022

Employee Management System is a web application developed using Django(Backend) which manages the record of employees, their salary, attendance. publish public notices, assign works to employees, make requests to employees.

Employee Management System is a web application developed using Django(Backend) which manages the record of employees, their salary, attendance. publish public notices, assign works to employees, make requests to employees.

Employee_Management_System Employee Management System is a web application developed using Django(Backend) which manages the record of employees, thei

Dec 16, 2022

The easiest way to record audio on the web :speaker:

BoothJS (or booth.js) is a zero-dependency, extensible wrapper around the Web Audio API that makes recording audio on the web super easy. Booth fully

Dec 15, 2022

Monolithic repo for api server, image server, web server

Onsecondary Market Deployed at https://market.onsecondary.com Monolithic repo for api server, image server, web server TODO -use a script to cull expi

Jan 11, 2022

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.

Phaser - HTML5 Game Framework Phaser is a fast, free, and fun open source HTML5 game framework that offers WebGL and Canvas rendering across desktop a

Jan 7, 2023

A plugin that can query multiple APIs for movies, series, anime, games, music and wiki articles, and import them into your vault.

Obsidian Media DB Plugin A plugin that can query multiple APIs for movies, series, anime, games, music and wiki articles, and import them into your va

Dec 21, 2022

A simple library for Node and the browser that allows you to rapidly develop stateful, socketed multiplayer games and web applications.

gameroom.js Overview gameroom.js is a simple library for Node and the browser that allows you to rapidly develop stateful, socketed multiplayer games

Nov 3, 2022
Comments
  • How to use Neeko-Server as a spectator server to watch replays already saved on disk?

    How to use Neeko-Server as a spectator server to watch replays already saved on disk?

    Hi,

    on README.md there's this section:

    If you have any questions of want to participate to the development, feel free to join this Discord server: https://discord.gg/gqkjwBK58Z

    I have a few questions and I tried to join the Discord Server but I got a message like "You don't have access to any text channels or there are none in this server."

    If it's not the most appropriate place to make this conversation, please tell me where that would be.

    I'd like to write a script to open replays that I've already downloaded and saved on my disk and I think I might need a spectator server for that. And people on #loldev channel from the 'riot 3rd party community" disc server directed me to this project and it's promising, since I see it is many things including a spectator server, but I'm still confused on how to run it as a spectator server and use it to achieve my goal of opening a replay saved on the disk from a script or CLI. Can someone help me with that?

    opened by rafaelvanderlei 1
  • Better error reporting

    Better error reporting

    If the ReplayManager throws an error, routes like getLastChunkInfo do not log the error, just send it to the LoL client. We should also log them so that user knows what happened (other than just seeing an error 500 in the LoL client logs)

    opened by Vidalee 0
Owner
Vivi
đź‘»
Vivi
Open Source REST API for the best league in the world

NBA REST API Open Source REST API for the best league in the world! We are not affiliated, associated, authorized, endorsed by, or in any way official

Francisco Panozzo 16 Nov 6, 2022
Django, wagtail-cms, league, kgs, baduk

Open Study Room Open Study Room (OSR) is a community of go/baduk/weiqi player who shares, builds and organizes knowledge, opportunities and resources

Dredsoft 3 Sep 15, 2022
AREX: It is a “Differential Testing” and “Record and Replay Testing” Tool.

AREX: It is a “Differential Testing” and “Record and Replay Testing” Tool. Test restful API by record, replay and stub request/response. Differential

ArexTest 15 Nov 1, 2022
A high-resolution local database that uses precise algorithms to easily record data in local files within a project with persistent JSON and YAML support designed to be easy to set up and use

About A high-resolution local database that uses precise algorithms to easily record data in local files within a project with persistent JSON and YML

Shuruhatik 5 Dec 28, 2022
Kyrillos Hany 14 Aug 10, 2022
An implementation of ERC1155D, a record setter for minting and transfer gas efficiency.

ERC1155D An implementation of ERC1155D, a record setter for minting and transfer gas efficiency. This contract is in alpha stage and has not been audi

null 72 Dec 26, 2022
A web tool for you to record your face and turn it into a 3D animation file.

Web Face Capture A free, open-source web tool for you to record your face and turn it into a 3D animation file. Go to the website Allow camera permisi

James Lee 9 Jan 6, 2023
Leaderboard is a simple app that allow the user to record his name and his score, store to an api

Leaderboard Leader board is a simple app that allows the user to record his name and his score Build With Major languages used : HTML, CSS, JAVASCRIT;

Yannick 3 May 16, 2022
Supercharge Notion with custom commands to record, draw, and more ✍️

Slashy Supercharge Notion with custom commands to record, draw, and more ✨ Slashy is an open source extension that lets you create custom commands for

Alyssa X 425 Dec 28, 2022