Urgent.News

What's breaking now, across thousands of outlets.

Tech

Online multiplayer with no game server: WebRTC invite links and a browser as referee

PlayTrova is a free games site I run as a fully static Next.js site, with no backend at all. I still wanted the board games to have the one feature families actually ask for: send a link, play together . No accounts, no lobby, and no server to pay for or keep alive. Today 12 of the turn-based games, including Checkers , Four in a Row, Reversi and Sea Battle , can be played online that way. Here's…

PlayTrova is a free, static Next.js website that offers turn-based board games without any backend, servers, or accounts. The site enables online multiplayer gaming via WebRTC invite links, eliminating the need for a game server or hosting. Twelve turn-based games, such as Checkers, Four in a Row, Reversi, and Sea Battle, can be played this way.

The core functionality involves two browsers communicating over a WebRTC data channel, with PeerJS providing the necessary signalling through a free hosted server. The host's peer ID, in the form of a room code, serves as the identifier for the game. The invite link, such as /games/checkers/?join=K7QX2M, is created using this code and can be shared with friends.

The games are deterministic, relying on pure logic and a seed stored in the game state for any randomness. This makes the networking process straightforward, as the host sends the seed and who moves first once, after which each side only sends its own moves as short strings. For instance, in Four in a Row, a move might be represented as "3".

The data channel's messages are parsed strictly to prevent malicious input. Each move is validated against the game's rules, ensuring both players receive and validate each other's moves. Additionally, a six-emoji reaction system serves as the chat function, with no support for arbitrary text input to maintain a family-friendly environment.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

377 SQL checks on 4.6 million generated rows: what they caught

In part 1 I showed the method: write every rule about your data as a sentence, then one SQL query that counts the rows breaking it. The rule holds when the query returns 0.

  • Author ran 377 SQL checks across 4.6 million generated rows
  • Identified issues like clustering of dates and unrealistic data counts
  • Explicitly written rules helped catch intended data problems

Reverse ASIN and Amazon Rank Tracking From Python, Without a Seller-Tool Subscription

Amazon sellers keep asking the same two questions: which keywords does this listing rank for , and is my rank going up or down ? Seller tools answer both for a monthly fee.

  • Apify Actor retrieves Amazon rank and keyword info without subscription
  • Reverse ASIN mode tracks up to 10 ASINs, returns keywords, searches, and ranks
  • Instant Pot ASIN example returned 20 keywords in 4 seconds at $0.090 cost

More from Thursday 5 November →