Add independent forums, YouSMP community page and private player support portal

This commit is contained in:
unimatrixgit 2026-10-13 15:06:02 +02:00
commit 79fd7a7f79
38 changed files with 284 additions and 18 deletions

View file

@ -4,3 +4,7 @@ DISCORD_BOT_TOKEN=
DISCORD_PUBLISHER_ID=
DISCORD_EXCHANGE_CHANNEL_ID=
DISCORD_NEWS_CHANNEL_ID=
# Comma-separated staff account emails; store as secrets in Sites.
FORUM_ADMIN_EMAILS=
SUPPORT_STAFF_EMAILS=

View file

@ -1,5 +1,5 @@
{
"project_id": "appgprj_6ace145fede88191b193de34d1753c02",
"d1": null,
"d1": "DB",
"r2": null
}

19
website/FORUMS-PORTAL.md Normal file
View file

@ -0,0 +1,19 @@
# Community and player portal
The public website has independent Forums and Discord pages. Forums store topics, replies and reports in the hosted D1 database. Reading is public; posting requires ChatGPT sign-in. Public display names are chosen by players. The YouSMP Discord page links the verified community invitation and reads public member/online counts from Discord's invite API. Website discussions are not forwarded to Discord.
## Private player support
Open **Player portal → Your profile → Support tickets**. Sign in with ChatGPT and save a display name and optional Minecraft/Discord names. Names are self-reported, not verified account links. A Minecraft name is required for a ban appeal. Choose **Ban appeal** or **Staff support**, enter a subject and full description, then submit. Appeals should describe the ban reason, approximate date and why staff should reconsider it.
Tickets and replies persist in D1 and are accessible only to the owning account and authorised staff. The owner can reply, close and reopen a closed case. Staff can reply and set Open, In progress, Waiting on player, Resolved or Closed. Each status change appears in the private case history. Closed cases must be reopened before replying. An appeal does not automatically unban a Minecraft account. No Discord messages or notifications are sent by this ticket system; staff should check the portal queue.
The portal overview lists recent cases and the number of active tickets. The profile page links directly to support tickets. Staff access is checked server-side using trusted Sites identity headers and the secret `SUPPORT_STAFF_EMAILS` allowlist; `FORUM_ADMIN_EMAILS` also grants support access. Configure comma-separated account emails through Sites environment variables, never in source or browser code. The site owner's moderator account is configured initially. Minecraft operator status alone does not grant website permissions.
Rate limits: three new tickets per hour, five active cases per account, five replies per minute. Requests validate length, use SQL parameters and require same-origin writes. Public topics/replies can be removed by their owner or moderators; authenticated players can report them. Moderators review reports separately from private support tickets.
## Hosting
`.openai/hosting.json` declares the `DB` binding. Schema-only migrations live in `drizzle/` and are packaged into `dist/.openai/drizzle`; Sites applies them before publication. Keep applied migration history immutable. Runtime secrets are managed in Sites. Game exchange/news integration remains separately configured through the existing DiscordSRV bridge and Discord bot channels; joining YouSMP does not configure those feeds.
Build with `node scripts/build.mjs`, then run `node --test tests/*.test.mjs`. Tests use a temporary SQLite database and do not create public topics or real support requests.

View file

@ -6,8 +6,11 @@ The home page is a Minecraft-styled banner and navigation hub. Every topic has i
Browser files are in `web/`. The server-only Discord API is in `worker/feed-api.mjs`. Hosting configuration is in `.openai/hosting.json`. `node scripts/build.mjs` creates a Worker ESM bundle with the website assets embedded, avoiding separate asset bindings. No dependency installation is required.
Run `node scripts/preview.mjs` for the local site and honest unconnected feed responses. Run `node --test tests/feed-api.test.mjs` for API transport and validation checks. Site publishing uses the supported Sites source workflow and packaging helpers.
Run `node scripts/preview.mjs` for the local site and honest unconnected feed responses. Run `node --test tests/*.test.mjs` for API transport and validation checks. Site publishing uses the supported Sites source workflow and packaging helpers.
See [DiscordSRV feed setup](DISCORD-FEEDS.md) for the optional DuneCore 1.0.9 bridge, required server-side secret names, channel setup and snapshot protocol. No credentials are committed or delivered to the browser. Feed data is read-only; trades stay inside Minecraft.
Art is reused from the Project Dune manual and optimized into WebP. Concept-art claims are identified on the page. No game server address or live market records are invented. The website retains the Site's owner-private audience until changed explicitly.
Art is reused from the Project Dune manual and optimized into WebP. Concept-art claims are identified on the page. No game server address or live market records are invented. The website is public. Private portal data requires sign-in and server-side authorisation.
See [Forums and player support](FORUMS-PORTAL.md) for independent forums, the YouSMP Discord page and private profile-based tickets.

View file

@ -0,0 +1,41 @@
CREATE TABLE forum_topics (
id TEXT PRIMARY KEY NOT NULL,
category TEXT NOT NULL CHECK(category IN ('help','gameplay','lore','feedback')),
title TEXT NOT NULL,
body TEXT NOT NULL,
author_id TEXT NOT NULL,
author_name TEXT NOT NULL,
created_at INTEGER NOT NULL,
last_activity_at INTEGER NOT NULL,
closed INTEGER NOT NULL DEFAULT 0,
deleted INTEGER NOT NULL DEFAULT 0
);
--> statement-breakpoint
CREATE INDEX forum_topics_activity ON forum_topics(deleted,last_activity_at);
--> statement-breakpoint
CREATE INDEX forum_topics_author ON forum_topics(author_id,created_at);
--> statement-breakpoint
CREATE TABLE forum_posts (
id TEXT PRIMARY KEY NOT NULL,
topic_id TEXT NOT NULL REFERENCES forum_topics(id),
body TEXT NOT NULL,
author_id TEXT NOT NULL,
author_name TEXT NOT NULL,
created_at INTEGER NOT NULL,
deleted INTEGER NOT NULL DEFAULT 0
);
--> statement-breakpoint
CREATE INDEX forum_posts_topic ON forum_posts(topic_id,deleted,created_at);
--> statement-breakpoint
CREATE INDEX forum_posts_author ON forum_posts(author_id,created_at);
--> statement-breakpoint
CREATE TABLE forum_reports (
id TEXT PRIMARY KEY NOT NULL,
target_type TEXT NOT NULL CHECK(target_type IN ('topic','post')),
target_id TEXT NOT NULL,
reporter_id TEXT NOT NULL,
reason TEXT NOT NULL,
created_at INTEGER NOT NULL,
resolved INTEGER NOT NULL DEFAULT 0,
UNIQUE(target_type,target_id,reporter_id)
);

View file

@ -0,0 +1,37 @@
CREATE TABLE player_profiles (
user_id TEXT PRIMARY KEY NOT NULL,
display_name TEXT NOT NULL,
minecraft_name TEXT NOT NULL DEFAULT '',
discord_name TEXT NOT NULL DEFAULT '',
created_at INTEGER NOT NULL,
updated_at INTEGER NOT NULL
);
--> statement-breakpoint
CREATE TABLE support_tickets (
id TEXT PRIMARY KEY NOT NULL,
user_id TEXT NOT NULL REFERENCES player_profiles(user_id),
category TEXT NOT NULL CHECK(category IN ('ban-appeal','staff-support')),
subject TEXT NOT NULL,
body TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'open' CHECK(status IN ('open','in_progress','waiting_on_player','resolved','closed')),
created_at INTEGER NOT NULL,
updated_at INTEGER NOT NULL
);
--> statement-breakpoint
CREATE INDEX support_tickets_owner ON support_tickets(user_id,updated_at);
--> statement-breakpoint
CREATE INDEX support_tickets_status ON support_tickets(status,updated_at);
--> statement-breakpoint
CREATE TABLE support_messages (
id TEXT PRIMARY KEY NOT NULL,
ticket_id TEXT NOT NULL REFERENCES support_tickets(id),
author_id TEXT NOT NULL,
author_name TEXT NOT NULL,
author_role TEXT NOT NULL CHECK(author_role IN ('player','staff','system')),
body TEXT NOT NULL,
created_at INTEGER NOT NULL
);
--> statement-breakpoint
CREATE INDEX support_messages_ticket ON support_messages(ticket_id,created_at);
--> statement-breakpoint
CREATE INDEX support_messages_author ON support_messages(author_id,created_at);

View file

@ -0,0 +1 @@
{"version":"7","dialect":"sqlite","entries":[{"idx":0,"version":"6","when":1791892800000,"tag":"0000_forums","breakpoints":true},{"idx":1,"version":"6","when":1791896400000,"tag":"0001_profiles_tickets","breakpoints":true}]}

View file

@ -1 +1,9 @@
{"name":"project-dune-website","private":true,"type":"module","scripts":{"build":"node scripts/build.mjs","test":"node --test tests/feed-api.test.mjs"}}
{
"name": "project-dune-website",
"private": true,
"type": "module",
"scripts": {
"build": "node scripts/build.mjs",
"test": "node --test tests/*.test.mjs"
}
}

View file

@ -2,6 +2,7 @@ import {readFileSync,writeFileSync,readdirSync,statSync,mkdirSync,existsSync,rmS
const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'..'),web=path.join(root,'web'),dist=path.join(root,'dist');
const assets={};const types={'.html':'text/html; charset=utf-8','.css':'text/css; charset=utf-8','.js':'text/javascript; charset=utf-8','.json':'application/json; charset=utf-8','.webp':'image/webp','.svg':'image/svg+xml'};
function collect(directory){for(const entry of readdirSync(directory)){const p=path.join(directory,entry);if(statSync(p).isDirectory())collect(p);else{const type=types[path.extname(entry)];if(!type)throw Error('Unexpected asset: '+entry);assets['/'+path.relative(web,p).split(path.sep).join('/')]=[type,readFileSync(p).toString('base64')]}}}collect(web);
let api=readFileSync(path.join(root,'worker/feed-api.mjs'),'utf8').replace(/export /g,'');let runtime=readFileSync(path.join(root,'worker/runtime.mjs'),'utf8').replace("import {handleFeed} from './feed-api.mjs';",'');
let api=['feed-api.mjs','forum-api.mjs','community-api.mjs','portal-api.mjs'].map(file=>readFileSync(path.join(root,'worker',file),'utf8').replace(/export /g,'')).join('\n');let runtime=readFileSync(path.join(root,'worker/runtime.mjs'),'utf8').replace(/^import .*;$/gm,'');
if(existsSync(dist)){const resolved=path.resolve(dist);if(resolved!==path.join(root,'dist'))throw Error('Invalid dist directory');rmSync(resolved,{recursive:true,force:true})}
mkdirSync(path.join(dist,'server'),{recursive:true});mkdirSync(path.join(dist,'.openai'),{recursive:true});writeFileSync(path.join(dist,'server/index.js'),'const ASSET_DATA='+JSON.stringify(assets)+';\n'+api+'\n'+runtime);cpSync(path.join(root,'.openai/hosting.json'),path.join(dist,'.openai/hosting.json'));console.log('Built Worker with',Object.keys(assets).length,'embedded website assets');
if(existsSync(path.join(root,'drizzle')))cpSync(path.join(root,'drizzle'),path.join(dist,'.openai/drizzle'),{recursive:true});

View file

@ -0,0 +1,7 @@
import {DatabaseSync} from 'node:sqlite';
export class LocalD1 {
constructor(schema,filename=':memory:'){this.sqlite=new DatabaseSync(filename);this.sqlite.exec('PRAGMA foreign_keys=ON');if(schema)this.sqlite.exec(schema)}
prepare(sql){const db=this.sqlite;let values=[];return {bind(...args){values=args;return this},async first(){return db.prepare(sql).get(...values)||null},async all(){return {results:db.prepare(sql).all(...values)}},async run(){const r=db.prepare(sql).run(...values);return {success:true,meta:{changes:Number(r.changes)}}}}}
async batch(statements){this.sqlite.exec('BEGIN');try{const results=[];for(const s of statements)results.push(await s.run());this.sqlite.exec('COMMIT');return results}catch(error){this.sqlite.exec('ROLLBACK');throw error}}
close(){this.sqlite.close()}
}

View file

@ -0,0 +1,10 @@
import test from 'node:test';import assert from 'node:assert/strict';import {readFileSync,mkdtempSync,rmSync} from 'node:fs';import {tmpdir} from 'node:os';import path from 'node:path';import {handleForum} from '../worker/forum-api.mjs';import {LocalD1} from './d1-adapter.mjs';
const schema=readFileSync(new URL('../drizzle/0000_forums.sql',import.meta.url),'utf8');
function request(endpoint,{user,method='GET',body,origin='https://example.test',email}={}){return new Request('https://example.test/api/forum'+endpoint,{method,headers:{'Content-Type':'application/json',Origin:origin,...(user?{'oai-authenticated-user-id':user}:{}),...(email?{'oai-authenticated-user-email':email}:{})},...(body?{body:JSON.stringify(body)}:{})})}
async function create(env){const r=await handleForum(request('/topics',{user:'alice',method:'POST',body:{title:'An Arrakis expedition',body:'How should I prepare my first stillsuit?',displayName:'Alice',category:'help'}}),env);assert.equal(r.status,201);return (await r.json()).id}
test('Anonymous readers can browse but cannot post',async()=>{const DB=new LocalD1(schema);try{const list=await handleForum(request('/topics'),{DB});assert.deepEqual((await list.json()).topics,[]);const r=await handleForum(request('/topics',{method:'POST',body:{}}),{DB});assert.equal(r.status,401)}finally{DB.close()}});
test('Topics and replies persist, with public identity IDs excluded',async()=>{const directory=mkdtempSync(path.join(tmpdir(),'dune-forum-test-')),file=path.join(directory,'forum.sqlite');let DB=new LocalD1(schema,file);try{const id=await create({DB});const reply=await handleForum(request('/topics/'+id+'/replies',{user:'bob',method:'POST',body:{displayName:'Bob',body:'Equip all four tagged pieces.'}}),{DB});assert.equal(reply.status,201);DB.close();DB=new LocalD1(null,file);const response=await handleForum(request('/topics/'+id),{DB});const data=await response.json();assert.equal(data.replies.length,1);assert.equal(data.replies[0].body,'Equip all four tagged pieces.');assert.equal(data.topic.canManage,false);assert.ok(!JSON.stringify(data).includes('author_id'))}finally{DB.close();rmSync(directory,{recursive:true,force:true})}});
test('Cross-site writes and forged management attempts fail',async()=>{const DB=new LocalD1(schema);try{const id=await create({DB});assert.equal((await handleForum(request('/topics/'+id,{method:'DELETE',user:'bob'}),{DB})).status,403);assert.equal((await handleForum(request('/topics',{method:'POST',user:'bob',origin:'https://other.test',body:{}}),{DB})).status,403)}finally{DB.close()}});
test('Closed topics reject replies and can be reopened by their owner',async()=>{const DB=new LocalD1(schema);try{const id=await create({DB});assert.equal((await handleForum(request('/topics/'+id+'/close',{method:'POST',user:'alice',body:{closed:true}}),{DB})).status,200);const reply=await handleForum(request('/topics/'+id+'/replies',{user:'bob',method:'POST',body:{body:'Test reply',displayName:'Bob'}}),{DB});assert.equal(reply.status,409);assert.equal((await handleForum(request('/topics/'+id+'/close',{method:'POST',user:'alice',body:{closed:false}}),{DB})).status,200)}finally{DB.close()}});
test('Post validation, rate limits and parameterized search resist abuse',async()=>{const DB=new LocalD1(schema);try{await create({DB});const second=await handleForum(request('/topics',{user:'alice',method:'POST',body:{title:'Another topic',body:'A second post too soon.',displayName:'Alice',category:'help'}}),{DB});assert.equal(second.status,429);assert.equal((await handleForum(request('/topics',{user:'bob',method:'POST',body:{title:'x',body:'Short',displayName:'Bob',category:'help'}}),{DB})).status,400);const search=await handleForum(request('/topics?q='+encodeURIComponent("' OR 1=1 --")),{DB});assert.deepEqual((await search.json()).topics,[])}finally{DB.close()}});
test('Reports are visible only to moderators; removal hides rather than erases',async()=>{const DB=new LocalD1(schema),env={DB,FORUM_ADMIN_EMAILS:'owner@example.invalid'};try{const id=await create(env);const report=await handleForum(request('/reports',{user:'bob',method:'POST',body:{targetType:'topic',targetId:id,reason:'Please review this topic.'}}),env);assert.equal(report.status,201);assert.equal((await handleForum(request('/reports',{user:'bob'}),env)).status,403);const moderator={user:'owner',email:'owner@example.invalid'};const reports=await handleForum(request('/reports',moderator),env);assert.equal((await reports.json()).reports.length,1);assert.equal((await handleForum(request('/topics/'+id,{...moderator,method:'DELETE'}),env)).status,200);assert.equal((await handleForum(request('/topics/'+id),env)).status,404);assert.equal(DB.sqlite.prepare('SELECT deleted FROM forum_topics WHERE id=?').get(id).deleted,1)}finally{DB.close()}});

View file

@ -0,0 +1,11 @@
import test from 'node:test';import assert from 'node:assert/strict';import {readFileSync,mkdtempSync,rmSync} from 'node:fs';import {tmpdir} from 'node:os';import path from 'node:path';import {LocalD1} from './d1-adapter.mjs';import {handlePortal} from '../worker/portal-api.mjs';
const schema=['0000_forums','0001_profiles_tickets'].map(n=>readFileSync(new URL('../drizzle/'+n+'.sql',import.meta.url),'utf8')).join('\n');
function req(endpoint,user='alice',method='GET',body,email,origin='https://example.test'){return new Request('https://example.test/api/'+endpoint,{method,headers:{'Content-Type':'application/json',Origin:origin,...(user?{'oai-authenticated-user-id':user}:{}),...(email?{'oai-authenticated-user-email':email}:{})},...(body!==undefined?{body:JSON.stringify(body)}:{})})}
const profile={displayName:'Alice',minecraftName:'DesertPlayer',discordName:'OptionalHandle'};
async function setup(env){assert.equal((await handlePortal(req('profile','alice','POST',profile),env)).status,200);const r=await handlePortal(req('tickets','alice','POST',{category:'ban-appeal',subject:'Please review my ban',body:'I would like staff to review the reason for my ban.'}),env);assert.equal(r.status,201);return (await r.json()).id}
test('Portal data requires authentication and same-origin writes',async()=>{const DB=new LocalD1(schema);try{assert.equal((await handlePortal(req('profile',null),{DB})).status,401);assert.equal((await handlePortal(req('profile','alice','POST',profile,null,'https://evil.test'),{DB})).status,403);assert.equal((await handlePortal(req('profile','alice','POST',null),{DB})).status,400)}finally{DB.close()}});
test('Tickets are tied to profiles and appeals require a Minecraft name',async()=>{const DB=new LocalD1(schema);try{const body={category:'ban-appeal',subject:'Review my account ban',body:'Here is my explanation for staff review.'};assert.equal((await handlePortal(req('tickets','alice','POST',body),{DB})).status,422);await handlePortal(req('profile','alice','POST',{...profile,minecraftName:''}),{DB});assert.equal((await handlePortal(req('tickets','alice','POST',body),{DB})).status,422);body.category='staff-support';assert.equal((await handlePortal(req('tickets','alice','POST',body),{DB})).status,201)}finally{DB.close()}});
test('Other players cannot read or alter a private ticket',async()=>{const DB=new LocalD1(schema);try{const id=await setup({DB});assert.equal((await handlePortal(req('tickets/'+id,'bob'),{DB})).status,404);assert.equal((await handlePortal(req('tickets/'+id+'/replies','bob','POST',{body:'Forged reply'}),{DB})).status,404);assert.equal((await handlePortal(req('tickets/'+id+'/status','bob','POST',{status:'closed'}),{DB})).status,404);assert.deepEqual((await (await handlePortal(req('tickets','bob'),{DB})).json()).tickets,[]);assert.equal((await handlePortal(req('tickets?view=staff','bob'),{DB})).status,403);const own=await (await handlePortal(req('tickets/'+id),{DB})).json();assert.ok(!JSON.stringify(own).includes('user_id'));assert.equal(own.ticket.minecraft_name,'DesertPlayer')}finally{DB.close()}});
test('Only authorised staff can triage; replies carry verified staff roles',async()=>{const DB=new LocalD1(schema),env={DB,SUPPORT_STAFF_EMAILS:'staff@example.invalid'};try{const id=await setup(env);assert.equal((await handlePortal(req('tickets/'+id+'/status','alice','POST',{status:'resolved'}),env)).status,403);assert.equal((await handlePortal(req('tickets/'+id+'/status','moderator','POST',{status:'in_progress'},'staff@example.invalid'),env)).status,200);assert.equal((await handlePortal(req('tickets/'+id+'/replies','moderator','POST',{body:'We are reviewing your case.',author_role:'player'},'staff@example.invalid'),env)).status,201);const data=await (await handlePortal(req('tickets/'+id),env)).json();assert.equal(data.ticket.status,'in_progress');assert.equal(data.messages.find(m=>m.body==='We are reviewing your case.').author_role,'staff');assert.equal((await (await handlePortal(req('tickets?view=staff','moderator','GET',undefined,'staff@example.invalid'),env)).json()).tickets.length,1)}finally{DB.close()}});
test('Owners close and reopen tickets; closed cases block replies and rate limits apply',async()=>{const DB=new LocalD1(schema),env={DB};try{const id=await setup(env);await handlePortal(req('tickets/'+id+'/status','alice','POST',{status:'closed'}),env);assert.equal((await handlePortal(req('tickets/'+id+'/replies','alice','POST',{body:'Hello again'}),env)).status,409);await handlePortal(req('tickets/'+id+'/status','alice','POST',{status:'open'}),env);for(let i=0;i<5;i++)assert.equal((await handlePortal(req('tickets/'+id+'/replies','alice','POST',{body:'Reply number '+i}),env)).status,201);assert.equal((await handlePortal(req('tickets/'+id+'/replies','alice','POST',{body:'Too many replies'}),env)).status,429)}finally{DB.close()}});
test('Private profiles and ticket history persist after database restart',async()=>{const dir=mkdtempSync(path.join(tmpdir(),'dune-tickets-')),file=path.join(dir,'db.sqlite');let DB=new LocalD1(schema,file);try{const id=await setup({DB});DB.close();DB=new LocalD1(null,file);assert.equal((await (await handlePortal(req('tickets/'+id),{DB})).json()).ticket.subject,'Please review my ban');assert.equal((await (await handlePortal(req('tickets'),{DB})).json()).activeCount,1);assert.equal((await (await handlePortal(req('profile','bob'),{DB})).json()).profile,null)}finally{DB.close();rmSync(dir,{recursive:true,force:true})}});

View file

@ -1,4 +1,4 @@
import test from 'node:test';import assert from 'node:assert/strict';import worker from '../dist/server/index.js';
test('Built Worker serves all ten separate pages and site assets',async()=>{for(const path of ['/','/arrakis.html','/smugglers.html','/equipment.html','/admin.html','/install.html','/manual.html','/races.html','/exchange.html','/news.html','/manual-data.json','/assets/item-0.webp']){const response=await worker.fetch(new Request('https://example.test'+path),{});assert.equal(response.status,200,path);assert.ok((await response.arrayBuffer()).byteLength>0,path)}});
test('Built Worker serves all fifteen separate pages and site assets',async()=>{for(const path of ['/','/arrakis.html','/smugglers.html','/equipment.html','/admin.html','/install.html','/manual.html','/races.html','/exchange.html','/news.html','/forums.html','/discord.html','/portal.html','/profile.html','/tickets.html','/manual-data.json','/assets/item-0.webp']){const response=await worker.fetch(new Request('https://example.test'+path),{});assert.equal(response.status,200,path);assert.ok((await response.arrayBuffer()).byteLength>0,path)}});
test('Built Worker retains unconnected feed state without leaking secrets',async()=>{const response=await worker.fetch(new Request('https://example.test/api/news'),{});const text=await response.text();assert.equal(JSON.parse(text).status,'not_connected');assert.ok(!text.includes('DISCORD_BOT_TOKEN'))});
test('Unsupported paths and write requests are rejected',async()=>{assert.equal((await worker.fetch(new Request('https://example.test/missing'),{})).status,404);assert.equal((await worker.fetch(new Request('https://example.test/api/exchange',{method:'POST'}),{})).status,405)});

View file

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="theme-color" content="#142a28"><link rel="icon" href="assets/favicon.svg"><link rel="stylesheet" href="styles.css"><link rel="stylesheet" href="pages.css"><link rel="stylesheet" href="minecraft.css"><script src="pages.js" defer></script><title>Admin tools — Project Dune</title></head><body><a class="skip" href="#page-content">Skip to content</a><header><a class="wordmark" href="index.html"><span class="sun">✦</span> PROJECT DUNE<small>MINECRAFT REALMS</small></a><button class="menu-toggle" aria-label="Open navigation" aria-expanded="false">☰</button><nav aria-label="Main navigation"><a href="index.html">Home</a><a href="races.html">Races & Houses</a><a href="manual.html">Manual</a><a href="exchange.html">Exchange</a><a href="news.html">News</a><a class="nav-cta" href="#realm-menu">Realm menu ↓</a></nav></header><main><section class="page-intro intro-admin"><p class="eyebrow">PROJECT DUNE / MINECRAFT REALMS</p><h1>Admin tools</h1><p>The Imperial Scepter. Your operator controls for the worlds and their inhabitants.</p></section><nav id="realm-menu" class="banner-menu" aria-label="Explore Project Dune"><a href="arrakis.html"><img src="assets/menu-12.webp" alt=""><span>Arrakis<small>Explore the desert</small></span></a><a href="races.html"><img src="assets/menu-7.webp" alt=""><span>Races & Houses<small>Choose your allegiance</small></span></a><a href="smugglers.html"><img src="assets/admin-icon-1.webp" alt=""><span>Smugglers<small>Spice & water missions</small></span></a><a href="equipment.html"><img src="assets/item-5.webp" alt=""><span>Equipment<small>Prepare your inventory</small></span></a><a href="admin.html"><img src="assets/admin-icon-0.webp" alt=""><span>Admin tools<small>Command the realms</small></span></a><a href="manual.html"><img src="assets/menu-5.webp" alt=""><span>Field manual<small>57 illustrated chapters</small></span></a><a href="exchange.html"><img src="assets/menu-0.webp" alt=""><span>Exchange<small>Spice & contracts</small></span></a><a href="news.html"><img src="assets/menu-2.webp" alt=""><span>News<small>Guild dispatches</small></span></a><a href="install.html"><img src="assets/menu-15.webp" alt=""><span>Get the plugin<small>Installation & downloads</small></span></a></nav><div id="page-content"><section id="admin" class="section admin"><div class="admin-art"><img src="assets/admin.webp" alt="An Imperial administrator with a glowing scepter beside Guild and smuggler NPCs" loading="lazy"></div><div class="admin-copy"><p class="eyebrow">04 / KEEPERS OF THE REALMS</p><h2>Your world.<br>Your <em>command.</em></h2><p>Operators receive the Imperial Admin Scepter automatically. Right-click the modified blaze rod to open the administration GUI.</p><ul><li>Summon a sandworm at your position or coordinates.</li><li>Place Guild Navigators and Arrakis smugglers.</li><li>Manage NPCs, view active contracts and return to the main admin menu.</li><li>Access spice bloom tools, kits, menus and politics.</li></ul><div class="command-row"><button class="copy-command" data-copy="/dune admin">/dune admin <span>Copy ⧉</span></button><button class="copy-command" data-copy="/dunenpc admin">/dunenpc admin <span>Copy ⧉</span></button></div><p class="small-note">GUI controls require operator status. Sandworm summoning uses the dune.admin permission.</p></div></section></div></main><footer><a class="wordmark" href="index.html">✦ PROJECT DUNE</a><p>A fan-made Dune-themed Minecraft plugin suite.<br>Concept artwork illustrates the theme; it is not an in-game screenshot.</p><div><a href="https://github.com/unimatrixgit/mcdune">GitHub ↗</a><a href="manual.html">Field manual →</a><a href="index.html">Home ↑</a></div><small>THE SPICE MUST FLOW.</small></footer><div class="toast" role="status" aria-live="polite"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="theme-color" content="#142a28"><link rel="icon" href="assets/favicon.svg"><link rel="stylesheet" href="styles.css"><link rel="stylesheet" href="pages.css"><link rel="stylesheet" href="minecraft.css"><script src="pages.js" defer></script><title>Admin tools — Project Dune</title></head><body><a class="skip" href="#page-content">Skip to content</a><header><a class="wordmark" href="index.html"><span class="sun">✦</span> PROJECT DUNE<small>MINECRAFT REALMS</small></a><button class="menu-toggle" aria-label="Open navigation" aria-expanded="false">☰</button><nav aria-label="Main navigation"><a href="index.html">Home</a><a href="races.html">Races & Houses</a><a href="manual.html">Manual</a><a href="exchange.html">Exchange</a><a href="forums.html">Forums</a><a href="discord.html">Discord</a><a class="nav-cta" href="#realm-menu">Realm menu ↓</a></nav></header><main><section class="page-intro intro-admin"><p class="eyebrow">PROJECT DUNE / MINECRAFT REALMS</p><h1>Admin tools</h1><p>The Imperial Scepter. Your operator controls for the worlds and their inhabitants.</p></section><nav id="realm-menu" class="banner-menu" aria-label="Explore Project Dune"><a href="arrakis.html"><img src="assets/menu-12.webp" alt=""><span>Arrakis<small>Explore the desert</small></span></a><a href="races.html"><img src="assets/menu-7.webp" alt=""><span>Races & Houses<small>Choose your allegiance</small></span></a><a href="smugglers.html"><img src="assets/admin-icon-1.webp" alt=""><span>Smugglers<small>Spice & water missions</small></span></a><a href="equipment.html"><img src="assets/item-5.webp" alt=""><span>Equipment<small>Prepare your inventory</small></span></a><a href="admin.html"><img src="assets/admin-icon-0.webp" alt=""><span>Admin tools<small>Command the realms</small></span></a><a href="manual.html"><img src="assets/menu-5.webp" alt=""><span>Field manual<small>57 illustrated chapters</small></span></a><a href="exchange.html"><img src="assets/menu-0.webp" alt=""><span>Exchange<small>Spice & contracts</small></span></a><a href="news.html"><img src="assets/menu-2.webp" alt=""><span>News<small>Guild dispatches</small></span></a><a href="forums.html"><img src="assets/menu-4.webp" alt=""><span>Forums<small>Topics & replies</small></span></a><a href="discord.html"><img src="assets/menu-7.webp" alt=""><span>Discord<small>YouSMP community</small></span></a><a href="portal.html"><img src="assets/menu-4.webp" alt=""><span>Player portal<small>Profile & support tickets</small></span></a><a href="install.html"><img src="assets/menu-15.webp" alt=""><span>Get the plugin<small>Installation & downloads</small></span></a></nav><div id="page-content"><section id="admin" class="section admin"><div class="admin-art"><img src="assets/admin.webp" alt="An Imperial administrator with a glowing scepter beside Guild and smuggler NPCs" loading="lazy"></div><div class="admin-copy"><p class="eyebrow">04 / KEEPERS OF THE REALMS</p><h2>Your world.<br>Your <em>command.</em></h2><p>Operators receive the Imperial Admin Scepter automatically. Right-click the modified blaze rod to open the administration GUI.</p><ul><li>Summon a sandworm at your position or coordinates.</li><li>Place Guild Navigators and Arrakis smugglers.</li><li>Manage NPCs, view active contracts and return to the main admin menu.</li><li>Access spice bloom tools, kits, menus and politics.</li></ul><div class="command-row"><button class="copy-command" data-copy="/dune admin">/dune admin <span>Copy ⧉</span></button><button class="copy-command" data-copy="/dunenpc admin">/dunenpc admin <span>Copy ⧉</span></button></div><p class="small-note">GUI controls require operator status. Sandworm summoning uses the dune.admin permission.</p></div></section></div></main><footer><a class="wordmark" href="index.html">✦ PROJECT DUNE</a><p>A fan-made Dune-themed Minecraft plugin suite.<br>Concept artwork illustrates the theme; it is not an in-game screenshot.</p><div><a href="https://github.com/unimatrixgit/mcdune">GitHub ↗</a><a href="manual.html">Field manual →</a><a href="index.html">Home ↑</a></div><small>THE SPICE MUST FLOW.</small></footer><div class="toast" role="status" aria-live="polite"></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
website/web/discord.html Normal file

File diff suppressed because one or more lines are too long

1
website/web/discord.js Normal file
View file

@ -0,0 +1 @@
fetch('/api/community').then(r=>r.json()).then(data=>{document.querySelector('#discord-name').textContent=data.name||'YouSMP';if(data.status==='connected'){document.querySelector('#discord-state').textContent='YouSMP Discord · Invite verified';document.querySelector('#discord-members').textContent=data.memberCount.toLocaleString();document.querySelector('#discord-online').textContent=data.onlineCount.toLocaleString()}else document.querySelector('#discord-state').textContent='Discord counts are temporarily unavailable.'}).catch(()=>document.querySelector('#discord-state').textContent='Discord counts are temporarily unavailable.');

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="theme-color" content="#142a28"><link rel="icon" href="assets/favicon.svg"><link rel="stylesheet" href="styles.css"><link rel="stylesheet" href="pages.css"><script src="pages.js" defer></script><script src="feeds.js" defer></script><title>The Spice Exchange — Project Dune</title><link rel="stylesheet" href="minecraft.css"></head><body data-feed="exchange"><header><a class="wordmark" href="index.html"><span class="sun">✦</span> PROJECT DUNE<small>MINECRAFT REALMS</small></a><button class="menu-toggle" aria-label="Open navigation" aria-expanded="false">☰</button><nav aria-label="Main navigation"><a href="index.html">Home</a><a href="races.html">Races & Houses</a><a href="manual.html">Manual</a><a href="exchange.html">Exchange</a><a href="news.html">News</a><a class="nav-cta" href="#realm-menu">Realm menu ↓</a></nav></header><main><section class="page-intro"><p class="eyebrow">LIVE REALM RECORDS / DISCORDSRV</p><h1>The<br>Spice Exchange</h1><p class="house-lore">Trade beyond the dunes.</p><p>Browse live buy and sell offers, and player-sponsored harvesting contracts. Listings come from the connected game server through DiscordSRV.</p></section><nav id="realm-menu" class="banner-menu" aria-label="Explore Project Dune"><a href="arrakis.html"><img src="assets/menu-12.webp" alt=""><span>Arrakis<small>Explore the desert</small></span></a><a href="races.html"><img src="assets/menu-7.webp" alt=""><span>Races & Houses<small>Choose your allegiance</small></span></a><a href="smugglers.html"><img src="assets/admin-icon-1.webp" alt=""><span>Smugglers<small>Spice & water missions</small></span></a><a href="equipment.html"><img src="assets/item-5.webp" alt=""><span>Equipment<small>Prepare your inventory</small></span></a><a href="admin.html"><img src="assets/admin-icon-0.webp" alt=""><span>Admin tools<small>Command the realms</small></span></a><a href="manual.html"><img src="assets/menu-5.webp" alt=""><span>Field manual<small>57 illustrated chapters</small></span></a><a href="exchange.html"><img src="assets/menu-0.webp" alt=""><span>Exchange<small>Spice & contracts</small></span></a><a href="news.html"><img src="assets/menu-2.webp" alt=""><span>News<small>Guild dispatches</small></span></a><a href="install.html"><img src="assets/menu-15.webp" alt=""><span>Get the plugin<small>Installation & downloads</small></span></a></nav><section class="feed-section"><div class="feed-toolbar"><div class="feed-controls"><label>Offer type<select id="type-filter"><option value="all">All offers</option><option value="buy">Buying</option><option value="sell">Selling</option><option value="contract">Harvest contracts</option></select></label><label>Search<input id="feed-search" type="search" placeholder="Search the board…"></label></div><button class="button" id="refresh-feed">Refresh ↻</button></div><p class="feed-state" id="feed-state" role="status">Checking the server connection…</p><div id="feed-results" aria-live="polite"><div class="feed-empty"><span class="seal">✦</span><h2>Opening the Guild records…</h2></div></div><button class="pagination-button" id="load-more" hidden>Load earlier notifications ↓</button><div class="feed-explainer"><h3>The current in-game exchange</h3><p>Player-posted listings are spice harvesting contracts: 15% of earnings go to the worker, 85% to the sponsor. They are distinct from item sell orders. The normal spice sale is a standing sale to the economy at 15 Solaris per unit by default, with the Imperial bonus and Trust levy applied in game.</p><p>The website is a read-only market board. Complete trades or accept contracts inside Minecraft. It does not spend Solaris or hold items.</p><a href="manual.html#the-player-spice-exchange">Read the exchange manual →</a></div></section></main><footer><a class="wordmark" href="index.html">✦ PROJECT DUNE</a><p>Real server records. No simulated offers or notifications.</p><a href="manual.html">Browse the field manual →</a></footer><div class="toast" role="status" aria-live="polite"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="theme-color" content="#142a28"><link rel="icon" href="assets/favicon.svg"><link rel="stylesheet" href="styles.css"><link rel="stylesheet" href="pages.css"><script src="pages.js" defer></script><script src="feeds.js" defer></script><title>The Spice Exchange — Project Dune</title><link rel="stylesheet" href="minecraft.css"></head><body data-feed="exchange"><header><a class="wordmark" href="index.html"><span class="sun">✦</span> PROJECT DUNE<small>MINECRAFT REALMS</small></a><button class="menu-toggle" aria-label="Open navigation" aria-expanded="false">☰</button><nav aria-label="Main navigation"><a href="index.html">Home</a><a href="races.html">Races & Houses</a><a href="manual.html">Manual</a><a href="exchange.html">Exchange</a><a href="forums.html">Forums</a><a href="discord.html">Discord</a><a class="nav-cta" href="#realm-menu">Realm menu ↓</a></nav></header><main><section class="page-intro"><p class="eyebrow">LIVE REALM RECORDS / DISCORDSRV</p><h1>The<br>Spice Exchange</h1><p class="house-lore">Trade beyond the dunes.</p><p>Browse live buy and sell offers, and player-sponsored harvesting contracts. Listings come from the connected game server through DiscordSRV.</p></section><nav id="realm-menu" class="banner-menu" aria-label="Explore Project Dune"><a href="arrakis.html"><img src="assets/menu-12.webp" alt=""><span>Arrakis<small>Explore the desert</small></span></a><a href="races.html"><img src="assets/menu-7.webp" alt=""><span>Races & Houses<small>Choose your allegiance</small></span></a><a href="smugglers.html"><img src="assets/admin-icon-1.webp" alt=""><span>Smugglers<small>Spice & water missions</small></span></a><a href="equipment.html"><img src="assets/item-5.webp" alt=""><span>Equipment<small>Prepare your inventory</small></span></a><a href="admin.html"><img src="assets/admin-icon-0.webp" alt=""><span>Admin tools<small>Command the realms</small></span></a><a href="manual.html"><img src="assets/menu-5.webp" alt=""><span>Field manual<small>57 illustrated chapters</small></span></a><a href="exchange.html"><img src="assets/menu-0.webp" alt=""><span>Exchange<small>Spice & contracts</small></span></a><a href="news.html"><img src="assets/menu-2.webp" alt=""><span>News<small>Guild dispatches</small></span></a><a href="forums.html"><img src="assets/menu-4.webp" alt=""><span>Forums<small>Topics & replies</small></span></a><a href="discord.html"><img src="assets/menu-7.webp" alt=""><span>Discord<small>YouSMP community</small></span></a><a href="portal.html"><img src="assets/menu-4.webp" alt=""><span>Player portal<small>Profile & support tickets</small></span></a><a href="install.html"><img src="assets/menu-15.webp" alt=""><span>Get the plugin<small>Installation & downloads</small></span></a></nav><section class="feed-section"><div class="feed-toolbar"><div class="feed-controls"><label>Offer type<select id="type-filter"><option value="all">All offers</option><option value="buy">Buying</option><option value="sell">Selling</option><option value="contract">Harvest contracts</option></select></label><label>Search<input id="feed-search" type="search" placeholder="Search the board…"></label></div><button class="button" id="refresh-feed">Refresh ↻</button></div><p class="feed-state" id="feed-state" role="status">Checking the server connection…</p><div id="feed-results" aria-live="polite"><div class="feed-empty"><span class="seal">✦</span><h2>Opening the Guild records…</h2></div></div><button class="pagination-button" id="load-more" hidden>Load earlier notifications ↓</button><div class="feed-explainer"><h3>The current in-game exchange</h3><p>Player-posted listings are spice harvesting contracts: 15% of earnings go to the worker, 85% to the sponsor. They are distinct from item sell orders. The normal spice sale is a standing sale to the economy at 15 Solaris per unit by default, with the Imperial bonus and Trust levy applied in game.</p><p>The website is a read-only market board. Complete trades or accept contracts inside Minecraft. It does not spend Solaris or hold items.</p><a href="manual.html#the-player-spice-exchange">Read the exchange manual →</a></div></section></main><footer><a class="wordmark" href="index.html">✦ PROJECT DUNE</a><p>Real server records. No simulated offers or notifications.</p><a href="manual.html">Browse the field manual →</a></footer><div class="toast" role="status" aria-live="polite"></div></body></html>

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