johnbox icon indicating copy to clipboard operation
johnbox copied to clipboard

Implement the `lock` opcode

Open StratusFearMe21 opened this issue 3 years ago • 2 comments

In order for Party Pack 9 to work with this server, it is essential that this opcode be implemented. My guess is that it's for "locking in" your answers in-game.

This is an example conversation between the ecast server, 1 host, and 2 players.

Welcome messages

Host Received: {"pc":0,"opcode":"client/welcome","result":{"id":1,"secret":"acbee8a31d3660758b87fa55","reconnect":false,"deviceId":"061bb8c28d.39e52f0dc5af5f1fb4dd31","entities":{},"here":{},"profile":null}}
Host Received: {"pc":1,"opcode":"client/connected","result":{"id":2,"userId":"cf857a72-e8ae-4ebd-92ab-7fdac160c475","name":"ISAAC","role":"player","reconnect":false,"profile":{"id":2,"roles":{"player":{"name":"ISAAC"}}}}}
Player 1 Received: {"pc":1,"opcode":"client/welcome","result":{"id":2,"name":"ISAAC","secret":"3e55d390-e822-4673-89d7-b9189ece81b3","reconnect":false,"deviceId":"03fc7cf552.12f10eec9fc54e20133f21","entities":{},"here":{"1":{"id":1,"roles":{"host":{}}}},"profile":{"id":2,"roles":{"player":{"name":"ISAAC"}}}}}
Host Received: {"pc":2,"opcode":"client/connected","result":{"id":3,"userId":"3d9845dd-ac69-4183-a5e9-dc69934b3f58","name":"ISAAC2","role":"player","reconnect":false,"profile":{"id":3,"roles":{"player":{"name":"ISAAC2"}}}}}
Player Two Received: {"pc":2,"opcode":"client/welcome","result":{"id":3,"name":"ISAAC2","secret":"0213201d-235e-4d88-b6cc-9b0d0db6d1b3","reconnect":false,"deviceId":"0165f909d4.d3d6b6f6f4feb347c8ebcc","entities":{},"here":{"1":{"id":1,"roles":{"host":{}}},"2":{"id":2,"roles":{"player":{"name":"ISAAC"}}}},"profile":{"id":3,"roles":{"player":{"name":"ISAAC2"}}}}}

Host creates text

Host Received: {"pc":3,"re":1,"opcode":"ok","result":{}}
Player 1 Received: {"pc":3,"opcode":"text","result":{"key":"name:3","val":"LOCK","version":0,"from":1}}

Player 1 updates text

Player 1 Received: {"pc":4,"re":2,"opcode":"ok","result":{}}
Host Received: {"pc":4,"opcode":"text","result":{"key":"name:3","val":"DUCK","version":1,"from":2}}

Player 1 sends lock

Player 1 Received: {"pc":6,"re":4,"opcode":"ok","result":{}}
Host Received: {"pc":6,"opcode":"lock","result":{"key":"name:3","from":2}}

Host sends room/exit

Player Two Received: {"pc":8,"opcode":"room/exit","result":{"cause":5}}
Host Received: {"pc":8,"re":5,"opcode":"ok","result":{}}
Player 1 Received: {"pc":8,"opcode":"room/exit","result":{"cause":5}}
Host Received: normal close
Player Two Received: normal close
Player 1 Received: normal close

I've tried implementing this API myself based on this conversation, but it only partially works, I must be missing something

StratusFearMe21 avatar Nov 16 '22 06:11 StratusFearMe21

Mentioning @InvoxiPlayGames in case you use the GitHub app

StratusFearMe21 avatar Nov 16 '22 06:11 StratusFearMe21

I don't currently own Party Pack 9 (or 8) so I'm unable to test this unfortunately. If I get around to picking it up I'll test this.

Also, looks like it might use a different set of opcodes for text entirely? text itself rather than text/set or text/update.

InvoxiPlayGames avatar Nov 16 '22 07:11 InvoxiPlayGames

Fixed with #4

StratusFearMe21 avatar May 23 '24 22:05 StratusFearMe21