say i'd like to make a multiplayer game/application using web technology, what are my best chances for achieving this without running a server? #WebRTC still needs a signaling server, but maybe someone else can let me use their signalis server for my app somehow?
alternatively maybe something like #libP2P can be used locally to create a tunnel of sorts?
@mauve using Agregore sounds like one of the cooler solutions. say i just wanna throw around jsons from one player to another, how could i best achieve that?
@sofia the built in libp2p pubsub support has you covered. Use a shared "topic" between the peers and send whatever you want. https://agregore.mauve.moe/docs/ipfs-protocol-handlers#libp2ps-pubsub-protocol-%F0%9F%93%B0
Bonus is that there's also an Android app in addition to mac/win/linux ehich supports the same APIs. No ios tho cause they don't allow custom browser engines still.
@mauve wow, that looks supercool 🤩!
i wanted to try in in the devtools but they seem to be b0rken here 🙁. (fresh install of the deb on ubuntu)
@sofia Well shit. :P Does using an older version work by any chance? I currently don't have a GOME / deb machine to test one. Also, does using the appimage help?
@mauve i'll try the appimage.
also it's KDE, not GNOME but you are excused 😉.
@mauve same error in 2.2.2 and 2.1.0 🙁.
@mauve oh, also i'm using wayland, maybe that's part of the issue? it seems mostly well-behaved by now but who knows…
@sofia Dang. 🤔 Nothing is rendering at all? I thibk there was some sort of "ozone wayland" flag for electron that folks were using. I think `--enable-features=UseOzonePlatform --ozone-platform=wayland`?
@mauve (forgot to attach the screenshot.)
the only problem with this one i see is that there is no icon (just blank) in the taskbar.
@sofia Oh that might be a GNOME thing. Tracking it here but I'm not certain what I'm doing wrong with regards to packing the icon. https://github.com/AgregoreWeb/agregore-browser/issues/181
Maybe the URL is wrong in the system tray and we need to use the unpacked asar directory? 🤷
@mauve the icon in the tray does work, but not in the task bar and the title bar of the window. no idea how these icons are assigned or how deb packages work…
and i'm still not using GNOME, lol.
anyway, i got it to send and recieve messages, which is quite exciting! though i haven't quite figured out how to attach the payload properly 😅.
also i guess it's about time i figure out how that async sorcery works 🔮.
@sofia Hmmm. Yeah no clue how the icons get set tbh. 😅😅
One thing to note, to test you'll want to have two devices loaded up since pubsub events don't get sent between tabs in the same browser instance. To support that case you'll want to use other browser apis to broadcast between your tabs
@mauve thanks again for you help so far, but i'm stuck again. i'm sending pubsub messages bewteen my desktop and laptop, any they arrive (yay!), but the it doesn't appear to send any payload, just an empty string (same as in my previous screenshot). do you know what i might be doing wrong?
@sofia Do you think you could link to your source code? It'd either be data not being in the body when you send, not parsing from the event source properly, or some sort of bug in the protocol handlers where they payload is being mishandled.
@mauve recieving:
let es = new EventSource('pubsub://testkeks/?format=base64')
es.onmessage = x => console.log (x.data)
sending:
fetch('pubsub://testkeks/', {method: 'POST', data: btoa ('giraffe cookies')})
recieved:
{"from":"12D3KooWKfd28A6ujcpxNgHZumXML84FT3HVaWD6mckBdgfXoxN8","data":""}
@sofia Sweet, I think it's the fetch request in this case! You need to use the `body` property instead of the `data` property. Did the docs say to use `data` by accident or something? :x I know I made that mixup a bunch in the past sadly. https://developer.mozilla.org/en-US/docs/Web/API/fetch
@mauve the docs kiiinda say "data": https://agregore.mauve.moe/docs/ipfs-protocol-handlers#libp2ps-pubsub-protocol-%F0%9F%93%B0
but yes, now it works! tysm 😊!
@sofia Excellent, ty! Just pushed a fix for those docs. Ty for your patience!