Rework backend #1
@@ -91,7 +91,7 @@ async function main() {
|
|||||||
const encounterId = crypto.randomUUID();
|
const encounterId = crypto.randomUUID();
|
||||||
|
|
||||||
await storage.setDoc(getPath.campaign(campaignId), {
|
await storage.setDoc(getPath.campaign(campaignId), {
|
||||||
name: 'Replay Campaign',
|
name: `Replay Campaign (${new Date().toLocaleString('en-US', { hour12: false })})`,
|
||||||
playerDisplayBackgroundUrl: '',
|
playerDisplayBackgroundUrl: '',
|
||||||
ownerId: 'replay',
|
ownerId: 'replay',
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
@@ -121,7 +121,7 @@ async function main() {
|
|||||||
];
|
];
|
||||||
|
|
||||||
await storage.setDoc(getPath.encounter(campaignId, encounterId), {
|
await storage.setDoc(getPath.encounter(campaignId, encounterId), {
|
||||||
name: 'Big Boss Replay',
|
name: `Big Boss Replay (${new Date().toLocaleString('en-US', { hour12: false })})`,
|
||||||
campaignId,
|
campaignId,
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
participants,
|
participants,
|
||||||
@@ -184,7 +184,9 @@ async function main() {
|
|||||||
const p = enc.participants.find(x => x.id === id);
|
const p = enc.participants.find(x => x.id === id);
|
||||||
return p ? `${p.name}:${p.initiative}` : id;
|
return p ? `${p.name}:${p.initiative}` : id;
|
||||||
}).join(',');
|
}).join(',');
|
||||||
console.log(` turn ${totalTurns} (round ${enc.round}): ${actorName} | order=[${ordStr}] cur=${enc.currentTurnParticipantId}`);
|
// Also dump participants[] order (display source). Diverge from order = sync bug.
|
||||||
|
const pStr = enc.participants.map(p => `${p.name}:${p.initiative}`).join(',');
|
||||||
|
console.log(` turn ${totalTurns} (round ${enc.round}): ${actorName} | order=[${ordStr}] parts=[${pStr}] cur=${enc.currentTurnParticipantId}`);
|
||||||
|
|
||||||
// 1. damage: actor hits a random living, active target.
|
// 1. damage: actor hits a random living, active target.
|
||||||
if (actor) {
|
if (actor) {
|
||||||
|
|||||||
@@ -2284,6 +2284,11 @@ function AdminView({ userId }) {
|
|||||||
<span className="inline-flex items-center">
|
<span className="inline-flex items-center">
|
||||||
<Swords size={12} className="mr-1" /> {campaign.encounterCount === undefined ? '...' : campaign.encounterCount} Encounters
|
<Swords size={12} className="mr-1" /> {campaign.encounterCount === undefined ? '...' : campaign.encounterCount} Encounters
|
||||||
</span>
|
</span>
|
||||||
|
{campaign.createdAt && (
|
||||||
|
<span className="inline-flex items-center opacity-80">
|
||||||
|
{new Date(campaign.createdAt).toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit', hour12: false })}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user