Scalable game server framework with clustering support and client libraries for iOS, Android, Unity and others through the C SDK.

pitaya Build Status Coverage Status GoDoc Docs Go Report Card MIT licensed

Pitaya is an simple, fast and lightweight game server framework with clustering support and client libraries for iOS, Android, Unity and others through the C SDK. It provides a basic development framework for distributed multiplayer games and server-side applications.

Getting Started

Prerequisites

  • Go >= 1.10
  • etcd (used for service discovery)
  • nats (optional, used for sending and receiving rpc, grpc implementations can be used too if prefered)
  • docker (optional: used for running etcd and nats dependencies on containers)

Installing

clone the repo

git clone https://github.com/topfreegames/pitaya.git

setup pitaya dependencies

make setup

Hacking pitaya

Here's one example of running Pitaya:

Start etcd (This command requires docker-compose and will run an etcd container locally. An etcd may be run without docker if prefered.)

cd ./examples/testing && docker-compose up -d etcd

run the connector frontend server from cluster_grpc example

make run-cluster-grpc-example-connector

run the room backend server from the cluster_grpc example

make run-cluster-grpc-example-room

Now there should be 2 pitaya servers running, a frontend connector and a backend room. To send requests, use a REPL client for pitaya pitaya-cli.

$ pitaya-cli
Pitaya REPL Client
>>> connect localhost:3250
connected!
>>> request room.room.entry
>>> sv-> {"code":0,"result":"ok"}

Running the tests

make test

This command will run both unit and e2e tests.

Contributing

#TODO

Authors

  • TFG Co - Initial work

License

MIT License

Acknowledgements

  • nano authors for building the framework pitaya is based on.
  • pomelo authors for the inspiration on the distributed design and protocol

Security

If you have found a security vulnerability, please email [email protected]

Resources

Owner
TFG Co
TFG is a leading gaming company for mobile. Check our open positions at https://boards.greenhouse.io/wildlifestudios
TFG Co
Similar Resources

MazePlay - a game powered by Go+ spx game engine

MazePlay - a game powered by Go+ spx game engine

MazePlay - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this g

Dec 16, 2021

A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy!

A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy!

galactic-asteroid-belt Overview A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy! Run To run, you will need Go

Dec 2, 2021

Simple rule based matchmaking for your online game with support of Redcon(RESP) protocol.

 Simple rule based matchmaking for your online game with support of Redcon(RESP) protocol.

Simple Matchmaking Simple rule based matchmaking for your online game with support of Redcon(RESP) protocol. 1- Simple Match Rule Easiest usage of sys

Jan 4, 2023

Battleblips - Work in progress multiplayer terminal base battleship game written in Go (with mouse support!) using tcell library

Battleblips - Work in progress multiplayer terminal base battleship game written in Go (with mouse support!) using tcell library

battleblips Work in progress multiplayer terminal base battleship game written in Go (with mouse support!) using tcell library (see https://github.com

Apr 26, 2022

Simple 2D game prototyping framework.

Simple 2D game prototyping framework.

prototype Simply prototype 2D games using an easy, minimal interface that lets you draw simple primitives and images on the screen, easily handle mous

Dec 17, 2022

Fab.io is a lightweight game backend framework written in Go (Golang).

Fab.io is a lightweight real-time game backend framework written in Go (Golang).

Jun 20, 2022

F1 Game Telemetry Client written in Go (no dependency)

F1 Game Telemetry Client written in Go (no dependency)

F1 Game Telemetry Client in Go Telemetry client for F1 Game, written in Go. Currently, supported only the UDP 2020 format. Features Event System Rich

Dec 13, 2022

Dedicated Game Server Hosting and Scaling for Multiplayer Games on Kubernetes

Dedicated Game Server Hosting and Scaling for Multiplayer Games on Kubernetes

Agones is a library for hosting, running and scaling dedicated game servers on Kubernetes. Agones, is derived from the Greek word agōn which roughly t

Jan 6, 2023

This is a "simple" game server. Main functionalities are matching and establishing a connection between players

This is a

Game Server This is a "simple" game server. Main functionalities are matching and establishing a connection between players How to Run? run the server

Aug 28, 2022
Comments
  • About module and components init

    About module and components init

    I found that startModules() is located after startupComponents() in app.listen(). Is there any deep meaning in doing this? At present, most of our basic capabilities are encapsulated as modules, so operations such as cache initialization cannot be completed in the AfterInit life cycle of components. Or you can give me some suggestions for use in such scenarios, thank you.

  • bug: connect not close when Handshake failed

    bug: connect not close when Handshake failed

    err := json.Unmarshal(p.Data, handshakeData) if err != nil { a.SetStatus(constants.StatusClosed)

    where Unmarshal failed, StatusClosed will be set

    then agent.Close() will find a.GetStatus() == constants.StatusClosed

    so sokcet will not be close

  • change remoteProcess to public

    change remoteProcess to public

    i want cache msg on gateway

    like this

    func (p *ProxyCacheService) RemoteProcess( ctx context.Context, server *cluster.Server, a agent.Agent, route *route.Route, msg *message.Message, ) {

    if msg.Type == message.Request {
    	cacheData := CacheService.cached(ctxt, msg.ID)
    	if cacheMsg != nil {
    		a.GetSession().ResponseMID(ctx, msg.ID, cacheData)
    		return
    	}
    }
    
    p.RemoteService.RemoteProcess(ctx, server, a, route, msg)
    

    }

    change remoteProcess to RemoteProcess is better?

  • Add acceptor support for receiving pre-loaded certificates

    Add acceptor support for receiving pre-loaded certificates

    This MR exposes a new constructor for the TCP acceptor that allows for pre-loaded certificates as arguments.

    It also refactors internal code in order to make sure the new constructor is used by the old one and make appropriate changes to store a list of pre-loaded certificates instead of a certFile/certKey pair.

    Tests were changed accordingly.

    You could say that there's a tiny API change, which is that the NewTCPAcceptor might now panic if the provided certificate file paths are invalid, but it doesn't seem to me as something that relevant as its actually related to a failed initialization case where pitaya would panic somewhere else anyway (inside ListenAndServeTLS).

a framework in golang for game server or app server
a framework in golang for game server or app server

einx a framework in golang for game server or app server. a example server for einx (https://github.com/Cyinx/game_server_einx) Features User-Friendly

Dec 8, 2022
A game server side framework with both web API and realtime communication.

HAYABUSA Framework Hayabusa is a server side framework for Japan-like social games. Easy to understand and use for beginners Powerful controller, flex

May 21, 2022
A game server framework in Go (golang)

Leaf A pragmatic game server framework in Go (golang). Features Extremely easy to use Reliable Multicore support Modularity Community QQ 群:376389675 D

Jan 2, 2023
Lightweight, facility, high performance golang based game server framework
Lightweight, facility, high performance golang based game server framework

Nano Nano is an easy to use, fast, lightweight game server networking library for Go. It provides a core network architecture and a series of tools an

Jan 1, 2023
RundQuiz-Game - This is a Go exercise that implements and builds a quiz game from a list of math questions in a CSV file.

Go RundQuiz Game Exercise details This exercise is broken into two parts to help simplify the process of explaining it as well as to make it easier to

Jan 5, 2022
Simple 2D game to teach myself various things about game development and ECS, etc

2d-grass-game I really don't know what to name this game. Its a big grass field, and its in 2d so....2D Grass game This is a simple 2D game to teach m

Jan 17, 2022
Arkanoid game in Go using Ebiten game engine with ECS.
Arkanoid game in Go using Ebiten game engine with ECS.

Arkanoid-go Arkanoid game in Go using Ebiten game engine with ECS. You must have Git LFS installed when cloning the repository to download assets. See

Oct 9, 2022
AircraftWar - a game powered by Go+ spx game engine
AircraftWar - a game powered by Go+ spx game engine

AircraftWar - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download thi

Jan 5, 2022
FlappyCalf - a game powered by Go+ spx game engine
FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this

Nov 6, 2022
FlappyCalf - a game powered by Go+ spx game engine
FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this

Nov 6, 2022