Simo
|
8fca407f0f
|
Add RCON client + SendCurrency service (AtomCMS-faithful)
- rcon.ts: Node net.Socket transport speaking AtomCMS's exact protocol (raw
JSON {"key","data"} over rcon_ip:rcon_port, fire-and-forget) with a bounded
timeout + backoff retry; typed commands matching RconService EXACTLY
(sendgift `itemid`, disconnect `username`, no-data => data:null, givepoints
numeric `type`, forwarduser, setmotto/setrank/alertuser, give*). Injectable
transport keeps command shapes unit-testable.
- send-currency.ts: mirrors the SendCurrency action — RCON deliver, else DB
fallback (credits -> users.credits; duckets/diamonds/points -> users_currency
by type 0/5/101).
- env: RCON_HOST/PORT/TIMEOUT/RETRIES. vitest: SKIP_ENV_VALIDATION for unit tests.
Verified: tsc exit 0, vitest 39/39, next build exit 0. Live TCP test deferred
(needs a running emulator).
|
2026-06-27 16:37:42 +02:00 |
|
Simo
|
b5bc7f6daf
|
Rebuild atomcms-next foundation on Prisma (align to habbo-next reference)
Replace the superseded Drizzle monorepo scaffold with a single-app Prisma 7
data layer, mirroring the proven habbo-next approach to the shared Arcturus
emulator DB (introspect/conform only, idempotent SQL migrations via a custom
runner; never migrate-diff).
- prisma/schema.prisma: User, UsersCurrency (composite PK), Ban, WebsiteSetting
mapped to AtomCMS's default.sql columns; client generated to src/generated/prisma
- src/lib/prisma.ts: PrismaMariaDb adapter singleton; src/env.ts zod env
- src/lib/services: siteSettings (cached setting() equivalent) + CurrencyType enum
- prisma/migrations + scripts/apply-migrations.ts: idempotent CMS-table runner
Verified: prisma generate OK, tsc --noEmit exit 0, vitest 6/6 pass.
|
2026-06-27 15:26:40 +02:00 |
|