Markkop / gather-town-websocket-examples

Examples on how to interact with Gather.town Web Socket API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

📡 Gather.town Websocket API interaction examples

Simple examples on how to interact with Gather.town Web Socket API

How to Develop

# Copy .env.example to .env
cp .env.example .env

# Set the environment variables on .env
# Get GATHER_API_KEY from https://gather.town/apiKeys
# Get GATHER_SPACE_ID from your space URL.
# Eg: 5jnhRfDYRIUyDmbF/my-space
# Get GATHER_MAP_ID from Mapmaker's Rooms panel

# Install dependencies
npm install

# Run server
npm run dev

Tips

Finding the event name and payload you wish to use

Go to node_modules/@gathertown/gather-game-common/src/events.proto and check ServerClientEvent message.
You might want to add this extension for syntax highlight.
On VSCode, select the the event name such as MapSetObjects, press Ctrl+D and find its payload.
You can also Ctrl+Click on the payload class names to check their content. In this case, WireObject.

References

About

Examples on how to interact with Gather.town Web Socket API


Languages

Language:TypeScript 99.7%Language:Shell 0.3%