MCPcopy
hub / github.com/topfreegames/pitaya

github.com/topfreegames/pitaya @v2.11.24 sqlite

repository ↗ · DeepWiki ↗ · release v2.11.24 ↗
2,968 symbols 11,697 edges 246 files 1,349 documented · 45%
README

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

WARNING: The version v1.x of pitaya is deprecated, complete guide of the new version v2.x can be found here. The current README is for version v2.x, make sure you look at branch v1 if you'd like to see the documentation for the older version.


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.16
  • etcd (optional, used for service discovery)
  • nats (optional, used for sending and receiving rpc)
  • 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 preferred.)

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 security@tfgco.com

Resources

Extension points exported contracts — how you extend this code

PacketEncoder (Interface)
PacketEncoder interface [6 implementers]
conn/codec/packet_encoder.go
Component (Interface)
Component is the interface that represent a component. [15 implementers]
component/component.go
NetworkEntity (Interface)
NetworkEntity represent low-level network instance [6 implementers]
networkentity/networkentity.go
Serializer (Interface)
Serializer is the interface that groups the basic Marshal and Unmarshal methods. [8 implementers]
serialize/serializer.go
Module (Interface)
Module is the interface that represent a module. [15 implementers]
interfaces/interfaces.go
GroupService (Interface)
GroupService has ranking methods [5 implementers]
groups/group_service.go
Reporter (Interface)
Reporter interface [4 implementers]
metrics/reporter_interfaces.go
PlayerConn (Interface)
PlayerConn iface [4 implementers]
acceptor/acceptor.go

Core symbols most depended-on inside this repo

Error
called by 234
logger/interfaces/interfaces.go
Call
called by 210
cluster/cluster.go
String
called by 154
agent/agent.go
Errorf
called by 138
logger/interfaces/interfaces.go
NewDefaultPitayaConfig
called by 116
config/config.go
NewSessionPool
called by 104
session/session.go
EXPECT
called by 97
session/mocks/session.go
Marshal
called by 92
serialize/serializer.go

Shape

Method 1,609
Function 1,021
Struct 286
Interface 38
TypeAlias 8
FuncType 6

Languages

Go99%
TypeScript1%

Modules by API surface

session/session.go132 symbols
session/mocks/session.go126 symbols
mocks/app.go90 symbols
app.go79 symbols
examples/demo/protos/cluster.pb.go73 symbols
session/session_test.go63 symbols
cluster/mocks/cluster.go56 symbols
agent/agent.go54 symbols
agent/agent_test.go48 symbols
config/config.go46 symbols
protos/protodescriptor.pb.go45 symbols
static.go44 symbols

Dependencies from manifests, versioned

github.com/DataDog/datadog-gov4.8.3+incompatible · 1×
github.com/HdrHistogram/hdrhistogram-gov1.1.0 · 1×
github.com/Microsoft/go-winiov0.6.1 · 1×
github.com/abiosoft/ishellv2.0.0+incompatible · 1×
github.com/abiosoft/readlinev0.0.0-2018060704043 · 1×
github.com/benbjohnson/clockv1.1.0 · 1×
github.com/beorn7/perksv1.0.1 · 1×
github.com/bufbuild/protocompilev0.4.0 · 1×
github.com/cespare/xxhash/v2v2.2.0 · 1×

For agents

$ claude mcp add pitaya \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact