PaimaStudios / paima-game-templates

Paima Engine Game Templates for developers.
https://paimastudios.com
MIT License
11 stars 8 forks source link

add events dummy example to chess #84

Open ecioppettini opened 2 months ago

ecioppettini commented 2 months ago

This is not a functional change, just an example application of the current code in https://github.com/PaimaStudios/paima-engine/pull/409 . It's also possible it may not compile, since I'm using local dependencies.

I defined an overloaded event to just to show how it looks, but both events are emitted at the same time (which could be a valid use-case though)

The events table looks something like this:

image

The joined lobby event was never emitted so it's not there.

The registered_event table looks like this:

image

The output of mqtt subscribe -h 127.0.0.1 -p 8883 -q 2 -l ws -t '#' -v looks something like this for example:

app/95a54b3250ababba95ca72d9c61a07554d8252746ad2ce711b44c0809adc75ac/user/0x82d9d608030496013587d9e0566509b2e6182afa/lobbyId/7ONFSpzOOwnO {"rounds":500}
app/b8c9872e0f8f4c6b9d9815fd4ff1f8746c6c4ca348911e7cda7fcc4771181ad6/user/0x82d9d608030496013587d9e0566509b2e6182afa/lobbyId/7ONFSpzOOwnO {"rounds":500,"isPractice":true}
node/block/1252 {}
node/block/1338 {}
app/365f0dd042b4225a85c20c6332be58dd5244de021b7778ef5d70d3056c9d5afa/winner/0x0 {}
node/block/1339 {}