Some checks failed
Build and Deploy / build-macos (push) Failing after 4s
Build and Deploy / build-windows (CLANG64) (push) Has been cancelled
Build and Deploy / package-dist (push) Has been cancelled
Build and Deploy / deploy-itch (push) Has been cancelled
Build and Deploy / deploy-gitea (push) Has been cancelled
Build and Deploy / build-linux (push) Has been cancelled
17 lines
321 B
JavaScript
17 lines
321 B
JavaScript
// Test to create a portal
|
|
|
|
var password = "abc123"
|
|
|
|
$_.portal(e => {
|
|
if (e.password !== password)
|
|
send(e, {reason:"Password does not match."});
|
|
else
|
|
send(e, $_)
|
|
}, 5678);
|
|
|
|
$_.receiver(e => {
|
|
console.log(`Got message: ${json.encode(e)}`)
|
|
send(e, {greet: "Hello back!"})
|
|
$_.delay(_ => $_.stop(), 0.2)
|
|
})
|