Skip to content

Instantly share code, notes, and snippets.

@odensc
Last active April 2, 2017 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save odensc/4d2c4624fe2d5f8fea3a115dfea48c98 to your computer and use it in GitHub Desktop.
Save odensc/4d2c4624fe2d5f8fea3a115dfea48c98 to your computer and use it in GitHub Desktop.

r.setup

Relevant properties:

// amount of visitors 
"place_active_visitors": 50149,
// ???
"place_wait_seconds": 0,
// width of the canvas element
"place_canvas_width": 1000,
// height of the canvas element
"place_canvas_height": 1000,
// cooldown between places
"place_cooldown": 300,
// url of websocket which broadcasts places - may be unique on each load
"place_websocket_url": "wss://ws-03ddd0c61a1d8a4f8.wss.redditmedia.com/place?m=AQAAtfreWLK3pD9FQA1Oh4H1as9T71KZGtaLTqLGXxudLcDq5pQR",

WebSocket

JSON

{
	"type": "place", // type of message
	"payload": {
		"x": 506, // x position of pixel
		"y": 436, // y position of pixel
		"color": 3, // color of pixel, zero-indexed. index of color in palette
		"author": "spez" // username of placer
	}
}
{
	"type": "activity", // type of message
	"payload": {
		"count": 9001 // amount of users playing
	}
}

HTTP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment