Open-source web player for Rublox games, dual-licensed under AGPL-3.0 + Commercial. Highlights: - Babylon.js 7 + React 18 + Vite 5 stack - Self-contained engine (~46k lines): BlockManager, ModelManager, PlayerController, ScriptSandboxWorker, MultiplayerSync, 30+ GD gamemodes - Configurable backend via VITE_API_BASE and friends — works against staging (dev-api.rublox.pro) out of the box - Standalone mode (VITE_STANDALONE=true) loads a bundled sample game for first-run without any backend - Full docs: README, ARCHITECTURE, CONTRIBUTING, SECURITY, CHANGELOG - Lint + format scaffolding (ESLint + Prettier + EditorConfig) - Legal: LICENSE (AGPL-3.0), LICENSE-COMMERCIAL.md, CLA.md, COPYRIGHT.md - Issue templates: bug_report, feature_request, security_disclosure Removed before public release: - frontend_deploy.py (contained production SSH credentials) - ~27 admin endpoints (kept in private repo) - Hard-coded internal URLs and IPs - All previous git history (clean repo init)
25 lines
1.4 KiB
JavaScript
25 lines
1.4 KiB
JavaScript
import { createRoot } from 'react-dom/client';
|
||
import App from './App.jsx';
|
||
|
||
// DevLog подключаем только на localhost. Используем тот же модуль что и
|
||
// engine (src/engine/devlog.js), чтобы не было ДВУХ хуков на console.* —
|
||
// иначе каждый log пишется в devlog.txt дважды (engine хукнул сам себя
|
||
// в BabylonScene.js, плюс наш хук сверху).
|
||
//
|
||
// Минус — теги [player]/[rs] здесь не работают (engine'овый devlog не
|
||
// поддерживает тег), но в плеере все логи плеерские, так что это
|
||
// безболезненно.
|
||
if (typeof window !== 'undefined' && window.location.hostname === 'localhost') {
|
||
import('./engine/devlog.js').then((m) => {
|
||
m.attachConsoleHook();
|
||
console.log('[player] boot');
|
||
});
|
||
}
|
||
|
||
// СТРОГО без React.StrictMode — engine (BabylonScene + WebGL) не
|
||
// идемпотентен на двойном монтировании. StrictMode дёргает useEffect
|
||
// дважды → создаётся два Engine на один canvas → второй вешает первый
|
||
// и игра остаётся в loading. В Майнкрафтии StrictMode тоже не используется
|
||
// (см. minecraftia-school.ru/Фронтенд/React/src/index.js).
|
||
createRoot(document.getElementById('root')).render(<App />);
|