🤼‍♂️ a simple FIFO matchmaker supporting scoring

Related tags

matchmaker
Overview

Matchmaker

This package is a simple FIFO matchmaker that supports player rank & latency (as tags). The rank & latency tags help you to group the players.

Implementations

Redis

This implementation uses Redis for Queue & scoring with the mutex locking support. for now, the score is time, a lower score has higher priority (FIFO)

import (
	"github.com/go-redis/redis/v8"
	mRedis "github.com/theredrad/matchmaker/redis"
)

func main() {
    client := redis.NewClient(&redis.Options{
        Addr:     "REDIS_ENDPOINT:PORT",
    })
    
    matchmaker, err := mRedis.NewMatchmaker(client, &mRedis.Options{
        Prefix:    "test_matchmaking",
        Handler:   MatchHandler, // handler func
        MaxPlayer: 2,
    })
    
    matchmaker.PushToQueue(context.Background(), "PLAYER_ID", 10, 100) // pass player rank as 10 & latency group as <= 100ms
    matchmaker.PushToQueue(context.Background(), "PLAYER_2_ID", 10, 100) // pass player rank as 10 & latency group as <= 100ms
    
    // wait for exit signal
    c := make(chan os.Signal, 1)
    signal.Notify(c, os.Interrupt, syscall.SIGTERM)
    <-c
}

func MatchHandler (rank int, latency uint, ids ...string) { 
	// list of matched players ID
}

TODO

  • Add timeout option to match players from different ranks or latency if no matched player is found in the same group
Owner
TheRedRad
Developer @manasky — co-founder @Atbox
TheRedRad
Simple HTML Modification in Go

Simple HTML Modification in Go Do you grin at the sight of html.Node ? Me too. Modifying HTML in Go should be simple. ???? Human friendly: query langu

Asaf Shitrit 6 Sep 29, 2021
A tool and library for using structural regular expressions.

Structural Regular Expressions sregx is a package and tool for using structural regular expressions as described by Rob Pike (link).

Zachary Yedidia 24 Sep 27, 2021
A super simple Lodash like utility library with essential functions that empowers the development in Go

A simple Utility library for Go Go does not provide many essential built in functions when it comes to the data structure such as slice and map. This

Rahul Baruri 88 Sep 13, 2021
egg - the simple error aggregator

egg - the simple error aggregator egg ingests errors and aggregates them egg has 1st class support for sentry SDKs so you dont have to change any code

Joe Burnard 14 Oct 6, 2021
[mirror] star-tex (or *TeX) is a TeX engine in Go.

star-tex star-tex (or *TeX) is a TeX engine in Go. cmd/star-tex star-tex provides a TeX to DVI typesetter. $> star-tex ./testdata/hello.tex out.div $>

null 11 Oct 7, 2021
Payload is a simple tool for working with production data in your local environment.

Payload Payload is a simple tool for working with production data in your local environment. What problem does it solve? You're working with Cloud SQL

Ivan Vanderbyl 1 Oct 13, 2021
A Simple Range for Golang

go-range-base Simple Range for Golang For(func(int32)) package main import ( "fmt" gorng "github.com/gopherzz/go-range-base" ) func main() {

Nikita Kazeka 1 Oct 9, 2021
Experiments with Go generics

generics Quick experiments with Go generics algebra, a generic square root function for float, complex and and rational. future, a concurrent cache ("

Alan Donovan 58 Aug 13, 2021
Simple profiling for Go

profile Simple profiling for Go. Easy management of Go's built-in profiling and tracing Based on the widely-used pkg/profile: mostly-compatible API Su

Michael McLoughlin 69 Sep 14, 2021
A local snippet manager in Go

Snip A local snippet manager :D Snip provides simple CLI for saving and copying links for emojis, gifs or whatever you want. Requirements Install go i

Felipe Mariotti 4 May 24, 2021
A simple thread-safe, fixed size LRU written in Go. Based on dominictarr's Hashlru Algorithm. 🔃

go-hashlru A simple thread-safe, fixed size LRU written in Go. Based on dominictarr's Hashlru Algorithm. ?? Uses map[interface{}]interface{} to allow

Saurabh Pujari 68 Sep 22, 2021
Simple expression evaluation engine for Go

??️ chili Currently in development, Unstable (API may change in future) Simple expression evaluation engine. Expression is one liner that evalutes int

Santhosh Kumar 65 Jun 6, 2021
this is an api that execute your deno code and send you the output

this a simple api that execute your deno code and send you the output, has not limit per request example request: in deno: const rawResponse = await f

pai 12 Oct 15, 2021
A go package implementing a simple logic-bomb.

puffgo A simple go package implementing a simple logic-bomb ❗ Warning ❗ This project is strictly for educational/research purposes, any malicious acti

Arachne 2 Oct 23, 2021
Simple in Pure Go in Browser Interactive Interpreter

GoBook This project is a PoC Don't take it seriously The main point of this project is the use of the library: github.com/brendonmatos/golive Maybe th

Brendon Ferreira 21 Sep 29, 2021
Simple project to demonstrate the loading of eBPF programs via florianl/go-tc.

tc-skeleton Simple project to demonstrate the loading of eBPF programs via florianl/go-tc.

Florian Lehner 25 Jul 20, 2021
A pluggable backend API that enforces the Event Sourcing Pattern for persisting & broadcasting application state changes

A pluggable "Application State Gateway" that enforces the Event Sourcing Pattern for securely persisting & broadcasting application state ch

Coleman Word 25 Aug 26, 2021
Procswap is a simple application that allows you to prioritize processes on a Windows machine.

Procswap is a simple application that allows you to prioritize processes on a Windows machine.

Billy 14 Sep 6, 2021
Simple unpacking script for Ezuri ELF Crypter

ezuri_unpack A simple unpacking script for the Ezuri ELF Crypter. Based on the analysis done by Ofer Caspi and Fernando Martinez of AT&T Alien Labs

Marius Genheimer 12 Jul 28, 2021