diff --git a/mockup/assets/README.md b/mockup/assets/README.md deleted file mode 100644 index f902c1b..0000000 --- a/mockup/assets/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Mockup Assets - -Questa cartella e' pronta per immagini o sprite dedicate ai mockup HTML. - -Uso previsto: -- copiare qui versioni statiche di asset che vuoi testare fuori dal progetto -- collegarle da `mockup/index.html` -- tenere separati i file di esperimento dagli asset reali di `src/assets` - -Percorso base: -- `Nitro-V3/mockup/index.html` -- `Nitro-V3/mockup/assets/` diff --git a/mockup/index.html b/mockup/index.html deleted file mode 100644 index 8a08573..0000000 --- a/mockup/index.html +++ /dev/null @@ -1,623 +0,0 @@ - - - - - - Nitro V3 Mockup Lab - - - -

Nitro V3 Mockup Lab

-

Mockup HTML standalone dei componenti principali attuali. La resa รจ pensata per darti una base visiva da modificare rapidamente fuori dal progetto reale.

- -
-
-
-

NitroCard

-

Base card attuale con header blu, tabs grigie e content chiaro.

-
-
-
-
-
-
Navigator
-
-
-
-
Hotel
-
Rooms
-
+
-
-
- Contenuto card attuale, usato come base da vari componenti. -
-
-
-
Source files: -src/common/card/NitroCardView.tsx -src/common/card/NitroCardHeaderView.tsx -src/common/card/NitroCardContentView.tsx -src/common/card/tabs/NitroCardTabsView.tsx -src/common/card/tabs/NitroCardTabsItemView.tsx -src/css/nitrocard/NitroCardView.css
-
-
- -
-
-

Purse

-

Layout attuale con currency, box HC, pulsanti laterali e seasonal sotto.

-
-
-
-
-
-
-
3601 โ—‰
-
5365 โ—Ž
-
700 โ—ˆ
-
-
-
HC
-
78 g
-
-
-
-
-
-
-
- Stagionale - 99 999 -
-
-
-
Source files: -src/components/purse/PurseView.tsx -src/components/purse/views/CurrencyView.tsx -src/components/purse/views/SeasonalView.tsx -src/css/purse/PurseView.css
-
-
- -
-
-

Toolbar

-

Barra bassa attuale con area me, icone centrali e blocco friend/message.

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Source files: -src/components/toolbar/ToolbarView.tsx -src/components/toolbar/ToolbarItemView.tsx -src/components/toolbar/ToolbarMeView.tsx
-
-
- -
-
-

Navigator

-

Finestra navigator attuale con card base, search e footer actions.

-
-
-
- -
-
Source files: -src/components/navigator/NavigatorView.tsx -src/components/navigator/NavigatorView.scss -src/css/room/NavigatorRoomSettings.css
-
-
- -
-
-

Notifications

-

Bubble attuale con fondo scuro e inner shadow.

-
-
-
-
- Hai ricevuto una nuova notifica. Questo box rappresenta lo stato attuale delle bubble notifications. -
-
-
Source files: -src/components/notification-center/NotificationCenterView.tsx -src/css/notification/NotificationCenterView.css
-
-
- -
-
-

Friends

-

Barra amici e blocchi friend pill attuali.

-
-
-
-
-
-
-
-
-
-
-
Source files: -src/components/friends/FriendsView.tsx -src/css/friends/FriendsView.css
-
-
- -
-
-

HotelView

-

Mockup della scena hotel attuale con sfondo e hotspot.

-
-
-
-
-
-
-
-
-
-
-
Source files: -src/components/hotel-view/HotelView.tsx -src/css/hotelview/HotelView.css
-
-
-
- - diff --git a/public/asset-loader.js b/public/asset-loader.js index be407cc..f64cbe6 100644 --- a/public/asset-loader.js +++ b/public/asset-loader.js @@ -49,7 +49,7 @@ const renderShell = () => { const root = document.getElementById("root"); if(!root || root.firstChild) return; - root.innerHTML = '
'; + root.innerHTML = '
'; }; const decodeAsset = (bytes) => { diff --git a/public/client-mode.example.json b/public/client-mode.example.json new file mode 100644 index 0000000..4582313 --- /dev/null +++ b/public/client-mode.example.json @@ -0,0 +1,8 @@ +{ + "distObfuscationEnabled": true, + "secureAssetsEnabled": true, + "secureApiEnabled": true, + "apiBaseUrl": "https://nitro.example.com:2096", + "plainConfigBaseUrl": "https://hotel.example.com/", + "plainGamedataBaseUrl": "https://hotel.example.com/client/nitro/gamedata/" +} diff --git a/public/renderer-config.example b/public/renderer-config.example new file mode 100644 index 0000000..4a294f2 --- /dev/null +++ b/public/renderer-config.example @@ -0,0 +1,53 @@ +{ + "socket.url": "wss://nitro.example.com:2096", + "api.url": "https://nitro.example.com:2096", + "asset.url": "https://hotel.example.com/client/nitro/bundled", + "image.library.url": "https://hotel.example.com/client/c_images/", + "hof.furni.url": "https://hotel.example.com/client/c_images/dcr/hof_furni", + "images.url": "https://hotel.example.com/client/nitro/images", + "gamedata.url": "https://nitro.example.com:2096/nitro-sec/file?kind=gamedata&file=", + "sounds.url": "${asset.url}/sounds/%sample%.mp3", + "external.texts.url": [ + "${gamedata.url}/ExternalTexts.json", + "${gamedata.url}/UITexts.json" + ], + "external.texts.translation.url": "${gamedata.url}/text_translate/ExternalTexts_%locale%.json?t=%timestamp%", + "external.samples.url": "${hof.furni.url}/mp3/sound_machine_sample_%sample%.mp3", + "furnidata.url": "${gamedata.url}/FurnitureData.json?t=%timestamp%", + "furnidata.translation.url": "${gamedata.url}/furniture_translate/FurnitureData_%locale%.json?t=%timestamp%", + "productdata.url": "${gamedata.url}/ProductData.json?t=%timestamp%", + "avatar.actions.url": "${gamedata.url}/HabboAvatarActions.json?t=%timestamp%", + "avatar.figuredata.url": "${gamedata.url}/FigureData.json?t=%timestamp%", + "avatar.figuremap.url": "${gamedata.url}/FigureMap.json?t=%timestamp%", + "avatar.effectmap.url": "${gamedata.url}/EffectMap.json?t=%timestamp%", + "avatar.asset.url": "${asset.url}/figure/%libname%.nitro", + "avatar.asset.effect.url": "${asset.url}/effect/%libname%.nitro", + "furni.asset.url": "${asset.url}/furniture/%libname%.nitro", + "furni.asset.icon.url": "${hof.furni.url}/icons/%libname%%param%_icon.png", + "pet.asset.url": "${asset.url}/pets/%libname%.nitro", + "generic.asset.url": "${asset.url}/generic/%libname%.nitro", + "badge.asset.url": "${image.library.url}album1584/%badgename%.gif", + "furni.rotation.bounce.steps": 20, + "furni.rotation.bounce.height": 0.0625, + "enable.avatar.arrow": false, + "system.log.debug": true, + "system.log.warn": true, + "system.log.error": true, + "system.log.events": false, + "system.log.packets": true, + "system.fps.animation": 24, + "system.fps.max": 60, + "system.pong.manually": true, + "system.pong.interval.ms": 20000, + "room.color.skip.transition": true, + "room.landscapes.enabled": true, + "room.zoom.enabled": true, + "login.screen.enabled": true, + "login.endpoint": "${api.url}/api/auth/login", + "login.register.endpoint": "${api.url}/api/auth/register", + "login.forgot.endpoint": "${api.url}/api/auth/forgot-password", + "login.logout.endpoint": "${api.url}/api/auth/logout", + "login.remember.endpoint": "${api.url}/api/auth/remember", + "login.turnstile.enabled": false, + "login.turnstile.sitekey": "" +} diff --git a/scripts/write-asset-loader.mjs b/scripts/write-asset-loader.mjs index 5b3aa5d..a94d388 100644 --- a/scripts/write-asset-loader.mjs +++ b/scripts/write-asset-loader.mjs @@ -52,7 +52,7 @@ const loader = `(() => { const renderShell = () => { const root = document.getElementById("root"); if(!root || root.firstChild) return; - root.innerHTML = '
'; + root.innerHTML = '
'; }; const decodeAsset = (bytes) => { diff --git a/src/bootstrap.ts b/src/bootstrap.ts index a9d95c3..2df054b 100644 --- a/src/bootstrap.ts +++ b/src/bootstrap.ts @@ -27,7 +27,7 @@ const cacheBustUrl = (path: string): string => return url.toString(); }; -(window as any).NitroSecureApiUrl = clientMode.apiBaseUrl || 'https://nitro.example.com:2096/'; +(window as any).NitroSecureApiUrl = clientMode.apiBaseUrl || window.location.origin; (window as any).NitroClientMode = clientMode; (window as any).NitroConfig = { 'config.urls': [ diff --git a/src/components/interface-settings/InterfaceImageTabView.tsx b/src/components/interface-settings/InterfaceImageTabView.tsx index 390a390..1b9860e 100644 --- a/src/components/interface-settings/InterfaceImageTabView.tsx +++ b/src/components/interface-settings/InterfaceImageTabView.tsx @@ -12,7 +12,7 @@ export const InterfaceImageTabView: FC<{}> = () => const baseUrl = useMemo(() => { - return GetConfigurationValue('ui.header.images.url', 'https://image.webbo.city/image/headerImage/image{id}.gif'); + return GetConfigurationValue('ui.header.images.url', ''); }, []); const images = useMemo(() => diff --git a/src/components/login/LoginView.tsx b/src/components/login/LoginView.tsx index 28575a3..ceba536 100644 --- a/src/components/login/LoginView.tsx +++ b/src/components/login/LoginView.tsx @@ -60,12 +60,19 @@ const CHAT_TRANSLATION_SETTINGS_KEY = 'chatTranslationSettings'; const MAX_ATTEMPTS = 5; const LOCK_WINDOW_MS = 60_000; const LOCK_DURATION_MS = 2 * 60_000; -const DEFAULT_LOGIN_IMAGES: Record = { - background: 'https://hotel.example.com/client/nitro/images/reception/background_gradient_apr25.png', - 'background.colour': '#6eadc8', - drape: 'https://hotel.example.com/client/nitro/images/reception/drape.png', - left: 'https://hotel.example.com/client/nitro/images/reception/mute_reception_backdrop_left.png', - right: 'https://hotel.example.com/client/nitro/images/reception/background_right.png' +const getDefaultLoginImages = (): Record => +{ + const imagesBase = (GetConfigurationValue('images.url', '') || '').replace(/\/$/, ''); + + if(!imagesBase.length) return { 'background.colour': '#6eadc8' }; + + return { + background: `${ imagesBase }/reception/background_gradient_apr25.png`, + 'background.colour': '#6eadc8', + drape: `${ imagesBase }/reception/drape.png`, + left: `${ imagesBase }/reception/mute_reception_backdrop_left.png`, + right: `${ imagesBase }/reception/background_right.png` + }; }; const LOGIN_LOCALES: LoginLocale[] = [ { code: 'it', file: 'it', label: 'Italiano', flag: flagIt }, @@ -188,7 +195,7 @@ export const LoginView: FC = ({ onAuthenticated, isEntering = fa const submitTimeRef = useRef(0); const configuredLoginImages: Record = (loginViewConfig?.['images'] as Record) ?? {}; - const loginImages: Record = { ...DEFAULT_LOGIN_IMAGES, ...configuredLoginImages }; + const loginImages: Record = { ...getDefaultLoginImages(), ...configuredLoginImages }; const configuredLoginWidgets: Record = (loginViewConfig?.['widgets'] as Record) ?? {}; const loginWidgetSlots = useMemo(() => @@ -487,7 +494,7 @@ export const LoginView: FC = ({ onAuthenticated, isEntering = fa const checkEmailUrl = GetConfigurationValue('login.check-email.endpoint', '/api/auth/check-email'); const checkUsernameUrl = GetConfigurationValue('login.check-username.endpoint', '/api/auth/check-username'); - const imagingUrl = GetConfigurationValue('login.register.imaging.url', 'https://www.habbo.com/habbo-imaging/avatarimage?figure={figure}&gender={gender}&direction=2&head_direction=2&size=l'); + const imagingUrl = GetConfigurationValue('login.register.imaging.url', ''); const interpretAvailability = (ok: boolean, status: number, payload: Record): { available: boolean; error?: string } => { const isTrue = (v: unknown) => v === true || v === 'true' || v === 1 || v === '1'; diff --git a/src/secure-assets.ts b/src/secure-assets.ts index a44e9d0..31018ac 100644 --- a/src/secure-assets.ts +++ b/src/secure-assets.ts @@ -194,7 +194,7 @@ const getApiBase = (): string => if(typeof configured === 'string' && configured.length) return configured.replace(/\/$/, ''); - return 'https://nitro.example.com:2096/'; + return window.location.origin; }; const getPlainAssetBase = (kind: 'config' | 'gamedata'): string =>