{"id":37136298,"url":"https://github.com/tiltfactor/toto","last_synced_at":"2026-01-14T15:53:14.280Z","repository":{"id":57607088,"uuid":"55799662","full_name":"tiltfactor/toto","owner":"tiltfactor","description":"Toto is a general game server for quick prototyping of websocket based games.","archived":false,"fork":false,"pushed_at":"2016-04-16T17:30:13.000Z","size":337,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-11T01:31:53.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiltfactor.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-08T18:07:56.000Z","updated_at":"2016-04-08T21:05:09.000Z","dependencies_parsed_at":"2022-08-30T00:00:33.081Z","dependency_job_id":null,"html_url":"https://github.com/tiltfactor/toto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tiltfactor/toto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiltfactor%2Ftoto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiltfactor%2Ftoto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiltfactor%2Ftoto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiltfactor%2Ftoto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiltfactor","download_url":"https://codeload.github.com/tiltfactor/toto/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiltfactor%2Ftoto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28425520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T15:24:48.085Z","status":"ssl_error","status_checked_at":"2026-01-14T15:23:41.940Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T15:53:13.530Z","updated_at":"2026-01-14T15:53:14.267Z","avatar_url":"https://github.com/tiltfactor.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Toto :video_game:\n__Toto__ is a game server for creating quick prototypes of online multiplayer\ngames. By leveraging socket.io and exposing a few key events to act essentially\nas a message relay. Toto makes it easy to start prototyping multiplayer games\nwithout worrying about writing a custom server for each prototype.\n\n__Toto__ __*is not*__ meant to be a finalized game server.\nYou'll notice that __Toto__ offers nothing in the way of state management or\nvalidation this is by design because __Toto__ is meant to be a prototyping\nserver and nothing more. As a result it assumes perfect and well behaved\nclients.\n\n# Installing\n```bash\ngo get github.com/tiltfactor/toto\n```\n\n# Running\n```bash\n# To run on port 8080\ntoto --port 8080\n\n# To run on default port (3000)\ntoto\n```\n\n# Upgrading\n```bash\ngo get -u github.com/tiltfactor/toto\n```\n\n\n# Usage\nFirst a game definition must be created and placed in a folder called _games_ in\nthe directory where Toto is run. A game definition is written in TOML and\nlooks like this:\n```toml\n# The number of players required to create a group\nminPlayers = 2\n\n# Optional maxPlayer\nmaxPlayers = 2\n\n# The title that will be displayed should be displayed to the user\ndisplayTitle = \"This is an example game!\"\n\n# A unique key that the client will use to request to join a game\nuniqueKey = \"example-game\"\n```\n\nHere players in group states the number of players that must be placed in a\ngroup.\nDisplay title is what players will be shown, and uniqueKey is the key that\n__Toto__ expects the client to send when requesting to join a game.\nThese are all required fields and __Toto__ will throw an error if there are\nfields missing or if the uniqueKey conflicts with another declared game.\n\n# Events and JSON structure.\n```javascript\n// To join the game clickRace we set the gameId to the uniqueKey defined in\n// the game file and emit the following to the join-game \nsocket.emit('join-game', {\n  gameId: 'clickRace',\n})\n\n// If the gameId does not exist then you will receive a client error\n// client-error and server-error will always include the error field\nsocket.on('client-error', function(r) {\n  // r will look like the following \n  {\n    \"timeStamp\": 1460792552456716300,\n    \"kind\": \"client-error\",\n    \"data\": {\n      \"error\": \"Invalid GameID\"\n    }\n  }\n})\n\n\n\n\n// You will then receive a in-queue message\n// in-queue will include the message and the number of players currently in the\n// queue.\nsocket.on('in-queue', function(r) {\n  // r will look like the following\n  {\n    \"timeStamp\": 1460792552507366000,\n    \"kind\": \"in-queue\",\n    \"data\": {\n      \"message\": \"You are in the queue for game: Click Race!\",\n      \"playersInQueue\": 1\n    }\n  }\n});\n\n\n// After a while you will receive the group-assignment message\n// group-assignment will always include the room name and the turn number\n// assigned to the client\nsocket.on('group-assignment', function(r) {\n  // r will look like the following\n  {\n    \"timeStamp\": 1460792555406774000,\n    \"kind\": \"group-assignment\",\n    \"data\": {\n      \"roomName\": \"2068-upset-pigs-swam-reproachfully\",\n      \"turnNumber\": 0\n    }\n  }\n})\n\n// At this point the player has been added to the group room by the server so\n// we can make a move by emitting the event \"make-move\". This JSON could contain anything, \n// with two exceptions. \n// The fields madeBy and madeById will be overwritten by the server with the associated \n// socketid and turn number.\nsocket.emit('make-move', {\n  clicks: 1,\n})\n\n// All clients will receive the move \n// And it is up to the client to only apply the other players moves\n// In this way you can also confirm that your move was indeed sent.\nsocket.on('move-made', function(r) {\n  // r will look like the following\n  {\n    \"timeStamp\": 1460792555410103300,\n    \"kind\": \"move-made\",\n    \"data\": {\n      \"clicks\": 1,\n      \"madeBy\": 0,\n      \"madeById\": \"RazcS5nrgT-2G7kX4HPP\"\n    }\n  }\n})\n\n// If a player disconnects then the player-disconnect event will be emitted.\n// player-disconnect will have the turn number of the player who disconnected\nsocket.on('player-disconnect', function(r) {\n  // r will look like the following\n  {\n    \"timeStamp\": 1460792704214456000,\n    \"kind\": \"player-disconnect\",\n    \"data\": {\n      \"player\": 1\n    }\n  }\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiltfactor%2Ftoto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiltfactor%2Ftoto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiltfactor%2Ftoto/lists"}