Menu

Controlling a Minecraft server from Laravel with RCON
📰

Controlling a Minecraft server from Laravel with RCON

DEV Community: laravel·Hugo Bachmann·11 days ago
#gtMMxmr2
#devtolaravel#devto#dev#server#rcon
Long article (3579 words) — no AI summary yet.
Reading 0:00
15s threshold

On Agoralis, a role-play Minecraft server, a player can buy a house from their phone. They tap "Buy" in the web app, the money leaves their bank account, and in the same request the region is theirs in the game: they become owner, the seller gets an in-game message. The same goes for jobs, XP and permissions. None of this goes through a database the game reads. Every action is a console command sent over RCON.

This article shows how we wired that up in Laravel: what an RCON packet looks like on the wire, how authentication works, how PHP sockets behave when the server does not answer, and the error-handling choices we made (and would make differently today).

TL;DR

RCON is a tiny TCP protocol: each packet is size | id | type | body\0\0 , all integers 32-bit little-endian.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.