Configuration changes

This commit is contained in:
Bill 2022-03-15 15:11:57 -04:00
parent 80b2635a22
commit 9d00bdb4b9
5 changed files with 49 additions and 56 deletions

View File

@ -1,7 +0,0 @@
BROWSER=none
GENERATE_SOURCEMAP=false
REACT_APP_CONFIG_URLS=/renderer-config.json,/ui-config.json
REACT_APP_SOCKET_URL=wss://ws.server.com:2096
REACT_APP_ASSET_URL=https://nitro.server.com
REACT_APP_IMAGE_LIBRARY_URL=https://swf.server.com/c_images/
REACT_APP_HOF_FURNI_URL=https://swf.server.com/dcr/hof_furni

View File

@ -1,46 +1,50 @@
# Getting Started with Create React App # Nitro React
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Prerequisites
## Available Scripts - You must have [git](https://git-scm.com/) installed
- You must have [NodeJS](https://nodejs.org/) >= 16.13 installed
- We recommend you use [Yarn](https://yarnpkg.com/) over [npm](https://npmjs.com/)
- `npm i yarn -g`
In the project directory, you can run: ## Installation
### `npm start` - First you should open terminal and navigate to the folder where you want to clone Nitro
- Clone Nitro
- `git clone https://git.krews.org/nitro/nitro-react.git`
- Install the dependencies
- `yarn install`
- This may take some time, please be patient
- Rename a few files
- Rename `public/renderer-config.json.example` to `public/renderer-config.json`
- Rename `public/ui-config.json.example` to `public/ui-config.json`
- Set your links
- Open `public/renderer-config.json`
- Update `socket.url, asset.url, image.library.url, & hof.furni.url`
- Open `public/ui-config.json`
- Update `camera.url, thumbnails.url, url.prefix, habbopages.url`
- You can override any variable by passing it to `NitroConfig` in the index.html
Runs the app in the development mode.\ ## Usage
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\ - To use Nitro you need `.nitro` assets generated, see [nitro-converter](https://git.krews.org/nitro/nitro-converter) for instructions
You will also see any lint errors in the console. - See [Morningstar Websockets](https://git.krews.org/nitro/ms-websockets) for instructions on configuring websockets on your server
### `npm test` ### Development
Launches the test runner in the interactive watch mode.\ Run Nitro in development mode when you are editing the files, this way you can see the changes in your browser instantly
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build` ```
yarn start
```
Builds the app for production to the `build` folder.\ ### Production
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\ To build a production version of Nitro just run the following command
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. ```
yarn build:prod
```
### `npm run eject` - A `build` folder will be generated, these are the files that must be uploaded to your webserver
- Consult your CMS documentation for compatibility with Nitro and how to add the production files
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).

View File

@ -1,13 +1,14 @@
{ {
"name": "nitro-react", "name": "nitro-react",
"version": "0.1.0", "version": "2.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"start": "craco start", "start": "craco start",
"build": "craco --max_old_space_size=8048 build", "build": "GENERATE_SOURCEMAP=false BROWSER=none craco build",
"build:prod": "npx browserslist@latest --update-db && yarn install && yarn build", "build:prod": "npx browserslist@latest --update-db && yarn build",
"test": "craco test", "test": "craco test",
"eject": "react-scripts eject" "eject": "react-scripts eject",
"postinstall": "node ./post-install.js"
}, },
"dependencies": { "dependencies": {
"@craco/craco": "^6.3.0", "@craco/craco": "^6.3.0",

View File

@ -22,12 +22,8 @@
<div id="root" class="w-100 h-100"></div> <div id="root" class="w-100 h-100"></div>
<script> <script>
const NitroConfig = { const NitroConfig = {
"config.urls": ("%REACT_APP_CONFIG_URLS%").split(','), "config.urls": [ '/renderer-config.json', '/ui-config.json' ],
"sso.ticket": (new URLSearchParams(window.location.search).get('sso') || null), "sso.ticket": (new URLSearchParams(window.location.search).get('sso') || null)
"socket.url": "%REACT_APP_SOCKET_URL%",
"asset.url": "%REACT_APP_ASSET_URL%",
"image.library.url": "%REACT_APP_IMAGE_LIBRARY_URL%",
"hof.furni.url": "%REACT_APP_HOF_FURNI_URL%"
}; };
</script> </script>
</body> </body>

View File

@ -1,8 +1,8 @@
{ {
"socket.url": "", "socket.url": "wss://ws.website.com:2096",
"asset.url": "", "asset.url": "https://website.com",
"image.library.url": "", "image.library.url": "https://website.com/c_images/",
"hof.furni.url": "", "hof.furni.url": "https://website.com/dcr/hof_furni",
"images.url": "${asset.url}/images", "images.url": "${asset.url}/images",
"gamedata.url": "${asset.url}/gamedata", "gamedata.url": "${asset.url}/gamedata",
"sounds.url": "${asset.url}/sounds/%sample%.mp3", "sounds.url": "${asset.url}/sounds/%sample%.mp3",
@ -21,14 +21,13 @@
"pet.asset.url": "${asset.url}/bundled/pet/%libname%.nitro", "pet.asset.url": "${asset.url}/bundled/pet/%libname%.nitro",
"generic.asset.url": "${asset.url}/bundled/generic/%libname%.nitro", "generic.asset.url": "${asset.url}/bundled/generic/%libname%.nitro",
"badge.asset.url": "${image.library.url}album1584/%badgename%.gif", "badge.asset.url": "${image.library.url}album1584/%badgename%.gif",
"badge.asset.grouparts.url": "${image.library.url}Badgeparts/badgepart_%part%.png",
"furni.rotation.bounce.steps": 20, "furni.rotation.bounce.steps": 20,
"furni.rotation.bounce.height": 0.0625, "furni.rotation.bounce.height": 0.0625,
"enable.avatar.arrow": false, "enable.avatar.arrow": false,
"system.animation.fps": 24, "system.animation.fps": 24,
"system.limits.fps": false, "system.limits.fps": false,
"system.dispatcher.log": false, "system.dispatcher.log": false,
"system.packet.log": true, "system.packet.log": false,
"system.pong.manually": true, "system.pong.manually": true,
"system.pong.interval.ms": 20000, "system.pong.interval.ms": 20000,
"room.color.skip.transition": true, "room.color.skip.transition": true,