Release Alpha 1.0.0.3: connect shop servers and unify community experience

This commit is contained in:
unimatrixgit 2026-11-02 03:42:45 +01:00
commit a76da3e78d
33 changed files with 324 additions and 11 deletions

32
website/ALPHA-1.0.0.3.md Normal file
View file

@ -0,0 +1,32 @@
# Alpha 1.0.0.3 — Shop and community update
Released 2 November 2026. This is an Alpha patch; the full roadmap is not complete.
## Included
- Native website shop with central DuneRealms sign-in, Member/VIP website role selection, protected/staff-rank exclusion and scoped support/coupon permissions.
- Six selectable game servers connected using official AzLink 1.3.13. Verified Java/Bedrock recipient snapshots, UUID-aware online delivery and network-operator-only command configuration. The proxy is excluded.
- Owner-configured PayPal enabled. VIP product artwork/lore and storefront styling updated. The redundant introduction and full-window button removed.
- Separate Account/Staff Center portals with contextual menus and artwork. Website team ban-list access retained.
- Searchable public ban register: 50 records per page, latest 12 on the portal and a full-list link. Private evidence and unresolved identities stay private.
- Canonical shared navigation scripts/styles across website, Boards and Support; desktop/mobile menu fixes and matching Support controls.
- Readable news titles/dates, category artwork and safe article formatting with HTTPS signup links.
- Private Alpha Tester Signup intake in Support, seven custom application fields and a Support-home invitation. Existing recruitment article rewritten with plans, test priorities and signup links.
## Verification
- Seven focused Node checks passed: public data/pagination, CP grouping, SSO, safe news rendering and search visibility.
- Thirteen isolated PHP command-bridge checks passed, including Java/Bedrock identity, command safety, operator gating and online UUID matching.
- Read-only `version` commands executed through the native queue on all six live game servers; test queue drained.
- Native machine API: unsigned request 401, valid status 200, registration blocked 403.
- Browser verified server choices, VIP artwork, canonical community headers, article layout, seven signup fields and signup links.
## Limits and open work
No successful real-money PayPal capture was tested; the existing pending payment was preserved. No synthetic Alpha application was submitted. Upcoming VIP generator benefits remain explicitly planned. Outstanding game GUI work, native kit/quest progression and the separately staged ban-fleet import are not claimed complete in this patch.
Two earlier broad permission-suite assertions remain stale (retired game-node documentation and an overly strict web-node regex); focused checks for this patch pass. The legacy patch-note generator cannot validate the pre-existing 2026-10-28 metadata format, so this Alpha is published as a Git prerelease with these notes rather than rewriting historical records.
## Operation
Backups were taken before application/configuration changes. No world regeneration, inventory-engine upgrade or real financial transaction was performed. Work and scheduled production remain paused at the user's request after publication.

View file

@ -0,0 +1,45 @@
DuneRealms is looking for Alpha testers. If you enjoy exploring new systems, trying unusual combinations and helping a community take shape, we would love to have you aboard.
This is an early Alpha, not a finished release. Some features are playable, others are still being developed, and rough edges are part of the journey. You do not need to buy anything to volunteer.
## What we are building
The Quest for Tavren II Aedrecht brings together a desert science-fiction Minecraft network and a connected community website. Our direction includes:
- A lobby and connected worlds, with travel between them through the network.
- Java and Bedrock access, linked website accounts and a shared player identity.
- Custom menus, jobs, spice trading, inventory systems and a Dunemark economy.
- Clans, clan banking, kit design and player trading.
- Quests, discoveries and longer-term progression, with more world and political systems planned.
- A connected website, forums and Support Center that make it easier to follow your journey and get help.
This describes the direction of the project; it is not a claim that every system is complete. The next stages focus on more polished menus, stronger Java/Bedrock compatibility, clearer kit and clan tools, and balanced quest progression.
## What we need help testing
- First-time setup: registration, linking a Minecraft account, joining and reaching the lobby.
- Java and Bedrock differences: controls, menus, text, images and actions that behave differently between clients.
- Travel: choosing destinations, arriving safely and returning to the lobby.
- Inventory and economy: items, balances, trading and what happens when you reconnect or change worlds.
- Menus and everyday tasks: unclear labels, dead buttons, missing options and too many steps.
- Clan and kit features as they become available: permissions, previews, ownership and ordinary player workflows.
- Website and Support: mobile layouts, account navigation and reporting a problem.
New players are especially useful: the things an experienced administrator overlooks are often the first things a newcomer notices. You do not need previous testing experience, and occasional testers are welcome.
## How to sign up
[Sign up for Alpha testing](https://support.dunerealms.com/alpha-signup.php)
The signup opens a private Support ticket. Tell us your Minecraft username, whether you play Java or Bedrock, your platform, a rough idea of your available time and what you would like to test. In the ticket details, add a few words about why you are interested. Our Support team will review your application and reply with the next steps.
Use your DuneRealms account to sign in. You can create or manage it in the [Account Center](https://cp.dunerealms.com/).
## What makes a useful bug report?
Tell us which edition and world you were using, the steps that led to the problem, what you expected and what actually happened. A screenshot or short video helps when the problem is visual. Mention whether you can reproduce it after reconnecting. Please leave passwords, payment details and unrelated personal information out of reports.
Ready to help shape the realms? [Join the Alpha tester crew](https://support.dunerealms.com/alpha-signup.php).
With regards,
The DuneRealms team

View file

@ -0,0 +1,13 @@
<?php
namespace Azuriom\Games\Minecraft\Servers;
use Azuriom\Models\User;
use Azuriom\Support\DuneShopGameIdentity;
class DuneShopAzLink extends AzLink
{
public function sendCommands(array $commands,User $user,bool $needConnected=false): void {
$recipient=['uuid'=>$user->getAttribute('dune_delivery_uuid'),'name'=>$user->getAttribute('dune_delivery_name')];
$rows=[];foreach($commands as $command)$rows[]=['command'=>DuneShopGameIdentity::expand($command,$recipient),'user_id'=>$user->id,'need_online'=>$needConnected,'dune_minecraft_uuid'=>$recipient['uuid'],'dune_minecraft_name'=>$recipient['name'],'created_at'=>now(),'updated_at'=>now()];
// Native AzLink queue; polling only, no new inbound game-server listener.
if($rows)\Illuminate\Support\Facades\DB::table('server_commands')->insert(array_map(fn($r)=>['server_id'=>$this->server->id]+$r,$rows));
}
}

View file

@ -0,0 +1,20 @@
<?php
namespace Azuriom\Support;
use PDO;
class DuneShopGameIdentity
{
public static function linked(string $account): ?array {
$c=json_decode(file_get_contents('/home/dunerealms/.config/integrations.json'),true,8,JSON_THROW_ON_ERROR);
$db=new PDO('mysql:host='.$c['host'].';dbname='.$c['database'].';charset=utf8mb4',$c['username'],$c['password'],[PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION,PDO::ATTR_EMULATE_PREPARES=>false]);
$q=$db->prepare('SELECT minecraft_uuid,minecraft_name FROM site_game_links WHERE user_id=?');$q->execute([$account]);$r=$q->fetch(PDO::FETCH_ASSOC);
return $r&&self::valid($r['minecraft_uuid'],$r['minecraft_name'])?['uuid'=>strtolower($r['minecraft_uuid']),'name'=>$r['minecraft_name']]:null;
}
public static function valid($uuid,$name): bool {return is_string($uuid)&&preg_match('/^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/i',$uuid)&&is_string($name)&&preg_match('/^[.a-z0-9_]{1,32}$/i',$name);}
public static function expand(string $command,array $recipient): string {
if(!self::valid($recipient['uuid']??null,$recipient['name']??null))throw new \RuntimeException('A verified Minecraft identity is required.');
$command=strtr($command,['{uuid}'=>$recipient['uuid'],'{game_id}'=>$recipient['uuid'],'{player}'=>$recipient['name'],'{name}'=>$recipient['name']]);
if(!preg_match('/^[A-Za-z][ -~]{0,239}$/D',$command))throw new \RuntimeException('Enter one console command without a leading slash.');
return $command;
}
public static function mayConfigure(array $identity): bool { $p=$identity['permissions']??[];return in_array('web.menu.servers',$p,true)&&in_array('web.servers.console',$p,true); }
}

View file

@ -0,0 +1,10 @@
<?php
namespace Azuriom\Support;
class DuneShopGameServers
{
public static function render(){
abort_unless(DuneShopGameIdentity::mayConfigure(request()->attributes->get('dune_identity',[])),403);
$rows='';foreach(\Azuriom\Models\Server::executable()->get() as $server){$data=$server->getData();$rows.='<tr><td>'.e($server->name).'</td><td>'.($data===null?'Awaiting connection':'Connected').'</td><td>AzLink · outbound HTTPS</td></tr>';}
return response('<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Connected shop servers</title><link rel="stylesheet" href="https://www.dunerealms.com/styles.css"><body style="padding:32px;background:#10271f;color:#eee6ce"><h1>Connected shop servers</h1><p>Select these servers in a product’s command settings. Commands for online players wait for the matching Minecraft UUID. The proxy is excluded.</p><table style="width:100%;text-align:left;border-spacing:16px"><thead><tr><th>Server</th><th>Status</th><th>Connection</th></tr></thead><tbody>'.$rows.'</tbody></table><p><a href="https://cp.dunerealms.com/?center=staff&amp;staff-area=game-staff#server-operations" target="_top">Open CP network controls</a> · <a href="https://cp.dunerealms.com/store/admin/shop/packages">Back to products</a></p><p>Use {uuid} for UUID-based permission commands and {player} for the verified Minecraft name. Server keys remain private.</p></body></html>')->header('Cache-Control','private, no-store');
}
}

View file

@ -0,0 +1,6 @@
<?php
namespace Azuriom\Games\Minecraft;
class DuneShopMinecraftGame extends MinecraftOfflineGame
{
public function getSupportedServers(): array {return ['mc-azlink'=>\Azuriom\Games\Minecraft\Servers\DuneShopAzLink::class];}
}

View file

@ -16,6 +16,8 @@ class DuneShopRankHooks
public static function register(): void
{
Package::saving(function (Package $package) {
if(request()->routeIs('shop.admin.packages.store','shop.admin.packages.update') && ($package->commands||$package->getOriginal('commands')) && $package->isDirty('commands') && !DuneShopGameIdentity::mayConfigure(request()->attributes->get('dune_identity',[])))throw ValidationException::withMessages(['commands'=>'Only authorised network console operators can configure server commands.']);
if (request()->routeIs('shop.admin.packages.store','shop.admin.packages.update')) {
$package->dune_website_rank = request()->input('dune_website_rank','user');
$required=request()->input('dune_required_ranks',[]);
@ -32,7 +34,10 @@ class DuneShopRankHooks
if ($item->buyable instanceof Package) {
$rank=$item->buyable->dune_website_rank??'user';
if (!DuneShopRanks::allowedRank($rank)) throw new \RuntimeException('Protected package rank');
$variables=$item->variables??[];$variables['_dune_website_rank']=$rank;$item->variables=$variables;
$variables=$item->variables??[];$variables['_dune_website_rank']=$rank;
$gameCommands=array_merge($item->buyable->commands??[],json_decode(setting('shop.commands')?:'[]',true,16,JSON_THROW_ON_ERROR));
if($gameCommands){$recipient=DuneShopGameIdentity::linked($item->payment->user->dune_account_id??'');if(!$recipient)throw ValidationException::withMessages(['minecraft'=>'Link your Minecraft account before buying a package with in-game rewards.']);$variables['_dune_minecraft_uuid']=$recipient['uuid'];$variables['_dune_minecraft_name']=$recipient['name'];}
$item->variables=$variables;
}
});
Event::listen(PaymentPaid::class,function (PaymentPaid $event) {
@ -44,6 +49,7 @@ class DuneShopRankHooks
}
public static function hasRequiredWebsiteRole(Package $package): bool
{
if(($package->commands||setting('shop.commands'))&&!DuneShopGameIdentity::linked(request()->attributes->get('dune_identity')['id']??''))return false;
$required=json_decode($package->dune_required_ranks??'[]',true,8,JSON_THROW_ON_ERROR);
if(!$required)return true;
if(!is_array($required)||array_filter($required,fn($r)=>!is_string($r)||!DuneShopRanks::allowedRank($r)))return false;

View file

@ -9,9 +9,10 @@ class DuneShopServiceProvider extends ServiceProvider
{
public function boot(): void
{
$this->app->booted(fn () => \Azuriom\Support\DuneShopRankHooks::register());
$this->app->booted(function(){ $this->app->instance('game',new \Azuriom\Games\Minecraft\DuneShopMinecraftGame()); \Azuriom\Support\DuneShopRankHooks::register(); });
$this->app->make(\Illuminate\Contracts\Http\Kernel::class)
->appendMiddlewareToGroup('web', DuneShopAccount::class);
Route::middleware('web')->get('/dune-servers', fn () => \Azuriom\Support\DuneShopGameServers::render());
Route::middleware('web')->get('/dune-login', fn (\Illuminate\Http\Request $request) => DuneShopAccount::login($request));
}
}

View file

@ -6,6 +6,11 @@ DuneShopAccount is installed as web middleware; DuneShopServiceProvider register
Deployment also patches native Package saving/eligibility, PaymentItem snapshot/revoke, package form and native admin layout. These upstream-specific changes must be preserved when updating Azuriom/Shop; these helper files alone are not an installer. Private backups are on the web host. Re-check integration after upstream upgrades.
Current verified limitations: no live PayPal payment tested; owner configures PayPal and products. Native server command delivery is NOT connected to the CP agent or game servers. The Servers link opens CP operations but does not itself connect automatic fulfillment. Do not advertise Minecraft rank delivery. VIP future generator/three codes remain next-Alpha backlog.
Current verified limitations: no live PayPal payment tested; owner configures PayPal and products. Native server command delivery now uses the official AzLink 1.3.13 queue on six game servers (proxy excluded). DuneShopMinecraftGame selects the guarded bridge. Payment items snapshot a verified central Minecraft UUID/name; queued commands retain that recipient, including Bedrock identities. Online-only commands require the matching UUID. Native API access is limited to authenticated status and polling; registration/account/balance endpoints are blocked. Command configuration requires central server-console permissions. Native upstream edits are captured in native-azlink.patch against the prior Dune-patched installation. VIP future generator/three codes remain next-Alpha backlog.
PHP policy and transaction tests use fictional identities and connection-local temporary tables. Never create real payments to test this bridge.
2026-11-02 rollout: six native executable server records and matching private AzLink config files installed, instantCommands=false (outbound HTTPS polling only), no RCON or new game-host listener. Official jar SHA256: 4d51f7fbcfaa0b9e61c2caf8ee2be193cb93c80fb1f4b4a01052b4841f3381de. Private keys are NOT included here. All six services restarted sequentially and confirmed connected. Read-only version commands drained and were observed in all six logs. Native AzLink queue semantics remain upstream; HTTP polling confirmation is not a financial end-to-end test or a guarantee of exactly-once execution during network failure. No existing pending payment was changed.
13 game-bridge checks run with fictional identities and a connection-local temporary queue. Run the QA script as the application owner, not root: Laravel runtime cache/log ownership must remain dunerealms. Shared header JS/CSS are proxied from the canonical website asset on native hosts with no-store; native application styling remains separate. The owner explicitly enabled the configured PayPal Standard gateway; no successful live PayPal capture was tested.

View file

@ -6,3 +6,22 @@ body .main,body .content,body .wrapper{background:#10271f;color:#eee4cb}body .si
body h1,body h2,body h3,body .h1,body .h2,body .h3,body label,body .form-label{color:#e7ce91!important}body .form-text{color:#b5c6b9!important}
.dune-vip-package{padding:20px;border:1px solid #b99a4c;border-radius:14px;background:linear-gradient(145deg,#153a30,#0b201b);color:#eee6ce}.dune-vip-package>p:first-child{text-align:center}.dune-vip-package img{display:block;margin:0 auto;object-fit:contain;filter:drop-shadow(0 4px 12px #b99a4c44)}.dune-vip-package h2{color:#e8cb7c;text-align:center}.dune-vip-package h3{margin-top:22px;padding-top:16px;border-top:1px solid #587356;color:#e8cb7c}.dune-vip-package li{margin:9px 0;line-height:1.6}.dune-vip-package>p:last-child{font-style:italic;text-align:center;color:#d5bc75}
/* Shared DuneRealms storefront language: emerald, antique gold, clear type. */
body.dune-shop-front{font:15px/1.65 Manrope,Arial,sans-serif!important;background:radial-gradient(ellipse at top,#1b3e30,#10251e 65%)!important}
.dune-shop-front :is(h1,h2,h3,h4,h5,.h1,.h2,.h3,.h4,.h5){font-family:Manrope,Arial,sans-serif!important;letter-spacing:-.025em;line-height:1.25;color:#e7ce91!important;font-weight:700}
.dune-shop-front h1{font-size:clamp(27px,4vw,38px);margin-bottom:28px}
.dune-shop-front .navbar{border-bottom:1px solid #9b804b66;background:#112b22!important;padding:12px 20px}
.dune-shop-front .navbar-brand{font-size:18px;font-weight:700;letter-spacing:.02em}
.dune-shop-front :is(.card,.list-group,.modal-content){border:1px solid #7b7449!important;border-radius:14px!important;box-shadow:0 9px 24px #0002;background:#17372a!important}
.dune-shop-front .card{height:100%;transition:border-color .15s,box-shadow .15s}
.dune-shop-front .card:hover{border-color:#c6a55e!important;box-shadow:0 12px 28px #0004}
.dune-shop-front .card-img-top{width:100%;height:280px;object-fit:contain;padding:25px;background:radial-gradient(ellipse,#35503a55,#112b2366);border-bottom:1px solid #8a764444}
.dune-shop-front .card-body{padding:24px}.dune-shop-front .card h4{font-size:24px}.dune-shop-front .card h5{font-size:23px;color:#f1d58a!important;margin:12px 0 22px}
.dune-shop-front :is(.btn-primary,.btn-success){background:linear-gradient(135deg,#d3b56c,#b29448)!important;border:1px solid #e1c98b!important;color:#10261f!important;font:700 14px/1.4 Manrope,Arial,sans-serif;border-radius:8px;padding:11px 20px;box-shadow:inset 0 1px #fff3,0 3px 8px #0002}
.dune-shop-front :is(.btn-primary,.btn-success):hover{background:#e1c98b!important;filter:brightness(1.06)}
.dune-shop-front :is(.form-control,.form-select){border-radius:8px;border-color:#72815d!important;min-height:42px}.dune-shop-front :is(.form-control,.form-select):focus{box-shadow:0 0 0 3px #d1ad6030;border-color:#d1ad60!important}
.dune-shop-front .list-group-item{padding:14px 18px;border-color:#496046!important}.dune-shop-front .list-group-item.active{background:linear-gradient(100deg,#3c5035,#263e2b)!important;border-left:3px solid #d4b46a!important}
.dune-shop-front .modal-dialog{max-width:900px}.dune-shop-front .modal-header,.dune-shop-front .modal-footer{background:#142f25;border-color:#7b744966}.dune-shop-front .modal-body{padding:20px}.dune-shop-front .modal-header .btn-close{filter:invert(1);opacity:.75}
.dune-shop-front footer{border-top:1px solid #7b744944;font-size:12px;color:#abbeb0;padding:20px!important}.dune-shop-front .alert{border-radius:10px;line-height:1.6}
@media(max-width:650px){.dune-shop-front .card-img-top{height:225px}.dune-shop-front .card-body{padding:20px}.dune-shop-front .modal-body{padding:12px}.dune-shop-front .navbar{padding:10px}.dune-shop-front main{padding-top:20px!important}}

View file

@ -0,0 +1,11 @@
<?php
chdir('/home/dunerealms/apps/azuriom');require 'vendor/autoload.php';$app=require 'bootstrap/app.php';$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
use Azuriom\Support\DuneShopGameIdentity as Identity;use Illuminate\Support\Facades\DB;use Azuriom\Models\Server;use Azuriom\Models\User;use Illuminate\Http\Request;
function check($ok,$message){if(!$ok)throw new RuntimeException($message);echo "PASS $message\n";}
$java=['uuid'=>'11111111-1111-4111-8111-111111111111','name'=>'ExamplePlayer'];$bedrock=['uuid'=>'00000000-0000-0000-0009-01f5413c46e7','name'=>'.ExampleBedrock'];
check(Identity::valid(...array_values($java)),'Java identity valid');check(Identity::valid(...array_values($bedrock)),'Bedrock identity valid');check(!Identity::valid($java['uuid'],'bad;name'),'Unsafe name rejected');check(Identity::expand('lp user {uuid} parent add vip',$java)==='lp user '.$java['uuid'].' parent add vip','Verified UUID placeholder');check(Identity::expand('give {player} stone',$bedrock)==='give .ExampleBedrock stone','Bedrock name placeholder');
try{Identity::expand("list\nstop",$java);throw new LogicException('Expected rejection');}catch(RuntimeException $e){check(!($e instanceof LogicException),'Multiline rejected');}
check(!Identity::mayConfigure(['permissions'=>['web.shop.support']]),'Shop support cannot configure console rewards');check(Identity::mayConfigure(['permissions'=>['web.menu.servers','web.servers.console']]),'Console operator can configure rewards');
config(['cache.default'=>'array']);DB::statement('CREATE TEMPORARY TABLE server_commands (id BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,server_id BIGINT UNSIGNED,user_id BIGINT UNSIGNED,need_online BOOLEAN,command TEXT,dune_minecraft_uuid VARCHAR(36),dune_minecraft_name VARCHAR(32),created_at DATETIME,updated_at DATETIME)');$server=Server::where('data->dune-server','lobby')->firstOrFail();$u=new User();$u->id=999999;$u->setAttribute('dune_delivery_uuid',$java['uuid']);$u->setAttribute('dune_delivery_name',$java['name']);$server->bridge()->sendCommands(['give {player} stone'], $u,true);$server->bridge()->sendCommands(['list'],$u,false);
check(DB::table('server_commands')->count()===2,'Native queue receives commands without executing');$fetch=function($players)use($server){$r=Request::create('/api/azlink','POST',[],[],[],['CONTENT_TYPE'=>'application/json'],json_encode(['server-id'=>$server->id,'players'=>$players,'maxPlayers'=>20,'full'=>false]));return (new Azuriom\Http\Controllers\Api\ServerController())->fetch($r)->getData(true);};
$r=$fetch([]);check(count($r['commands'])===1&&DB::table('server_commands')->count()===1,'Offline action drained; online action retained');$r=$fetch([['uuid'=>'22222222-2222-4222-8222-222222222222','name'=>'ExamplePlayer']]);check(DB::table('server_commands')->count()===1,'Same name with wrong UUID cannot receive online reward');$r=$fetch([['uuid'=>$java['uuid'],'name'=>'ExamplePlayer']]);check(DB::table('server_commands')->count()===0&&$r['commands']['ExamplePlayer'][0]==='give ExamplePlayer stone','Matching UUID drains recipient snapshot');$r=$fetch([]);check(!$r['commands'],'Drained action is not returned again');echo "No real payment or console action executed.\n";

View file

@ -0,0 +1,58 @@
--- a/plugins/shop/src/Models/Package.php
+++ b/plugins/shop/src/Models/Package.php
@@ -567,13 +567,16 @@
], [
$item->quantity, $this->id, $this->name, $item->price, $item->payment->transaction_id,
], $command))
- ->map(fn (string $command) => $item->replaceVariables($command))
+ ->map(fn (string $command) => $item->replaceVariables(\Azuriom\Support\DuneShopGameIdentity::expand($command,['uuid'=>$item->variables['_dune_minecraft_uuid']??null,'name'=>$item->variables['_dune_minecraft_name']??null])))
->all();
return $command;
})
->filter(fn (array $command) => $command['server'] !== null);
- $this->sendServerCommands($commands, $item->payment->user);
+ $recipient=clone $item->payment->user;
+ $recipient->setAttribute('dune_delivery_uuid',$item->variables['_dune_minecraft_uuid']??null);
+ $recipient->setAttribute('dune_delivery_name',$item->variables['_dune_minecraft_name']??null);
+ $this->sendServerCommands($commands, $recipient);
}
}
--- a/app/Http/Controllers/Api/ServerController.php
+++ b/app/Http/Controllers/Api/ServerController.php
@@ -73,10 +73,11 @@
], $request->json('full', false));
$users = User::whereIn($uidKey ? 'game_id' : 'name', $players)->get();
+ $onlineUuids=array_map(function($uuid){$v=strtolower(str_replace('-','',$uuid));return strlen($v)===32?substr($v,0,8).'-'.substr($v,8,4).'-'.substr($v,12,4).'-'.substr($v,16,4).'-'.substr($v,20):'';},array_keys($players));
$commands = $server->commands()
- ->with('user')
- ->where(function (Builder $query) use ($users) {
- $query->whereIn('user_id', $users->modelKeys())
+ ->with('user')->whereNotNull('dune_minecraft_uuid')->whereNotNull('dune_minecraft_name')
+ ->where(function (Builder $query) use ($onlineUuids) {
+ $query->whereIn('dune_minecraft_uuid', $onlineUuids)
->orWhere('need_online', false);
})
->limit(100)
@@ -251,7 +252,7 @@
protected function mapLegacyCommands(Collection $commands): Collection
{
- return $commands->groupBy('user.name')
+ return $commands->groupBy('dune_minecraft_name')
->map(fn (Collection $group) => $group->pluck('command'));
}
--- a/app/Http/Middleware/VerifyServerToken.php
+++ b/app/Http/Middleware/VerifyServerToken.php
@@ -16,6 +16,8 @@
*/
public function handle(Request $request, Closure $next): Response
{
+ abort_unless($request->is('api/azlink') && in_array($request->method(),['GET','POST'],true),403,'Only game status and command polling are enabled.');
+
$token = $request->header('Azuriom-Link-Token');
abort_if($token === null, 401, 'No server key provided.');

View file

@ -0,0 +1,16 @@
# Include inside each native community HTTPS server block.
# Native pages keep same-origin CSP while fetching the canonical website header assets.
location = /dune-navigation.js {
proxy_pass http://127.0.0.1:3000/portal-navigation.js;
proxy_set_header Host www.dunerealms.com;
proxy_hide_header Cache-Control;
add_header Cache-Control "no-store" always;
add_header X-Content-Type-Options nosniff always;
}
location = /dune-navigation.css {
proxy_pass http://127.0.0.1:3000/portal-navigation.css;
proxy_set_header Host www.dunerealms.com;
proxy_hide_header Cache-Control;
add_header Cache-Control "no-store" always;
add_header X-Content-Type-Options nosniff always;
}

View file

@ -13,18 +13,23 @@ function dune_shared_header($html) {
$html=str_ireplace('</head>',$head.'</head>',$html);
}
if(!str_contains($html,'class="dune-memorial"')&&is_file($base.'shared-memorial.html'))$html=preg_replace_callback('/<header class="dune-site-header"[\s\S]*?<\/header>/',fn($m)=>str_replace('</header>',file_get_contents($base.'shared-memorial.html').'</header>',$m[0]),$html,1);
$html=preg_replace('~https://www\.dunerealms\.com/portal-navigation\.(js|css)(?:\?[^\"\s>]*)?~','/dune-navigation.$1?v=memorial-20261030-4',$html);
$html=preg_replace('~https://www\.dunerealms\.com/portal-navigation\.(js|css)(?:\?[^\"\s>]*)?~','/dune-navigation.$1?v=shared-20261102',$html);
if(($_SERVER['HTTP_HOST']??'')==='support.dunerealms.com'&&!str_contains($_SERVER['SCRIPT_NAME']??'','/scp/'))$html=str_ireplace('</head>','<script src="/dune-appeal-routing.js" defer></script></head>',$html);
if(($_SERVER['HTTP_HOST']??'')==='support.dunerealms.com'){
$html=str_ireplace('</head>','<link rel="stylesheet" href="/dune-osticket-theme.css?v=1"></head>',$html);
$html=str_ireplace('</head>','<link rel="stylesheet" href="/dune-osticket-theme.css?v=20261102-theme"></head>',$html);
$html=str_ireplace('</head>','<link rel="stylesheet" href="/dune-ticket-compose.css?v=4"><script src="/dune-ticket-compose.js?v=4" defer></script></head>',$html);
$html=str_ireplace('</head>','<link rel="stylesheet" href="/dune-support.css?v=signature-4"></head>',$html);
$html=preg_replace('/<body\b(?![^>]*\bclass=)/i','<body class="dune-support"',$html,1);
}
if(($_SERVER['HTTP_HOST']??'')==='support.dunerealms.com')$html=preg_replace('~(?<=>)\s*[a-f0-9-]{36}@accounts\.dunerealms\.invalid\s*(?=<)~i','Website account',$html);
// Alpha recruitment is a native private help-topic intake, not an automatic rank grant.
if(($_SERVER['HTTP_HOST']??'')==='support.dunerealms.com' && str_contains($html,'id="landing_page"') && !str_contains($html,'dune-alpha-invitation')){
$invite='<section class="dune-alpha-invitation"><img src="https://www.dunerealms.com/assets/news-community.webp" alt="" width="180" height="120"><div><p class="eyebrow">HELP SHAPE THE REALMS</p><h2>Become an Alpha tester</h2><p>Java or Bedrock, new or experienced: tell us what you would like to test. Applications are reviewed privately by Support.</p><a class="button" href="/alpha-signup.php">Sign up for Alpha testing</a></div></section>';
$html=preg_replace_callback('/<div\b[^>]*id=["\']landing_page["\'][^>]*>/i',fn($m)=>$m[0].$invite,$html,1);
}
// DuneRealms native MyBB surface polish
if(($_SERVER['HTTP_HOST']??'')==='forums.dunerealms.com'){
$html=str_replace('/dune-navigation.js?v=memorial-20261030-4','/dune-navigation.js?v=boards-keyboard-20261101',$html);
$html=str_replace('/dune-navigation.js?v=shared-20261102','/dune-navigation.js?v=shared-20261102',$html);
$html=str_ireplace('</head>','<link rel="stylesheet" href="/dune-forum-polish.css?v=1"></head>',$html);
$html=preg_replace_callback('/<body\b([^>]*)>/i',function($m){$attrs=$m[1];if(preg_match('/\bclass=["\']([^"\']*)["\']/i',$attrs))$attrs=preg_replace('/\bclass=(["\'])([^"\']*)\1/i','class="$2 dune-forum"',$attrs,1);else $attrs.=' class="dune-forum"';return '<body'.$attrs.'>';},$html,1);
}

View file

@ -0,0 +1,4 @@
<?php
require 'client.inc.php';
foreach(Topic::getPublicHelpTopics() as $id=>$name){if($name==='Alpha Tester Signup'){header('Location: /open.php?topicId='.(int)$id, true,302);exit;}}
http_response_code(503);echo 'Alpha signup is temporarily unavailable. Please use the Support Center.';

View file

@ -0,0 +1,27 @@
<?php
// Idempotent CLI installer: creates intake metadata only, never applications or ranks.
if(PHP_SAPI!=='cli')exit(1);
$c=json_decode(file_get_contents('/home/dunerealms/.config/integrations.json'),true,8,JSON_THROW_ON_ERROR);
$db=new PDO('mysql:host='.$c['host'].';dbname='.$c['database'].';charset=utf8mb4',$c['username'],$c['password'],[PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION,PDO::ATTR_DEFAULT_FETCH_MODE=>PDO::FETCH_ASSOC]);
function alphaFind($table,$key,$value){global $db;$q=$db->prepare('SELECT * FROM '.$table.' WHERE `'.$key.'`=?');$q->execute([$value]);return $q->fetch();}
function alphaInsert($table,$r){global $db;$keys=array_keys($r);$q=$db->prepare('INSERT INTO '.$table.' (`'.implode('`,`',$keys).'`) VALUES('.implode(',',array_fill(0,count($keys),'?')).')');$q->execute(array_values($r));return(int)$db->lastInsertId();}
$base=alphaFind('drsupport_help_topic','topic','General support');$subject=alphaFind('drsupport_form_field','name','subject');if(!$base||!$subject)throw new RuntimeException('Native support base missing.');
$db->beginTransaction();try{
$form=alphaFind('drsupport_form','name','dune_alpha_signup');
if(!$form)$formId=alphaInsert('drsupport_form',['pid'=>0,'type'=>'G','flags'=>1,'title'=>'Alpha tester application','instructions'=>'Tell us how you would like to help. Use your Minecraft name, not your real name. Rough availability is enough; this is not a commitment. Do not include passwords, addresses, dates of birth or payment information. In Issue Details, briefly tell us why you would like to test.','name'=>'dune_alpha_signup','notes'=>'Private applications for manual Support review. No automatic approval, rank assignment or rewards.','created'=>gmdate('Y-m-d H:i:s'),'updated'=>gmdate('Y-m-d H:i:s')]);else $formId=(int)$form['id'];
$fields=[
['alpha_minecraft','Minecraft username','text',true,['size'=>32,'length'=>32],'Include the Bedrock prefix if your name has one.'],
['alpha_edition','Which edition can you test?','choices',true,['choices'=>"java:Java Edition\nbedrock:Bedrock Edition\nboth:Both Java and Bedrock",'prompt'=>'Choose an edition','multiselect'=>false],''],
['alpha_platform','Platforms you can use','choices',true,['choices'=>"pc:PC or laptop\nconsole:Console\nmobile:Phone or tablet",'multiselect'=>true],'Select all that apply.'],
['alpha_availability','Approximate testing time per week','choices',true,['choices'=>"under1:Less than one hour\n1to3:1 to 3 hours\n4to7:4 to 7 hours\n8plus:8 hours or more\nflexible:Occasional or flexible",'prompt'=>'Choose an estimate','multiselect'=>false],'An estimate only; no fixed schedule is required.'],
['alpha_focus','What would you like to test?','choices',true,['choices'=>"accounts:Account linking and first login\ntravel:World travel and exploration\nmenus:Menus, controls and accessibility\neconomy:Items, inventory and trading\nclans:Clans, banks and kits\nquests:Quests and progression\nany:Happy to test anything",'multiselect'=>true],'Choose as many as you like. Some systems are still planned or being built.'],
['alpha_experience','Previous testing experience (optional)','memo',false,['rows'=>3,'cols'=>60,'length'=>700,'html'=>false],'New testers are welcome. Mention useful experience, or leave this blank.'],
['alpha_ack','Alpha participation','bool',true,['desc'=>'I understand this is an unfinished Alpha and will report problems constructively.'],'']
];
foreach($fields as$i=>[$name,$label,$type,$required,$config,$hint]){if(alphaFind('drsupport_form_field','name',$name))continue;$r=$subject;unset($r['id']);$r['form_id']=$formId;$r['type']=$type;$r['flags']=0x3301|($required?0x400:0);$r['name']=$name;$r['label']=$label;$r['configuration']=json_encode($config,JSON_THROW_ON_ERROR);$r['hint']=$hint;$r['sort']=$i+1;$r['created']=$r['updated']=gmdate('Y-m-d H:i:s');alphaInsert('drsupport_form_field',$r);}
$topic=alphaFind('drsupport_help_topic','topic','Alpha Tester Signup');
if(!$topic){$r=$base;unset($r['topic_id']);$r['topic']='Alpha Tester Signup';$r['dept_id']=1;$r['ispublic']=1;$r['notes']='Alpha tester applications; Support reviews privately. No automatic rank or reward.';$r['created']=$r['updated']=gmdate('Y-m-d H:i:s');$topicId=alphaInsert('drsupport_help_topic',$r);}else $topicId=(int)$topic['topic_id'];
$q=$db->prepare('SELECT form_id FROM drsupport_help_topic_form WHERE topic_id=?');$q->execute([$base['topic_id']]);$ids=$q->fetchAll(PDO::FETCH_COLUMN);$ids[]=$formId;
foreach(array_unique($ids)as$id){$q=$db->prepare('SELECT id FROM drsupport_help_topic_form WHERE topic_id=? AND form_id=?');$q->execute([$topicId,$id]);if(!$q->fetch())alphaInsert('drsupport_help_topic_form',['topic_id'=>$topicId,'form_id'=>$id,'sort'=>$id==$formId?1:2,'extra'=>'{}']);}
$db->commit();echo json_encode(['topicId'=>$topicId,'formId'=>$formId,'customFields'=>count($fields)]).PHP_EOL;
}catch(Throwable $e){$db->rollBack();throw$e;}

View file

@ -10,3 +10,15 @@ body.dune-support :is(.redactor-box,.redactor-editor,.redactor-statusbar){backgr
body.dune-support :is(.warning,.warning-banner,#msg_warning){background:#3d3521!important;border:1px solid #9a8550!important;color:#eddaaa!important;border-radius:6px;padding:12px!important}body.dune-support :is(.error,#msg_error,.error-banner){background-color:#3c2725!important;color:#f1cac2!important;border-color:#945e58!important}body.dune-support :is(.success,#msg_notice,.notice){background-color:#1e3c29!important;color:#c9e4c9!important;border-color:#5c8a61!important;border-radius:6px}body.dune-support .error:empty{background:none!important}body.dune-support :is(.tip_box,.help,.form-header){background-color:#203c2b!important;color:#d2dcbf!important;border-color:#536d49!important}body.dune-support :is(fieldset,legend,.panel,.card,.well,.tab_content){border-color:#466241!important}body.dune-support hr{border:0!important;border-top:1px solid #425f42!important}
body.dune-support .dune-appeal-actions{border:1px solid #567457!important;background:linear-gradient(135deg,#19392b,#10271f)!important;border-radius:9px!important}body.dune-support .dune-status-appeal-row>td{padding:10px 0!important}body.dune-support .dune-ticket-status-menu{display:flex;flex-wrap:wrap;gap:9px}
@media(max-width:700px){body.dune-support #container{max-width:calc(100% - 12px)!important;margin:6px auto!important}body.dune-support #content{padding:14px!important}body.dune-support :is(table.list,table.listings,#ticketTable) :is(td,th){padding:9px!important}body.dune-support :is(.dialog,.modal){max-width:calc(100vw - 24px)!important}}
/* Shared storefront/support controls, 2026-11-02. */
body.dune-support{font-family:Manrope,Arial,sans-serif!important;font-size:15px;line-height:1.6}
body.dune-support :is(h1,h2,h3){font-family:Manrope,Arial,sans-serif!important;line-height:1.3;letter-spacing:-.02em;color:#e7ce91!important}
body.dune-support :is(.button,.btn,input[type=submit],input[type=button],button.primary){font-family:Manrope,Arial,sans-serif!important;font-size:14px;line-height:1.4;border:1px solid #d5ba79!important;border-radius:8px!important;background:linear-gradient(135deg,#d3b56c,#b29448)!important;color:#10261f!important;text-shadow:none!important;box-shadow:inset 0 1px #fff3,0 3px 8px #0002!important;padding:10px 16px!important}
body.dune-support :is(.button,.btn,input[type=submit],input[type=button],button.primary):hover{filter:brightness(1.08)}
body.dune-support :is(.panel,.card,.well,.tab_content,fieldset){border-radius:10px!important;border-color:#6e744f!important;background-color:#153328!important}
body.dune-support :is(.tabs,.nav-tabs){border-radius:9px 9px 0 0!important}body.dune-support :is(.tabs,.nav-tabs) a{padding:10px 16px!important;font-family:Manrope,Arial,sans-serif!important}
@media(max-width:650px){body.dune-support #landing_page{display:flex!important;flex-direction:column;gap:20px}body.dune-support #landing_page :is(.main-content,.pull-right.flush-right){float:none!important;width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box}}
.dune-alpha-invitation{display:flex;align-items:center;gap:24px;border:1px solid #9f874d;border-radius:14px;padding:22px;margin-bottom:24px;background:linear-gradient(135deg,#203d2f,#10271f);clear:both}.dune-alpha-invitation>img{width:180px;height:120px;object-fit:cover;border-radius:9px}.dune-alpha-invitation h2{margin:4px 0 10px!important}.dune-alpha-invitation p{margin:8px 0!important}.dune-alpha-invitation .eyebrow{font-size:10px;color:#d0b675;letter-spacing:.14em}@media(max-width:650px){.dune-alpha-invitation{flex-direction:column;align-items:flex-start}.dune-alpha-invitation>img{width:100%;height:140px}}

View file

@ -0,0 +1,3 @@
const esc=v=>String(v).replace(/[&<>"']/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
function inline(text){let result='',from=0;for(const m of text.matchAll(/\[([^\]\n]{1,200})\]\((https:\/\/[^\s)]+)\)/g)){result+=esc(text.slice(from,m.index));let url;try{url=new URL(m[2]);}catch{}result+=url?.protocol==='https:'?'<a class="dispatch-read-more" href="'+esc(url.href)+'" rel="noopener noreferrer">'+esc(m[1])+'</a>':esc(m[0]);from=m.index+m[0].length;}return result+esc(text.slice(from));}
export function renderNewsBody(value){let html='',paragraph=[],list=false;const flush=()=>{if(paragraph.length){html+='<p>'+inline(paragraph.join(' '))+'</p>';paragraph=[];}if(list){html+='</ul>';list=false;}};for(const raw of String(value).replace(/\r/g,'').split('\n')){const line=raw.trim();if(!line){flush();continue;}const heading=line.match(/^#{1,3}\s+(.+)$/),bullet=line.match(/^[-*]\s+(.+)$/);if(heading){flush();html+='<h3>'+inline(heading[1])+'</h3>';}else if(bullet){if(paragraph.length)flush();if(!list){html+='<ul>';list=true;}html+='<li>'+inline(bullet[1])+'</li>';}else{if(list)flush();paragraph.push(line);}}flush();return html;}

View file

@ -1,3 +1,4 @@
import {renderNewsBody} from './news-format.mjs';
import {SHARED_HEADER,SHARED_HEAD} from '../scripts/portal-navigation.mjs';
const base='https://www.dunerealms.com';
const esc=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
@ -35,7 +36,8 @@ export function createSearchVisibility(db){
const p=await db.prepare(published+' AND id=?').bind(Date.now(),id).first();if(!p)return new Response('News post not found',{status:404,headers:{'X-Robots-Tag':'noindex'}});
const path=newsPath(p);if(legacy||u.pathname!==path)return Response.redirect(base+path,301);
const description=p.body.replace(/\s+/g,' ').slice(0,160),date=new Date(Number(p.published_at)).toISOString();
let html='<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="stylesheet" href="/styles.css"><link rel="stylesheet" href="/home-news.css">'+SHARED_HEAD+'</head><body>'+SHARED_HEADER+'<main id="main"><article class="dispatch-full"><a href="/news-archive.html">← News archive</a><header class="article-heading"><div><p class="article-category">'+esc(p.category)+'</p><h1>'+esc(p.title)+'</h1><time datetime="'+date+'">'+esc(new Date(Number(p.published_at)).toLocaleDateString('en-GB',{dateStyle:'long'}))+'</time></div></header><div class="article-body">'+p.body.split(/\n\s*\n/).filter(Boolean).map(text=>'<p>'+esc(text).replaceAll('\n','<br>')+'</p>').join('')+'</div></article></main><footer><a href="/">DuneRealms</a> · <a href="/wiki.html">Disclaimer &amp; contact</a></footer></body></html>';
const art='/assets/news-'+(['world','news','maintenance','changelogs','events','community'].includes(p.category)?p.category:'news')+'.webp';
let html='<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="stylesheet" href="/styles.css"><link rel="stylesheet" href="/home-news.css?v=article-20261102">'+SHARED_HEAD+'</head><body class="home-news news-article-page">'+SHARED_HEADER+'<main id="main"><article id="news-full-post" class="dispatch-full"><a class="article-back" href="/news-archive.html">← News archive</a><div class="article-heading"><div><div class="article-meta"><span class="article-category">'+esc(p.category)+'</span><time datetime="'+date+'">'+esc(new Date(Number(p.published_at)).toLocaleDateString('en-GB',{dateStyle:'long'}))+'</time></div><h1>'+esc(p.title)+'</h1></div><img src="'+art+'" alt="Imperial dispatch artwork" width="360" height="240"></div><div class="dispatch-full-body article-body">'+renderNewsBody(p.body)+'</div></article></main><footer><a href="/">DuneRealms</a> · <a href="/wiki.html">Disclaimer &amp; contact</a></footer></body></html>';
html=metadata(html,{title:p.title+' | DuneRealms',description,canonical:base+path,type:'article',structured:{'@context':'https://schema.org','@type':'NewsArticle',headline:p.title,datePublished:date,dateModified:new Date(Number(p.updated_at||p.published_at)).toISOString(),mainEntityOfPage:base+path,image:[base+'/assets/dunerealms-season-logo-v2.png'],publisher:{'@type':'Organization',name:'DuneRealms',url:base}}});
return new Response(request.method==='HEAD'?null:html,{headers:{'Content-Type':'text/html; charset=utf-8','Cache-Control':'public,max-age=60'}});
},

View file

@ -0,0 +1,3 @@
import test from 'node:test';import assert from 'node:assert/strict';import {renderNewsBody} from '../node/news-format.mjs';
test('article headings, lists and HTTPS signup links render safely',()=>{const h=renderNewsBody('## Join us\n\n- Java\n- Bedrock\n\n[Sign up](https://support.dunerealms.com/alpha-signup.php)');assert(h.includes('<h3>Join us</h3>'));assert(h.includes('<ul><li>Java</li><li>Bedrock</li></ul>'));assert(h.includes('href="https://support.dunerealms.com/alpha-signup.php"'));});
test('article text never becomes executable markup or javascript links',()=>{const h=renderNewsBody('<img src=x onerror=alert(1)>\n\n[bad](javascript:alert(1))');assert(!h.includes('<img'));assert(!h.includes('href="javascript:'));assert(h.includes('&lt;img'));});

Some files were not shown because too many files have changed in this diff Show more